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:
java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CmsJspTagPdf()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(java.lang.String name, java.lang.String value)
Add a parameter to this tag.int
doEndTag()
int
doStartTag()
static java.lang.String
pdfTagAction(javax.servlet.ServletRequest request, java.lang.String format, java.lang.String content, java.lang.String localeStr, java.lang.String filename, java.util.SortedMap<java.lang.String,java.lang.String> params, java.lang.String paramEncoding)
The implementation of the tag.void
setContent(java.lang.String content)
Setter for the content path.void
setFilename(java.lang.String filename)
Sets the file name for the PDF download link.void
setFormat(java.lang.String format)
Setter for the format path.void
setLocale(java.lang.String locale)
Sets the locale to use for the PDF link.void
setParamEncoding(java.lang.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
-
-
-
-
Constructor Detail
-
CmsJspTagPdf
public CmsJspTagPdf()
-
-
Method Detail
-
pdfTagAction
public static java.lang.String pdfTagAction(javax.servlet.ServletRequest request, java.lang.String format, java.lang.String content, java.lang.String localeStr, java.lang.String filename, java.util.SortedMap<java.lang.String,java.lang.String> params, java.lang.String paramEncoding) throws CmsException
The 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
public void addParameter(java.lang.String name, java.lang.String value)
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:
I_CmsJspTagParamParent.addParameter(java.lang.String, java.lang.String)
-
doEndTag
public int doEndTag()
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
BodyTagSupport.doEndTag()
-
doStartTag
public int doStartTag()
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
Tag.doStartTag()
-
setContent
public void setContent(java.lang.String content)
Setter for the content path.- Parameters:
content
- the content path
-
setFilename
public void setFilename(java.lang.String filename)
Sets the file name for the PDF download link.- Parameters:
filename
- the file name
-
setFormat
public void setFormat(java.lang.String format)
Setter for the format path.- Parameters:
format
- the format path
-
setLocale
public void setLocale(java.lang.String locale)
Sets the locale to use for the PDF link.- Parameters:
locale
- the locale to use
-
setParamEncoding
public void setParamEncoding(java.lang.String encoding)
Sets the parameter encoding.- Parameters:
encoding
- the parameter encoding
-
-