org.compiere.report
Class ReportStarter

java.lang.Object
  extended byorg.compiere.report.ReportStarter
All Implemented Interfaces:
org.compiere.process.ProcessCall

public class ReportStarter
extends java.lang.Object
implements org.compiere.process.ProcessCall

Author:
rlemeill originaly coming from an application note from compiere.co.uk

Nested Class Summary
(package private)  class ReportStarter.FileFilter
           
(package private)  class ReportStarter.JasperData
           
(package private)  class ReportStarter.ReportData
           
 
Field Summary
private static org.compiere.util.CLogger log
           
private static java.io.File REPORT_HOME
           
 
Constructor Summary
ReportStarter()
           
 
Method Summary
private  void addProcessParameters(int AD_PInstance_ID, java.util.Map params)
           
private  net.sf.jasperreports.engine.JasperReport compileReport(java.io.File reportFile, java.io.File jasperFile)
           
private  java.lang.String ejbGetRemoteMD5(java.lang.String requestedURLString)
           
private  java.io.File getRemoteFile(java.lang.String reportLocation, java.lang.String localPath)
           
 ReportStarter.ReportData getReportData(int AD_PInstance_ID)
           
private  java.io.File getReportFile(java.lang.String reportPath)
           
private  java.io.File getReportFile(java.lang.String reportPath, java.lang.String reportType)
           
private  java.io.File httpDownloadedReport(java.lang.String reportLocation)
           
private  boolean isMD5HomeInterfaceAvailable()
           
private  boolean isRequestedonAS(java.net.URL requestURL)
           
private  void JWScorrectClassPath()
           
private  ReportStarter.JasperData processReport(java.io.File reportFile)
           
private  void reportResult(int AD_PInstance_ID, java.lang.String errMsg)
           
 boolean startProcess(java.util.Properties ctx, org.compiere.process.ProcessInfo pi, org.compiere.util.Trx trx)
          Start the process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.compiere.util.CLogger log

REPORT_HOME

private static java.io.File REPORT_HOME
Constructor Detail

ReportStarter

public ReportStarter()
Method Detail

isRequestedonAS

private boolean isRequestedonAS(java.net.URL requestURL)
Parameters:
requestURL -
Returns:
true if the report is on the same ip address than Application Server

isMD5HomeInterfaceAvailable

private boolean isMD5HomeInterfaceAvailable()
Returns:
true if the class org.compiere.interfaces.MD5Home is present

ejbGetRemoteMD5

private java.lang.String ejbGetRemoteMD5(java.lang.String requestedURLString)
Parameters:
requestedURLString -
Returns:
md5 hash of remote file computed directly on application server null if problem or if report doesn't seem to be on AS (different IP or 404)

getRemoteFile

private java.io.File getRemoteFile(java.lang.String reportLocation,
                                   java.lang.String localPath)
Parameters:
reportLocation - http://applicationserver/webApp/standalone.jrxml for exemple
localPath - Where to put the http downloadede file
Returns:
abstract File wich represent the downloaded file

httpDownloadedReport

private java.io.File httpDownloadedReport(java.lang.String reportLocation)
Parameters:
reportLocation - http string url ex: http://compiereserver.domain.com/webApp/standalone.jrxml
Returns:
downloaded File (or already existing one)

startProcess

public boolean startProcess(java.util.Properties ctx,
                            org.compiere.process.ProcessInfo pi,
                            org.compiere.util.Trx trx)
Start the process. Called then pressing the Process button in R_Request. It should only return false, if the function could not be performed as this causes the process to abort.

Specified by:
startProcess in interface org.compiere.process.ProcessCall
Parameters:
ctx - context
pi - Compiere standard process info
trx -
Returns:
true if success

getReportFile

private java.io.File getReportFile(java.lang.String reportPath,
                                   java.lang.String reportType)
Parameters:
reportPath -
reportType -
Returns:
the abstract file corresponding to typed report

getReportFile

private java.io.File getReportFile(java.lang.String reportPath)
Parameters:
reportPath -
Returns:
the abstract file corresponding to report

reportResult

private void reportResult(int AD_PInstance_ID,
                          java.lang.String errMsg)
Parameters:
AD_PInstance_ID -
errMsg -

processReport

private ReportStarter.JasperData processReport(java.io.File reportFile)
Parameters:
reportFile -
Returns:

addProcessParameters

private void addProcessParameters(int AD_PInstance_ID,
                                  java.util.Map params)

JWScorrectClassPath

private void JWScorrectClassPath()

compileReport

private net.sf.jasperreports.engine.JasperReport compileReport(java.io.File reportFile,
                                                               java.io.File jasperFile)
Parameters:
reportFile -
jasperFile -
Returns:
compiled JasperReport

getReportData

public ReportStarter.ReportData getReportData(int AD_PInstance_ID)
Parameters:
AD_PInstance_ID -
Returns:
ReportData