net.windward.xmlreport
Interface ProcessHtmlAPI

All Superinterfaces:
ProcessReportAPI, ProcessReportAPIBase
All Known Implementing Classes:
ProcessHtml

public interface ProcessHtmlAPI
extends ProcessReportAPI

This class is a subclass of ProcessReportAPI specifically for creating an output in the html format.

Version:
2.0 2 January 2004

Field Summary
static int CSS_EXISTS
          Assume they have the css file already.
static int CSS_INCLUDE
          Put the css contents in the output (html) file.
static int CSS_NO
          No css.
static int CSS_SEPARATE
          Put the css contents in the css stream.
static int DHTML
          Create a HTML file that conforms to the DHTML spec.
static int HTML_2
          Create a HTML file that conforms to html 2.0.
static int HTML_4_1
          Create a HTML file that conforms to 4.01.
static int IE5
          Create a HTML file that conforms to the IE 5.0 spec.
static int IE5_5
          Create a HTML file that conforms to the IE 5.5 spec.
static int IE6
          Create a HTML file that conforms to the IE 6.0 spec.
static int NN4
          Create a HTML file that conforms to the Netscape 4.0 spec.
static int NN6_1
          Create a HTML file that conforms to the Netscape 6.1 spec.
static int OP5
          Create a HTML file that conforms to the Opera 5.0 spec.
static int XHTML
          Create a HTML file that conforms to the XHTML spec.
 
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
 
Method Summary
 void addImageName(HtmlImage img)
          Set a single image name.
 void addImageNames(java.util.ArrayList imgs)
          Set several image names.
 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.
 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 interface net.windward.xmlreport.ProcessReportAPI
setChartProvider
 
Methods inherited from interface net.windward.xmlreport.ProcessReportAPIBase
addBean, close, duplicate, getBaseDirectory, getCharset, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, isDebugMode, process, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setDebugMode, setKeywords, setLocale, setSubject, setTitle
 

Field Detail

HTML_2

public static final int HTML_2
Create a HTML file that conforms to html 2.0.

HTML_4_1

public static final int HTML_4_1
Create a HTML file that conforms to 4.01. This is Netscape 4 and IE 4 and later.

NN4

public static final int NN4
Create a HTML file that conforms to the Netscape 4.0 spec.

NN6_1

public static final int NN6_1
Create a HTML file that conforms to the Netscape 6.1 spec.

IE5

public static final int IE5
Create a HTML file that conforms to the IE 5.0 spec.

IE5_5

public static final int IE5_5
Create a HTML file that conforms to the IE 5.5 spec.

IE6

public static final int IE6
Create a HTML file that conforms to the IE 6.0 spec.

OP5

public static final int OP5
Create a HTML file that conforms to the Opera 5.0 spec.

DHTML

public static final int DHTML
Create a HTML file that conforms to the DHTML spec.

XHTML

public static final int XHTML
Create a HTML file that conforms to the XHTML spec.

CSS_NO

public static final int CSS_NO
No css. For browsers that don't support css.

CSS_INCLUDE

public static final int CSS_INCLUDE
Put the css contents in the output (html) file.

CSS_SEPARATE

public static final int CSS_SEPARATE
Put the css contents in the css stream.

CSS_EXISTS

public static final int CSS_EXISTS
Assume they have the css file already. Don't need to rebuild it.
Method Detail

duplicate

public ProcessHtmlAPI duplicate(java.io.OutputStream out,
                                java.io.OutputStream cssStream)
                         throws AlreadyProcessedException,
                                LicenseException,
                                SetupException
Creates and returns a copy of this object. You may call this before or after calling processData(). You may then call processData() on the created object. You must call this after calling processSetup() and before calling processComplete(). While this mostly does a deep copy, it does not do a deep copy of bean objects or image data. This will always return a ProcessHtml object.
Parameters:
out - The stream to write the report to. If null will create a ByteArrayOutputStream.
cssStream - The css stream to write to. Can be null.
Throws:
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.

getReportType

public int getReportType()
Get the report format of the output stream.
Specified by:
getReportType in interface ProcessReportAPIBase
Returns:
The type (format) of the output report. Will be TYP_HTML.

addImageName

public void addImageName(HtmlImage img)
Set a single image name. If there are no images, this is it. If there are already images, this adds this name to the end of the list. This method can only be called before processing a report.
Parameters:
img - The image to add to the list of images for this file.
Throws:
java.lang.IllegalArgumentException - Thrown if addImageName(s) already called

addImageNames

