|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.mapfish.print.servlet.BaseMapServlet
org.mapfish.print.servlet.MapPrinterServlet
public class MapPrinterServlet
Main print servlet.
| Nested Class Summary | |
|---|---|
protected static class |
MapPrinterServlet.TempFile
|
| Field Summary | |
|---|---|
protected static java.lang.String |
TEMP_FILE_PREFIX
|
protected static java.lang.String |
TEMP_FILE_SUFFIX
|
| Fields inherited from class org.mapfish.print.servlet.BaseMapServlet |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
MapPrinterServlet()
|
|
| Method Summary | |
|---|---|
protected void |
addTempFile(MapPrinterServlet.TempFile tempFile,
java.lang.String id)
|
protected void |
createAndGetPDF(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
All in one method: create and returns the PDF to the client. |
protected void |
createPDF(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String basePath)
Create the PDF and returns to the client (in JSON) the URL to get the PDF. |
protected void |
deleteFile(java.io.File file)
If the file is defined, delete it. |
void |
destroy()
|
protected MapPrinterServlet.TempFile |
doCreatePDFFile(java.lang.String spec,
javax.servlet.http.HttpServletRequest httpServletRequest)
Do the actual work of creating the PDF temporary file. |
protected void |
doGet(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
|
protected void |
error(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String message,
int code)
Send an error XXX to the client with a message |
protected void |
error(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.Throwable e)
Send an error XXX to the client with an exception |
protected java.lang.String |
generateId(java.io.File tempFile)
Get the ID to use in function of the filename (filename without the prefix and the extension). |
protected java.lang.String |
getBaseUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
|
protected void |
getInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String basePath)
To get (in JSON) the information about the available formats and CO. |
protected void |
getPDF(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String id)
To get the PDF created previously. |
protected java.lang.String |
getSpecFromPostBody(javax.servlet.http.HttpServletRequest httpServletRequest)
|
protected java.io.File |
getTempDir()
Get and cache the temporary directory to use for saving the generated PDF files. |
void |
init()
|
protected void |
purgeOldTemporaryFiles()
Will purge all the known temporary files older than TEMP_FILE_PURGE_SECONDS. |
protected void |
sendPdfFile(javax.servlet.http.HttpServletResponse httpServletResponse,
java.io.File tempFile)
copy the PDF into the output stream |
| Methods inherited from class org.mapfish.print.servlet.BaseMapServlet |
|---|
getMapPrinter |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String TEMP_FILE_PREFIX
protected static final java.lang.String TEMP_FILE_SUFFIX
| Constructor Detail |
|---|
public MapPrinterServlet()
| Method Detail |
|---|
protected void doGet(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletException
java.io.IOException
protected void doPost(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
throws javax.servlet.ServletException,
java.io.IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletException
java.io.IOException
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Servletdestroy in class BaseMapServlet
protected void createAndGetPDF(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
protected void createPDF(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String basePath)
throws javax.servlet.ServletException
javax.servlet.ServletException
protected void addTempFile(MapPrinterServlet.TempFile tempFile,
java.lang.String id)
protected java.lang.String getSpecFromPostBody(javax.servlet.http.HttpServletRequest httpServletRequest)
throws java.io.IOException
java.io.IOException
protected void getPDF(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String id)
throws java.io.IOException
java.io.IOException
protected void getInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String basePath)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected MapPrinterServlet.TempFile doCreatePDFFile(java.lang.String spec,
javax.servlet.http.HttpServletRequest httpServletRequest)
throws java.io.IOException,
com.lowagie.text.DocumentException,
javax.servlet.ServletException
java.io.IOException
com.lowagie.text.DocumentException
javax.servlet.ServletException
protected void sendPdfFile(javax.servlet.http.HttpServletResponse httpServletResponse,
java.io.File tempFile)
throws java.io.IOException
java.io.IOException
protected void error(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.Throwable e)
protected void error(javax.servlet.http.HttpServletResponse httpServletResponse,
java.lang.String message,
int code)
protected java.io.File getTempDir()
protected void deleteFile(java.io.File file)
protected java.lang.String generateId(java.io.File tempFile)
protected java.lang.String getBaseUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
protected void purgeOldTemporaryFiles()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||