Package org.opencms.ui.favorites
Class CmsFavoriteEntry
java.lang.Object
org.opencms.ui.favorites.CmsFavoriteEntry
Represents an entry in the favorite location list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the type of the favorite. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new entry.Creates a new entry from a JSON object. -
Method Summary
Modifier and TypeMethodDescriptionGets the custom title.Gets the detail id.Gets the project id.Gets the site root.Gets the structure idgetType()Gets the type.static CmsUUIDreadId(JSONObject obj, String key) Reads a UUID from a JSON object.voidsetCustomTitle(String title) Sets the custom title.voidsetDetailId(CmsUUID detailId) Sets the detail id.voidsetProjectId(CmsUUID projectId) Sets the project id.voidsetSiteRoot(String siteRoot) Sets the site root.voidsetStructureId(CmsUUID structureId) Sets the structure id.voidsetType(CmsFavoriteEntry.Type type) Sets the type.toJson()Converts this object to JSON.Prepares the CmsObject for jumping to this favorite location, and returns the appropriate URL.
-
Field Details
-
JSON_DETAIL
JSON key.- See Also:
-
JSON_PROJECT
JSON key.- See Also:
-
JSON_SITEROOT
JSON key.- See Also:
-
JSON_STRUCTUREID
JSON key.- See Also:
-
JSON_TITLE
JSON key.- See Also:
-
JSON_TYPE
JSON key.- See Also:
-
-
Constructor Details
-
CmsFavoriteEntry
public CmsFavoriteEntry()Creates a new entry. -
CmsFavoriteEntry
Creates a new entry from a JSON object.- Parameters:
obj- the JSON object
-
-
Method Details
-
readId
Reads a UUID from a JSON object. Returns null if the JSON value for the given key is not present or not a valid UUID- Parameters:
obj- the JSON objectkey- the JSON key- Returns:
- the UUID
-
getCustomTitle
Gets the custom title.- Returns:
- the custom title
-
getDetailId
Gets the detail id.- Returns:
- the detail id
-
getProjectId
Gets the project id.- Returns:
- the project id
-
getSiteRoot
Gets the site root.- Returns:
- the site root
-
getStructureId
Gets the structure id- Returns:
- the structure id
-
getType
Gets the type.- Returns:
- the type
-
setCustomTitle
Sets the custom title.- Parameters:
title- the custom title
-
setDetailId
Sets the detail id.- Parameters:
detailId- the detail id
-
setProjectId
Sets the project id.- Parameters:
projectId- the project id
-
setSiteRoot
Sets the site root.- Parameters:
siteRoot- the site root
-
setStructureId
Sets the structure id.- Parameters:
structureId- the structure id
-
setType
Sets the type.- Parameters:
type- the type
-
toJson
Converts this object to JSON.- Returns:
- the JSON representation
- Throws:
JSONException- if JSON operations fail
-
updateContextAndGetFavoriteUrl
Prepares the CmsObject for jumping to this favorite location, and returns the appropriate URL.- Parameters:
cms- the CmsObject to initialize for jumping to the favorite- Returns:
- the link for the favorite location
- Throws:
CmsException- if something goes wrong
-