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.

        cms - the CMS context
        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.

        the map of content types by folder root paths
        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).
        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
        the new configuration state
      • getContentTypes

        public java.util.Set<java.lang.String> getContentTypes()
        Gets the set of content types configured anywhere in sitemap configurations.
        the set of content types
      • 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.

        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.

        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.

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

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

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

        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.
        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.

        rootPath - the root path for which to look up the configuration
        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.

        the list of detail page info beans
      • getCms

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

        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.

        type - the name of the type
        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.

        path - a root path
        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.

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

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

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