org.apache.cocoon.transformation
Class TraxTransformer
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLoggable
|
+--org.apache.cocoon.xml.AbstractXMLProducer
|
+--org.apache.cocoon.xml.AbstractXMLPipe
|
+--org.apache.cocoon.transformation.AbstractTransformer
|
+--org.apache.cocoon.transformation.TraxTransformer
- All Implemented Interfaces:
- Cacheable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.xml.sax.ContentHandler, org.apache.avalon.framework.activity.Disposable, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, SitemapModelComponent, Transformer, XMLConsumer, XMLPipe, XMLProducer
- public class TraxTransformer
- extends AbstractTransformer
- implements Transformer, org.apache.avalon.framework.component.Composable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.configuration.Configurable, Cacheable, org.apache.avalon.framework.activity.Disposable
This Transformer is used to transform this incomming SAX stream using
a XSLT stylesheet. Use the following sitemap declarations to define, configure
and parameterize it:
In the map:sitemap/map:components/map:transformers:
<map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<use-session-info>false</use-session-info>
<xslt-processor-role>org.apache.cocoon.components.xslt.XSLTProcessor</xslt-processor-role>
</map:transformer>
The <use-request-parameter> configuration forces the transformer to make all
request parameters available in the XSLT stylesheet. Note that this might have issues
concerning cachability of the generated output of this transformer.
This property is false by default.
The <use-browser-capabilities-db> configuration forces the transformer to make all
properties from the browser capability database available in the XSLT stylesheetas.
Note that this might have issues concerning cachability of the generated output of this
transformer.
This property is false by default.
The <use-cookies> configuration forces the transformer to make all
cookies from the request available in the XSLT stylesheetas.
Note that this might have issues concerning cachability of the generated output of this
transformer.
This property is false by default.
The <use-session-info> configuration forces the transformer to make all
of the session information available in the XSLT stylesheetas.
These infos are (boolean values are "true" or "false" strings: session-is-new,
session-id-from-cookie, session-id-from-url, session-valid, session-id.
This property is false by default.
The <use-deli> configuration forces the transformer to
make all the properties from the CC/PP profile resolved from the
request available in the XSLT stylesheets. CC/PP support is
provided via the DELI library. If the request does not provide
CC/PP information, then CC/PP information can added via the DELI
legacy device database. This property is false by default.
Note that these properties might introduces issues concerning
cacheability of the generated output of this transformer.
The <xslt-processor> configuration allows to specify the XSLT processor that will be
used by its role name. This allows to have several XSLT processors in the configuration
(e.g. Xalan and Saxon) and choose one or the other depending on the needs of stylesheet
specificities.
This property defaults to "org.apache.cocoon.components.xslt.XSLTProcessor" which is the
standard role name for an XSLTProcessor.
In a map:sitemap/map:pipelines/map:pipeline:
<map:transform type="xslt" src="stylesheets/yours.xsl">
<parameter name="myparam" value="myvalue"/>
</map:transform>
All <parameter> declarations will be made available in the XSLT stylesheet as
xsl:variables.
- Version:
- CVS $Id: TraxTransformer.java,v 1.8 2002/01/23 18:47:43 vgritsenko Exp $
- Author:
- Pierpaolo Fumagalli
(Apache Software Foundation, Exoffice Technologies), Davanum Srinivas, Carsten Ziegeler, Giacomo Pati, Ovidiu Predescu, Mark H. Butler
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Method Summary |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
Set the current ComponentManager instance used by this
Composable . |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Configure this transformer. |
void |
dispose()
|
long |
generateKey()
Generate the unique key.
|
CacheValidity |
generateValidity()
Generate the validity object. |
void |
recycle()
Recycle the producer by removing references |
void |
setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data. |
void |
setup(SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
Set the SourceResolver , the Map with
the object model, the source and sitemap
Parameters used to process the request. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
TraxTransformer
public TraxTransformer()
configure
public void configure(org.apache.avalon.framework.configuration.Configuration conf)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Configure this transformer.
- Specified by:
configure
in interface org.apache.avalon.framework.configuration.Configurable
compose
public void compose(org.apache.avalon.framework.component.ComponentManager manager)
throws org.apache.avalon.framework.component.ComponentException
- Set the current
ComponentManager
instance used by this
Composable
.
- Specified by:
compose
in interface org.apache.avalon.framework.component.Composable
setup
public void setup(SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.xml.sax.SAXException,
ProcessingException,
java.io.IOException
- Set the
SourceResolver
, the Map
with
the object model, the source and sitemap
Parameters
used to process the request.
- Specified by:
setup
in interface SitemapModelComponent
generateKey
public long generateKey()
- Generate the unique key.
This key must be unique inside the space of this component.
- Specified by:
generateKey
in interface Cacheable
- Returns:
- The generated key hashes the src
generateValidity
public CacheValidity generateValidity()
- Generate the validity object.
- Specified by:
generateValidity
in interface Cacheable
- Returns:
- The generated validity object or
null
if the
component is currently not cacheable.
setConsumer
public void setConsumer(XMLConsumer consumer)
- Set the
XMLConsumer
that will receive XML data.
- Specified by:
setConsumer
in interface XMLProducer
- Overrides:
setConsumer
in class AbstractXMLProducer
dispose
public void dispose()
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
recycle
public void recycle()
- Description copied from class:
AbstractXMLProducer
- Recycle the producer by removing references
- Specified by:
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
- Overrides:
recycle
in class AbstractXMLProducer
Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.