Class CMSTemplate
java.lang.Object
com.netscape.cms.servlet.common.CMSFile
com.netscape.cms.servlet.common.CMSTemplate
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 Summary
FieldsFields inherited from class com.netscape.cms.servlet.common.CMSFile
mAbsPath, mContent, mLastAccess, mLastModified -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEscape 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.static StringLike escapeJavaScriptString(String s) but also escapes for HTML processing; i.e., first encode for HTML and then encode for outputting in JavaScript.getOutput(CMSTemplateParams input) for debugging, return contents that would've been outputed.booleanbooleanoutputEpilog(PrintWriter out) Output the post HTML tags and post-output buffer.booleanoutputProlog(PrintWriter out) Ouput the pre-amble HTML Header including the pre-output buffer.voidrenderOutput(OutputStream rout, CMSTemplateParams input) Write a javascript representation of 'input' surrounded by SCRIPT tags to the outputstreamMethods inherited from class com.netscape.cms.servlet.common.CMSFile
getAbsPath, getContent, getLastAccess, getLastModified, setLastAccess, toString, toString
-
Field Details
-
logger
public static org.slf4j.Logger logger -
SUFFIX
- See Also:
-
mPreOutput
-
mPostOutput
-
TEMPLATE_TAG
- See Also:
-
-
Constructor Details
-
CMSTemplate
Constructor- Parameters:
file- template file to loadcharset- character set- Throws:
IOException- if the there was an error opening the fileEBaseException
-
-
Method Details
-
init
- Throws:
EBaseExceptionIOException
-
renderOutput
Write a javascript representation of 'input' surrounded by SCRIPT tags to the outputstream- Parameters:
rout- the outputstream to write toinput- the parameters to write- Throws:
IOException
-
outputProlog
Ouput the pre-amble HTML Header including the pre-output buffer.- Parameters:
out- output stream specified- Returns:
- success or error
-
outputEpilog
Output the post HTML tags and post-output buffer.- Parameters:
out- output stream specified- Returns:
- success or error
-
getTemplateName
- Returns:
- full path of template
-
escapeJavaScriptString
-
escapeJavaScriptStringHTML
-
getOutput
for debugging, return contents that would've been outputed.- Throws:
IOException
-