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.
|
static java.util.function.Function<java.lang.String,java.lang.String> |
createStringTemplateSource(I_CmsFormatterBean formatter,
com.google.common.base.Supplier<CmsXmlContent> contentSupplier)
Helper method to create a string template source for a given formatter and content.
|
java.lang.String |
getContentByContainer(CmsFile elementFile,
java.lang.String elementId,
CmsContainer container)
Returns the HTML content for the given resource and container.
|
CmsContainerElementData |
getElementData(CmsResource page,
CmsContainerElementBean element,
java.util.Collection<CmsContainer> containers)
Returns the data for an element.
|
CmsElementSettingsConfig |
getElementSettingsConfig(CmsResource page,
CmsContainerElementBean element,
java.lang.String containerId,
java.util.Collection<CmsContainer> containers)
Returns the formatter and settings config data for an element.
|
static I_CmsFormatterBean |
getFormatterForContainer(CmsObject cms,
CmsContainerElementBean element,
CmsContainer container,
CmsADEConfigData config,
CmsADESessionCache cache)
Returns the formatter bean for the given element and container.
|
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 static java.util.function.Function<java.lang.String,java.lang.String> createStringTemplateSource(I_CmsFormatterBean formatter, com.google.common.base.Supplier<CmsXmlContent> contentSupplier)
formatter
- the formattercontentSupplier
- the content supplierpublic static I_CmsFormatterBean getFormatterForContainer(CmsObject cms, CmsContainerElementBean element, CmsContainer container, CmsADEConfigData config, CmsADESessionCache cache)
cms
- the cms contextelement
- the element to rendercontainer
- the containerconfig
- the configuration datacache
- the session cachepublic java.lang.String getContentByContainer(CmsFile elementFile, java.lang.String elementId, CmsContainer container)
elementFile
- the element resource fileelementId
- the element idcontainer
- the containerpublic CmsContainerElementData getElementData(CmsResource page, CmsContainerElementBean element, java.util.Collection<CmsContainer> containers) throws CmsException
page
- the current container pageelement
- the resourcecontainers
- the containers on the current container pageCmsException
- if something goes wrongpublic CmsElementSettingsConfig getElementSettingsConfig(CmsResource page, CmsContainerElementBean element, java.lang.String containerId, java.util.Collection<CmsContainer> containers) throws CmsException
page
- the current container pageelement
- the resourcecontainerId
- the parent container idcontainers
- the containers on the current container pageCmsException
- 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