Class CmsMutableContainer
java.lang.Object
org.opencms.xml.containerpage.mutable.CmsMutableContainer
A mutable bean representing a container for use in programmaticall editing container pages.
-
Constructor Summary
ConstructorDescriptionCmsMutableContainer
(String name, String type, String parentInstanceId, boolean isRootContainer, List<CmsContainerElementBean> elements) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionelements()
Gets the mutable list of container elements.static CmsMutableContainer
fromImmutable
(CmsContainerBean container) Converts a CmsContainerBean to an instance of this class.getName()
Gets the container name.Gets the parent instance id.getType()
Gets the container typeboolean
Returns true if this is a root container.boolean
Checks if the container matches the given user-readable name.void
Sets the container name.void
setParentInstanceId
(String parentInstanceId) Sets the parent instance id.void
setRootContainer
(boolean isRootContainer) Sets the 'is root container' property.void
Sets the type.Converts this bean to a CmsContainerBean.
-
Constructor Details
-
CmsMutableContainer
public CmsMutableContainer(String name, String type, String parentInstanceId, boolean isRootContainer, 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 Details
-
fromImmutable
Converts a CmsContainerBean to an instance of this class.- Parameters:
container
- the immutable container bean- Returns:
- the new instance
-
elements
Gets the mutable list of container elements.- Returns:
- the list of container elements
-
getName
Gets the container name.- Returns:
- the container name
-
getParentInstanceId
Gets the parent instance id.- Returns:
- the parent instance id
-
getType
Gets the container type- Returns:
- the container type
-
isRootContainer
Returns true if this is a root container.- Returns:
- true if this is a root container
-
matches
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
Sets the container name.- Parameters:
name
- the container name
-
setParentInstanceId
Sets the parent instance id.- Parameters:
parentInstanceId
- the parent instance id
-
setRootContainer
Sets the 'is root container' property.- Parameters:
isRootContainer
- true if this should be set as a root container
-
setType
Sets the type.- Parameters:
type
- the type
-
toImmutable
Converts this bean to a CmsContainerBean.- Returns:
- a new CmsContainerBean with the data from this bean
-