pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.xml.transform
Class XSLTOutputter

java.lang.Object
  extended by org.torweg.pulse.util.xml.transform.XSLTOutputter

public final class XSLTOutputter
extends java.lang.Object

performs the XSLT transformation of the ResultSet and the MetaData.

Version:
$Revision: 2029 $
Author:
Thomas Weber

Field Summary
static java.io.File MAIN_XSL
          the location of the main XSL file: WEB-INF/xsl/main.xsl.
 
Method Summary
static void marshalAndTransform(java.lang.Object jaxbObject, XSLHandle xsl, javax.xml.transform.Result result)
          transforms a given JAXB enabled object with the default JAXBContext provided by Lifecycle.getJAXBContext() with the given XSLHandle into the given Result.
static java.lang.String output(org.jdom.Element root, XSLHandle xsl)
          transforms a given Element with a given XSLHandle and returns the output as a String.
static void output(ResultSet rs, ServiceRequest request)
          performs the XSL transformation of the result set and writes the output to the HttpServletResponse's writer.
static void output(ResultSet resultSet, ServiceRequest request, XSLHandle xsl, CacheMode cacheMode)
          performs the XSL transformation of the given Element with the given XSLHandle and writes the output to the HttpServletResponse's writer.
static void transformAndCreatePDF(JDOMable jdomAble, java.io.OutputStream out, XSLHandle xsl)
          performs the XSL transformation of the given JDOMable with the given XSLHandle and afterwards processed the result with FOP to generate a PDF.
static void transformAndCreatePdfFromJAXB(java.lang.Object jaxbAble, java.io.OutputStream out, XSLHandle xsl)
          performs the XSL transformation of the given JAXB enabled Object with the given XSLHandle and afterwards processed the result with FOP to generate a PDF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN_XSL

public static final java.io.File MAIN_XSL
the location of the main XSL file: WEB-INF/xsl/main.xsl.

Method Detail

output

public static void output(ResultSet rs, ServiceRequest request)
performs the XSL transformation of the result set and writes the output to the HttpServletResponse's writer.

Parameters:
rs - the ResultSet to be transformed
request - the current request

output

public static void output(ResultSet resultSet, ServiceRequest request, XSLHandle xsl, CacheMode cacheMode)
performs the XSL transformation of the given Element with the given XSLHandle and writes the output to the HttpServletResponse's writer.

Parameters:
resultSet - the ResultSet to be transformed
request - the ServiceRequest
xsl - the XSLHandle of the stylesheet
cacheMode - the cache mode

output

public static java.lang.String output(org.jdom.Element root, XSLHandle xsl)
transforms a given Element with a given XSLHandle and returns the output as a String.

Parameters:
root - the source XML
xsl - the XSL as an XSLHandle
Returns:
the output as a String

marshalAndTransform

public static void marshalAndTransform(java.lang.Object jaxbObject, XSLHandle xsl,
                                       javax.xml.transform.Result result)
transforms a given JAXB enabled object with the default JAXBContext provided by Lifecycle.getJAXBContext() with the given XSLHandle into the given Result.

Parameters:
jaxbObject - the object to marshaled and transformed
xsl - the XSL to be used for transformation
result - the Result of the transformation

transformAndCreatePDF

public static void transformAndCreatePDF(JDOMable jdomAble,
                                         java.io.OutputStream out, XSLHandle xsl)
performs the XSL transformation of the given JDOMable with the given XSLHandle and afterwards processed the result with FOP to generate a PDF.

Parameters:
jdomAble - the JDOMable to be transformed
out - the output stream to write the PDF to
xsl - the XSLHandle of the stylesheet to be used to generate the FO document
Throws:
PulseException - on errors generating the PDF

transformAndCreatePdfFromJAXB

public static void transformAndCreatePdfFromJAXB(java.lang.Object jaxbAble,
                                                 java.io.OutputStream out, XSLHandle xsl)
performs the XSL transformation of the given JAXB enabled Object with the given XSLHandle and afterwards processed the result with FOP to generate a PDF.

Parameters:
jaxbAble - an object which can be unmarshaled with an Unmarshaller created from Lifecycle.getJAXBContext()
out - the output stream to write the PDF to
xsl - the XSLHandle of the stylesheet to be used to generate the FO document
Throws:
PulseException - on errors generating the PDF