public void addImageNames(java.util.ArrayList imgs)
Set several image names. If there are no images, this is it. If there are already images, this adds these to the end of the list. This method can only be called before processing a report.
Parameters:
imgs - The images to add to the list of images for this file.
Throws:
java.lang.IllegalArgumentException - Thrown if addImageName(s) already called

setImagePath

public void setImagePath(java.lang.String file,
                         java.lang.String html,
                         java.lang.String prefix)
Set a path that all images will be saved to. All images will be written to the disk as they are read from the template. If this is called, you may not also call addImageName. You can however after processing call getImageNames and the filenames will be in there (but not the streams).
The path can be just a series of folders like "c:/dir1/dir2/" or it can include the begining of the filename like "c:/dir1/dir2/tmp". The first will create the file "c:/dir1/dir2/00001.jpg" while the second will create the file "c:/dir1/dir2/tmp00001.jpg".
Note: file and prefix should not end with a /
Note: as Windward Reports has no idea when the created file is no longer needed, it will not delete any files created.
Note: The path seperator should be /, not \ (to work on unix and windows).
Parameters:
file - 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.
Throws:
java.lang.IllegalArgumentException - Thrown if addImageName(s) already called

getFilePath

public java.lang.String getFilePath()
Get the path that all images will be saved to on the disk. The path can be just a series of folders like "c:/dir1/dir2/" or it can include the begining of the filename like "c:/dir1/dir2/tmp". The first should be used to create the file "c:/dir1/dir2/00001.jpg" while the second to create the file "c:/dir1/dir2/tmp00001.jpg".
Note: as Windward Reports has no idea when the created file is no longer needed, it will not delete any files created.

getHtmlPath

public java.lang.String getHtmlPath()
Get the path that all images will be prefixed with in the html file. The path can be just a series of folders like "c:/dir1/dir2/" or it can include the begining of the filename like "c:/dir1/dir2/tmp". The first should be used to include the file "c:/dir1/dir2/00001.jpg" while the second to include the file "c:/dir1/dir2/tmp00001.jpg".

getFilePrefix

public 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. In this case the file will be "c:/dir1/dir2/tmp00001.jpg" where tmp is the prefix.

getImageNames

public java.util.ArrayList getImageNames()
Get the image names/streams for the images in a report. This method can only be called after processing a report. This will have an entry for every image in the template. However, if Windward Reports is naming the files and/or creating the OutputStream then images that are not needed in the final report will have a filename of "" and an OutputStream size of 0.
Returns:
The images for this report.

setFullFile

public void setFullFile(boolean fullDoc)
The report can be generated as either a complete html file, or as just the body. If it is set to full file, the report will have everything from <html> to </html>. If not set, it will be a body, and can be included with additional html as just part of the body of a final html file. In this case the returned stream must be placed inside a <body>...</body>. Default is true.
Parameters:
fullDoc - Set to true to return a complete html file, false otherwise.

isFullFile

public boolean isFullFile()
The report can be generated as either a complete html file, or as just the body. If it is set to full file, the report will have everything from <html> to </html>. If not set, it will be a body, and can be included with additional html as just part of the body of a final html file. In this case the returned stream must be placed inside a <body>...</body>. Default is true.
Returns:
true if will return a complete html file, false otherwise.

setCss

public void setCss(int cssMethod,
                   java.io.OutputStream cssStream,
                   java.lang.String cssFileName)
            throws java.lang.IllegalArgumentException
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). Default is CSS_NO.
Parameters:
cssMethod - 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.
Throws:
java.lang.IllegalArgumentException - Thrown if an illegal reportType value is passed in.

getCssType

public 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). Default is CSS_NO.
Returns:
Will be one of the values CSS_NO, CSS_INCLUDE, CSS_SEPARATE, or CSS_EXISTS.

getCssFilename

public java.lang.String getCssFilename()
Returns the css filename. Null if there is no separate css file.
Returns:
The css filename.

getCssStream

public java.io.OutputStream getCssStream()
Returns the css stream. Null if not CSS_SEPARATE.
Returns:
The css stream.

setSpec

public void setSpec(int spec)
             throws java.lang.IllegalArgumentException
Sets the spec that the produced report must run under. The produced report will not use any html tags that are not supported by the set spec. Default is HTML_4_1.
Parameters:
spec - Must be one of the spec final int's from this class: HTML*, NN*, IE*, ...
Throws:
java.lang.IllegalArgumentException - Thrown if an illegal spec value is passed in.

getSpec

public int getSpec()
Gets the spec that the produced report must run under. The produced report will not use any html tags that are not supported by this spec. Default is HTML_4_1.
Returns:
Will be one of the spec final int's from this class: HTML*, NN*, IE*, ...


Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software