public class CmsADEConfigData
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
m_createContentsLocally
The "create contents locally" flag.
|
protected boolean |
m_discardInheritedModelPages
Should inherited model pages be discarded?
|
protected boolean |
m_discardInheritedProperties
Should inherited properties be discard?
|
protected boolean |
m_discardInheritedTypes
Should inherited types be discarded?
|
protected CmsFormatterChangeSet |
m_formatterChangeSet
The configured formatter changes.
|
构造器和说明 |
---|
CmsADEConfigData()
Default constructor to create an empty configuration.
|
CmsADEConfigData(java.lang.String basePath)
Creates an empty configuration data object with a given base path.
|
CmsADEConfigData(java.lang.String basePath,
java.util.List<CmsResourceTypeConfig> resourceTypeConfig,
boolean discardInheritedTypes,
java.util.List<CmsPropertyConfig> propertyConfig,
boolean discardInheritedProperties,
java.util.List<CmsDetailPageInfo> detailPageInfos,
java.util.List<CmsModelPageConfig> modelPages,
java.util.List<CmsFunctionReference> functionReferences,
boolean discardInheritedModelPages,
boolean createContentsLocally,
CmsFormatterChangeSet formatterChangeSet)
Creates a new configuration data instance.
|
限定符和类型 | 方法和说明 |
---|---|
void |
applyAllFormatterChanges(java.util.Map<CmsUUID,I_CmsFormatterBean> formatters,
CmsFormatterConfigurationCacheState formatterCacheState)
Applies the formatter change sets of this and all parent configurations to a map of external (non-schema) formatters.
|
protected void |
checkInitialized()
Checks whether the configuration is initialized and throws an error otherwise.
|
protected void |
checkNotInitialized()
Checks whether the configuration is *NOT* initialized and throws an error otherwise.
|
protected static <C extends I_CmsConfigurationObject<C>> |
combineConfigurationElements(java.util.List<C> parentConfigs,
java.util.List<C> childConfigs)
Generic method to merge lists of named configuration objects.
|
protected void |
createContentDirectory()
Creates the content directory for this configuration node if possible.
|
static CmsADEConfigData |
emptyConfiguration(java.lang.String basePath)
Creates an empty configuration for a given base path.
|
java.util.Map<CmsUUID,I_CmsFormatterBean> |
getActiveFormatters()
Gets the active external (non-schema) formatters for this sub-sitemap.
|
java.util.List<CmsDetailPageInfo> |
getAllDetailPages()
Gets the list of all detail pages.
|
java.util.List<CmsDetailPageInfo> |
getAllDetailPages(boolean update)
Gets a list of all detail pages.
|
java.lang.String |
getBasePath()
Gets the configuration base path.
|
CmsFormatterConfigurationCacheState |
getCachedFormatters()
Gets the cached formatters.
|
protected CmsObject |
getCmsObject()
Gets the CMS object used for VFS operations.
|
java.lang.String |
getContentFolderPath()
Gets the content folder path.
|
java.util.List<CmsResourceTypeConfig> |
getCreatableTypes(CmsObject cms)
Returns a list of the creatable resource types.
|
CmsModelPageConfig |
getDefaultModelPage()
Returns the default model page.
|
java.util.List<CmsDetailPageInfo> |
getDetailPagesForType(java.lang.String type)
Gets the detail pages for a specific type.
|
protected java.util.Map<java.lang.String,java.util.List<CmsDetailPageInfo>> |
getDetailPagesMap(java.util.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.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getFolderTypes()
Collects the folder types in a map.
|
java.util.List<CmsFormatterChangeSet> |
getFormatterChangeSets()
Returns the formatter change sets for this and all parent sitemaps, ordered by increasing folder depth of the sitemap.
|
CmsFormatterConfiguration |
getFormatters(CmsObject cms,
CmsResource res)
Gets the formatter configuration for a resource.
|
protected CmsFormatterConfiguration |
getFormattersFromSchema(CmsObject cms,
CmsResource res)
Gets the formatters from the schema.
|
CmsFunctionReference |
getFunctionReference(java.lang.String name)
Gets a named function reference.
|
java.util.List<CmsFunctionReference> |
getFunctionReferences()
Gets the list of configured function references.
|
java.util.Map<CmsUUID,I_CmsFormatterBean> |
getInactiveFormatters()
Gets the map of external (non-schema) formatters which are inactive in this sub-sitemap.
|
CmsDetailPageInfo |
getMainDetailPage(java.lang.String type)
Gets the main detail page for a specific type.
|
java.util.List<CmsModelPageConfig> |
getModelPages()
Gets the list of available model pages.
|
CmsFormatterChangeSet |
getOwnFormatterChangeSet()
Gets the formatter changes for this sitemap configuration.
|
java.util.List<CmsPropertyConfig> |
getPropertyConfiguration()
Gets the configuration for the available properties.
|
java.util.Map<java.lang.String,CmsXmlContentProperty> |
getPropertyConfigurationAsMap()
Gets the property configuration as a map of CmsXmlContentProperty instances.
|
CmsResource |
getResource()
Returns the resource from which this configuration was read.
|
CmsResourceTypeConfig |
getResourceType(java.lang.String typeName)
Returns the configuration for a specific resource type.
|
java.util.List<CmsResourceTypeConfig> |
getResourceTypes()
Gets a list of all available resource type configurations.
|
java.util.Collection<CmsResourceTypeConfig> |
getSearchableTypes(CmsObject cms)
Gets the searchable resource type configurations.
|
java.util.Set<java.lang.String> |
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.
|
java.util.Set<java.lang.String> |
getTypesWithModifiableFormatters()
Gets the set of names of resource types which have schema-based formatters that can be enabled or disabled.
|
void |
initialize(CmsObject cms)
Initializes the configuration object.
|
protected java.util.List<CmsFunctionReference> |
internalGetFunctionReferences()
Internal method for getting the function references.
|
protected java.util.List<CmsResourceTypeConfig> |
internalGetResourceTypes()
Helper method for getting the list of resource types.
|
boolean |
isCreateContentsLocally()
Returns the value of the "create contents locally" flag.
|
boolean |
isDiscardInheritedModelPages()
Returns the value of the "discard inherited model pages" flag.
|
boolean |
isDiscardInheritedProperties()
Returns the value of the "discard inherited properties" flag.
|
boolean |
isDiscardInheritedTypes()
Returns the value of the "discard inherited types" flag.
|
boolean |
isModuleConfiguration()
Returns true if this is a module configuration instead of a normal sitemap configuration.
|
protected java.util.List<CmsDetailPageInfo> |
mergeDetailPages(java.util.List<CmsDetailPageInfo> parentDetailPages,
java.util.List<CmsDetailPageInfo> ownDetailPages)
Merges two lists of detail pages, one from a parent configuration and one from a child configuration.
|
protected void |
mergeParent(CmsADEConfigData parent)
Merges the parent's data into this object.
|
CmsADEConfigData |
parent()
Fetches the parent configuration of this configuration.
|
protected void |
processModuleOrdering()
Handle the ordering from the module configurations.
|
void |
setIsModuleConfig(boolean isModuleConfig)
Sets the "module configuration" flag.
|
void |
setResource(CmsResource resource)
Sets the configuration file resource.
|
protected java.util.List<CmsDetailPageInfo> |
updateUris(java.util.List<CmsDetailPageInfo> detailPages)
Helper method to correct paths in detail page beans if the corresponding resources have been moved.
|
protected boolean m_createContentsLocally
protected boolean m_discardInheritedModelPages
protected boolean m_discardInheritedProperties
protected boolean m_discardInheritedTypes
protected CmsFormatterChangeSet m_formatterChangeSet
public CmsADEConfigData()
public CmsADEConfigData(java.lang.String basePath)
basePath
- the base pathpublic CmsADEConfigData(java.lang.String basePath, java.util.List<CmsResourceTypeConfig> resourceTypeConfig, boolean discardInheritedTypes, java.util.List<CmsPropertyConfig> propertyConfig, boolean discardInheritedProperties, java.util.List<CmsDetailPageInfo> detailPageInfos, java.util.List<CmsModelPageConfig> modelPages, java.util.List<CmsFunctionReference> functionReferences, boolean discardInheritedModelPages, boolean createContentsLocally, CmsFormatterChangeSet formatterChangeSet)
basePath
- the base pathresourceTypeConfig
- the resource type configurationdiscardInheritedTypes
- the "discard inherited types" flagpropertyConfig
- the property configurationdiscardInheritedProperties
- the "discard inherited properties" flagdetailPageInfos
- the detail page configurationmodelPages
- the model page configurationfunctionReferences
- the function reference configurationdiscardInheritedModelPages
- the "discard inherited model pages" flagcreateContentsLocally
- the "create contents locally" flagformatterChangeSet
- the formatter changespublic static CmsADEConfigData emptyConfiguration(java.lang.String basePath)
basePath
- the base pathprotected static <C extends I_CmsConfigurationObject<C>> java.util.List<C> combineConfigurationElements(java.util.List<C> parentConfigs, java.util.List<C> childConfigs)
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.
C
- the type of configuration objectparentConfigs
- the parent configurationschildConfigs
- the child configurationspublic void applyAllFormatterChanges(java.util.Map<CmsUUID,I_CmsFormatterBean> formatters, CmsFormatterConfigurationCacheState formatterCacheState)
formatters
- the external formatter map which will be modifiedformatterCacheState
- the formatter cache state from which new external formatters should be fetchedpublic java.util.Map<CmsUUID,I_CmsFormatterBean> getActiveFormatters()
public java.util.List<CmsDetailPageInfo> getAllDetailPages()
public java.util.List<CmsDetailPageInfo> getAllDetailPages(boolean update)
update
- if true, this method will try to correct the root paths in the returned objects if the corresponding resources have been movedpublic java.lang.String getBasePath()
For example, if the configuration file is located at /sites/default/.content/.config, the base path is /sites/default.
public CmsFormatterConfigurationCacheState getCachedFormatters()
public java.lang.String getContentFolderPath()
For example, if the configuration file is located at /sites/default/.content/.config, the content folder path is /sites/default/.content
public java.util.List<CmsResourceTypeConfig> getCreatableTypes(CmsObject cms) throws CmsException
cms
- the CMS context used to check whether the resource types are creatableCmsException
- if something goes wrongpublic CmsModelPageConfig getDefaultModelPage()
public java.util.List<CmsDetailPageInfo> getDetailPagesForType(java.lang.String type)
type
- the type namepublic java.util.List<CmsFormatterChangeSet> getFormatterChangeSets()
public CmsFormatterConfiguration getFormatters(CmsObject cms, CmsResource res)
cms
- the current CMS contextres
- the resource for which the formatter configuration should be retrievedpublic CmsFunctionReference getFunctionReference(java.lang.String name)
name
- the name of the function referencepublic java.util.List<CmsFunctionReference> getFunctionReferences()
public java.util.Map<CmsUUID,I_CmsFormatterBean> getInactiveFormatters()
public CmsDetailPageInfo getMainDetailPage(java.lang.String type)
type
- the type namepublic java.util.List<CmsModelPageConfig> getModelPages()
public CmsFormatterChangeSet getOwnFormatterChangeSet()
public java.util.List<CmsPropertyConfig> getPropertyConfiguration()
public java.util.Map<java.lang.String,CmsXmlContentProperty> getPropertyConfigurationAsMap()
public CmsResource getResource()
public CmsResourceTypeConfig getResourceType(java.lang.String typeName)
typeName
- the name of the typepublic java.util.List<CmsResourceTypeConfig> getResourceTypes()
public java.util.Collection<CmsResourceTypeConfig> getSearchableTypes(CmsObject cms)
cms
- the current CMS contextpublic java.util.Set<java.lang.String> getTypesWithActiveSchemaFormatters()
public java.util.Set<java.lang.String> getTypesWithModifiableFormatters()
public void initialize(CmsObject cms)
cms
- the CMS context to be used for VFS operationspublic boolean isCreateContentsLocally()
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).
public boolean isDiscardInheritedModelPages()
If this flag is set, inherited model pages will be discarded for this sitemap.
public boolean isDiscardInheritedProperties()
If this is flag is set, inherited property definitions will be discarded for this sitemap.
public boolean isDiscardInheritedTypes()
If this flag is set, inherited resource types from a super-sitemap will be discarded for this sitemap.
public boolean isModuleConfiguration()
public CmsADEConfigData parent()
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.
public void setIsModuleConfig(boolean isModuleConfig)
isModuleConfig
- true if this configuration should be marked as a module configurationpublic void setResource(CmsResource resource)
resource
- the configuration file resourceprotected void checkInitialized()
protected void checkNotInitialized()
protected void createContentDirectory() throws CmsException
CmsException
- if something goes wrongprotected CmsObject getCmsObject()
protected java.util.Map<java.lang.String,java.util.List<CmsDetailPageInfo>> getDetailPagesMap(java.util.List<CmsDetailPageInfo> detailPages)
detailPages
- the list of detail pagesprotected java.util.Map<java.lang.String,java.lang.String> getFolderTypes() throws CmsException
CmsException
- if something goes wrongprotected CmsFormatterConfiguration getFormattersFromSchema(CmsObject cms, CmsResource res)
cms
- the current CMS contextres
- the resource for which the formatters should be retrievedprotected java.util.List<CmsFunctionReference> internalGetFunctionReferences()
protected java.util.List<CmsResourceTypeConfig> internalGetResourceTypes()
protected java.util.List<CmsDetailPageInfo> mergeDetailPages(java.util.List<CmsDetailPageInfo> parentDetailPages, java.util.List<CmsDetailPageInfo> ownDetailPages)
parentDetailPages
- the parent's detail pagesownDetailPages
- the child's detail pagesprotected void mergeParent(CmsADEConfigData parent)
parent
- the parent configuration dataprotected void processModuleOrdering()
protected java.util.List<CmsDetailPageInfo> updateUris(java.util.List<CmsDetailPageInfo> detailPages)
detailPages
- the original list of detail pages