public class CmsFavoriteDAO extends java.lang.Object
When loading favorites, the individual entries are validated by trying to read the resources/projects they reference. If this fails, the entries are discareded from the returned list.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADDINFO_KEY
The additional info key under which the favorites for a user are saved.
|
static java.lang.String |
BASE_KEY
The main key in the JSON object containing the favorites.
|
| Constructor and Description |
|---|
CmsFavoriteDAO(CmsObject cms)
Creates a new instance.
|
CmsFavoriteDAO(CmsObject cms,
java.lang.String userName)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CmsFavoriteEntry> |
loadFavorites()
Loads the favorite list.
|
void |
saveFavorites(java.util.List<CmsFavoriteEntry> favorites)
Saves the favorites.
|
public static final java.lang.String ADDINFO_KEY
public static final java.lang.String BASE_KEY
public CmsFavoriteDAO(CmsObject cms) throws CmsException
cms - the CMS ContextCmsException - if something goes wrongpublic CmsFavoriteDAO(CmsObject cms, java.lang.String userName) throws CmsException
cms - the CMS ContextuserName - the name of the user in whose additional infos the bookmarks are storedCmsException - if something goes wrongpublic java.util.List<CmsFavoriteEntry> loadFavorites() throws CmsException
CmsException - if something goes wrongpublic void saveFavorites(java.util.List<CmsFavoriteEntry> favorites) throws CmsException
favorites - the list of favorites to saveCmsException - if something goes wrong