ERXSLTWrapper Class Reference

Inherits er::extensions::components::ERXNonSynchronizingComponent.

Collaboration diagram for ERXSLTWrapper:

Collaboration graph
[legend]

List of all members.

Classes

class  TemplatePool

Public Member Functions

void appendToResponse (WOResponse response, WOContext context)
 ERXSLTWrapper (WOContext context)

Static Public Member Functions

static Transformer getTransformer (String framework, String filename)
static NSData transform (Transformer transformer, NSData data) throws TransformerException
static String transform (Transformer transformer, String xml) throws TransformerException

Static Package Functions

 [static initializer]

Private Member Functions

boolean isEnabled ()
Transformer transformer ()

Private Attributes

long current
long start

Static Private Attributes

static Map cache = new HashMap()
static final Logger log = Logger.getLogger(ERXSLTWrapper.class)
static TemplatePool pool = new TemplatePool()
static XMLReader xmlReader


Detailed Description

Wrapper that translates its content via XSLT. The content must be valid XML for this to work. This is pretty usefull in conjunction with DynaReporter when you want to use one of the zillion PDF libs. You can generate the content via DynaReporter and then transform the content to a form that the PDF lib understands. Most likely this will be much easier than trying to re-generate the report with XML.
Other uses include a simple transformation of the generated front end code to privide for "skinning". As there is only so much you can do with CSS, you might need to structurally change the generated HTML prior to handing it to the client.
Note that XSLT engines vary <emp>greatly</emp> in speed. The default case of using Xalan which is included by WO is probably not the best choice for a site with a little bit of traffic. Therefore there is an option where you can set the transformer factory name to use, you also need to include the corresponding jar into the classpath.

enabled flag that decides if the transformation is applied. If not set, then only the content will be shown. stylesheet name of the XLST stylesheet (mandatory) transformerFactory name of the class for the XSLT transformer factory (optional, defaults to Xalan) framework name of the XLST stylesheet's framework (optional) data will be set to the transformed data (optional) stream will be set to the transformed data (optional) nocache flag that if set creates a new transformer instead of using the one in the cache. Useful when deleloping the stylesheet.

Author:
ak on 07.04.05 ERExtensions

Constructor & Destructor Documentation

ERXSLTWrapper ( WOContext  context  ) 

Public constructor

Parameters:
context the context


Member Function Documentation

[static initializer] (  )  [static, package]

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Overridden to get use apply the XLST transformation on the content.

Exceptions:
TransformerException 

Reimplemented from ERXNonSynchronizingComponent.

static Transformer getTransformer ( String  framework,
String  filename 
) [static]

boolean isEnabled (  )  [private]

static NSData transform ( Transformer  transformer,
NSData  data 
) throws TransformerException [static]

static String transform ( Transformer  transformer,
String  xml 
) throws TransformerException [static]

Transformer transformer (  )  [private]


Member Data Documentation

Map cache = new HashMap() [static, private]

long current [private]

final Logger log = Logger.getLogger(ERXSLTWrapper.class) [static, private]

logging support

TemplatePool pool = new TemplatePool() [static, private]

long start [private]

XMLReader xmlReader [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:06 2012 for Project Wonder by  doxygen 1.5.8