public abstract class Generator<In,Out>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONVERTER_ID_HTTP_PARAM |
static java.lang.String |
DISPATCH_HTTP_PARAM |
static java.lang.String |
DOWNLOAD_DISPATCH |
static java.lang.String |
ENTRY_NAME_HTTP_PARAM |
static java.lang.String |
PROCESS_STATE_HTTP_PARAM |
static java.lang.String |
REMOVE_DISPATCH |
static java.lang.String |
REPORT_ID_HTTP_PARAM |
static java.lang.String |
TEMPLATE_ENGINE_ID_HTTP_PARAM |
static java.lang.String |
TEMPLATE_ENGINE_KIND_HTTP_PARAM |
static java.lang.String |
VIEW_DISPATCH |
| Constructor and Description |
|---|
Generator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDocumentArchive(ProcessState state,
java.lang.String entryName,
In request,
Out response) |
protected boolean |
doGenerateReport(java.lang.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,
java.lang.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,
java.lang.Exception cause)
Invoked when there is an error thrown in any part of doRequest() processing.
|
protected java.lang.String |
getConverterId(IXDocReport report,
In request)
Returns the converter id.
|
protected java.lang.String |
getDispatchParameter(In request)
Returns dispatch parameter value.
|
protected java.lang.String |
getEntryName(In request)
Returns the entry name of the report.
|
protected FieldsMetadata |
getFieldsMetadata(java.lang.String reportId,
In request) |
protected Options |
getOptionsConverter(IXDocReport report,
In request) |
protected abstract java.io.OutputStream |
getOutputStream(Out response) |
protected abstract java.lang.String |
getParameter(In request,
java.lang.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 java.lang.String |
getReportId(In request)
Returns the id of the report.
|
protected abstract java.io.InputStream |
getSourceStream(java.lang.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(java.lang.String reportId,
In request)
Returns the template engine to use for the report.
|
protected java.lang.String |
getTemplateEngineId(In request)
Returns the template engine id from request.
|
protected java.lang.String |
getTemplateEngineKind(In request) |
protected java.lang.String |
getTemplateEngineKind(java.lang.String reportId,
In request) |
protected boolean |
isCacheOriginalDocument(java.lang.String reportId,
In request) |
protected boolean |
isGenerateContentDisposition(java.lang.String reportId,
MimeMapping mimeMapping,
In request) |
protected IXDocReport |
loadReport(java.lang.String reportId,
XDocReportRegistry registry,
In request)
Load report.
|
protected abstract void |
populateContext(IContext context,
java.lang.String reportId,
In request)
Put the Java model in the context for the report
reportId. |
protected abstract void |
prepareHTTPResponse(java.lang.String id,
MimeMapping mimeMapping,
In request,
Out response) |
protected abstract void |
prepareHTTPResponse(java.lang.String reportId,
java.lang.String entryName,
In request,
Out response) |
protected void |
prepareOptions(Options options,
IXDocReport report,
java.lang.String converterId,
In request) |
void |
processRequest(In request,
Out response)
Handles all requests (by default).
|
public static final java.lang.String REMOVE_DISPATCH
public static final java.lang.String DOWNLOAD_DISPATCH
public static final java.lang.String VIEW_DISPATCH
public static final java.lang.String REPORT_ID_HTTP_PARAM
public static final java.lang.String TEMPLATE_ENGINE_KIND_HTTP_PARAM
public static final java.lang.String TEMPLATE_ENGINE_ID_HTTP_PARAM
public static final java.lang.String ENTRY_NAME_HTTP_PARAM
public static final java.lang.String PROCESS_STATE_HTTP_PARAM
public static final java.lang.String DISPATCH_HTTP_PARAM
public static final java.lang.String CONVERTER_ID_HTTP_PARAM
public void processRequest(In request, Out response) throws java.lang.Exception
request - In object containing client requestresponse - Out object for the responsejava.lang.Exceptionprotected void doRemoveReport(In request, Out response) throws java.io.IOException
request - response - java.io.IOExceptionprotected void doRedirectAfterRemoveReport(In request, Out response) throws java.io.IOException
java.io.IOExceptionprotected void doDocumentArchive(ProcessState state, java.lang.String entryName, In request, Out response) throws java.lang.Exception
java.lang.Exceptionprotected void doSaveReport(ProcessState processState, In request, Out response) throws java.lang.Exception
processState - request - response - java.io.IOExceptionjava.lang.Exceptionprotected void doSaveEntry(ProcessState processState, java.lang.String entryName, In request, Out response) throws java.io.IOException, java.lang.Exception
processState - request - response - java.io.IOExceptionjava.lang.Exceptionprotected boolean doGenerateReport(java.lang.String entryName,
In request,
Out response)
throws java.lang.Exception,
java.io.IOException
java.lang.Exceptionjava.io.IOExceptionprotected IXDocReport getReport(In request) throws java.io.IOException, XDocReportException
request - java.io.IOExceptionXDocReportExceptionprotected IXDocReport loadReport(java.lang.String reportId, XDocReportRegistry registry, In request) throws java.io.IOException, XDocReportException
reportId - registry - request - java.io.IOExceptionXDocReportExceptionprotected boolean isCacheOriginalDocument(java.lang.String reportId,
In request)
protected FieldsMetadata getFieldsMetadata(java.lang.String reportId, In request)
protected abstract void error(In request, Out response, java.lang.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 java.lang.String getConverterId(IXDocReport report, In request)
request - protected Options getOptionsConverter(IXDocReport report, In request)
protected void prepareOptions(Options options, IXDocReport report, java.lang.String converterId, In request)
protected boolean isGenerateContentDisposition(java.lang.String reportId,
MimeMapping mimeMapping,
In request)
protected java.lang.String getDispatchParameter(In request)
request - protected java.lang.String getReportId(In request)
request - protected ProcessState getProcessState(In request)
request - protected java.lang.String getEntryName(In request)
request - protected java.lang.String getTemplateEngineKind(java.lang.String reportId,
In request)
protected java.lang.String getTemplateEngineKind(In request)
protected java.lang.String getTemplateEngineId(In request)
request - protected ITemplateEngine getTemplateEngine(java.lang.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 java.io.InputStream getSourceStream(java.lang.String reportId,
In request)
throws java.io.IOException,
XDocReportException
reportId.reportId - report id.request - Http servlet request context.java.io.IOExceptionXDocReportExceptionprotected abstract void populateContext(IContext context, java.lang.String reportId, In request) throws java.io.IOException, XDocReportException
reportId.context - XDocReport context to register Java data model.reportId - report id.request - Http servlet request context.java.io.IOExceptionXDocReportExceptionprotected abstract java.io.OutputStream getOutputStream(Out response) throws java.io.IOException
java.io.IOExceptionprotected abstract java.lang.String getParameter(In request, java.lang.String name)
protected abstract void prepareHTTPResponse(java.lang.String id,
MimeMapping mimeMapping,
In request,
Out response)
Copyright © 2022. All Rights Reserved.