com.elasticpath.cmweb.reportservice.impl
Class BirtReportServiceImpl

java.lang.Object
  extended by com.elasticpath.cmweb.reportservice.impl.BirtReportServiceImpl
All Implemented Interfaces:
BirtReportService, ReportConstants, EpService

public class BirtReportServiceImpl
extends java.lang.Object
implements BirtReportService, ReportConstants

This service provides access to the birt reporting engine.


Field Summary
 
Fields inherited from interface com.elasticpath.cmweb.reportservice.ReportConstants
ACTION, CSV_ACTION, DOCUMENT_EXTENSION, ERRORS_EXIST, HTML_ACTION, HTML_RESULT, LIST_ACTION, PDF_ACTION, REPORT_EXTENSION, REPORT_NAME, REPORT_PAGE_NUMBER, REPORT_PARAMS, URL
 
Constructor Summary
BirtReportServiceImpl()
           
 
Method Summary
 void csvToStream(java.lang.String reportName, int sessionId, java.util.Map params, java.io.OutputStream out)
          Renders csv report and outputs to stream.
 void deleteOldDocuments()
          Deletes old report documents from the document dir older than 1 day.
 ElasticPath getElasticPath()
          Returns ElasticPath instance.
 java.lang.String getHtml(java.lang.String reportName, int sessionId, java.lang.Long pageNumber, java.util.Map params)
          Returns html for specified report page.
 java.util.List getParameters(java.lang.String reportName)
          Returns a List of report parameters.
 void initializeOnce(javax.servlet.ServletContext servletContext)
          Initialized the birt engine.
 void pdfToStream(java.lang.String reportName, java.util.Map params, java.io.OutputStream out)
          Renders pdf report and outputs to stream.
 void setElasticPath(ElasticPath elasticPath)
          Sets ElasticPath instance.
 void shutDown()
          Shutdown the birt engine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BirtReportServiceImpl

public BirtReportServiceImpl()
Method Detail

csvToStream

public void csvToStream(java.lang.String reportName,
                        int sessionId,
                        java.util.Map params,
                        java.io.OutputStream out)
Renders csv report and outputs to stream.

Specified by:
csvToStream in interface BirtReportService
Parameters:
reportName - name of report.
sessionId - unique id for each user.
params - map of param names and values.
out - output stream.

deleteOldDocuments

public void deleteOldDocuments()
Deletes old report documents from the document dir older than 1 day.

Specified by:
deleteOldDocuments in interface BirtReportService

getElasticPath

public ElasticPath getElasticPath()
Returns ElasticPath instance.

Specified by:
getElasticPath in interface EpService
Returns:
ElasticPath instance.

getHtml

public java.lang.String getHtml(java.lang.String reportName,
                                int sessionId,
                                java.lang.Long pageNumber,
                                java.util.Map params)
Returns html for specified report page.

Specified by:
getHtml in interface BirtReportService
Parameters:
reportName - name of report.
sessionId - unique id for each user.
pageNumber - page # to display. If page number is null, it means that this report hasn't been run before and that a document should be created.
params - map of param names and values.
Returns:
html.

getParameters

public java.util.List getParameters(java.lang.String reportName)
Returns a List of report parameters.

Specified by:
getParameters in interface BirtReportService
Parameters:
reportName - name of report.
Returns:
a List of report parameters.

initializeOnce

public void initializeOnce(javax.servlet.ServletContext servletContext)
Initialized the birt engine.

Specified by:
initializeOnce in interface BirtReportService
Parameters:
servletContext - servlet context for PlatformServletContext.

pdfToStream

public void pdfToStream(java.lang.String reportName,
                        java.util.Map params,
                        java.io.OutputStream out)
Renders pdf report and outputs to stream.

Specified by:
pdfToStream in interface BirtReportService
Parameters:
reportName - name of report.
params - map of param names and values.
out - output stream.

setElasticPath

public void setElasticPath(ElasticPath elasticPath)
Sets ElasticPath instance.

Specified by:
setElasticPath in interface EpService
Parameters:
elasticPath - ElasticPath instance.

shutDown

public void shutDown()
Shutdown the birt engine.

Specified by:
shutDown in interface BirtReportService