public class CmsADEConfigCacheState extends java.lang.Object
Constructor and Description |
---|
CmsADEConfigCacheState(CmsObject cms,
java.util.Map<CmsUUID,CmsADEConfigDataInternal> siteConfigurations,
java.util.List<CmsADEConfigDataInternal> moduleConfigs,
java.util.Map<CmsUUID,CmsElementView> elementViews)
Creates a new configuration cache state.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
computeFolderTypes()
Computes the map from folder paths to content types for this ADE configuration state.
|
CmsADEConfigCacheState |
createUpdatedCopy(java.util.Map<CmsUUID,CmsADEConfigDataInternal> sitemapUpdates,
java.util.List<CmsADEConfigDataInternal> moduleUpdates,
java.util.Map<CmsUUID,CmsElementView> elementViewUpdates)
Creates a new object which represents the changed configuration state given some updates, without
changing the current configuration state (this object instance).
|
static CmsADEConfigCacheState |
emptyState(CmsObject cms)
Creates an empty ADE configuration cache state.
|
protected java.util.List<CmsDetailPageInfo> |
getAllDetailPages()
Gets all detail page info beans which are defined anywhere in the configuration.
|
protected CmsObject |
getCms()
Gets the CMS context used for VFS operations.
|
java.util.List<CmsADEConfigData.DetailInfo> |
getDetailInfosForSubsites(CmsObject cms)
Gets the detail page information for everything.
|
protected java.util.List<java.lang.String> |
getDetailPages(java.lang.String type)
Gets all the detail pages for a given type.
|
java.util.Set<java.lang.String> |
getDetailPageTypes()
Gets the set of type names for which detail pages are configured in any sitemap configuration.
|
java.util.Map<CmsUUID,CmsElementView> |
getElementViews()
Returns the element views.
|
java.util.Map<java.lang.String,java.lang.String> |
getFolderTypes()
Gets the map of folder types.
|
protected CmsADEConfigData |
getModuleConfiguration()
Gets the merged module configuration.
|
java.lang.String |
getParentFolderType(java.lang.String rootPath)
Helper method to retrieve the parent folder type or
null if none available. |
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.
|
protected java.util.List<java.lang.String> |
getSiteConfigPaths(java.lang.String path)
Finds the paths of sitemap configuration base paths above a given path.
|
java.util.Set<java.lang.String> |
getSiteConfigurationPaths()
Returns the root paths to all configured sites and sub sites.
|
protected boolean |
isDetailPage(CmsObject cms,
CmsResource resource)
Checks whether the given resource is configured as a detail page.
|
CmsADEConfigData |
lookupConfiguration(java.lang.String rootPath)
Looks up the sitemap configuration for a root path.
|
protected CmsADEConfigDataInternal |
mergeConfigurations(java.util.List<CmsADEConfigDataInternal> configurations)
Merges a list of multiple configuration objects into a single configuration object.
|
public CmsADEConfigCacheState(CmsObject cms, java.util.Map<CmsUUID,CmsADEConfigDataInternal> siteConfigurations, java.util.List<CmsADEConfigDataInternal> moduleConfigs, java.util.Map<CmsUUID,CmsElementView> elementViews)
cms
- the CMS context to usesiteConfigurations
- the map of sitemap configuration beans by structure idmoduleConfigs
- the complete list of module configurationselementViews
- the available element viewspublic static CmsADEConfigCacheState emptyState(CmsObject cms)
cms
- the CMS contextpublic java.util.Map<java.lang.String,java.lang.String> computeFolderTypes() throws CmsException
CmsException
- if something goes wrongpublic CmsADEConfigCacheState createUpdatedCopy(java.util.Map<CmsUUID,CmsADEConfigDataInternal> sitemapUpdates, java.util.List<CmsADEConfigDataInternal> moduleUpdates, java.util.Map<CmsUUID,CmsElementView> elementViewUpdates)
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 neededelementViewUpdates
- the updated element views, or null if no update neededpublic java.util.List<CmsADEConfigData.DetailInfo> getDetailInfosForSubsites(CmsObject cms)
cms
- the current CMS contextpublic java.util.Set<java.lang.String> getDetailPageTypes()
public java.util.Map<CmsUUID,CmsElementView> getElementViews()
public java.util.Map<java.lang.String,java.lang.String> getFolderTypes()
public java.lang.String getParentFolderType(java.lang.String rootPath)
null
if none available.rootPath
- the path of a resourcepublic java.util.Set<java.lang.String> getSiteConfigurationPaths()
public CmsADEConfigData lookupConfiguration(java.lang.String rootPath)
rootPath
- the root path for which to look up the configurationprotected java.util.List<CmsDetailPageInfo> getAllDetailPages()
protected CmsObject getCms()
protected java.util.List<java.lang.String> getDetailPages(java.lang.String type)
type
- the name of the typeprotected CmsADEConfigData getModuleConfiguration()
protected CmsADEConfigDataInternal getSiteConfigData(java.lang.String path)
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 pathprotected java.util.List<java.lang.String> getSiteConfigPaths(java.lang.String path)
path
- the path for which to find the base paths of all valid sitemap configurationsprotected boolean isDetailPage(CmsObject cms, CmsResource resource)
cms
- the current CMS contextresource
- the resource to testprotected CmsADEConfigDataInternal mergeConfigurations(java.util.List<CmsADEConfigDataInternal> configurations)
configurations
- the list of configuration objects.