public class CmsContainerElementBean extends java.lang.Object implements java.lang.Cloneable
Modifier | Constructor and Description |
---|---|
protected |
CmsContainerElementBean()
Constructor to enable wrapped elements.
|
|
CmsContainerElementBean(CmsUUID elementId,
CmsUUID formatterId,
java.util.Map<java.lang.String,java.lang.String> individualSettings,
boolean createNew)
Creates a new container page element bean.
|
Modifier and Type | Method and Description |
---|---|
CmsContainerElementBean |
clone() |
static CmsContainerElementBean |
cloneWithSettings(CmsContainerElementBean source,
java.util.Map<java.lang.String,java.lang.String> settings)
Clones the given element bean with a different set of settings.
|
static CmsContainerElementBean |
createElementForResourceType(CmsObject cms,
I_CmsResourceType resourceType,
java.lang.String targetFolder,
java.util.Map<java.lang.String,java.lang.String> individualSettings,
boolean isCopyModels,
java.util.Locale locale)
Creates an element bean for the given resource type.
|
java.lang.String |
editorHash()
Returns the ADE client editor has value.
|
boolean |
equals(java.lang.Object obj) |
CmsUUID |
getFormatterId()
Returns the structure id of the formatter of this element.
|
CmsUUID |
getId()
Returns the structure id of the resource of this element.
|
java.util.Map<java.lang.String,java.lang.String> |
getIndividualSettings()
Returns the settings of this element.
|
CmsInheritanceInfo |
getInheritanceInfo()
Returns the inheritance info.
|
java.lang.String |
getInstanceId()
Returns the element instance id.
|
CmsResource |
getResource()
Returns the resource of this element.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings()
Returns the element settings including default values for settings not set.
|
java.lang.String |
getSitePath()
Returns the site path of the resource of this element.
|
java.lang.String |
getTypeName()
Returns the resource type name.
|
int |
hashCode() |
void |
initResource(CmsObject cms)
Initializes the resource and the site path of this element.
|
void |
initSettings(CmsObject cms,
I_CmsFormatterBean formatterBean)
Initializes the element settings.
|
boolean |
isCopyModel()
Returns if the given element should be used as a copy model.
|
boolean |
isCreateNew()
Returns if a new element should be created replacing the given one on first edit of a container-page.
|
boolean |
isGroupContainer(CmsObject cms)
Tests whether this element refers to a group container.
|
boolean |
isInheritedContainer(CmsObject cms)
Returns whether this element refers to an inherited container element.
|
boolean |
isInMemoryOnly()
Returns if the represented resource is in memory only and not persisted in the VFS.
|
boolean |
isModelGroup()
Returns if the given element is a model group.
|
boolean |
isModelGroupAlwaysReplace()
Returns if all instances of this element should be replaced within a copy model.
|
boolean |
isReleasedAndNotExpired()
Returns if the element resource is released and not expired.
|
boolean |
isTemporaryContent()
Returns if the element resource contains temporary file content.
|
void |
removeInstanceId()
Removes the instance id.
|
void |
setFormatterId(CmsUUID formatterId)
Sets the formatter id.
|
void |
setHistoryFile(CmsFile file)
Sets a historical file.
|
void |
setInheritanceInfo(CmsInheritanceInfo inheritanceInfo)
Sets the inheritance info for this element.
|
void |
setTemporaryFile(CmsFile elementFile)
Sets the element resource as a temporary file.
|
java.lang.String |
toString() |
public CmsContainerElementBean(CmsUUID elementId, CmsUUID formatterId, java.util.Map<java.lang.String,java.lang.String> individualSettings, boolean createNew)
elementId
- the element's structure idformatterId
- the formatter's structure id, could be null
individualSettings
- the element settings as a map of name/value pairscreateNew
- true
if a new element should be created replacing the given one on first edit of a container-pageprotected CmsContainerElementBean()
public static CmsContainerElementBean cloneWithSettings(CmsContainerElementBean source, java.util.Map<java.lang.String,java.lang.String> settings)
source
- the element to clonesettings
- the new settingspublic static CmsContainerElementBean createElementForResourceType(CmsObject cms, I_CmsResourceType resourceType, java.lang.String targetFolder, java.util.Map<java.lang.String,java.lang.String> individualSettings, boolean isCopyModels, java.util.Locale locale) throws CmsException
The represented resource will be in memory only and not in the VFS!!!.
cms
- the CMS contextresourceType
- the resource typetargetFolder
- the parent folder of the resourceindividualSettings
- the element settings as a map of name/value pairsisCopyModels
- if this element when used in models should be copied instead of reusedlocale
- the locale to useCmsException
- if something goes wrong creating the elementjava.lang.IllegalArgumentException
- if the resource type not instance of CmsResourceTypeXmlContent
public CmsContainerElementBean clone()
clone
in class java.lang.Object
Object.clone()
public java.lang.String editorHash()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public CmsUUID getFormatterId()
public CmsUUID getId()
public java.util.Map<java.lang.String,java.lang.String> getIndividualSettings()
public CmsInheritanceInfo getInheritanceInfo()
null
if not availablepublic java.lang.String getInstanceId()
public CmsResource getResource()
It is required to call initResource(CmsObject)
before this method can be used.
initResource(CmsObject)
public java.util.Map<java.lang.String,java.lang.String> getSettings()
Will return null
if the element bean has not been initialized with initResource(org.opencms.file.CmsObject)
.
public java.lang.String getSitePath()
It is required to call initResource(CmsObject)
before this method can be used.
initResource(CmsObject)
public java.lang.String getTypeName()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public void initResource(CmsObject cms) throws CmsException
cms
- the CMS contextCmsException
- if something goes wrong reading the element resourcepublic void initSettings(CmsObject cms, I_CmsFormatterBean formatterBean)
cms
- the CMS contextformatterBean
- the formatter configuration beanpublic boolean isCopyModel()
true
if the given element should be used as a copy modelpublic boolean isCreateNew()
true
if a new element should be created replacing the given one on first edit of a container-pagepublic boolean isGroupContainer(CmsObject cms) throws CmsException
cms
- the CmsObject used for VFS operationstrue
if the container element refers to a group containerCmsException
- if something goes wrongpublic boolean isInheritedContainer(CmsObject cms) throws CmsException
cms
- the CmsObject used for VFS operationstrue
if the container element refers to an inherited containerCmsException
- if something goes wrongpublic boolean isInMemoryOnly()
true
if the represented resource is in memory only and not persisted in the VFSpublic boolean isModelGroup()
true
if the given element is a model grouppublic boolean isModelGroupAlwaysReplace()
true
if all instances of this element should be replaced within a copy modelpublic boolean isReleasedAndNotExpired()
true
if the element resource is released and not expiredpublic boolean isTemporaryContent()
true
if the element resource contains temporary file contentpublic void removeInstanceId()
public void setFormatterId(CmsUUID formatterId)
formatterId
- the formatter idpublic void setHistoryFile(CmsFile file)
file
- the historical filepublic void setInheritanceInfo(CmsInheritanceInfo inheritanceInfo)
inheritanceInfo
- the inheritance infopublic void setTemporaryFile(CmsFile elementFile)
elementFile
- the temporary filepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()