|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.ade.configuration.CmsResourceTypeConfig
public class CmsResourceTypeConfig
The configuration for a single resource type.
| Field Summary | |
|---|---|
protected CmsObject |
m_cms
The CMS object used for VFS operations. |
| Fields inherited from interface org.opencms.ade.configuration.I_CmsConfigurationObject |
|---|
DEFAULT_ORDER |
| Constructor Summary | |
|---|---|
CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig)
Creates a new resource type configuration. |
|
CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig,
boolean detailPagesDisabled,
int order)
Creates a new resource type configuration. |
|
CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig,
int order)
Creates a new resource type configuration. |
|
| Method Summary | |
|---|---|
boolean |
checkCreatable(CmsObject cms)
Checks if this resource type is creatable. |
void |
checkInitialized()
Checks whether the object is initialized and throws an exception otherwise. |
void |
checkOffline(CmsObject cms)
Checks whether the cms context is in the offline project and throws an exception otherwise. |
boolean |
checkViewable(CmsObject cms,
java.lang.String referenceUri)
Checks if a resource type is viewable for the current user. |
protected CmsResourceTypeConfig |
copy()
Creates a shallow copy of this resource type configuration object. |
void |
createFolder(CmsObject cms,
java.lang.String rootPath)
Creates a folder and its parent folders if they don't exist. |
CmsResource |
createNewElement(CmsObject userCms)
Creates a new element. |
CmsResource |
createNewElement(CmsObject userCms,
CmsResource modelResource)
Creates a new element. |
protected CmsFolderOrName |
getFolderOrName()
Returns the folder bean from the configuration. |
java.lang.String |
getFolderPath(CmsObject cms)
Computes the folder path for this resource type. |
protected CmsFormatterConfiguration |
getFormatterConfiguration()
Gets the formatter configuration of this resource type. |
java.lang.String |
getKey()
The name of the configuration object. |
protected java.lang.String |
getNamePattern()
Gets the configured name pattern. |
java.lang.String |
getNamePattern(boolean useDefaultIfEmpty)
Gets the name pattern. |
int |
getOrder()
Returns the number used for sorting module resource types. |
I_CmsResourceType |
getType()
Gets the actual resource type for which this is a configuration. |
java.lang.String |
getTypeName()
Returns the type name. |
void |
initialize(CmsObject cms)
Initializes this instance. |
boolean |
isDetailPagesDisabled()
True if the detail page creation should be disabled for this resource type. |
boolean |
isDisabled()
If true, this configuration object will disable an inherited configuration object of the same name. |
CmsResourceTypeConfig |
merge(CmsResourceTypeConfig childConfig)
Merges this configuration object with a child configuration object. |
protected CmsObject |
rootCms(CmsObject cms)
Creates a new CMS object based on existing one and changes its site root to the site root. |
protected void |
tryToUnlock(CmsObject cms,
java.lang.String folderPath)
Tries to remove a lock on an ancestor of a given path owned by the current user. |
protected void |
updateBasePath(java.lang.String basePath)
Updates the base path for the folder information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CmsObject m_cms
| Constructor Detail |
|---|
public CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig)
typeName - the resource type namedisabled - true if this is a disabled configurationfolder - the folder referencepattern - the name patternformatterConfig - the formatter configuration
public CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig,
boolean detailPagesDisabled,
int order)
typeName - the resource type namedisabled - true if this is a disabled configurationfolder - the folder referencepattern - the name patternformatterConfig - the formatter configurationdetailPagesDisabled - true if detail page creation should be disabled for this typeorder - the number used for sorting resource types from modules
public CmsResourceTypeConfig(java.lang.String typeName,
boolean disabled,
CmsFolderOrName folder,
java.lang.String pattern,
CmsFormatterConfiguration formatterConfig,
int order)
typeName - the resource type namedisabled - true if this is a disabled configurationfolder - the folder referencepattern - the name patternformatterConfig - the formatter configurationorder - the number used for sorting resource types from modules| Method Detail |
|---|
public boolean checkCreatable(CmsObject cms)
throws CmsException
cms - the current CMS context
true if the resource type is creatable
CmsException - if something goes wrongpublic void checkInitialized()
public void checkOffline(CmsObject cms)
cms -
public boolean checkViewable(CmsObject cms,
java.lang.String referenceUri)
cms - the current CMS contextreferenceUri - the resource URI to check permissions for
true if the resource type is viewable
public void createFolder(CmsObject cms,
java.lang.String rootPath)
throws CmsException
cms - the CMS context to userootPath - the folder root path
CmsException - if something goes wrong
public CmsResource createNewElement(CmsObject userCms)
throws CmsException
userCms - the CMS context to use
CmsException - if something goes wrong
public CmsResource createNewElement(CmsObject userCms,
CmsResource modelResource)
throws CmsException
userCms - the CMS context to usemodelResource - the model resource to use
CmsException - if something goes wrongpublic java.lang.String getFolderPath(CmsObject cms)
cms - the cms context to use
public java.lang.String getKey()
I_CmsConfigurationObjectThis name should be unique for each single configuration
getKey in interface I_CmsConfigurationObject<CmsResourceTypeConfig>I_CmsConfigurationObject.getKey()public java.lang.String getNamePattern(boolean useDefaultIfEmpty)
useDefaultIfEmpty - if true, uses a default value if the name pattern isn't set directly
public int getOrder()
public I_CmsResourceType getType()
throws CmsException
CmsException - if something goes wrongpublic java.lang.String getTypeName()
public void initialize(CmsObject cms)
cms - the CMS context to usepublic boolean isDetailPagesDisabled()
public boolean isDisabled()
I_CmsConfigurationObject
isDisabled in interface I_CmsConfigurationObject<CmsResourceTypeConfig>I_CmsConfigurationObject.isDisabled()public CmsResourceTypeConfig merge(CmsResourceTypeConfig childConfig)
I_CmsConfigurationObject
merge in interface I_CmsConfigurationObject<CmsResourceTypeConfig>childConfig - the child configuration object
I_CmsConfigurationObject.merge(org.opencms.ade.configuration.I_CmsConfigurationObject)protected CmsResourceTypeConfig copy()
protected CmsFolderOrName getFolderOrName()
Normally, you should use getFolderPath() instead.
protected CmsFormatterConfiguration getFormatterConfiguration()
protected java.lang.String getNamePattern()
protected CmsObject rootCms(CmsObject cms)
throws CmsException
cms - the CMS context
CmsException - if something goes wrong
protected void tryToUnlock(CmsObject cms,
java.lang.String folderPath)
throws CmsException
cms - the CMS contextfolderPath - the path for which the lock should be removed
CmsException - if something goes wrongprotected void updateBasePath(java.lang.String basePath)
basePath - the new base path
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||