public abstract class Generator<In,Out> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONVERTER_ID_HTTP_PARAM |
static String |
DISPATCH_HTTP_PARAM |
static String |
DOWNLOAD_DISPATCH |
static String |
ENTRY_NAME_HTTP_PARAM |
static String |
PROCESS_STATE_HTTP_PARAM |
static String |
REMOVE_DISPATCH |
static String |
REPORT_ID_HTTP_PARAM |
static String |
TEMPLATE_ENGINE_ID_HTTP_PARAM |
static String |
TEMPLATE_ENGINE_KIND_HTTP_PARAM |
static String |
VIEW_DISPATCH |
| Constructor and Description |
|---|
Generator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDocumentArchive(ProcessState state,
String entryName,
In request,
Out response) |
protected boolean |
doGenerateReport(String entryName,
In request,
Out response) |
protected void |
doRedirectAfterRemoveReport(In request,
Out response) |
protected void |
doRemoveReport(In request,
Out response)
Remove report from the registry.
|
protected void |
doSaveEntry(ProcessState processState,
String entryName,
In request,
Out response)
Extract entry from a report.
|
protected void |
doSaveReport(ProcessState processState,
In request,
Out response)
Save document archive of the report.
|
protected abstract void |
error(In request,
Out response,
Exception cause)
Invoked when there is an error thrown in any part of doRequest() processing.
|
protected String |
getConverterId(IXDocReport report,
In request)
Returns the converter id.
|
protected String |
getDispatchParameter(In request)
Returns dispatch parameter value.
|
protected String |
getEntryName(In request)
Returns the entry name of the report.
|
protected FieldsMetadata |
getFieldsMetadata(String reportId,
In request) |
protected Options |
getOptionsConverter(IXDocReport report,
In request) |
protected abstract OutputStream |
getOutputStream(Out response) |
protected abstract String |
getParameter(In request,
String name) |
protected ProcessState |
getProcessState(In request)
Returns process state (original|preprocessed|generated).
|
protected XDocReportRegistry |
getRegistry(In request)
Returns the XDocReport registry which load and cache document.
|
protected IXDocReport |
getReport(In request) |
protected String |
getReportId(In request)
Returns the id of the report.
|
protected abstract InputStream |
getSourceStream(String reportId,
In request)
Returns input stream of the report to load identified with
reportId. |
protected ITemplateEngine |
getTemplateEngine(In request)
Returns the template engine from request and otherwise returns the default template engine.
|
protected ITemplateEngine |
getTemplateEngine(IXDocReport report,
In request) |
protected ITemplateEngine |
getTemplateEngine(String reportId,
In request)
Returns the template engine to use for the report.
|
protected String |
getTemplateEngineId(In request)
Returns the template engine id from request.
|
protected String |
getTemplateEngineKind(In request) |
protected String |
getTemplateEngineKind(String reportId,
In request) |
protected boolean |
isCacheOriginalDocument(String reportId,
In request) |
protected boolean |
isGenerateContentDisposition(String reportId,
MimeMapping mimeMapping,
In request) |
protected IXDocReport |
loadReport(String reportId,
XDocReportRegistry registry,
In request)
Load report.
|
protected abstract void |
populateContext(IContext context,
String reportId,
In request)
Put the Java model in the context for the report
reportId. |
protected abstract void |
prepareHTTPResponse(String id,
MimeMapping mimeMapping,
In request,
Out response) |
protected abstract void |
prepareHTTPResponse(String reportId,
String entryName,
In request,
Out response) |
protected void |
prepareOptions(Options options,
IXDocReport report,
String converterId,
In request) |
void |
processRequest(In request,
Out response)
Handles all requests (by default).
|
public static final String REMOVE_DISPATCH
public static final String DOWNLOAD_DISPATCH
public static final String VIEW_DISPATCH
public static final String REPORT_ID_HTTP_PARAM
public static final String TEMPLATE_ENGINE_KIND_HTTP_PARAM
public static final String TEMPLATE_ENGINE_ID_HTTP_PARAM
public static final String ENTRY_NAME_HTTP_PARAM
public static final String PROCESS_STATE_HTTP_PARAM
public static final String DISPATCH_HTTP_PARAM
public static final String CONVERTER_ID_HTTP_PARAM
public void processRequest(In request, Out response) throws Exception
request - In object containing client requestresponse - Out object for the responseExceptionprotected void doRemoveReport(In request, Out response) throws IOException
request - response - IOExceptionprotected void doRedirectAfterRemoveReport(In request, Out response) throws IOException
IOExceptionprotected void doDocumentArchive(ProcessState state, String entryName, In request, Out response) throws Exception
Exceptionprotected void doSaveReport(ProcessState processState, In request, Out response) throws Exception
processState - request - response - IOExceptionExceptionprotected void doSaveEntry(ProcessState processState, String entryName, In request, Out response) throws IOException, Exception
processState - request - response - IOExceptionExceptionprotected boolean doGenerateReport(String entryName, In request, Out response) throws Exception, IOException
ExceptionIOExceptionprotected IXDocReport getReport(In request) throws IOException, XDocReportException
request - IOExceptionXDocReportExceptionprotected IXDocReport loadReport(String reportId, XDocReportRegistry registry, In request) throws IOException, XDocReportException
reportId - registry - request - IOExceptionXDocReportExceptionprotected FieldsMetadata getFieldsMetadata(String reportId, In request)
protected abstract void error(In request, Out response, Exception cause)
request - original In from servlet container.response - Out object from servlet container.cause - Exception that was thrown by some other part of process.protected String getConverterId(IXDocReport report, In request)
request - protected Options getOptionsConverter(IXDocReport report, In request)
protected void prepareOptions(Options options, IXDocReport report, String converterId, In request)
protected boolean isGenerateContentDisposition(String reportId, MimeMapping mimeMapping, In request)
protected String getDispatchParameter(In request)
request - protected String getReportId(In request)
request - protected ProcessState getProcessState(In request)
request - protected String getEntryName(In request)
request - protected String getTemplateEngineId(In request)
request - protected ITemplateEngine getTemplateEngine(String reportId, In request)
reportId - request - protected ITemplateEngine getTemplateEngine(IXDocReport report, In request)
protected ITemplateEngine getTemplateEngine(In request)
request - protected XDocReportRegistry getRegistry(In request)
request - protected abstract InputStream getSourceStream(String reportId, In request) throws IOException, XDocReportException
reportId.reportId - report id.request - Http servlet request context.IOExceptionXDocReportExceptionprotected abstract void populateContext(IContext context, String reportId, In request) throws IOException, XDocReportException
reportId.context - XDocReport context to register Java data model.reportId - report id.request - Http servlet request context.IOExceptionXDocReportExceptionprotected abstract OutputStream getOutputStream(Out response) throws IOException
IOExceptionprotected abstract void prepareHTTPResponse(String id, MimeMapping mimeMapping, In request, Out response)
Copyright © 2015. All Rights Reserved.