|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.ade.configuration.CmsADEConfigData
public class CmsADEConfigData
A class which represents the accessible configuration data at a given point in a sitemap.
Field Summary | |
---|---|
static String |
CONTENT_FOLDER_NAME
The content folder name. |
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? |
Constructor Summary | |
---|---|
CmsADEConfigData()
Default constructor to create an empty configuration. |
|
CmsADEConfigData(String basePath)
Creates an empty configuration data object with a given base path. |
|
CmsADEConfigData(String basePath,
List<CmsResourceTypeConfig> resourceTypeConfig,
boolean discardInheritedTypes,
List<CmsPropertyConfig> propertyConfig,
boolean discardInheritedProperties,
List<CmsDetailPageInfo> detailPageInfos,
List<CmsModelPageConfig> modelPages,
List<CmsFunctionReference> functionReferences,
boolean discardInheritedModelPages,
boolean createContentsLocally)
Creates a new configuration data instance. |
Method Summary | ||
---|---|---|
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
|
combineConfigurationElements(List<C> parentConfigs,
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(String basePath)
Creates an empty configuration for a given base path. |
|
List<CmsDetailPageInfo> |
getAllDetailPages()
Gets the list of all detail pages. |
|
List<CmsDetailPageInfo> |
getAllDetailPages(boolean update)
Gets a list of all detail pages. |
|
String |
getBasePath()
Gets the configuration base path. |
|
protected CmsObject |
getCmsObject()
Gets the CMS object used for VFS operations. |
|
String |
getContentFolderPath()
Gets the content folder path. |
|
List<CmsResourceTypeConfig> |
getCreatableTypes(CmsObject cms)
Returns a list of the creatable resource types. |
|
CmsModelPageConfig |
getDefaultModelPage()
Returns the default model page. |
|
List<CmsDetailPageInfo> |
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. |
|
protected Map<String,String> |
getFolderTypes()
Collects the folder types in a map. |
|
CmsFormatterConfiguration |
getFormatters(CmsObject cms,
CmsResource res)
Gets the formatter configuration for a resource. |
|
protected CmsFormatterConfiguration |
getFormatters(String type)
Gets the formatter configuration for a given type. |
|
protected CmsFormatterConfiguration |
getFormattersFromSchema(CmsObject cms,
CmsResource res)
Gets the formatters from the schema. |
|
CmsFunctionReference |
getFunctionReference(String name)
Gets a named function reference. |
|
List<CmsFunctionReference> |
getFunctionReferences()
Gets the list of configured function references. |
|
CmsDetailPageInfo |
getMainDetailPage(String type)
Gets the main detail page for a specific type. |
|
List<CmsModelPageConfig> |
getModelPages()
Gets the list of available model pages. |
|
List<CmsPropertyConfig> |
getPropertyConfiguration()
Gets the configuration for the available properties. |
|
Map<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(String typeName)
Returns the configuration for a specific resource type. |
|
List<CmsResourceTypeConfig> |
getResourceTypes()
Gets a list of all available resource type configurations. |
|
Collection<CmsResourceTypeConfig> |
getSearchableTypes(CmsObject cms)
Gets the searchable resource type configurations. |
|
void |
initialize(CmsObject cms)
Initializes the configuration object. |
|
protected List<CmsFunctionReference> |
internalGetFunctionReferences()
Internal method for getting the function references. |
|
protected 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 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. |
|
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 List<CmsDetailPageInfo> |
updateUris(List<CmsDetailPageInfo> detailPages)
Helper method to correct paths in detail page beans if the corresponding resources have been moved. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONTENT_FOLDER_NAME
protected boolean m_createContentsLocally
protected boolean m_discardInheritedModelPages
protected boolean m_discardInheritedProperties
protected boolean m_discardInheritedTypes
Constructor Detail |
---|
public CmsADEConfigData()
public CmsADEConfigData(String basePath)
basePath
- the base pathpublic CmsADEConfigData(String basePath, List<CmsResourceTypeConfig> resourceTypeConfig, boolean discardInheritedTypes, List<CmsPropertyConfig> propertyConfig, boolean discardInheritedProperties, List<CmsDetailPageInfo> detailPageInfos, List<CmsModelPageConfig> modelPages, List<CmsFunctionReference> functionReferences, boolean discardInheritedModelPages, boolean createContentsLocally)
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" flagMethod Detail |
---|
public static CmsADEConfigData emptyConfiguration(String basePath)
basePath
- the base path
protected static <C extends I_CmsConfigurationObject<C>> List<C> combineConfigurationElements(List<C> parentConfigs, 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 configurations
public List<CmsDetailPageInfo> getAllDetailPages()
public 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 moved
public String getBasePath()
For example, if the configuration file is located at /sites/default/.content/.config, the base path is /sites/default.
public String getContentFolderPath()
For example, if the configuration file is located at /sites/default/.content/.config, the content folder path is /sites/default/.content
public List<CmsResourceTypeConfig> getCreatableTypes(CmsObject cms) throws CmsException
cms
- the CMS context used to check whether the resource types are creatable
CmsException
- if something goes wrongpublic CmsModelPageConfig getDefaultModelPage()
public List<CmsDetailPageInfo> getDetailPagesForType(String type)
type
- the type name
public CmsFormatterConfiguration getFormatters(CmsObject cms, CmsResource res)
cms
- the current CMS contextres
- the resource for which the formatter configuration should be retrieved
public CmsFunctionReference getFunctionReference(String name)
name
- the name of the function reference
public List<CmsFunctionReference> getFunctionReferences()
public CmsDetailPageInfo getMainDetailPage(String type)
type
- the type name
public List<CmsModelPageConfig> getModelPages()
public List<CmsPropertyConfig> getPropertyConfiguration()
public Map<String,CmsXmlContentProperty> getPropertyConfigurationAsMap()
public CmsResource getResource()
public CmsResourceTypeConfig getResourceType(String typeName)
typeName
- the name of the type
public List<CmsResourceTypeConfig> getResourceTypes()
public Collection<CmsResourceTypeConfig> getSearchableTypes(CmsObject cms)
cms
- the current CMS context
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 Map<String,List<CmsDetailPageInfo>> getDetailPagesMap(List<CmsDetailPageInfo> detailPages)
detailPages
- the list of detail pages
protected Map<String,String> getFolderTypes() throws CmsException
CmsException
- if something goes wrongprotected CmsFormatterConfiguration getFormatters(String type)
type
- the type for which to get the formatters
protected CmsFormatterConfiguration getFormattersFromSchema(CmsObject cms, CmsResource res)
cms
- the current CMS contextres
- the resource for which the formatters should be retrieved
protected List<CmsFunctionReference> internalGetFunctionReferences()
protected List<CmsResourceTypeConfig> internalGetResourceTypes()
protected List<CmsDetailPageInfo> mergeDetailPages(List<CmsDetailPageInfo> parentDetailPages, List<CmsDetailPageInfo> ownDetailPages)
parentDetailPages
- the parent's detail pagesownDetailPages
- the child's detail pages
protected void mergeParent(CmsADEConfigData parent)
parent
- the parent configuration dataprotected void processModuleOrdering()
protected List<CmsDetailPageInfo> updateUris(List<CmsDetailPageInfo> detailPages)
detailPages
- the original list of detail pages
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |