Package org.opencms.jsp.util
Class CmsStringTemplateRenderer
- java.lang.Object
-
- org.opencms.jsp.util.CmsStringTemplateRenderer
-
public class CmsStringTemplateRenderer extends java.lang.Object
Renderer for string templates.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ERROR_DISPLAY
The error display HTML.static java.lang.String
ERROR_DISPLAY_WITH_DETAILS
The error display HTML, including error details.static java.lang.String
KEY_FUNCTIONS
Key to access object function wrapper.static java.lang.String
KEY_SETTINGS
Key to access element settings.
-
Constructor Summary
Constructors Constructor Description CmsStringTemplateRenderer(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
render()
Renders the requested element content with the flex formatter string template.static java.lang.String
renderTemplate(CmsObject cms, java.lang.String template, CmsResource content, java.util.Map<java.lang.String,java.lang.Object> contextObjects)
Renders the given string template.static java.lang.String
renderTemplate(CmsObject cms, java.lang.String template, CmsResource content, java.util.Map<java.lang.String,java.lang.Object> contextObjects, java.lang.String pathPrefix)
Renders the given string template.static java.lang.String
renderTemplate(CmsObject cms, java.lang.String template, CmsJspContentAccessBean content, java.util.Map<java.lang.String,java.lang.Object> contextObjects)
Renders the given string template.static java.lang.String
renderTemplate(CmsObject cms, java.lang.String template, CmsJspContentAccessValueWrapper contentValue, java.util.Map<java.lang.String,java.lang.Object> contextObjects)
Renders the given string template.static java.util.Map<java.lang.String,CmsJspObjectValueWrapper>
wrapSettings(CmsObject cms, java.util.Map<java.lang.String,java.lang.String> settings)
Wraps the element settings with access wrappers.
-
-
-
Field Detail
-
ERROR_DISPLAY
public static final java.lang.String ERROR_DISPLAY
The error display HTML.- See Also:
- Constant Field Values
-
ERROR_DISPLAY_WITH_DETAILS
public static final java.lang.String ERROR_DISPLAY_WITH_DETAILS
The error display HTML, including error details.- See Also:
- Constant Field Values
-
KEY_FUNCTIONS
public static final java.lang.String KEY_FUNCTIONS
Key to access object function wrapper.- See Also:
- Constant Field Values
-
KEY_SETTINGS
public static final java.lang.String KEY_SETTINGS
Key to access element settings.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsStringTemplateRenderer
public CmsStringTemplateRenderer(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req)
Constructor.- Parameters:
context
- the page contextreq
- the request
-
-
Method Detail
-
renderTemplate
public static java.lang.String renderTemplate(CmsObject cms, java.lang.String template, CmsJspContentAccessBean content, java.util.Map<java.lang.String,java.lang.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 java.lang.String renderTemplate(CmsObject cms, java.lang.String template, CmsJspContentAccessValueWrapper contentValue, java.util.Map<java.lang.String,java.lang.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 java.lang.String renderTemplate(CmsObject cms, java.lang.String template, CmsResource content, java.util.Map<java.lang.String,java.lang.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 java.lang.String renderTemplate(CmsObject cms, java.lang.String template, CmsResource content, java.util.Map<java.lang.String,java.lang.Object> contextObjects, java.lang.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 java.util.Map<java.lang.String,CmsJspObjectValueWrapper> wrapSettings(CmsObject cms, java.util.Map<java.lang.String,java.lang.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
public void render() throws java.io.IOException
Renders the requested element content with the flex formatter string template.- Throws:
java.io.IOException
- in case writing to to page context out fails
-
-