Package org.opencms.ui.favorites
Class CmsFavoriteDAO
java.lang.Object
org.opencms.ui.favorites.CmsFavoriteDAO
Loads/saves favorites.
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.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCmsFavoriteDAO
(CmsObject cms) Creates a new instance.CmsFavoriteDAO
(CmsObject cms, String userName) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionLoads the favorite list.void
saveFavorites
(List<CmsFavoriteEntry> favorites) Saves the favorites.
-
Field Details
-
ADDINFO_KEY
The additional info key under which the favorites for a user are saved.- See Also:
-
BASE_KEY
The main key in the JSON object containing the favorites.- See Also:
-
-
Constructor Details
-
CmsFavoriteDAO
Creates a new instance.- Parameters:
cms
- the CMS Context- Throws:
CmsException
- if something goes wrong
-
CmsFavoriteDAO
Creates a new instance.- Parameters:
cms
- the CMS ContextuserName
- the name of the user in whose additional infos the bookmarks are stored- Throws:
CmsException
- if something goes wrong
-
-
Method Details
-
loadFavorites
Loads the favorite list.- Returns:
- the list of favorites
- Throws:
CmsException
- if something goes wrong
-
saveFavorites
Saves the favorites.- Parameters:
favorites
- the list of favorites to save- Throws:
CmsException
- if something goes wrong
-