public class CmsElementUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_NESTING_LEVEL
The maximum number of nested container levels.
|
Constructor and Description |
---|
CmsElementUtil(CmsObject cms,
java.lang.String currentPageUri,
CmsContainerPageBean containerPage,
CmsUUID detailContentId,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
boolean isDragMode,
java.util.Locale locale)
Creates a new instance.
|
CmsElementUtil(CmsObject cms,
java.lang.String currentPageUri,
CmsUUID detailContentId,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.util.Locale locale)
Creates a new instance.
|
CmsElementUtil(CmsObject cms,
java.lang.String currentPageUri,
CmsUUID detailContentId,
java.lang.String requestParameters,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.util.Locale locale)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkGroupAllowed(java.lang.String containerType,
CmsGroupContainerBean groupContainer)
Checks if a group element is allowed in a container with a given type.
|
java.lang.String |
getContentByContainer(CmsFile elementFile,
java.lang.String elementId,
CmsContainer container,
boolean allowNested)
Returns the HTML content for the given resource and container.
|
CmsContainerElementData |
getElementData(CmsResource page,
CmsContainerElementBean element,
java.util.Collection<CmsContainer> containers,
boolean allowNested)
Returns the data for an element.
|
CmsResource |
getPage()
Gets the container page.
|
CmsContainerElement |
setElementInfo(CmsContainerElementBean elementBean,
CmsContainerElement result)
Sets the data to the given container element.
|
public static final int MAX_NESTING_LEVEL
public CmsElementUtil(CmsObject cms, java.lang.String currentPageUri, CmsContainerPageBean containerPage, CmsUUID detailContentId, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, boolean isDragMode, java.util.Locale locale) throws CmsException
Use this constructor to set the current container page state.
cms
- the cms contextcurrentPageUri
- the current page uricontainerPage
- the container page bean with the current container statedetailContentId
- the detail content structure idreq
- the http requestres
- the http responseisDragMode
- if the page is in drag modelocale
- the content localeCmsException
- if something goes wrongpublic CmsElementUtil(CmsObject cms, java.lang.String currentPageUri, CmsUUID detailContentId, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.util.Locale locale) throws CmsException
cms
- the cms contextcurrentPageUri
- the current page uridetailContentId
- the detail content structure idreq
- the http requestres
- the http responselocale
- the content localeCmsException
- if something goes wrongpublic CmsElementUtil(CmsObject cms, java.lang.String currentPageUri, CmsUUID detailContentId, java.lang.String requestParameters, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.util.Locale locale) throws CmsException
cms
- the cms contextcurrentPageUri
- the current page uridetailContentId
- the detail content structure idrequestParameters
- the request parameters to use while rendering the elementsreq
- the http requestres
- the http responselocale
- the content localeCmsException
- if something goes wrongpublic static boolean checkGroupAllowed(java.lang.String containerType, CmsGroupContainerBean groupContainer)
containerType
- the container type spec (comma separated)groupContainer
- the grouppublic java.lang.String getContentByContainer(CmsFile elementFile, java.lang.String elementId, CmsContainer container, boolean allowNested)
elementFile
- the element resource fileelementId
- the element idcontainer
- the containerallowNested
- if nested containers are allowedpublic CmsContainerElementData getElementData(CmsResource page, CmsContainerElementBean element, java.util.Collection<CmsContainer> containers, boolean allowNested) throws CmsException
page
- the current container pageelement
- the resourcecontainers
- the containers on the current container pageallowNested
- if nested containers are allowedCmsException
- if something goes wrongpublic CmsResource getPage()
public CmsContainerElement setElementInfo(CmsContainerElementBean elementBean, CmsContainerElement result) throws CmsException
elementBean
- the element beanresult
- the container element to set the data toCmsException
- if something goes wrong