com.ibm.itim.adhocreport
Class AdhocReportGenerator

java.lang.Object
  |
  +--com.ibm.itim.adhocreport.AdhocReportGenerator

public class AdhocReportGenerator
extends java.lang.Object

This class performs the functionality of generating a report in the required format. The formats currently supported are XML, PDF and CSV. The FOP parser is used for rendering the report into PDF. The data to be generated by the repor tcan be obtained from the AdhocDataManager object.

See Also:
AdhocDataManager

Constructor Summary
AdhocReportGenerator()
           
 
Method Summary
static java.lang.String getCSV(java.lang.String reportData, AdhocReportTemplate reportTemplate, UserAuthInfo userContext, java.util.Locale locale)
          This method constructs the final report (to be viewed by the user) in CSV format.
static java.lang.String getPDF(java.lang.String reportData, AdhocReportTemplate reportTemplate, UserAuthInfo userContext, java.util.Locale locale, com.ibm.itim.apps.ejb.adhocreport.AdhocReportManager reportManager)
          This method gets the report data as input, and the template object, and returns the report in PDF format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdhocReportGenerator

public AdhocReportGenerator()
Method Detail

getPDF

public static java.lang.String getPDF(java.lang.String reportData,
                                      AdhocReportTemplate reportTemplate,
                                      UserAuthInfo userContext,
                                      java.util.Locale locale,
                                      com.ibm.itim.apps.ejb.adhocreport.AdhocReportManager reportManager)
                               throws java.io.FileNotFoundException,
                                      java.io.IOException,
                                      javax.naming.NamingException,
                                      java.rmi.RemoteException,
                                      java.util.MissingResourceException,
                                      javax.xml.transform.TransformerConfigurationException,
                                      javax.xml.transform.TransformerException,
                                      org.apache.fop.apps.FOPException
This method gets the report data as input, and the template object, and returns the report in PDF format. The input data does not include the header and the footer information, which is constructed here based on the Report template object.
Parameters:
reportData - The contents of the report.
reportTemplate - The report template object which contains the information about the report header and footer as the user selected during report design.
userContext - This object is used to get the name of the user who is logged into the system. This name is displyed in the header of the report.
locale - Locale object for localization.
reportManager - This is used to get the stylesheet information for this rpeort.
Returns:
String Returns the PDF report in String format.
Throws:
java.io.FileNotFoundException - Stylesheet file not found.
java.io.IOException - Error in reading file.
java.rmi.RemoteException - Error during invocation of bean.
javax.xml.transform.TransformerConfigurationException - Error in transforming to PDF.
javax.xml.transform.TransformerException - Error during PDF transformation.
org.apache.fop.apps.FOPException - Error in FOP parser.

getCSV

public static java.lang.String getCSV(java.lang.String reportData,
                                      AdhocReportTemplate reportTemplate,
                                      UserAuthInfo userContext,
                                      java.util.Locale locale)
This method constructs the final report (to be viewed by the user) in CSV format.
Parameters:
reportData - The contents of the report.
reportTemplate - The report template object which contains the information about the report header and footer as the user selected during report design.
userContext - This object is used to get the name of the user who is logged into the system. This name is displyed in the header of the report.
locale - Locale object for localization.
Returns:
String Returns the CSV report in String format.