Class CmsStringTemplateRenderer

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsStringTemplateRenderer

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

        Parameters:
        context - the page context
        req - 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 context
        template - the template
        content - the 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,
                                                      CmsJspContentAccessValueWrapper contentValue,
                                                      java.util.Map<java.lang.String,​java.lang.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 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 context
        template - the template
        content - the 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,
                                                      java.lang.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

        public static java.util.Map<java.lang.String,​CmsJspObjectValueWrapperwrapSettings​(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 context
        settings - 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