org.dbforms.servlets.reports
Class AbstractReportServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.dbforms.servlets.base.AbstractServletBase
              extended by org.dbforms.servlets.reports.AbstractReportServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
AbstractLineReportServlet, JasperReportServlet

public abstract class AbstractReportServlet
extends AbstractServletBase

This is the abstract base class for generating reports.

Author:
Henner Kollmann
See Also:
Serialized Form

Constructor Summary
AbstractReportServlet()
           
 
Method Summary
protected  void compileReport(ServletContext context, String reportFile)
           
protected abstract  String getReportFileExtension()
           
protected  void handleException(HttpServletRequest request, HttpServletResponse response, Exception e)
           
 void init()
          Initialize this servlet.
protected  void process(HttpServletRequest request, HttpServletResponse response)
          generates a report from request.
protected abstract  ReportWriter processReport(String reportFileFullName, AbstractJRDataSource dataSource, ServletContext context, HttpServletRequest request, HttpServletResponse response)
          generates a report.
 
Methods inherited from class org.dbforms.servlets.base.AbstractServletBase
doGet, doPost, sendErrorMessage
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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
 

Constructor Detail

AbstractReportServlet

public AbstractReportServlet()
Method Detail

init

public void init()
          throws ServletException
Initialize this servlet.

Overrides:
init in class AbstractServletBase
Throws:
ServletException - if we cannot configure ourselves correctly

processReport

protected abstract ReportWriter processReport(String reportFileFullName,
                                              AbstractJRDataSource dataSource,
                                              ServletContext context,
                                              HttpServletRequest request,
                                              HttpServletResponse response)
generates a report.

Parameters:
reportFileFullName - filename of report to process reportHTTPServletRequest generated by getReportFile! getReportFile should be called before fetching data, so that error handling of report not found e.g. could be processed first!
dataSource - data for the report
context - ServletContext
request - HTTPServletRequest
response - HTTPServletResponse

getReportFileExtension

protected abstract String getReportFileExtension()

handleException

protected final void handleException(HttpServletRequest request,
                                     HttpServletResponse response,
                                     Exception e)

compileReport

protected void compileReport(ServletContext context,
                             String reportFile)
                      throws Exception
Throws:
Exception

process

protected void process(HttpServletRequest request,
                       HttpServletResponse response)
generates a report from request. Tries to get data from DbForms.

Specified by:
process in class AbstractServletBase
Parameters:
request - HTTPServletRequest
response - HTTPServletResponse


Copyright © 2002-2006 DbForms. All Rights Reserved.