|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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. This class exists seperate from ProcessReportAPI because of the .net version.
| 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. |
ProcessReportAPIBase |
duplicate(java.io.OutputStream out)
Creates and returns a copy of this object. |
java.lang.String |
getBaseDirectory()
Get the base directory used for imported files that have a relative path. |
int |
getCharset()
This call set's the locale used in creating a report. |
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. |
int |
getReportType()
Get the report format of the output stream. |
java.lang.String |
getSubject()
Get the subject of the document. |
java.lang.String |
getTitle()
Get the title of the document. |
boolean |
isDebugMode()
Get if debug mode is on or off. |
void |
process()
Create a report from the input (xml & rtf) streams, writing it to the output (report) stream. |
void |
processComplete()
Process the final report and create the output. |
void |
processData(DataSourceProvider data,
java.lang.String datasource)
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 |
setDebugMode(boolean debugOn)
Set debug mode on or off. |
void |
setKeywords(java.lang.String keywords)
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 subject)
Set the subject of the document. |
void |
setTitle(java.lang.String title)
Set the title of the document. |
| Method Detail |
public void setCharset(int num)
num - The charset to use when generating an html or txt report.public int getCharset()
public void setLocale(java.util.Locale locale)
locale - The locale to use when generating a report.public java.util.Locale getLocale()
public int getReportType()
public void setTitle(java.lang.String title)
title - The value of the title.public java.lang.String getTitle()
public void setSubject(java.lang.String subject)
subject - The value of the subject.public java.lang.String getSubject()
public void setKeywords(java.lang.String keywords)
keywords - The value of the keywords.public java.lang.String getKeywords()
public void setDebugMode(boolean debugOn)
debugOn - Set to true to set debug mode on.public boolean isDebugMode()
public void setBaseDirectory(java.lang.String directory)
directory - The base directory. Does not need to have a final /.public java.lang.String getBaseDirectory()
public int getNumPages()
public void process()
throws LicenseException,
java.io.IOException,
net.windward.format.TemplateParseException,
java.lang.IllegalArgumentException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException
java.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.java.lang.IllegalArgumentException - thrown if come across an unknown element type or an illegal reportType value is used.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()
throws AlreadyProcessedException,
net.windward.format.TemplateParseException,
java.io.IOException,
TagException,
DataSourceException,
BeanProviderException,
LicenseException
java.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.java.lang.IllegalArgumentException - thrown if come across an unknown element type or an illegal reportType value is used.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
inputType - 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 void addBean(java.lang.String name,
BeanProvider bean)
name - The name of the bean. This is the bean="name" attribute in the tag.bean - The bean to attach to that name.
public net.windward.xmlreport.TemplateInfo getInfo()
throws java.io.IOException,
DataSourceException,
BeanProviderException,
TagException,
AlreadyProcessedException
AlreadyProcessedException - 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 processData(DataSourceProvider data,
java.lang.String datasource)
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.
data - The data that will be placed into the report where there are xml elements.datasource - 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.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.DataSourceException - thrown if there is a problem with the datasource.
public void processComplete()
throws java.io.IOException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException,
LicenseException
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.AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.DataSourceException - thrown if there is a problem with the datasource.
public java.io.OutputStream getReport()
throws AlreadyProcessedException
AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.public void close()
public ProcessReportAPIBase duplicate(java.io.OutputStream out)
throws AlreadyProcessedException,
LicenseException,
SetupException
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 called too often for the license type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||