Class CMSTemplate

java.lang.Object
com.netscape.cms.servlet.common.CMSFile
com.netscape.cms.servlet.common.CMSTemplate

public class CMSTemplate extends CMSFile
File templates. This implementation will take an HTML file with a special customer tag <CMS_TEMPLATE> and replace the tag with a series of javascript variable definitions (depending on the servlet)
Version:
$Revision$, $Date$
  • Field Details

  • Constructor Details

  • Method Details

    • init

      public boolean init(File template) throws EBaseException, IOException
      Throws:
      EBaseException
      IOException
    • renderOutput

      public void renderOutput(OutputStream rout, CMSTemplateParams input) throws IOException
      Write a javascript representation of 'input' surrounded by SCRIPT tags to the outputstream
      Parameters:
      rout - the outputstream to write to
      input - the parameters to write
      Throws:
      IOException
    • outputProlog

      public boolean outputProlog(PrintWriter out)
      Ouput the pre-amble HTML Header including the pre-output buffer.
      Parameters:
      out - output stream specified
      Returns:
      success or error
    • outputEpilog

      public boolean outputEpilog(PrintWriter out)
      Output the post HTML tags and post-output buffer.
      Parameters:
      out - output stream specified
      Returns:
      success or error
    • getTemplateName

      public String getTemplateName()
      Returns:
      full path of template
    • escapeJavaScriptString

      public static String escapeJavaScriptString(String v)
      Escape the contents of src string in preparation to be enclosed in double quotes as a JavaScript String Literal within an <script> portion of an HTML document.
    • escapeJavaScriptStringHTML

      public static String escapeJavaScriptStringHTML(String v)
      Like escapeJavaScriptString(String s) but also escapes for HTML processing; i.e., first encode for HTML and then encode for outputting in JavaScript.
    • getOutput

      public String getOutput(CMSTemplateParams input) throws IOException
      for debugging, return contents that would've been outputed.
      Throws:
      IOException