Class CmsADESessionCache

java.lang.Object
org.opencms.xml.containerpage.CmsADESessionCache

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

Since:
8.0.0
  • Field Details

  • Constructor Details

    • CmsADESessionCache

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

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

      public void addRecentFormatter(String resType, 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

      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

      public String getDynamicValue(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

      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
    • getRecentFormatter

      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
    • 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 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(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(String attribute, 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
    • setLastPageEditorGallerySearch

      Sets the last stored gallery search from the page editor.

      Parameters:
      searchObj - the search to store
    • setSitemapEditorMode

      public void setSitemapEditorMode(CmsSitemapData.EditorMode sitemapEditorMode)
      Sets the sitemap editor mode.

      Parameters:
      sitemapEditorMode - the sitemap editor mode
    • setTemplateBean

      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