Class CmsADESessionCache


  • public final class CmsADESessionCache
    extends java.lang.Object
    ADE's session cache.

    Since:
    8.0.0
    • Constructor Detail

      • CmsADESessionCache

        protected CmsADESessionCache​(CmsObject cms,
                                     javax.servlet.http.HttpServletRequest request)
        Initializes the session cache.

        Parameters:
        cms - the cms context
        request - the current request
    • Method Detail

      • 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 request
        cms - the current CMS context
        Returns:
        the ADE session cache for the current session
      • addRecentFormatter

        public void addRecentFormatter​(java.lang.String resType,
                                       java.lang.String keyOrId)
        Adds the formatter id to the recently used list for the given type.

        Parameters:
        resType - the resource type
        keyOrId - the formatter id
      • clearDynamicValues

        public void clearDynamicValues()
        Clear the cache values that are dynamically loaded in the Acacia content editor.
      • clearLastPage

        public void clearLastPage()
        Removes the information about the last edited container page.

      • getCacheContainerElement

        public CmsContainerElementBean getCacheContainerElement​(java.lang.String key)
        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

        public CmsXmlContent getCacheXmlContent​(CmsUUID structureId)
        Returns the cached XML content document.

        Parameters:
        structureId - the structure id
        Returns:
        the XML document
      • getDynamicValue

        public java.lang.String getDynamicValue​(java.lang.String attribute)
        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

        public CmsUUID getElementView()
        Returns the current element view id.

        Returns:
        the current element view id
      • getRecentFormatter

        public I_CmsFormatterBean getRecentFormatter​(java.lang.String resType,
                                                     CmsContainer container,
                                                     CmsADEConfigData config)
        Returns the least recently used matching formatter for the given resource type.

        Parameters:
        resType - the resource type
        container - the container to match
        config - the config data
        Returns:
        the formatter if any
      • getTemplateBean

        public CmsJspStandardContextBean.TemplateBean getTemplateBean​(java.lang.String uri,
                                                                      boolean safe)
        Gets the cached template bean for a given container page uri.

        Parameters:
        uri - the container page uri
        safe - if true, return a valid template bean even if it hasn't been cached before
        Returns:
        the template bean
      • isEditSmallElements

        public boolean 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

        public boolean isToolbarVisible()
        Returns the tool-bar visibility.

        Returns:
        the tool-bar visibility
      • setCacheContainerElement

        public void setCacheContainerElement​(java.lang.String key,
                                             CmsContainerElementBean containerElement)
        Caches the given container element under the given key.

        Parameters:
        key - the cache key
        containerElement - the object to cache
      • setCacheXmlContent

        public void setCacheXmlContent​(CmsUUID structureId,
                                       CmsXmlContent xmlContent)
        Caches the given XML content document.

        Parameters:
        structureId - the structure id
        xmlContent - the XML document
      • setDynamicValue

        public void setDynamicValue​(java.lang.String attribute,
                                    java.lang.String value)
        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 cached
        value - the value to cache
      • setEditSmallElements

        public void setEditSmallElements​(boolean editSmallElements)
        Sets the default initial setting for small element editability in this session.

        Parameters:
        editSmallElements - true if small elements should be initially editable
      • setElementView

        public void setElementView​(CmsUUID elementView)
        Sets the current element view id.

        Parameters:
        elementView - the current element view id
      • setLastPage

        public void setLastPage​(CmsObject cms,
                                CmsUUID pageId,
                                CmsUUID detailId)
        Stores information about the last edited container page.

        Parameters:
        cms - the CMS context
        pageId - the page id
        detailId - the detail content id
      • setTemplateBean

        public void setTemplateBean​(java.lang.String uri,
                                    CmsJspStandardContextBean.TemplateBean templateBean)
        Caches a template bean for a given container page URI.

        Parameters:
        uri - the container page uri
        templateBean - the template bean to cache
      • setToolbarVisible

        public void setToolbarVisible​(boolean toolbarVisible)
        Sets the tool-bar visibility flag.

        Parameters:
        toolbarVisible - the tool-bar visibility to set
      • uncacheXmlContent

        public void uncacheXmlContent​(CmsUUID structureId)
        Purges the XML content document by the given id from the cache.

        Parameters:
        structureId - the structure id