Class CmsMutableContainer

java.lang.Object
org.opencms.xml.containerpage.mutable.CmsMutableContainer

public class CmsMutableContainer extends Object
A mutable bean representing a container for use in programmaticall editing container pages.
  • Constructor Details

    • CmsMutableContainer

      public CmsMutableContainer(String name, String type, String parentInstanceId, boolean isRootContainer, List<CmsContainerElementBean> elements)
      Creates a new instance.
      Parameters:
      name - the container name
      type - the container type
      parentInstanceId - the parent instance id
      isRootContainer - true if this is a root container
      elements - 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

      public String getName()
      Gets the container name.
      Returns:
      the container name
    • getParentInstanceId

      Gets the parent instance id.
      Returns:
      the parent instance id
    • getType

      public 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(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(String name)
      Sets the container name.
      Parameters:
      name - the container name
    • setParentInstanceId

      public void setParentInstanceId(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(String type)
      Sets the type.
      Parameters:
      type - the type
    • toImmutable

      Converts this bean to a CmsContainerBean.
      Returns:
      a new CmsContainerBean with the data from this bean