Class CmsStringTemplateRenderer

java.lang.Object
org.opencms.jsp.util.CmsStringTemplateRenderer

public class CmsStringTemplateRenderer extends Object
Renderer for string templates.

  • Field Details

  • Constructor Details

    • CmsStringTemplateRenderer

      public CmsStringTemplateRenderer(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req)
      Constructor.

      Parameters:
      context - the page context
      req - 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 context
      template - the template
      content - the content
      contextObjects - 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 context
      template - the template
      contentValue - 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 context
      template - the template
      content - the 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, String pathPrefix)
      Renders the given string template.

      Parameters:
      cms - the cms context
      template - the template
      content - the content
      contextObjects - additional context objects made available to the template
      pathPrefix - the path to the content part that should be accessible as content to the string template.
      Returns:
      the rendering result
    • wrapSettings

      Wraps the element settings with access wrappers.

      Parameters:
      cms - the current OpenCms user context
      settings - the settings to wrap
      Returns:
      the element settings wrapped in access wrappers
    • render

      public void render() throws IOException
      Renders the requested element content with the flex formatter string template.

      Throws:
      IOException - in case writing to to page context out fails