Class CmsMutableContainer
- java.lang.Object
-
- org.opencms.xml.containerpage.mutable.CmsMutableContainer
-
public class CmsMutableContainer extends java.lang.Object
A mutable bean representing a container for use in programmaticall editing container pages.
-
-
Constructor Summary
Constructors Constructor Description CmsMutableContainer(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, java.util.List<CmsContainerElementBean> elements)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CmsContainerElementBean>
elements()
Gets the mutable list of container elements.static CmsMutableContainer
fromImmutable(CmsContainerBean container)
Converts a CmsContainerBean to an instance of this class.java.lang.String
getName()
Gets the container name.java.lang.String
getParentInstanceId()
Gets the parent instance id.java.lang.String
getType()
Gets the container typeboolean
isRootContainer()
Returns true if this is a root container.boolean
matches(java.lang.String name)
Checks if the container matches the given user-readable name.void
setName(java.lang.String name)
Sets the container name.void
setParentInstanceId(java.lang.String parentInstanceId)
Sets the parent instance id.void
setRootContainer(boolean isRootContainer)
Sets the 'is root container' property.void
setType(java.lang.String type)
Sets the type.CmsContainerBean
toImmutable()
Converts this bean to a CmsContainerBean.
-
-
-
Constructor Detail
-
CmsMutableContainer
public CmsMutableContainer(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, java.util.List<CmsContainerElementBean> elements)
Creates a new instance.- Parameters:
name
- the container nametype
- the container typeparentInstanceId
- the parent instance idisRootContainer
- true if this is a root containerelements
- the list of container elements (will be copied)
-
-
Method Detail
-
fromImmutable
public static CmsMutableContainer fromImmutable(CmsContainerBean container)
Converts a CmsContainerBean to an instance of this class.- Parameters:
container
- the immutable container bean- Returns:
- the new instance
-
elements
public java.util.List<CmsContainerElementBean> elements()
Gets the mutable list of container elements.- Returns:
- the list of container elements
-
getName
public java.lang.String getName()
Gets the container name.- Returns:
- the container name
-
getParentInstanceId
public java.lang.String getParentInstanceId()
Gets the parent instance id.- Returns:
- the parent instance id
-
getType
public java.lang.String getType()
Gets the container type- Returns:
- the container type
-
isRootContainer
public boolean isRootContainer()
Returns true if this is a root container.- Returns:
- true if this is a root container
-
matches
public boolean matches(java.lang.String name)
Checks if the container matches the given user-readable name.Because of nested containers, container names are not always just the values given to the cms:container tag, but can also have a prefix consisting of the parent instance id of the element which contains them.
- Parameters:
name
- the user-readable name- Returns:
- true if the container matches the name
-
setName
public void setName(java.lang.String name)
Sets the container name.- Parameters:
name
- the container name
-
setParentInstanceId
public void setParentInstanceId(java.lang.String parentInstanceId)
Sets the parent instance id.- Parameters:
parentInstanceId
- the parent instance id
-
setRootContainer
public void setRootContainer(boolean isRootContainer)
Sets the 'is root container' property.- Parameters:
isRootContainer
- true if this should be set as a root container
-
setType
public void setType(java.lang.String type)
Sets the type.- Parameters:
type
- the type
-
toImmutable
public CmsContainerBean toImmutable()
Converts this bean to a CmsContainerBean.- Returns:
- a new CmsContainerBean with the data from this bean
-
-