public class CmsPdfResourceHandler extends java.lang.Object implements I_CmsResourceInit
In Online mode, the generated PDFs are cached on the real file system, while in Offline mode, the PDF data is always generated on-the-fly.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IMAGE_MIMETYPECONFIG
Mime type data for different file extensions.
|
static java.util.Map<java.lang.String,java.lang.String> |
IMAGE_MIMETYPES
Map of mime types for different file extensions.
|
Constructor and Description |
---|
CmsPdfResourceHandler()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handlePdfLink(CmsObject cms,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String uri)
Handles a link for generating a PDF.
|
CmsResource |
initResource(CmsResource resource,
CmsObject cms,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Possibility to modify or change the CmsFile with the CmsObject.
|
protected void |
logXhtmlOutput(CmsResource formatter,
CmsResource content,
byte[] xhtmlData)
Logs the XHTML output.
|
public static final java.lang.String IMAGE_MIMETYPECONFIG
public static final java.util.Map<java.lang.String,java.lang.String> IMAGE_MIMETYPES
public CmsPdfResourceHandler()
public CmsResource initResource(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws CmsResourceInitException, CmsSecurityException
I_CmsResourceInit
Caution: reading parameters from the request, destroys special characters in all parameters, because the encoding for the request was not set yet.
initResource
in interface I_CmsResourceInit
resource
- the requested filecms
- the current CmsObjectrequest
- the current requestresponse
- the current responseCmsResourceInitException
- if other implementations of the interface should not be executedCmsSecurityException
- if other implementations of the interface should not be executed,
and the security exception should be escalatedI_CmsResourceInit.initResource(org.opencms.file.CmsResource, org.opencms.file.CmsObject, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
protected void handlePdfLink(CmsObject cms, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String uri) throws java.lang.Exception
cms
- the current CMS contextrequest
- the servlet requestresponse
- the servlet responseuri
- the current urijava.lang.Exception
- if something goes wrongCmsResourceInitException
- if the resource initialization is cancelledprotected void logXhtmlOutput(CmsResource formatter, CmsResource content, byte[] xhtmlData)
formatter
- the formattercontent
- the content resourcexhtmlData
- the XHTML data