org.opencms.ade.containerpage
Class CmsElementUtil

java.lang.Object
  extended by org.opencms.ade.containerpage.CmsElementUtil

public class CmsElementUtil
extends java.lang.Object

Utility class to generate the element data objects used within the container-page editor.

Since:
8.0.0

Constructor Summary
CmsElementUtil(CmsObject cms, java.lang.String currentPageUri, 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, java.lang.String requestParameters, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.util.Locale locale)
          Creates a new instance.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getContentsByContainerName(CmsContainerElementBean element, java.util.Collection<CmsContainer> containers)
          Returns the rendered element content for all the given containers.
 CmsContainerElementData getElementData(CmsContainerElementBean element, java.util.Collection<CmsContainer> containers)
          Returns the data for an element.
 CmsContainerElement setElementInfo(CmsContainerElementBean elementBean, CmsContainerElement result)
          Sets the data to the given container element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsElementUtil

public CmsElementUtil(CmsObject cms,
                      java.lang.String currentPageUri,
                      javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse res,
                      java.util.Locale locale)
               throws CmsException
Creates a new instance.

Parameters:
cms - the cms context
currentPageUri - the current page uri
req - the http request
res - the http response
locale - the content locale
Throws:
CmsException - if something goes wrong

CmsElementUtil

public CmsElementUtil(CmsObject cms,
                      java.lang.String currentPageUri,
                      java.lang.String requestParameters,
                      javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse res,
                      java.util.Locale locale)
               throws CmsException
Creates a new instance.

Parameters:
cms - the cms context
currentPageUri - the current page uri
requestParameters - the request parameters to use while rendering the elements
req - the http request
res - the http response
locale - the content locale
Throws:
CmsException - if something goes wrong
Method Detail

getContentsByContainerName

public java.util.Map<java.lang.String,java.lang.String> getContentsByContainerName(CmsContainerElementBean element,
                                                                                   java.util.Collection<CmsContainer> containers)
Returns the rendered element content for all the given containers.

Parameters:
element - the element to render
containers - the containers the element appears in
Returns:
a map from container names to rendered page contents

getElementData

public CmsContainerElementData getElementData(CmsContainerElementBean element,
                                              java.util.Collection<CmsContainer> containers)
                                       throws CmsException
Returns the data for an element.

Parameters:
element - the resource
containers - the containers on the current container page
Returns:
the data for an element
Throws:
CmsException - if something goes wrong

setElementInfo

public CmsContainerElement setElementInfo(CmsContainerElementBean elementBean,
                                          CmsContainerElement result)
                                   throws CmsException
Sets the data to the given container element.

Parameters:
elementBean - the element bean
result - the container element to set the data to
Returns:
the container element
Throws:
CmsException - if something goes wrong