Class PageElementCache

    • Method Detail

      • setPluginInfo

        public void setPluginInfo​(String pluginName,
                                  String featureName,
                                  String id)
        Description copied from interface: PluginAware
        Sets the plugin info relative to the current component.
        Note : The feature name may be null if the targeted component in declared at plugin level.
        Specified by:
        setPluginInfo in interface PluginAware
        Parameters:
        pluginName - Unique identifier for the plugin hosting the extension
        featureName - Unique feature identifier (unique for a given pluginName)
        id - Unique identifier of this component
      • storePageElement

        public void storePageElement​(String workspace,
                                     String site,
                                     String pageElementType,
                                     String elementId,
                                     RenderingContext renderingContext,
                                     SaxBuffer content)
        Add a content in the cache.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the page element type.
        elementId - the element id (page id or zoneItem id).
        renderingContext - the current rendering context.
        content - the actual content.
      • storePageElement

        public void storePageElement​(String workspace,
                                     String site,
                                     String pageElementType,
                                     String elementId,
                                     String subElementId,
                                     RenderingContext renderingContext,
                                     SaxBuffer content)
        Add a content in the cache.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the page element type.
        elementId - the element id (page id or zoneItem id).
        subElementId - the sub-element id (page id, in case the element id is a zoneItem id).
        renderingContext - the current rendering context.
        content - the actual content.
      • getPageElement

        public SaxBuffer getPageElement​(String workspace,
                                        String site,
                                        String pageElementType,
                                        String elementId,
                                        RenderingContext renderingContext)
        Returns the data in the cache, or null if none.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the element type.
        elementId - the element id (page id or zoneItem id).
        renderingContext - the current rendering context.
        Returns:
        the stored content.
      • getPageElement

        public SaxBuffer getPageElement​(String workspace,
                                        String site,
                                        String pageElementType,
                                        String elementId,
                                        String subElementId,
                                        RenderingContext renderingContext)
        Returns the data in the cache, or null if none.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the element type.
        elementId - the element id (page id or zoneItem id).
        subElementId - the sub-element id (page id, in case the element id is a zoneItem id).
        renderingContext - the current rendering context.
        Returns:
        the stored content.
      • getPageElementTypes

        public Set<StringgetPageElementTypes​(String workspace,
                                               String site)
        Returns all stored element types, or null if none.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        Returns:
        all stored element types.
      • getElementCache

        public Collection<StringgetElementCache​(String workspace,
                                                  String site,
                                                  String pageElementType)
        Returns all cached data for a given InputData, or null if none.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the element type.
        Returns:
        the stored content.
      • removeItem

        public void removeItem​(String workspace,
                               String site,
                               String pageElementType,
                               String elementId)
        Removes a single item from the cache.
        Parameters:
        workspace - the target JCR workspace or null to remove from all workspaces.
        site - the target site.
        pageElementType - the element type.
        elementId - the element id.
      • clear

        public void clear()
        Removes all stored data.
      • clear

        public void clear​(String workspace,
                          String site)
        Removes all data associated with a JCR workspace and a site.
        Parameters:
        workspace - the current JCR workspace. If null, means all workspaces.
        site - the current site.
      • clear

        public void clear​(String workspace,
                          String site,
                          String pageElementType)
        Removes all data associated with a JCR workspace, a site and a given element type.
        Parameters:
        workspace - the current JCR workspace.
        site - the current site.
        pageElementType - the element type.
      • isEnabled

        protected boolean isEnabled()
        Test if the cache is enabled.
        Returns:
        true if the cache is enabled, false otherwise.