Class CmsContainerBean

java.lang.Object
org.opencms.xml.containerpage.CmsContainerBean

public class CmsContainerBean extends Object
One container of a container page.

Since:
8.0
  • 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 name
      type - the container type
      parentInstanceId - the parent instance id
      isRootContainer - true if this container not nested
      maxElements - the maximal number of elements in the container
      elements - 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 name
      type - the container type
      parentInstanceId - the parent instance id
      isRootContainer - true if this container not nested
      elements - the elements
  • Method Details

    • containsElement

      public boolean containsElement(CmsUUID elementId)
      Returns true 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

      public int getMaxElements()
      Returns the maximal number of elements in this container.

      Returns:
      the maximal number of elements in this container
    • getName

      public String getName()
      Returns the name of this container.

      Returns:
      the name of this container
    • getParam

      public 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

      Returns the the parent instance id.

      Returns:
      the parent instance id
    • getType

      public String getType()
      Returns the type of this container.

      Returns:
      the type of this container
    • getWidth

      public 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(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(String type)
      Sets the container type.

      Parameters:
      type - the container type
    • setWidth

      public void setWidth(String width)
      Sets the client side render with of this container.

      Parameters:
      width - the client side render with of this container