|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.windward.xmlreport.ProcessReport
|
+--net.windward.xmlreport.ProcessHtml
This class is the main program that takes a template stream and a datasource and
merges them to create an html report stream. The way
to use this is to construct a ProcessRtf object, set any options, then call process.
Images are separate files for html. So this object has a list of HtmlImage objects, one
for each image in the report document. (Note: in the case of an image inside a while/end,
it does not create multiple image files for each iteration. The same file is used each time
the image is rendered in the report). These HtmlImage objects can either be streams that get
the image as it is rendered, or they can be file names of the images that are already written
to the hard disk.
So you can pass in these objects beforehand giving the filename, and optionally a stream to
write the image to. And after the report is processed, the same objects will now have the
filenames (if they were not set before the call) and the streams will hold the image file
data (if set).
The calling method must close all streams after calling process. process will flush the
output (report) stream before returning.
| Fields inherited from class net.windward.xmlreport.ProcessReport |
TEMPLATE_TYPE_DOCX, TEMPLATE_TYPE_RTF, TEMPLATE_TYPE_UNKNOWN, TEMPLATE_TYPE_WORD_11, TEMPLATE_TYPE_XLSX |
| Fields inherited from interface net.windward.xmlreport.ProcessHtmlAPI |
CSS_EXISTS, CSS_INCLUDE, CSS_NO, CSS_SEPARATE, DHTML, HTML_2, HTML_4_1, IE5, IE5_5, IE6, NN4, NN6_1, OP5, XHTML |
| 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 | |
ProcessHtml(java.io.InputStream rtfTemplate)
Create a ProcessHtml object with the passed in template. |
|
ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream rtfTemplate,
java.io.OutputStream report)
Create a ProcessReport object with the passed in template & data streams, writing it to the passed in report stream. |
|
ProcessHtml(java.io.InputStream rtfTemplate,
java.io.OutputStream report)
Create a ProcessHtml object with the passed in template, writing it to the passed in report stream. |
|
| Method Summary | |
void |
addImageName(HtmlImage img)
Set a single image name. |
void |
addImageNames(java.util.ArrayList imgs)
Set several image names. |
ProcessReportAPIBase |
duplicate(java.io.OutputStream out)
Creates and returns a copy of this object. |
ProcessHtmlAPI |
duplicate(java.io.OutputStream out,
java.io.OutputStream cssStream)
Creates and returns a copy of this object. |
java.lang.String |
getCssFilename()
Returns the css filename. |
java.io.OutputStream |
getCssStream()
Returns the css stream. |
int |
getCssType()
Returns if the css information will be written to a separate file, as part of the html file, or skipped (because the file already exists). |
java.lang.String |
getFilePath()
Get the path that all images will be saved to on the disk. |
java.lang.String |
getFilePrefix()
Get the prefix that will be part of the filename of all images saved to disk and listed in the html file. |
java.lang.String |
getHtmlPath()
Get the path that all images will be prefixed with in the html file. |
java.util.ArrayList |
getImageNames()
Get the image names/streams for the images in a report. |
int |
getReportType()
Get the report format of the output stream. |
int |
getSpec()
Gets the spec that the produced report must run under. |
boolean |
isFullFile()
The report can be generated as either a complete html file, or as just the body. |
boolean |
isIE()
Returns true if the spec is set to a version of Internet Explorer. |
boolean |
isNetscape()
Returns true if the spec is set to a version of Netscape. |
boolean |
isOpera()
Returns true if the spec is set to a version of Opera |
void |
process()
Create a report from the input (xml & rtf) streams, writing it to the output (report) stream. |
void |
setCss(int cssMethod,
java.io.OutputStream cssStream,
java.lang.String cssFileName)
Sets if the css information will be written to a separate file, as part of the html file, or skipped (because the file already exists). |
void |
setFullFile(boolean fullDoc)
The report can be generated as either a complete html file, or as just the body. |
void |
setImagePath(java.lang.String file,
java.lang.String html,
java.lang.String prefix)
Set a path that all images will be saved to. |
void |
setSpec(int spec)
Sets the spec that the produced report must run under. |
| Methods inherited from class net.windward.xmlreport.ProcessReport |
addBean, close, dispose, getBaseDirectory, getCharset, getChartProvider, getCompany, getImportingProvider, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, getVersion, getVersionMajor, getVersionMinor, getVersionRelease, init, isDebugMode, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setChartProvider, setDebugMode, setKeywords, setLocale, setSubject, setTitle, statLine |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.windward.xmlreport.ProcessReportAPI |
setChartProvider |
| Methods inherited from interface net.windward.xmlreport.ProcessReportAPIBase |
addBean, close, getBaseDirectory, getCharset, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, isDebugMode, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setDebugMode, setKeywords, setLocale, setSubject, setTitle |
| Constructor Detail |
public ProcessHtml(java.io.InputStream rtfTemplate)
throws LicenseException,
SetupException
rtfTemplate - The report template, as a rtf document.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
public ProcessHtml(java.io.InputStream rtfTemplate,
java.io.OutputStream report)
throws LicenseException,
SetupException
rtfTemplate - The report template, as a rtf document.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 ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream rtfTemplate,
java.io.OutputStream report)
throws java.lang.IllegalArgumentException,
DataSourceException,
LicenseException,
SetupException
xmlData - The xml data that will be placed into the report where there are xml elements.rtfTemplate - The report template, as a rtf document.report - The stream to write the report to.java.lang.IllegalArgumentException - Thrown if an illegal spec value is passed in.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.| Method Detail |
public ProcessReportAPIBase duplicate(java.io.OutputStream out)
throws AlreadyProcessedException,
LicenseException,
SetupException
duplicate in interface ProcessReportAPIBaseout - 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.
public ProcessHtmlAPI duplicate(java.io.OutputStream out,
java.io.OutputStream cssStream)
throws AlreadyProcessedException,
LicenseException,
SetupException
duplicate in interface ProcessHtmlAPIout - The stream to write the report to. If null will create a ByteArrayOutputStream.cssStream - The css stream to write to. Can be null.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.
public void process()
throws LicenseException,
java.io.IOException,
net.windward.format.TemplateParseException,
java.lang.IllegalArgumentException,
TagException,
AlreadyProcessedException,
DataSourceException,
BeanProviderException
process in interface ProcessReportAPIBaseprocess in class ProcessReportjava.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.public boolean isIE()
public boolean isNetscape()
public boolean isOpera()
public int getReportType()
getReportType in interface ProcessHtmlAPIpublic void addImageName(HtmlImage img)
addImageName in interface ProcessHtmlAPIimg - The image to add to the list of images for this file.java.lang.IllegalArgumentException - Thrown if addImageName(s) already calledpublic void addImageNames(java.util.ArrayList imgs)
addImageNames in interface ProcessHtmlAPIimgs - The images to add to the list of images for this file.java.lang.IllegalArgumentException - Thrown if addImageName(s) already called
public void setImagePath(java.lang.String file,
java.lang.String html,
java.lang.String prefix)
setImagePath in interface ProcessHtmlAPIfile - The path of the file on the disk relative to the default directory of your program.html - The path of the file relative to the default directory of the client browser.prefix - The prefix to use when creating the filename. This can be null.java.lang.IllegalArgumentException - Thrown if addImageName(s) already calledpublic java.lang.String getFilePath()
getFilePath in interface ProcessHtmlAPIpublic java.lang.String getHtmlPath()
getHtmlPath in interface ProcessHtmlAPIpublic java.lang.String getFilePrefix()
getFilePrefix in interface ProcessHtmlAPIpublic java.util.ArrayList getImageNames()
getImageNames in interface ProcessHtmlAPIpublic void setFullFile(boolean fullDoc)
setFullFile in interface ProcessHtmlAPIfullDoc - Set to true to return a complete html file, false otherwise.public boolean isFullFile()
isFullFile in interface ProcessHtmlAPI
public void setCss(int cssMethod,
java.io.OutputStream cssStream,
java.lang.String cssFileName)
throws java.lang.IllegalArgumentException
setCss in interface ProcessHtmlAPIcssMethod - Must be one of the values CSS_NO, CSS_INCLUDE, CSS_SEPARATE, or CSS_EXISTS.cssStream - The stream to write the css file to. This can (and must) only be set if cssMethod
is CSS_SEPARATE. This file will always be the same every time a given template is run so it can be
generated the first time and just reused without being regenerated after that.cssFileName - The name of the file when cssMethod is CSS_SEPARATE or CSS_EXISTS. This is
only needed if the report will write the full file. Set to "" or null for other methods.java.lang.IllegalArgumentException - Thrown if an illegal reportType value is passed in.public int getCssType()
getCssType in interface ProcessHtmlAPIpublic java.lang.String getCssFilename()
getCssFilename in interface ProcessHtmlAPIpublic java.io.OutputStream getCssStream()
getCssStream in interface ProcessHtmlAPI
public void setSpec(int spec)
throws java.lang.IllegalArgumentException
setSpec in interface ProcessHtmlAPIspec - Must be one of the spec final int's from this class: HTML*, NN*, IE*, ...java.lang.IllegalArgumentException - Thrown if an illegal spec value is passed in.public int getSpec()
getSpec in interface ProcessHtmlAPI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||