Package org.opencms.xml.containerpage
Class CmsContainerBean
java.lang.Object
org.opencms.xml.containerpage.CmsContainerBean
One container of a container page.
- Since:
- 8.0
-
Constructor Summary
ConstructorDescriptionCmsContainerBean
(String name, String type, String parentInstanceId, boolean isRootContainer, int maxElements, List<CmsContainerElementBean> elements) Creates a new container bean.CmsContainerBean
(String name, String type, String parentInstanceId, boolean isRootContainer, List<CmsContainerElementBean> elements) Creates a new container bean with an unlimited number of elements. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsElement
(CmsUUID elementId) Returnstrue
if the element with the provided id is contained in this container.copyWithNewElements
(List<CmsContainerElementBean> elements) Creates a copy of this bean, but with the element list replaced with something else.Returns a lazy initialized map that describes if a certain element if part of this container.Returns the id's of all elements in this container.Returns the elements in this container.int
Returns the maximal number of elements in this container.getName()
Returns the name of this container.getParam()
Returns the (optional) container parameter.Returns the the parent instance id.getType()
Returns the type of this container.getWidth()
Returns the container width set by the rendering container tag.boolean
Returns if this container is used on detail pages only.boolean
Returns if the given container is a nested container.boolean
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
Sets the container parameter.void
Sets the container type.void
Sets the client side render with of this container.
-
Constructor Details
-
CmsContainerBean
public CmsContainerBean(String name, String type, String parentInstanceId, boolean isRootContainer, int maxElements, 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(String name, String type, String parentInstanceId, boolean isRootContainer, 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 Details
-
containsElement
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
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
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
Returns the id's of all elements in this container.- Returns:
- the id's of all elements in this container
-
getElements
Returns the elements in this container.- Returns:
- the elements in this container
-
getMaxElements
Returns the maximal number of elements in this container.- Returns:
- the maximal number of elements in this container
-
getName
Returns the name of this container.- Returns:
- the name of this container
-
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
Returns the the parent instance id.- Returns:
- the parent instance id
-
getType
Returns the type of this container.- Returns:
- the type of this container
-
getWidth
Returns the container width set by the rendering container tag.- Returns:
- the container width
-
isDetailOnly
Returns if this container is used on detail pages only.- Returns:
true
if this container is used on detail pages only
-
isNestedContainer
Returns if the given container is a nested container.- Returns:
true
if the given container is a nested container
-
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
Sets if this container is used on detail pages only.- Parameters:
detailOnly
-true
if this container is used on detail pages only
-
setMaxElements
Sets the maximal number of elements in the container.- Parameters:
maxElements
- the maximal number of elements to set
-
setParam
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
Sets the container type.- Parameters:
type
- the container type
-
setWidth
Sets the client side render with of this container.- Parameters:
width
- the client side render with of this container
-