org.opencms.xml.containerpage
public class CmsContainerElementBean extends java.lang.Object implements java.lang.Cloneable
Constructor and Description |
---|
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,
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.
|
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.
|
int |
hashCode() |
void |
initResource(CmsObject cms)
Initializes the resource and the site path of this element.
|
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 |
isReleasedAndNotExpired()
Returns if the element resource is released and not expired.
|
boolean |
isTemporaryContent()
Returns if the element resource contains temporary file content.
|
void |
setFormatterId(CmsUUID formatterId)
Sets the formatter id.
|
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-pagepublic 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, 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 pairslocale
- the locale to useCmsException
java.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 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 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 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 isReleasedAndNotExpired()
true
if the element resource is released and not expiredpublic boolean isTemporaryContent()
true
if the element resource contains temporary file contentpublic void setInheritanceInfo(CmsInheritanceInfo inheritanceInfo)
inheritanceInfo
- the inheritance infopublic void setFormatterId(CmsUUID formatterId)
formatterId
- the formatter idpublic void setTemporaryFile(CmsFile elementFile)
elementFile
- the temporary filepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()