Package org.opencms.jsp.util
Class CmsStringTemplateRenderer
java.lang.Object
org.opencms.jsp.util.CmsStringTemplateRenderer
Renderer for string templates.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCmsStringTemplateRenderer
(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
render()
Renders the requested element content with the flex formatter string template.static String
renderTemplate
(CmsObject cms, String template, CmsResource content, Map<String, Object> contextObjects) Renders the given string template.static String
renderTemplate
(CmsObject cms, String template, CmsResource content, Map<String, Object> contextObjects, String pathPrefix) Renders the given string template.static String
renderTemplate
(CmsObject cms, String template, CmsJspContentAccessBean content, Map<String, Object> contextObjects) Renders the given string template.static String
renderTemplate
(CmsObject cms, String template, CmsJspContentAccessValueWrapper contentValue, Map<String, Object> contextObjects) Renders the given string template.static Map<String,
CmsJspObjectValueWrapper> wrapSettings
(CmsObject cms, Map<String, String> settings) Wraps the element settings with access wrappers.
-
Field Details
-
ERROR_DISPLAY
The error display HTML.- See Also:
-
ERROR_DISPLAY_WITH_DETAILS
The error display HTML, including error details.- See Also:
-
KEY_FUNCTIONS
Key to access object function wrapper.- See Also:
-
KEY_SETTINGS
Key to access element settings.- See Also:
-
-
Constructor Details
-
CmsStringTemplateRenderer
public CmsStringTemplateRenderer(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req) Constructor.- Parameters:
context
- the page contextreq
- the request
-
-
Method Details
-
renderTemplate
public static String renderTemplate(CmsObject cms, String template, CmsJspContentAccessBean content, Map<String, Object> contextObjects) Renders the given string template.- Parameters:
cms
- the cms contexttemplate
- the templatecontent
- the contentcontextObjects
- additional context objects made available to the template- Returns:
- the rendering result
-
renderTemplate
public static String renderTemplate(CmsObject cms, String template, CmsJspContentAccessValueWrapper contentValue, Map<String, Object> contextObjects) Renders the given string template.- Parameters:
cms
- the cms contexttemplate
- the templatecontentValue
- the content value (part of a content)contextObjects
- additional context objects made available to the template- Returns:
- the rendering result
-
renderTemplate
public static String renderTemplate(CmsObject cms, String template, CmsResource content, Map<String, Object> contextObjects) Renders the given string template.- Parameters:
cms
- the cms contexttemplate
- the templatecontent
- the contentcontextObjects
- additional context objects made available to the template- Returns:
- the rendering result
-
renderTemplate
public static String renderTemplate(CmsObject cms, String template, CmsResource content, Map<String, Object> contextObjects, String pathPrefix) Renders the given string template.- Parameters:
cms
- the cms contexttemplate
- the templatecontent
- the contentcontextObjects
- additional context objects made available to the templatepathPrefix
- the path to the content part that should be accessible as content to the string template.- Returns:
- the rendering result
-
wrapSettings
public static Map<String,CmsJspObjectValueWrapper> wrapSettings(CmsObject cms, Map<String, String> settings) Wraps the element settings with access wrappers.- Parameters:
cms
- the current OpenCms user contextsettings
- the settings to wrap- Returns:
- the element settings wrapped in access wrappers
-
render
Renders the requested element content with the flex formatter string template.- Throws:
IOException
- in case writing to to page context out fails
-