er.extensions.components
Class ERXSLTWrapper
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.extensions.components.ERXComponent
er.extensions.components.ERXNonSynchronizingComponent
er.extensions.components.ERXSLTWrapper
- All Implemented Interfaces:
- WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable
public class ERXSLTWrapper
- extends ERXNonSynchronizingComponent
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 greatly 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.
- See Also:
- Serialized Form
| Bindings |
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. |
| Methods inherited from class er.extensions.components.ERXComponent |
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, invokeAction, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, reset, stringValueForBinding, stringValueForBinding, takeValuesFromRequest, useDefaultComponentCSS, useDefaultComponentJavascript |
| Methods inherited from class com.webobjects.appserver.WOComponent |
__valueForBinding, _associationWithName, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding |
ERXSLTWrapper
public ERXSLTWrapper(WOContext context)
- Public constructor
- Parameters:
context - the context
appendToResponse
public void appendToResponse(WOResponse response,
WOContext context)
- Overridden to get use apply the XLST transformation on the content.
- Overrides:
appendToResponse in class ERXComponent
- Throws:
TransformerException
getTransformer
public static Transformer getTransformer(String framework,
String filename)
transform
public static String transform(Transformer transformer,
String xml)
throws TransformerException
- Throws:
TransformerException
transform
public static NSData transform(Transformer transformer,
NSData data)
throws TransformerException
- Throws:
TransformerException
Copyright © 2002 – 2007 Project Wonder.