com.oroad.stxx.transform
Class CachedFOPTransformer

java.lang.Object
  extended bycom.oroad.stxx.transform.AbstractSAXTransformer
      extended bycom.oroad.stxx.transform.AbstractXSLTransformer
          extended bycom.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

Field Summary
 
Fields inherited from class com.oroad.stxx.transform.AbstractXSLTransformer
autoReloadTemplates
 
Fields inherited from class com.oroad.stxx.transform.AbstractSAXTransformer
allowURLDebug, builder, cache, context, debugXMLPath, expiryTime, log, name, resolveFromTemplatePath, rules, transFactory, writeXMLDebug
 
Fields inherited from interface com.oroad.stxx.transform.Transformer
PROPS_PREFIX
 
Constructor Summary
CachedFOPTransformer()
          Constructor
 
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 com.oroad.stxx.transform.AbstractXSLTransformer
getTemplates, getTemplatesFromCache, loadHandlers, putTemplates
 
Methods inherited from class com.oroad.stxx.transform.AbstractSAXTransformer
getFactory, setCache, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.oroad.stxx.transform.Transformer
setCache
 

Constructor Detail

CachedFOPTransformer

public CachedFOPTransformer()
Constructor

Method Detail

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 transformer
props - The properties
context - The servlet context
rules - 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 information
response - The response object (to set content-type, etc)
request - The request object
Throws:
TransformerException - If something goes wrong