Class CmsContainerPageWrapper
java.lang.Object
org.opencms.xml.containerpage.mutable.CmsContainerPageWrapper
'Wrapper' around XML container page used for programmatic editing operations on container pages.
Uses mutable helper classes for the container page and its containers.
-
Constructor Summary
ConstructorDescriptionCmsContainerPageWrapper
(CmsObject cms, CmsResource res) Creates a new instance by reading the container page from a file.Creates a new instance from an existing XML container page object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addElementToContainer
(String containerName, CmsContainerElementBean element) Adds an element to the given container (the first container with the given container suffix is used).byte[]
marshal()
Marshals the page data without writing it to the VFS.page()
Gets the mutable page bean instance.void
Saves the page data to the VFS, using the same resource from which this object was created.
-
Constructor Details
-
CmsContainerPageWrapper
Creates a new instance by reading the container page from a file.- Parameters:
cms
- the CMS contextres
- the resource- Throws:
CmsException
- if something goes wrong
-
CmsContainerPageWrapper
Creates a new instance from an existing XML container page object.- Parameters:
cms
- the CMS contextxml
- the XML container page object
-
-
Method Details
-
addElementToContainer
Adds an element to the given container (the first container with the given container suffix is used).- Parameters:
containerName
- the container name or suffixelement
- the element to add- Returns:
- false if there was no container to add the element to, true otherwise
-
marshal
Marshals the page data without writing it to the VFS.- Returns:
- the marshalled page data
- Throws:
CmsException
- if something goes wrong
-
page
Gets the mutable page bean instance.- Returns:
- the mutable page bean
-
saveToVfs
Saves the page data to the VFS, using the same resource from which this object was created.- Throws:
CmsException
- if something goes wrong
-