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 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)
           
 
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)
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)
Specified by:
startProcess in interface org.compiere.process.ProcessCall

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