Class CmsADEConfigCacheState


  • public class CmsADEConfigCacheState
    extends java.lang.Object
    An immutable object which represents the complete ADE configuration (sitemap and module configurations) at a certain instant in time.

    • Method Detail

      • emptyState

        public static CmsADEConfigCacheState emptyState​(CmsObject cms)
        Creates an empty ADE configuration cache state.

        Parameters:
        cms - the CMS context
        Returns:
        the empty configuration cache state
      • computeFolderTypes

        public java.util.Map<java.lang.String,​java.lang.String> computeFolderTypes()
                                                                                  throws CmsException
        Computes the map from folder paths to content types for this ADE configuration state.

        Returns:
        the map of content types by folder root paths
        Throws:
        CmsException - if something goes wrong
      • createUpdatedCopy

        public CmsADEConfigCacheState createUpdatedCopy​(java.util.Map<CmsUUID,​CmsADEConfigDataInternal> sitemapUpdates,
                                                        java.util.List<CmsADEConfigDataInternal> moduleUpdates,
                                                        java.util.Map<CmsUUID,​CmsElementView> elementViewUpdates,
                                                        java.util.Map<CmsUUID,​CmsSitePlugin> sitePluginUpdates,
                                                        java.util.Map<CmsUUID,​CmsSitemapAttributeEditorConfiguration> attributeEditorConfigurations)
        Creates a new object which represents the changed configuration state given some updates, without changing the current configuration state (this object instance).
        Parameters:
        sitemapUpdates - a map containing changed sitemap configurations indexed by structure id (the map values are null if the corresponding sitemap configuration is not valid or could not be found)
        moduleUpdates - the list of *all* module configurations, or null if no module configuration update is needed
        elementViewUpdates - the updated element views, or null if no update needed
        sitePluginUpdates - the new map of site plugins, or null if no update needed
        attributeEditorConfigurations - the sitemap attribute editor configurations
        Returns:
        the new configuration state
      • getDetailPageTypes

        public java.util.Set<java.lang.String> getDetailPageTypes()
        Gets the set of type names for which detail pages are configured in any sitemap configuration.

        Returns:
        the set of type names with configured detail pages
      • getFolderTypes

        public java.util.Map<java.lang.String,​java.lang.String> getFolderTypes()
        Gets the map of folder types.

        Returns:
        the map of folder types
      • getParentFolderType

        public java.lang.String getParentFolderType​(java.lang.String rootPath)
        Helper method to retrieve the parent folder type or null if none available.

        Parameters:
        rootPath - the path of a resource
        Returns:
        the parent folder content type
      • getRawDetailPages

        public java.util.List<CmsDetailPageInfogetRawDetailPages()
        Gets the raw detail page information, with no existence checks or path corrections.
        Returns:
        the detail page information
      • getSiteConfigurationPaths

        public java.util.Set<java.lang.String> getSiteConfigurationPaths()
        Returns the root paths to all configured sites and sub sites.

        Returns:
        the root paths to all configured sites and sub sites
      • getSubsitesForSiteSelector

        public java.util.List<java.lang.String> getSubsitesForSiteSelector()
        Gets subsites to be included in the site selector.
        Returns:
        the list of root paths of subsites that should be included in the site selector
      • lookupConfiguration

        public CmsADEConfigData lookupConfiguration​(java.lang.String rootPath)
        Looks up the sitemap configuration for a root path.

        Parameters:
        rootPath - the root path for which to look up the configuration
        Returns:
        the sitemap configuration for the given root path
      • getAllDetailPages

        protected java.util.List<CmsDetailPageInfogetAllDetailPages()
        Gets all detail page info beans which are defined anywhere in the configuration.

        Returns:
        the list of detail page info beans
      • getCms

        protected CmsObject getCms()
        Gets the CMS context used for VFS operations.

        Returns:
        the CMS context used for VFS operations
      • getDetailPages

        protected java.util.List<java.lang.String> getDetailPages​(java.lang.String type)
        Gets all the detail pages for a given type.

        Parameters:
        type - the name of the type
        Returns:
        the detail pages for that type
      • getSiteConfigData

        protected CmsADEConfigDataInternal getSiteConfigData​(java.lang.String path)
        Helper method for getting the best matching sitemap configuration object for a given root path, ignoring the module configuration.

        For example, if there are configurations available for the paths /a, /a/b/c, /a/b/x and /a/b/c/d/e, then the method will return the configuration object for /a/b/c when passed the path /a/b/c/d. If no configuration data is found for the path, null will be returned.

        Parameters:
        path - a root path
        Returns:
        the configuration data for the given path, or null if none was found
      • getSiteConfigPaths

        protected java.util.List<java.lang.String> getSiteConfigPaths​(java.lang.String path)
        Finds the paths of sitemap configuration base paths above a given path.

        Parameters:
        path - the path for which to find the base paths of all valid sitemap configurations
        Returns:
        the list of base paths
      • isDetailPage

        protected boolean isDetailPage​(CmsObject cms,
                                       CmsResource resource)
        Checks whether the given resource is configured as a detail page.

        Parameters:
        cms - the current CMS context
        resource - the resource to test
        Returns:
        true if the resource is configured as a detail page