Package org.opencms.jsp
Class CmsJspTagPdf
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagPdf
- All Implemented Interfaces:
Serializable
,javax.servlet.jsp.tagext.BodyTag
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
,I_CmsJspTagParamParent
public class CmsJspTagPdf
extends javax.servlet.jsp.tagext.BodyTagSupport
implements I_CmsJspTagParamParent
JSP tag to generate a link to a PDF produced from a given XML content.
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(String name, String value) Add a parameter to this tag.int
doEndTag()
int
static String
pdfTagAction
(javax.servlet.ServletRequest request, String format, String content, String localeStr, String filename, SortedMap<String, String> params, String paramEncoding) The implementation of the tag.void
setContent
(String content) Setter for the content path.void
setFilename
(String filename) Sets the file name for the PDF download link.void
Setter for the format path.void
Sets the locale to use for the PDF link.void
setParamEncoding
(String encoding) Sets the parameter encoding.Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
CmsJspTagPdf
public CmsJspTagPdf()
-
-
Method Details
-
pdfTagAction
public static String pdfTagAction(javax.servlet.ServletRequest request, String format, String content, String localeStr, String filename, SortedMap<String, String> params, String paramEncoding) throws CmsExceptionThe implementation of the tag.- Parameters:
request
- the current requestformat
- the format pathcontent
- the content pathlocaleStr
- the name of the locale to include in the PDF linkparams
- map of parametersparamEncoding
- the character encoding to use for URL parameters- Returns:
- the link to the PDF
- Throws:
CmsException
- if something goes wrong
-
addParameter
Description copied from interface:I_CmsJspTagParamParent
Add a parameter to this tag. The intent is that the <param> subtag will call this to register parameters. Assumes that 'name' and 'value' are appropriately encoded and do not contain any meaningful metacharacters; in order words, escaping is the responsibility of the caller.- Specified by:
addParameter
in interfaceI_CmsJspTagParamParent
- Parameters:
name
- the name of the parametervalue
- the value of the parameter- See Also:
-
doEndTag
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
-
BodyTagSupport.doEndTag()
-
doStartTag
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
-
Tag.doStartTag()
-
setContent
Setter for the content path.- Parameters:
content
- the content path
-
setFilename
Sets the file name for the PDF download link.- Parameters:
filename
- the file name
-
setFormat
Setter for the format path.- Parameters:
format
- the format path
-
setLocale
Sets the locale to use for the PDF link.- Parameters:
locale
- the locale to use
-
setParamEncoding
Sets the parameter encoding.- Parameters:
encoding
- the parameter encoding
-