com.oroad.stxx.transform
Class CachedFOPTransformer
java.lang.Object
com.oroad.stxx.transform.AbstractSAXTransformer
com.oroad.stxx.transform.AbstractXSLTransformer
com.oroad.stxx.transform.CachedFOPTransformer
- All Implemented Interfaces:
- Transformer
- public class CachedFOPTransformer
- extends AbstractXSLTransformer
- implements Transformer
This class defines the implementation of a FOP transformer using the
Transformation API for XML (TRaX). All templates (compiled XSL templates)
are cached upon first use. To reload the cache, reload the application.
This Transformer uses the property "outputType" to determine what type of
output to produce. Supported values are "pdf" and "svg".
- Author:
- Don Brown
Fields inherited from class com.oroad.stxx.transform.AbstractSAXTransformer |
allowURLDebug, builder, cache, context, debugXMLPath, expiryTime, log, name, resolveFromTemplatePath, rules, transFactory, writeXMLDebug |
Method Summary |
void |
init(java.lang.String name,
StxxProperties props,
javax.servlet.ServletContext context,
BuilderRules rules)
Initializes the transformer |
void |
transform(ActionTransform trans,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the transform stage by creating the XML from the request,
then uses FOP and an XSL file to create a PDF or SVG. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedFOPTransformer
public CachedFOPTransformer()
- Constructor
init
public void init(java.lang.String name,
StxxProperties props,
javax.servlet.ServletContext context,
BuilderRules rules)
- Initializes the transformer
- Specified by:
init
in interface Transformer
- Overrides:
init
in class AbstractXSLTransformer
- Parameters:
name
- The name of the transformerprops
- The propertiescontext
- The servlet contextrules
- The document builder rules
transform
public void transform(ActionTransform trans,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws TransformerException
- Handles the transform stage by creating the XML from the request,
then uses FOP and an XSL file to create a PDF or SVG.
- Specified by:
transform
in interface Transformer
- Specified by:
transform
in class AbstractSAXTransformer
- Parameters:
trans
- The value object holding transformation
informationresponse
- The response object (to set
content-type, etc)request
- The request object
- Throws:
TransformerException
- If something goes wrong