Package org.opencms.xml.containerpage
Class CmsContainerBean
- java.lang.Object
-
- org.opencms.xml.containerpage.CmsContainerBean
-
public class CmsContainerBean extends java.lang.Object
One container of a container page.- Since:
- 8.0
-
-
Constructor Summary
Constructors Constructor Description CmsContainerBean(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, int maxElements, java.util.List<CmsContainerElementBean> elements)
Creates a new container bean.CmsContainerBean(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, java.util.List<CmsContainerElementBean> elements)
Creates a new container bean with an unlimited number of elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsElement(CmsUUID elementId)
Returnstrue
if the element with the provided id is contained in this container.CmsContainerBean
copyWithNewElements(java.util.List<CmsContainerElementBean> elements)
Creates a copy of this bean, but with the element list replaced with something else.java.util.Map<CmsUUID,java.lang.Boolean>
getContainsElement()
Returns a lazy initialized map that describes if a certain element if part of this container.java.util.List<CmsUUID>
getElementIds()
Returns the id's of all elements in this container.java.util.List<CmsContainerElementBean>
getElements()
Returns the elements in this container.int
getMaxElements()
Returns the maximal number of elements in this container.java.lang.String
getName()
Returns the name of this container.java.lang.String
getParam()
Returns the (optional) container parameter.java.lang.String
getParentInstanceId()
Returns the the parent instance id.java.lang.String
getType()
Returns the type of this container.java.lang.String
getWidth()
Returns the container width set by the rendering container tag.boolean
isDetailOnly()
Returns if this container is used on detail pages only.boolean
isNestedContainer()
Returns if the given container is a nested container.boolean
isRootContainer()
Returns if this container not nested, or in case of a detail only container page the starting point of a detail only container hierarchy.void
setDetailOnly(boolean detailOnly)
Sets if this container is used on detail pages only.void
setMaxElements(int maxElements)
Sets the maximal number of elements in the container.void
setParam(java.lang.String param)
Sets the container parameter.void
setType(java.lang.String type)
Sets the container type.void
setWidth(java.lang.String width)
Sets the client side render with of this container.
-
-
-
Constructor Detail
-
CmsContainerBean
public CmsContainerBean(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, int maxElements, java.util.List<CmsContainerElementBean> elements)
Creates a new container bean.- Parameters:
name
- the container nametype
- the container typeparentInstanceId
- the parent instance idisRootContainer
-true
if this container not nestedmaxElements
- the maximal number of elements in the containerelements
- the elements
-
CmsContainerBean
public CmsContainerBean(java.lang.String name, java.lang.String type, java.lang.String parentInstanceId, boolean isRootContainer, java.util.List<CmsContainerElementBean> elements)
Creates a new container bean with an unlimited number of elements.- Parameters:
name
- the container nametype
- the container typeparentInstanceId
- the parent instance idisRootContainer
-true
if this container not nestedelements
- the elements
-
-
Method Detail
-
containsElement
public boolean containsElement(CmsUUID elementId)
Returnstrue
if the element with the provided id is contained in this container.- Parameters:
elementId
- the element id to check- Returns:
true
if the element with the provided id is contained in this container
-
copyWithNewElements
public CmsContainerBean copyWithNewElements(java.util.List<CmsContainerElementBean> elements)
Creates a copy of this bean, but with the element list replaced with something else.- Parameters:
elements
- the new list of elements for the copy- Returns:
- the copied container bean
-
getContainsElement
public java.util.Map<CmsUUID,java.lang.Boolean> getContainsElement()
Returns a lazy initialized map that describes if a certain element if part of this container.- Returns:
- a lazy initialized map that describes if a certain element if part of this container
-
getElementIds
public java.util.List<CmsUUID> getElementIds()
Returns the id's of all elements in this container.- Returns:
- the id's of all elements in this container
-
getElements
public java.util.List<CmsContainerElementBean> getElements()
Returns the elements in this container.- Returns:
- the elements in this container
-
getMaxElements
public int getMaxElements()
Returns the maximal number of elements in this container.- Returns:
- the maximal number of elements in this container
-
getName
public java.lang.String getName()
Returns the name of this container.- Returns:
- the name of this container
-
getParam
public java.lang.String getParam()
Returns the (optional) container parameter.This is useful for a dynamically generated nested container, to pass information to the formatter used inside that container. If no parameters have been set, this will return
null
- Returns:
- the (optional) container parameter
-
getParentInstanceId
public java.lang.String getParentInstanceId()
Returns the the parent instance id.- Returns:
- the parent instance id
-
getType
public java.lang.String getType()
Returns the type of this container.- Returns:
- the type of this container
-
getWidth
public java.lang.String getWidth()
Returns the container width set by the rendering container tag.- Returns:
- the container width
-
isDetailOnly
public boolean isDetailOnly()
Returns if this container is used on detail pages only.- Returns:
true
if this container is used on detail pages only
-
isNestedContainer
public boolean isNestedContainer()
Returns if the given container is a nested container.- Returns:
true
if the given container is a nested container
-
isRootContainer
public boolean isRootContainer()
Returns if this container not nested, or in case of a detail only container page the starting point of a detail only container hierarchy.- Returns:
true
if this container not nested
-
setDetailOnly
public void setDetailOnly(boolean detailOnly)
Sets if this container is used on detail pages only.- Parameters:
detailOnly
-true
if this container is used on detail pages only
-
setMaxElements
public void setMaxElements(int maxElements)
Sets the maximal number of elements in the container.- Parameters:
maxElements
- the maximal number of elements to set
-
setParam
public void setParam(java.lang.String param)
Sets the container parameter.This is useful for a dynamically generated nested container, to pass information to the formatter used inside that container.
- Parameters:
param
- the parameter String to set
-
setType
public void setType(java.lang.String type)
Sets the container type.- Parameters:
type
- the container type
-
setWidth
public void setWidth(java.lang.String width)
Sets the client side render with of this container.- Parameters:
width
- the client side render with of this container
-
-