Package org.opencms.xml.containerpage
Class CmsADESessionCache
java.lang.Object
org.opencms.xml.containerpage.CmsADESessionCache
ADE's session cache.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Stores information about the container page which was last edited, so we can jump back to it later. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
CmsADESessionCache
(CmsObject cms, javax.servlet.http.HttpServletRequest request) Initializes the session cache. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecentFormatter
(String resType, String keyOrId) Adds the formatter id to the recently used list for the given type.void
Clear the cache values that are dynamically loaded in the Acacia content editor.void
Removes the information about the last edited container page.static CmsADESessionCache
Gets the session cache for the current session.Returns the cached container element under the given key.getCacheXmlContent
(CmsUUID structureId) Returns the cached XML content document.getDynamicValue
(String attribute) Get cached value that is dynamically loaded by the Acacia content editor.Returns the current element view id.Returns the lastPage.Returns the lastPageEditorGallerySearch.getRecentFormatter
(String resType, CmsContainer container, CmsADEConfigData config) Returns the least recently used matching formatter for the given resource type.Returns the sitemap editor mode.getTemplateBean
(String uri, boolean safe) Gets the cached template bean for a given container page uri.boolean
Returns true if, in this session, a newly opened container page editor window should display edit points for small elements initially.boolean
Returns the tool-bar visibility.void
setCacheContainerElement
(String key, CmsContainerElementBean containerElement) Caches the given container element under the given key.void
setCacheXmlContent
(CmsUUID structureId, CmsXmlContent xmlContent) Caches the given XML content document.void
setDynamicValue
(String attribute, String value) Set cached value for the attribute.void
setEditSmallElements
(boolean editSmallElements) Sets the default initial setting for small element editability in this session.void
setElementView
(CmsUUID elementView) Sets the current element view id.void
setLastPage
(CmsObject cms, CmsUUID pageId, CmsUUID detailId) Stores information about the last edited container page.void
Sets the last stored gallery search from the page editor.void
setSitemapEditorMode
(CmsSitemapData.EditorMode sitemapEditorMode) Sets the sitemap editor mode.void
setTemplateBean
(String uri, CmsJspStandardContextBean.TemplateBean templateBean) Caches a template bean for a given container page URI.void
setToolbarVisible
(boolean toolbarVisible) Sets the tool-bar visibility flag.void
uncacheXmlContent
(CmsUUID structureId) Purges the XML content document by the given id from the cache.
-
Field Details
-
SESSION_ATTR_ADE_CACHE
Session attribute name constant.- See Also:
-
-
Constructor Details
-
CmsADESessionCache
Initializes the session cache.- Parameters:
cms
- the cms contextrequest
- the current request
-
-
Method Details
-
getCache
public static CmsADESessionCache getCache(javax.servlet.http.HttpServletRequest request, CmsObject cms) Gets the session cache for the current session.In case the request is not editable,
null
will be returned.- Parameters:
request
- the current requestcms
- the current CMS context- Returns:
- the ADE session cache for the current session
-
addRecentFormatter
Adds the formatter id to the recently used list for the given type.- Parameters:
resType
- the resource typekeyOrId
- the formatter id
-
clearDynamicValues
Clear the cache values that are dynamically loaded in the Acacia content editor. -
clearLastPage
Removes the information about the last edited container page. -
getCacheContainerElement
Returns the cached container element under the given key.- Parameters:
key
- the cache key- Returns:
- the cached container element or
null
if not found
-
getCacheXmlContent
Returns the cached XML content document.- Parameters:
structureId
- the structure id- Returns:
- the XML document
-
getDynamicValue
Get cached value that is dynamically loaded by the Acacia content editor.- Parameters:
attribute
- the attribute to load the value to- Returns:
- the cached value
-
getElementView
Returns the current element view id.- Returns:
- the current element view id
-
getLastPage
Returns the lastPage.- Returns:
- the lastPage
-
getLastPageEditorGallerySearch
Returns the lastPageEditorGallerySearch.- Returns:
- the lastPageEditorGallerySearch
-
getSitemapEditorMode
Returns the sitemap editor mode.- Returns:
- the sitemap editor mode
-
getTemplateBean
Gets the cached template bean for a given container page uri.- Parameters:
uri
- the container page urisafe
- if true, return a valid template bean even if it hasn't been cached before- Returns:
- the template bean
-
isEditSmallElements
Returns true if, in this session, a newly opened container page editor window should display edit points for small elements initially.- Returns:
- true if small elements should be editable initially
-
isToolbarVisible
Returns the tool-bar visibility.- Returns:
- the tool-bar visibility
-
setCacheContainerElement
Caches the given container element under the given key.- Parameters:
key
- the cache keycontainerElement
- the object to cache
-
setCacheXmlContent
Caches the given XML content document.- Parameters:
structureId
- the structure idxmlContent
- the XML document
-
setDynamicValue
Set cached value for the attribute. Used for dynamically loaded values in the Acacia content editor.- Parameters:
attribute
- the attribute for which the value should be cachedvalue
- the value to cache
-
setEditSmallElements
Sets the default initial setting for small element editability in this session.- Parameters:
editSmallElements
- true if small elements should be initially editable
-
setElementView
Sets the current element view id.- Parameters:
elementView
- the current element view id
-
setLastPage
Stores information about the last edited container page.- Parameters:
cms
- the CMS contextpageId
- the page iddetailId
- the detail content id
-
setTemplateBean
Caches a template bean for a given container page URI.- Parameters:
uri
- the container page uritemplateBean
- the template bean to cache
-
setToolbarVisible
Sets the tool-bar visibility flag.- Parameters:
toolbarVisible
- the tool-bar visibility to set
-
uncacheXmlContent
Purges the XML content document by the given id from the cache.- Parameters:
structureId
- the structure id
-