Class CmsMutableContainer


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

      • CmsMutableContainer

        public CmsMutableContainer​(java.lang.String name,
                                   java.lang.String type,
                                   java.lang.String parentInstanceId,
                                   boolean isRootContainer,
                                   java.util.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 Detail

      • elements

        public java.util.List<CmsContainerElementBeanelements()
        Gets the mutable list of container elements.
        Returns:
        the list of container elements
      • getName

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

        public java.lang.String getParentInstanceId()
        Gets the parent instance id.
        Returns:
        the parent instance id
      • getType

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

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

        public CmsContainerBean toImmutable()
        Converts this bean to a CmsContainerBean.
        Returns:
        a new CmsContainerBean with the data from this bean