public class RenderUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
dispatchBufferedRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String url)
Dispatch a url to a request dispatcher while buffering the output in a string
(and not directly to the response's writer).
|
static List<ComponentPresentation> |
filterComponentPresentations(List<ComponentPresentation> componentPresentations,
String schemaName,
String rootElementName,
String viewName,
String region)
Filters the list of component presentations based on the processors provided
by schemaName and templateName.
|
static String |
fixUrl(String url)
Utility method to fix the url, by convention urls are lower case and all
spaces are replaced by dashes (-)
|
static String |
getViewName(ComponentPresentation cp)
If the component template has a template parameter viewName, the value of
that parameter is returned.
|
static void |
removeViewModelsFromRequest(javax.servlet.http.HttpServletRequest request) |
static String |
renderComponentPresentation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ComponentPresentation cp)
Renders a single component presentation using the dispatchers include method.
|
static String |
renderComponentPresentations(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
List<ComponentPresentation> componentPresentations)
Renders a list of component presentations.
|
static String |
renderDynamicComponentPresentation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String componentURI,
String templateURI,
String viewName)
Render a dynamic component presentation based on component / ct uri and view name
|
static void |
setDynamicComponentOnRequest(javax.servlet.http.HttpServletRequest request,
Component component) |
static void |
setViewModelsOnRequest(javax.servlet.http.HttpServletRequest request,
ComponentPresentation cp) |
public static String getViewName(ComponentPresentation cp)
public static List<ComponentPresentation> filterComponentPresentations(List<ComponentPresentation> componentPresentations, String schemaName, String rootElementName, String viewName, String region)
public static String fixUrl(String url)
url - , the original urlpublic static String renderComponentPresentations(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, List<ComponentPresentation> componentPresentations) throws FactoryException
request - , the http requestresponse - , the http responsecomponentPresentations - , the list with component presentationsFactoryExceptionpublic static String renderComponentPresentation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ComponentPresentation cp) throws FactoryException
request - the http requestresponse - the http responsecp - the component presentationFactoryExceptionpublic static String renderDynamicComponentPresentation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String componentURI, String templateURI, String viewName) throws FactoryException
request - the current Http Requestresponse - the current Http ResponsecomponentURI - the Tcm Uri of the componenttemplateURI - the Tcm Uri of the templateviewName - the view nameFactoryExceptionpublic static String dispatchBufferedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String url) throws javax.servlet.ServletException, IOException
javax.servlet.ServletExceptionIOExceptionpublic static void removeViewModelsFromRequest(javax.servlet.http.HttpServletRequest request)
public static void setViewModelsOnRequest(javax.servlet.http.HttpServletRequest request,
ComponentPresentation cp)
public static void setDynamicComponentOnRequest(javax.servlet.http.HttpServletRequest request,
Component component)
Copyright © 2016. All rights reserved.