|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.windward.xmlreport.ProcessReport
This class is the base class that takes a template stream and a DataSource and merges them to
create a report stream. The way to use this is to construct an object that extends this class, set any options, then
call the process methods.
| Field Summary | |
static int |
TEMPLATE_TYPE_DOCX
The template is a Word 2007 DOCX file. |
static int |
TEMPLATE_TYPE_RTF
The template is an RTF file. |
static int |
TEMPLATE_TYPE_UNKNOWN
Parse the template to determine what format it is. |
static int |
TEMPLATE_TYPE_WORD_11
The template is a Word 2003 WordML XML file. |
static int |
TEMPLATE_TYPE_XLSX
The template is an Excel 2007 XLSX file. |
| Fields inherited from interface net.windward.xmlreport.ProcessReportAPI |
CHARSET_DEFAULT, CHARSET_RTF, CHARSET_UNICODE, LOCALE_DEFAULT, LOCALE_SYSTEM, TYP_DOCX, TYP_EXCEL_ML, TYP_HTML, TYP_PDF, TYP_RTF, TYP_TXT, TYP_WORD_ML, TYP_XLS, TYP_XLSX |
| Constructor Summary | |
ProcessReport(DataSourceProvider data,
java.io.InputStream template,
java.io.OutputStream report)
Create a ProcessReport object with the passed in template & data streams, writing it to the passed in report stream. |
|
ProcessReport(java.io.InputStream templateStream)
Create a ProcessReport object with the passed in template. |
|
ProcessReport(java.io.InputStream xmlData,
java.io.InputStream templateStream,
java.io.OutputStream report)
Create a ProcessReport object with the passed in template & data streams, writing it to the passed in report stream. |
|
ProcessReport(java.io.InputStream templateStream,
java.io.OutputStream report)
Create a ProcessReport object with the passed in template, writing it to the passed in report stream. |
|
ProcessReport(ProcessReport src,
java.io.OutputStream out)
Creates and returns a copy of this object. |
|
| Method Summary | |
void |
addBean(java.lang.String name,
BeanProvider bean)
This adds a bean that is available during the processing of a report. |
void |
close()
Call when you are done with this object, including done with the OutputStream returned by getReport if that stream was created by ProcessReport. |
static void |
dispose()
Releases all resources held by Windward Reports. |
java.lang.String |
getBaseDirectory()
Get the base directory used for imported files that have a relative path. |
int |
getCharset()
Html and txt files are generated using a charset (rtf & pdf use unicode). |
static net.windward.chart.ChartProvider |
getChartProvider()
Returns the chart provider used for this process. |
static java.lang.String |
getCompany()
The company in the license licenseKey. |
static IImportFile |
getImportingProvider()
Returns the importing provider used for the engine. |
net.windward.xmlreport.TemplateInfo |
getInfo()
Returns all vars referenced in the template that are not defined in the template. |
java.lang.String |
getKeywords()
Get the keywords of the document. |
java.util.Locale |
getLocale()
This call returns the locale used in creating a report. |
int |
getNumPages()
Returns how many pages long a report is. |
java.io.OutputStream |
getReport()
Return the final report. |
java.lang.String |
getSubject()
Get the subject of the document. |
java.lang.String |
getTitle()
Get the title of the document. |
static java.lang.String |
getVersion()
The version of Windward Reports. |
static int |
getVersionMajor()
The major version number of Windward Reports. |
static int |
getVersionMinor()
The minor version number of Windward Reports. |
static int |
getVersionRelease()
The release version number of Windward Reports. |
static void |
init()
This method should be called before any other code anywhere in Windward Reports. |
boolean |
isDebugMode()
Get if debug mode is on or off. |
void |
process()
Create a report from the input streams, writing it to the output (report) stream. |
void |
processComplete()
Process the final report and create the output. |
void |
processData(DataSourceProvider datasourceProvider,
java.lang.String datasourceName)
Process a set of data for the report. |
void |
processSetup()
Process the template and get the report ready to process data files. |
void |
processSetup(int inputType)
Process the template and get the report ready to process data files. |
void |
setBaseDirectory(java.lang.String directory)
Set the base directory used for imported files that have a relative path. |
void |
setCharset(int num)
Html and txt files are generated using a charset (rtf & pdf use unicode). |
void |
setChartProvider(net.windward.chart.ChartProvider chartProvider)
Returns the chart provider used for this process. |
void |
setDebugMode(boolean debugOn)
Set debug mode on or off. |
void |
setKeywords(java.lang.String docKeywords)
Set the keywords of the document. |
void |
setLocale(java.util.Locale locale)
This call set's the locale used in creating a report. |
void |
setSubject(java.lang.String docSubject)
Set the subject of the document. |
void |
setTitle(java.lang.String docTitle)
Set the title of the document. |
static void |
statLine(java.lang.String msg)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.windward.xmlreport.ProcessReportAPIBase |
duplicate, getReportType |
| Field Detail |
public static final int TEMPLATE_TYPE_UNKNOWN
public static final int TEMPLATE_TYPE_RTF
public static final int TEMPLATE_TYPE_WORD_11
public static final int TEMPLATE_TYPE_DOCX
public static final int TEMPLATE_TYPE_XLSX
| Constructor Detail |
public ProcessReport(java.io.InputStream templateStream)
throws LicenseException,
SetupException
Do not pass in buffered streams if you have the option. ProcessReport wraps all streams in buffers, generally BufferedReader and BufferedWriter.
templateStream - The report template.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
public ProcessReport(java.io.InputStream templateStream,
java.io.OutputStream report)
throws LicenseException,
SetupException
Do not pass in buffered streams if you have the option. ProcessReport wraps all streams in buffers, generally BufferedReader and BufferedWriter.
templateStream - The report template.report - The stream to write the report to.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
public ProcessReport(java.io.InputStream xmlData,
java.io.InputStream templateStream,
java.io.OutputStream report)
throws DataSourceException,
LicenseException,
SetupException
Do not pass in buffered streams if you have the option. ProcessReport wraps all streams in buffers, generally BufferedReader and BufferedWriter.
xmlData - The xml data that will be placed into the report where there are xml elements.templateStream - The report template.report - The stream to write the report to.DataSourceException - thrown if there is a problem with the datasource.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
public ProcessReport(DataSourceProvider data,
java.io.InputStream template,
java.io.OutputStream report)
throws LicenseException,
SetupException
Do not pass in buffered streams if you have the option. ProcessReport wraps all streams in buffers, generally BufferedReader and BufferedWriter.
data - The data that will be placed into the report where there are xml elements.template - The report template.report - The stream to write the report to.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
public ProcessReport(ProcessReport src,
java.io.OutputStream out)
throws AlreadyProcessedException,
LicenseException,
SetupException
src - The ProcessReport object to copy.out - The stream to write the report to. If null will create a ByteArrayOutputStream.AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.| Method Detail |
public static int getVersionMajor()
public static int getVersionMinor()
public static int getVersionRelease()
public static java.lang.String getVersion()
public static java.lang.String getCompany()
public static void dispose()
public static void init()
throws LicenseException,
SetupException
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.public static void statLine(java.lang.String msg)
public void setCharset(int num)
setCharset in interface ProcessReportAPIBasenum - The charset to use when generating an html or txt report.public int getCharset()
getCharset in interface ProcessReportAPIBasepublic void setLocale(java.util.Locale locale)
setLocale in interface ProcessReportAPIBaselocale - The locale to use when generating a report.public java.util.Locale getLocale()
getLocale in interface ProcessReportAPIBasepublic void setTitle(java.lang.String docTitle)
setTitle in interface ProcessReportAPIBasedocTitle - The value of the title.public java.lang.String getTitle()
getTitle in interface ProcessReportAPIBasepublic void setSubject(java.lang.String docSubject)
setSubject in interface ProcessReportAPIBasedocSubject - The value of the subject.public java.lang.String getSubject()
getSubject in interface ProcessReportAPIBasepublic void setKeywords(java.lang.String docKeywords)
setKeywords in interface ProcessReportAPIBasedocKeywords - The value of the keywords.public java.lang.String getKeywords()
getKeywords in interface ProcessReportAPIBasepublic void setDebugMode(boolean debugOn)
setDebugMode in interface ProcessReportAPIBasedebugOn - Set to true to set debug mode on.public boolean isDebugMode()
isDebugMode in interface ProcessReportAPIBasepublic void setBaseDirectory(java.lang.String directory)
ProcessReportAPIBasesetBaseDirectory in interface ProcessReportAPIBasenet.windward.xmlreport.ProcessReportAPIBasedirectory - The base directory. Does not need to have a final /.public java.lang.String getBaseDirectory()
ProcessReportAPIBasegetBaseDirectory in interface ProcessReportAPIBasenet.windward.xmlreport.ProcessReportAPIBasepublic int getNumPages()
getNumPages in interface ProcessReportAPIBase
public void processSetup()
throws AlreadyProcessedException,
net.windward.format.TemplateParseException,
java.io.IOException,
TagException,
DataSourceException,
BeanProviderException,
LicenseException
processSetup in interface ProcessReportAPIBasejava.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.
public void processSetup(int inputType)
throws AlreadyProcessedException,
net.windward.format.TemplateParseException,
java.io.IOException,
TagException,
DataSourceException,
BeanProviderException,
LicenseException
processSetup in interface ProcessReportAPIBaseinputType - The format of the input template. Use one of the INPUT_FILE_TYPE_* integers.java.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.public static net.windward.chart.ChartProvider getChartProvider()
public static IImportFile getImportingProvider()
public void setChartProvider(net.windward.chart.ChartProvider chartProvider)
setChartProvider in interface ProcessReportAPIchartProvider - The chart provider to use.
public net.windward.xmlreport.TemplateInfo getInfo()
throws java.io.IOException,
DataSourceException,
BeanProviderException,
TagException,
AlreadyProcessedException
getInfo in interface ProcessReportAPIBaseAlreadyProcessedException - thrown if setup not called or complete called.java.io.IOException - thrown if have problems accessing the xml, template, or report streams.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.DataSourceException - thrown if there is a problem with the datasource.
public void addBean(java.lang.String name,
BeanProvider bean)
addBean in interface ProcessReportAPIBasename - The name of the bean. This is the bean="name" attribute in the tag.bean - The bean to attach to that name.
public void processData(DataSourceProvider datasourceProvider,
java.lang.String datasourceName)
throws java.io.IOException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException
Do not pass in buffered streams if you have the option. ProcessReport wraps all streams in buffers, generally BufferedReader and BufferedWriter.
processData in interface ProcessReportAPIBasedatasourceProvider - The data that will be placed into the report where there are xml elements.datasourceName - The name of the datasource to process. Only tags with this datasource will be processed. A
value of "" is legitimate and signifies the default datasource.java.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.
public void processComplete()
throws java.io.IOException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException,
LicenseException
processComplete in interface ProcessReportAPIBasejava.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.
public java.io.OutputStream getReport()
throws AlreadyProcessedException
getReport in interface ProcessReportAPIBase
public void process()
throws LicenseException,
java.io.IOException,
net.windward.format.TemplateParseException,
java.lang.IllegalArgumentException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException
process in interface ProcessReportAPIBasejava.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.public void close()
close in interface ProcessReportAPIBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||