Class CmsADEConfigCacheState

java.lang.Object
org.opencms.ade.configuration.CmsADEConfigCacheState

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

  • Constructor Details

  • Method Details

    • emptyState

      Creates an empty ADE configuration cache state.

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

      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(Map<CmsUUID,CmsADEConfigDataInternal> sitemapUpdates, List<CmsADEConfigDataInternal> moduleUpdates, Map<CmsUUID,CmsElementView> elementViewUpdates, Map<CmsUUID,CmsSitePlugin> sitePluginUpdates, 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
    • getAttributeEditorConfiguration

      Gets the sitemap attribute editor configuration with the given id (or null, if there isn't one).
      Parameters:
      id - the structure id of an attribute editor configuration
      Returns:
      the attribute editor configuration for the id
    • getContentTypes

      Gets the set of content types configured anywhere in sitemap configurations.
      Returns:
      the set of content types
    • getDetailInfosForSubsites

      Gets the detail page information for everything.

      Parameters:
      cms - the current CMS context
      Returns:
      the list containing all detail information
    • 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
    • getElementViews

      Returns the element views.

      Returns:
      the element views
    • getFolderTypes

      Gets the map of folder types.

      Returns:
      the map of folder types
    • getParentFolderType

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

      Gets the raw detail page information, with no existence checks or path corrections.
      Returns:
      the detail page information
    • getSiteConfigurationPaths

      Returns the root paths to all configured sites and sub sites.

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

      The map of site plugins, by structure id.
      Returns:
      the map of site plugins
    • 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

      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

      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 List<String> getDetailPages(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
    • getModuleConfiguration

      Gets the merged module configuration.

      Returns:
      the merged module configuration instance
    • getSiteConfigData

      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 List<String> getSiteConfigPaths(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
    • mergeConfigurations

      Merges a list of multiple configuration objects into a single configuration object.

      Parameters:
      configurations - the list of configuration objects.

      Returns:
      the merged configuration object