Class CmsADEConfigData
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Bean which contains the detail information for a single sub-sitemap and resource type. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Sitemap attribute for the upload folder.protected CmsADEConfigDataInternal
The wrapped configuration bean containing the actual data.static final String
Prefix for logging special request log messages.static final String
Channel for logging special request log messages. -
Constructor Summary
ConstructorDescriptionCmsADEConfigData
(CmsADEConfigDataInternal data, CmsADEConfigCacheState cache, CmsADEConfigurationSequence configSequence) Creates a new configuration data object, based on an internal configuration data bean and a configuration cache state. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyAllFormatterChanges
(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState formatterCacheState) Applies the formatter change sets of this and all parent configurations to a formatter indexprotected void
Clears the internal formatter caches.static <C extends I_CmsConfigurationObject<C>>
List<C>combineConfigurationElements
(List<C> parentConfigs, List<C> childConfigs, boolean preserveDisabled) Generic method to merge lists of named configuration objects.protected void
Creates the content directory for this configuration node if possible.findFormatter
(String name) Gets the 'best' formatter for the given name.findFormatter
(String name, boolean noWarn) Gets the 'best' formatter for the given name.findFormatter
(CmsUUID id) Gets the 'best' formatter for the given ID.findFormatter
(CmsUUID id, boolean noWarn) Gets the 'best' formatter for the given ID.Gets the active external (non-schema) formatters for this sub-sitemap.getActiveFormattersWithContainerType
(String containerType) Gets the active formatters for a given container type.getActiveFormattersWithDisplayType
(String displayType) Gets the active formatters for a given display type.Gets the set of names of types active in this sitemap configuration.Gets the 'add content' restriction for this configuration.Gets the list of all detail pages.getAllDetailPages
(boolean update) Gets a list of all detail pages.Gets the set of names of types configured in this or any ancestor sitemap configurations.getAttribute
(String key, String defaultValue) Gets the value of an attribute, or a default valueGets the active sitemap attribute editor configuration.Gets the structure id of the configured sitemap attribute editor configuration.Gets the map of attributes configured for this sitemap, including values inherited from parent sitemaps.Gets the configuration base path.Gets the cached formatters.protected CmsObject
getCms()
Gets the CMS object used for VFS operations.protected CmsObject
Gets the CMS object used for VFS operations.Gets an (immutable) list of paths of configuration files in inheritance order.Returns the names of the bundles configured as workplace bundles in any module configuration.Gets the content folder path.getCreatableTypes
(CmsObject cms, String pageFolderRootPath) Returns a list of the creatable resource types.Returns the default detail page.Returns the default model page.getDetailInfos
(CmsObject cms) Gets the detail information for this sitemap config data object.getDetailPagesForType
(String type) Gets the detail pages for a specific type.protected Map<String,
List<CmsDetailPageInfo>> getDetailPagesMap
(List<CmsDetailPageInfo> detailPages) Helper method to converts a list of detail pages to a map from type names to lists of detail pages for each type.Returns the direct edit permissions for e.g.getDisabledFunctionsMode
(CmsGalleryDisabledTypesMode defaultValue) Gets the display mode for deactivated functions in the gallery dialog.getDisabledTypeMode
(CmsGalleryDisabledTypesMode defaultValue) Gets the display mode for deactivated types in the gallery dialog.Returns all available display formatters.getDynamicFunctionAvailability
(CmsFormatterConfigurationCacheState formatterConfig) Gets the bean that represents the dynamic function availability.Gets the root path of the closest subsite going up the tree which has the 'exclude external detail contents' option enabled, or '/' if no such subsite exists.Collects the folder types in a map.Returns the formatter change sets for this and all parent sitemaps, ordered by increasing folder depth of the sitemap.getFormatters
(CmsObject cms, CmsResource res) Gets the formatter configuration for a resource.protected CmsFormatterConfiguration
getFormatters
(CmsObject cms, I_CmsResourceType resType, CmsFormatterConfiguration schemaFormatters) Gets the formatter configuration for a resource type.protected CmsFormatterConfiguration
getFormattersFromSchema
(CmsObject cms, CmsResource res) Gets the formatters from the schema.getFunctionReference
(String name) Gets a named function reference.Gets the list of configured function references.Gets the map of external (non-schema) formatters which are inactive in this sub-sitemap.getMeta()
Gets the metadata about how this configuration was referenced.Gets the list of available model pages.getModelPages
(boolean includeDisable) Gets the list of available model pages.Gets the formatter changes for this sitemap configuration.static final String
If the given formatter key has a sub-formatter suffix, returns the part before it, otherwise returns null.Gets the configuration for the available properties.getPropertyConfiguration
(Map<String, CmsXmlContentProperty> defaultProperties) Computes the ordered map of properties to display in the property dialog, given the map of default property configurations passed as a parameter.Gets the property configuration as a map of CmsXmlContentProperty instances.Returns the resource from which this configuration was read.getResourceType
(String typeName) Returns the configuration for a specific resource type.Gets a list of all available resource type configurations.Gets the searchable resource type configurations.com.google.common.collect.ImmutableList<CmsUUID>
Gets the list of structure ids of the shared setting overrides, ordered by increasing specificity.Gets the ids of site plugins which are active in this sitemap configuration.Gets the list of site plugins active in this sitemap configuration.Gets the type ordering mode.Gets a map of the active resource type configurations, with type names as keys.Gets the set of resource type names for which schema formatters can be enabled or disabled and which are not disabled in this sub-sitemap.Gets the set of names of resource types which have schema-based formatters that can be enabled or disabled.boolean
hasFormatters
(CmsObject cms, I_CmsResourceType resType, Collection<CmsContainer> containers) Checks if there are any matching formatters for the given set of containers.protected List<CmsFunctionReference>
Internal method for getting the function references.protected List<CmsResourceTypeConfig>
internalGetResourceTypes
(boolean filterDisabled) Helper method for getting the list of resource types.boolean
Returns the value of the "create contents locally" flag.boolean
Returns the value of the "discard inherited model pages" flag.boolean
Returns the value of the "discard inherited properties" flag.boolean
Returns the value of the "discard inherited types" flag.boolean
True if detail contents outside this sitemap should not be rendered in detail pages from this sitemap.boolean
Checks if dynamic functions not matching any containers should be hidden.boolean
Returns true if the subsite should be included in the site selector.boolean
Returns true if this is a module configuration instead of a normal sitemap configuration.boolean
Returns true if detail pages from this sitemap should be preferred for links to contents in this sitemap.boolean
isSearchContentFormatter
(CmsUUID jspId) Checks if any formatter with the given JSP id has the 'search content' option set to true.boolean
Returns true if the new container page format, which uses formatter keys (but also is different in other ways from the new formatprotected List<CmsDetailPageInfo>
mergeDetailPages
(List<CmsDetailPageInfo> parentDetailPages, List<CmsDetailPageInfo> ownDetailPages) Merges two lists of detail pages, one from a parent configuration and one from a child configuration.parent()
Fetches the parent configuration of this configuration.boolean
Returns true if the sitemap attribute editor should be available in this subsite.protected List<CmsDetailPageInfo>
updateUris
(List<CmsDetailPageInfo> detailPages) Helper method to correct paths in detail page beans if the corresponding resources have been moved.
-
Field Details
-
ATTR_BINARY_UPLOAD_TARGET
Sitemap attribute for the upload folder.- See Also:
-
REQ_LOG_PREFIX
Prefix for logging special request log messages.- See Also:
-
REQUEST_LOG_CHANNEL
Channel for logging special request log messages.- See Also:
-
m_data
The wrapped configuration bean containing the actual data.
-
-
Constructor Details
-
CmsADEConfigData
public CmsADEConfigData(CmsADEConfigDataInternal data, CmsADEConfigCacheState cache, CmsADEConfigurationSequence configSequence) Creates a new configuration data object, based on an internal configuration data bean and a configuration cache state.- Parameters:
data
- the internal configuration data beancache
- the configuration cache stateconfigSequence
- the configuration sequence
-
-
Method Details
-
combineConfigurationElements
public static <C extends I_CmsConfigurationObject<C>> List<C> combineConfigurationElements(List<C> parentConfigs, List<C> childConfigs, boolean preserveDisabled) Generic method to merge lists of named configuration objects.The lists are merged such that the configuration objects from the child list rise to the front of the result list, and two configuration objects will be merged themselves if they share the same name.
For example, if we have two lists of configuration objects:
parent: A1, B1, C1
child: D2, B2
then the resulting list will look like:
D2, B3, A1, C1
where B3 is the result of merging B1 and B2.
- Type Parameters:
C
- the type of configuration object- Parameters:
parentConfigs
- the parent configurationschildConfigs
- the child configurationspreserveDisabled
- if true, try to merge parents with disabled children instead of discarding them- Returns:
- the merged configuration object list
-
getParentFormatterKey
If the given formatter key has a sub-formatter suffix, returns the part before it, otherwise returns null.- Parameters:
key
- the formatter key- Returns:
- the parent formatter key
-
applyAllFormatterChanges
public void applyAllFormatterChanges(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState formatterCacheState) Applies the formatter change sets of this and all parent configurations to a formatter index- Parameters:
formatterIndex
- the collection of formatters to apply the changes toformatterCacheState
- the formatter cache state from which new external formatters should be fetched
-
findFormatter
Gets the 'best' formatter for the given ID.If the formatter with the ID has a key, then the active formatter with the same key is returned. Otherwise, the formatter matching the ID is returned. So being active and having the same key is prioritized over an exact ID match.
- Parameters:
id
- the formatter ID- Returns:
- the best formatter the given ID
-
findFormatter
Gets the 'best' formatter for the given ID.If the formatter with the ID has a key, then the active formatter with the same key is returned. Otherwise, the formatter matching the ID is returned. So being active and having the same key is prioritized over an exact ID match.
- Parameters:
id
- the formatter IDnoWarn
- if true, disables warnings- Returns:
- the best formatter the given ID
-
findFormatter
Gets the 'best' formatter for the given name.The name can be either a formatter key, or a formatter UUID. If it's a key, an active formatter with that key is returned. If it's a UUID, and the formatter with that UUID has no key, it will be returned. If it does have a key, the active formatter with that key is returned (so being active and having the same key is prioritized over an exact ID match).
- Parameters:
name
- a formatter name (key or ID)- Returns:
- the best formatter for that name, or null if no formatter could be found
-
findFormatter
Gets the 'best' formatter for the given name.The name can be either a formatter key, or a formatter UUID. If it's a key, an active formatter with that key is returned. If it's a UUID, and the formatter with that UUID has no key, it will be returned. If it does have a key, the active formatter with that key is returned (so being active and having the same key is prioritized over an exact ID match).
- Parameters:
name
- a formatter name (key or ID)noWarn
- if true, disables warnings- Returns:
- the best formatter for that name, or null if no formatter could be found
-
getActiveFormatters
Gets the active external (non-schema) formatters for this sub-sitemap.- Returns:
- the map of active external formatters by structure id
-
getActiveFormattersWithContainerType
Gets the active formatters for a given container type.- Parameters:
containerType
- a container type- Returns:
- the active formatters for the container type
-
getActiveFormattersWithDisplayType
Gets the active formatters for a given display type.- Parameters:
displayType
- a display type- Returns:
- the active formatters for the display type
-
getAddableTypeNames
Gets the set of names of types active in this sitemap configuration.- Returns:
- the set of type names of active types
-
getAddContentRestriction
Gets the 'add content' restriction for this configuration.- Returns:
- the 'add content' restriction
-
getAllDetailPages
Gets the list of all detail pages.- Returns:
- the list of all detail pages
-
getAllDetailPages
Gets a list of all detail pages.- Parameters:
update
- if true, this method will try to correct the root paths in the returned objects if the corresponding resources have been moved- Returns:
- the list of all detail pages
-
getAncestorTypeNames
Gets the set of names of types configured in this or any ancestor sitemap configurations.- Returns:
- the set of type names from all ancestor configurations
-
getAttribute
Gets the value of an attribute, or a default value- Parameters:
key
- the attribute keydefaultValue
- the value to return if no attribute with the given name is found- Returns:
- the attribute value
-
getAttributeEditorConfiguration
Gets the active sitemap attribute editor configuration.- Returns:
- the active sitemap attribute editor configuration
-
getAttributeEditorConfigurationId
Gets the structure id of the configured sitemap attribute editor configuration.- Returns:
- the structure id of the configured sitemap attribute editor configuration
-
getAttributes
Gets the map of attributes configured for this sitemap, including values inherited from parent sitemaps.- Returns:
- the map of attributes
-
getBasePath
Gets the configuration base path.For example, if the configuration file is located at /sites/default/.content/.config, the base path is /sites/default.
- Returns:
- the base path of the configuration
-
getCachedFormatters
Gets the cached formatters.- Returns:
- the cached formatters
-
getConfigPaths
Gets an (immutable) list of paths of configuration files in inheritance order.- Returns:
- the list of configuration files
-
getConfiguredWorkplaceBundles
Returns the names of the bundles configured as workplace bundles in any module configuration.- Returns:
- the names of the bundles configured as workplace bundles in any module configuration.
-
getContentFolderPath
Gets the content folder path.For example, if the configuration file is located at /sites/default/.content/.config, the content folder path is /sites/default/.content
- Returns:
- the content folder path
-
getCreatableTypes
public List<CmsResourceTypeConfig> getCreatableTypes(CmsObject cms, String pageFolderRootPath) throws CmsException Returns a list of the creatable resource types.- Parameters:
cms
- the CMS context used to check whether the resource types are creatablepageFolderRootPath
- the root path of the current container page- Returns:
- the list of creatable resource type
- Throws:
CmsException
- if something goes wrong
-
getDefaultDetailPage
Returns the default detail page.- Returns:
- the default detail page
-
getDefaultModelPage
Returns the default model page.- Returns:
- the default model page
-
getDetailInfos
Gets the detail information for this sitemap config data object.- Parameters:
cms
- the CMS context- Returns:
- the list of detail information
-
getDetailPagesForType
Gets the detail pages for a specific type.- Parameters:
type
- the type name- Returns:
- the list of detail pages for that type
-
getDirectEditPermissions
public CmsAdvancedDirectEditProvider.SitemapDirectEditPermissions getDirectEditPermissions(String type) Returns the direct edit permissions for e.g. list elements with the given type.- Parameters:
type
- the resource type name- Returns:
- the permissions
-
getDisabledFunctionsMode
public CmsGalleryDisabledTypesMode getDisabledFunctionsMode(CmsGalleryDisabledTypesMode defaultValue) Gets the display mode for deactivated functions in the gallery dialog.- Parameters:
defaultValue
- the default value to return if it's not set- Returns:
- the display mode for deactivated types
-
getDisabledTypeMode
Gets the display mode for deactivated types in the gallery dialog.- Parameters:
defaultValue
- the default value to return if it's not set- Returns:
- the display mode for deactivated types
-
getDisplayFormatters
Returns all available display formatters.- Parameters:
cms
- the cms context- Returns:
- the available display formatters
-
getDynamicFunctionAvailability
public CmsFunctionAvailability getDynamicFunctionAvailability(CmsFormatterConfigurationCacheState formatterConfig) Gets the bean that represents the dynamic function availability.- Parameters:
formatterConfig
- the formatter configuration state- Returns:
- the dynamic function availability
-
getExternalDetailContentExclusionFolder
Gets the root path of the closest subsite going up the tree which has the 'exclude external detail contents' option enabled, or '/' if no such subsite exists.- Returns:
- the root path of the closest subsite with 'external detail contents excluded'
-
getFormatterChangeSets
Returns the formatter change sets for this and all parent sitemaps, ordered by increasing folder depth of the sitemap.- Returns:
- the formatter change sets for all ancestor sitemaps
-
getFormatters
Gets the formatter configuration for a resource.- Parameters:
cms
- the current CMS contextres
- the resource for which the formatter configuration should be retrieved- Returns:
- the configuration of formatters for the resource
-
getFunctionReference
Gets a named function reference.- Parameters:
name
- the name of the function reference- Returns:
- the function reference for the given name
-
getFunctionReferences
Gets the list of configured function references.- Returns:
- the list of configured function references
-
getInactiveFormatters
Gets the map of external (non-schema) formatters which are inactive in this sub-sitemap.- Returns:
- the map inactive external formatters
-
getModelPages
Gets the list of available model pages.- Returns:
- the list of available model pages
-
getModelPages
Gets the list of available model pages.- Parameters:
includeDisable
-true
to include disabled model pages- Returns:
- the list of available model pages
-
getOwnFormatterChangeSet
Gets the formatter changes for this sitemap configuration.- Returns:
- the formatter change set
-
getPropertyConfiguration
Gets the configuration for the available properties.- Returns:
- the configuration for the available properties
-
getPropertyConfiguration
public Map<String,CmsXmlContentProperty> getPropertyConfiguration(Map<String, CmsXmlContentProperty> defaultProperties) Computes the ordered map of properties to display in the property dialog, given the map of default property configurations passed as a parameter.- Parameters:
defaultProperties
- the default property configurations- Returns:
- the ordered map of property configurations for the property dialog
-
getPropertyConfigurationAsMap
Gets the property configuration as a map of CmsXmlContentProperty instances.- Returns:
- the map of property configurations
-
getResource
Returns the resource from which this configuration was read.- Returns:
- the resource from which this configuration was read
-
getResourceType
Returns the configuration for a specific resource type.- Parameters:
typeName
- the name of the type- Returns:
- the resource type configuration for that type
-
getResourceTypes
Gets a list of all available resource type configurations.- Returns:
- the available resource type configurations
-
getSearchableTypes
Gets the searchable resource type configurations.- Parameters:
cms
- the current CMS context- Returns:
- the searchable resource type configurations
-
getSitePluginIds
Gets the ids of site plugins which are active in this sitemap configuration.- Returns:
- the ids of active site plugins
-
getSitePlugins
Gets the list of site plugins active in this sitemap configuration.- Returns:
- the list of active site plugins
-
getTypeOrderingMode
Gets the type ordering mode.- Returns:
- the type ordering mode
-
getTypesByName
Gets a map of the active resource type configurations, with type names as keys.- Returns:
- the map of active types
-
getTypesWithActiveSchemaFormatters
Gets the set of resource type names for which schema formatters can be enabled or disabled and which are not disabled in this sub-sitemap.- Returns:
- the set of types for which schema formatters are active
-
getTypesWithModifiableFormatters
Gets the set of names of resource types which have schema-based formatters that can be enabled or disabled.- Returns:
- the set of names of resource types which have schema-based formatters that can be enabled or disabled
-
hasFormatters
public boolean hasFormatters(CmsObject cms, I_CmsResourceType resType, Collection<CmsContainer> containers) Checks if there are any matching formatters for the given set of containers.- Parameters:
cms
- the current CMS contextresType
- the resource type for which the formatter configuration should be retrievedcontainers
- the page containers- Returns:
- if there are any matching formatters
-
isCreateContentsLocally
Returns the value of the "create contents locally" flag.If this flag is set, contents of types configured in a super-sitemap will be created in the sub-sitemap (if the user creates them from the sub-sitemap).
- Returns:
- the "create contents locally" flag
-
isDiscardInheritedModelPages
Returns the value of the "discard inherited model pages" flag.If this flag is set, inherited model pages will be discarded for this sitemap.
- Returns:
- the "discard inherited model pages" flag
-
isDiscardInheritedProperties
Returns the value of the "discard inherited properties" flag.If this is flag is set, inherited property definitions will be discarded for this sitemap.
- Returns:
- the "discard inherited properties" flag.
-
isDiscardInheritedTypes
Returns the value of the "discard inherited types" flag.If this flag is set, inherited resource types from a super-sitemap will be discarded for this sitemap.
- Returns:
- the "discard inherited types" flag
-
isExcludeExternalDetailContents
True if detail contents outside this sitemap should not be rendered in detail pages from this sitemap.- Returns:
- true if detail contents outside this sitemap should not be rendered in detail pages from this sitemap.
-
isHideNonMatchingFunctions
Checks if dynamic functions not matching any containers should be hidden.- Returns:
- true if dynamic functions not matching any containers should be hidden
-
isIncludeInSiteSelector
Returns true if the subsite should be included in the site selector.- Returns:
- true if the subsite should be included in the site selector
-
isModuleConfiguration
Returns true if this is a module configuration instead of a normal sitemap configuration.- Returns:
- true if this is a module configuration
-
isPreferDetailPagesForLocalContents
Returns true if detail pages from this sitemap should be preferred for links to contents in this sitemap.- Returns:
- true if detail pages from this sitemap should be preferred for links to contents in this sitemap
-
isSearchContentFormatter
Checks if any formatter with the given JSP id has the 'search content' option set to true.- Parameters:
jspId
- the structure id of a formatter JSP- Returns:
- true if any of the formatters
-
isUseFormatterKeys
Returns true if the new container page format, which uses formatter keys (but also is different in other ways from the new format- Returns:
- true if formatter keys should be used
-
parent
Fetches the parent configuration of this configuration.If this configuration is a sitemap configuration with no direct parent configuration, the module configuration will be returned. If this configuration already is a module configuration, null will be returned.
- Returns:
- the parent configuration
-
shouldShowSitemapAttributeDialog
Returns true if the sitemap attribute editor should be available in this subsite.- Returns:
- true if the sitemap attribute editor dialog should be available
-
clearCaches
Clears the internal formatter caches.This should only be used for test cases.
-
createContentDirectory
Creates the content directory for this configuration node if possible.- Throws:
CmsException
- if something goes wrong
-
getCms
Gets the CMS object used for VFS operations.- Returns:
- the CMS object used for VFS operations
-
getCmsObject
Gets the CMS object used for VFS operations.- Returns:
- the CMS object
-
getDetailPagesMap
protected Map<String,List<CmsDetailPageInfo>> getDetailPagesMap(List<CmsDetailPageInfo> detailPages) Helper method to converts a list of detail pages to a map from type names to lists of detail pages for each type.- Parameters:
detailPages
- the list of detail pages- Returns:
- the map of detail pages
-
getFolderTypes
Collects the folder types in a map.- Returns:
- the map of folder types
- Throws:
CmsException
- if something goes wrong
-
getFormatters
protected CmsFormatterConfiguration getFormatters(CmsObject cms, I_CmsResourceType resType, CmsFormatterConfiguration schemaFormatters) Gets the formatter configuration for a resource type.- Parameters:
cms
- the current CMS contextresType
- the resource typeschemaFormatters
- the resource schema formatters- Returns:
- the configuration of formatters for the resource type
-
getFormattersFromSchema
Gets the formatters from the schema.- Parameters:
cms
- the current CMS contextres
- the resource for which the formatters should be retrieved- Returns:
- the formatters from the schema
-
getMeta
Gets the metadata about how this configuration was referenced.- Returns:
- the metadata
-
internalGetFunctionReferences
Internal method for getting the function references.- Returns:
- the function references
-
internalGetResourceTypes
Helper method for getting the list of resource types.- Parameters:
filterDisabled
- true if disabled types should be filtered from the result- Returns:
- the list of resource types
-
mergeDetailPages
protected List<CmsDetailPageInfo> mergeDetailPages(List<CmsDetailPageInfo> parentDetailPages, List<CmsDetailPageInfo> ownDetailPages) Merges two lists of detail pages, one from a parent configuration and one from a child configuration.- Parameters:
parentDetailPages
- the parent's detail pagesownDetailPages
- the child's detail pages- Returns:
- the merged detail pages
-
updateUris
Helper method to correct paths in detail page beans if the corresponding resources have been moved.- Parameters:
detailPages
- the original list of detail pages- Returns:
- the corrected list of detail pages
-