OpenNMS API 1.2.3

org.opennms.report.datablock
Class PDFWriter

java.lang.Object
  extended byorg.opennms.report.datablock.PDFWriter

public class PDFWriter
extends java.lang.Object

PDFWriter is a XML to PDF generator. It uses apache's fop api for conversion. The conversion is a 2 step process that takes 1) XML + XSL to FOT (Formatting Object Tree) 2) FOT is converted to PDF using the FOP api's

Author:
Jacinta Remedios , oculan.com

Field Summary
private static java.lang.String LOG4J_CATEGORY
          The log4j category used to log debug messsages and statements.
(package private)  org.apache.fop.apps.Driver m_driver
          FOP Driver
(package private)  java.lang.String m_xslSource
          XSL path
 
Constructor Summary
PDFWriter(java.lang.String xslSource)
          Default Constructor
 
Method Summary
private  org.xml.sax.XMLReader createParser()
          Creates an xml parser.
 void generateHTML(java.io.FileReader xml, java.io.OutputStream fotFileName)
          This converts the outage report from xml to pdf format using fop.
 void generatePDF(java.io.FileReader xml, java.io.OutputStream pdfWriter, java.lang.String fotFileName)
          This converts the outage report from xml to pdf format using fop.
private  void initDriver()
          Initialises the fop driver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
The log4j category used to log debug messsages and statements.

See Also:
Constant Field Values

m_driver

org.apache.fop.apps.Driver m_driver
FOP Driver


m_xslSource

java.lang.String m_xslSource
XSL path

Constructor Detail

PDFWriter

public PDFWriter(java.lang.String xslSource)
Default Constructor

Method Detail

generateHTML

public void generateHTML(java.io.FileReader xml,
                         java.io.OutputStream fotFileName)
                  throws org.exolab.castor.xml.MarshalException,
                         org.exolab.castor.xml.ValidationException,
                         java.io.IOException,
                         java.lang.Exception
This converts the outage report from xml to pdf format using fop.

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.Exception

generatePDF

public void generatePDF(java.io.FileReader xml,
                        java.io.OutputStream pdfWriter,
                        java.lang.String fotFileName)
                 throws org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException,
                        java.io.IOException,
                        java.lang.Exception
This converts the outage report from xml to pdf format using fop.

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.Exception

initDriver

private void initDriver()
                 throws java.lang.Exception
Initialises the fop driver

Throws:
java.lang.Exception

createParser

private org.xml.sax.XMLReader createParser()
                                    throws java.lang.Exception
Creates an xml parser.

Returns:
XMLReader
Throws:
java.lang.Exception

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.