com.oroad.stxx.transform
Class CachedXFormTransformer

java.lang.Object
  extended bycom.oroad.stxx.transform.AbstractSAXTransformer
      extended bycom.oroad.stxx.transform.AbstractXSLTransformer
          extended bycom.oroad.stxx.transform.CachedXSLTransformer
              extended bycom.oroad.stxx.transform.CachedXFormTransformer
All Implemented Interfaces:
Transformer

public class CachedXFormTransformer
extends CachedXSLTransformer
implements Transformer

This transformer extends the XSL transformer to add support for XForms by using the XMLForm library.

Author:
Don Brown

Field Summary
 
Fields inherited from class com.oroad.stxx.transform.CachedXSLTransformer
allowRenderParameter, autoReloadTemplates, isPlugin, mimeType
 
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
CachedXFormTransformer()
          Constructor
 
Method Summary
protected  void addErrors(javax.servlet.http.HttpServletRequest request, org.xmlform.Form form, java.util.Locale locale, org.apache.struts.util.MessageResources msg)
          Adds violations to the xform taken from the action errors.
 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)
          Creates and transforms the XML using XSL and a special XMLForm transformer.
 
Methods inherited from class com.oroad.stxx.transform.CachedXSLTransformer
getXMLConsumer
 
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

CachedXFormTransformer

public CachedXFormTransformer()
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 CachedXSLTransformer
Parameters:
props - The properties
context - The servlet context
rules - The builder rules
name - Description of the Parameter

transform

public void transform(ActionTransform trans,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws TransformerException
Creates and transforms the XML using XSL and a special XMLForm transformer.

Specified by:
transform in interface Transformer
Overrides:
transform in class CachedXSLTransformer
Parameters:
trans - The value object holding transformation information
response - The response object
request - The request object
Throws:
TransformerException - If something goes wrong

addErrors

protected void addErrors(javax.servlet.http.HttpServletRequest request,
                         org.xmlform.Form form,
                         java.util.Locale locale,
                         org.apache.struts.util.MessageResources msg)
Adds violations to the xform taken from the action errors. Also looks up error keys in the message resources

Parameters:
request - The http request
form - The XMLForm form
locale - The current locale
msg - The The message resources