|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.TraxTransformer
This Transformer is used to transform the incoming SAX stream using a TrAXProcessor. 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">The <use-request-parameter> configuration forces the transformer to make all request parameters available in the XSLT stylesheet. Note that this has implications for caching of the generated output of this transformer.
<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>xslt</xslt-processor-role> <transformer-factory>org.apache.xalan.processor.TransformerFactoryImpl</transformer-factory> <check-includes>true</check-includes> </map:transformer>
The <use-cookies> configuration forces the transformer to make all
cookies from the request available in the XSLT stylesheets.
Note that this has implications for caching 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.
Note that this has implications for caching of the generated output of
this transformer.
The <xslt-processor-role> configuration allows to specify the TrAX processor (defined in
the cocoon.xconf) that will be used to obtain the XSLT processor. This allows to have
several XSLT processors in the configuration (e.g. Xalan, XSLTC, Saxon, ...) and choose
one or the other depending on the needs of stylesheet specificities.
If no processor is specified, this transformer will use the XSLT implementation
that Cocoon uses internally.
The <transformer-factory> configuration allows to specify the TrAX transformer factory
implementation that will be used to obtain the XSLT processor. This is only useful for
compatibility reasons. Please configure the XSLT processor in the cocoon.xconf properly
and use the xslt-processor-role configuration mentioned above.
The <check-includes> configuration specifies if the included stylesheets are
also checked for changes during caching. If this is set to true (default), the
included stylesheets are also checked for changes; if this is set to false, only
the main stylesheet is checked. Setting this to false improves the performance,
and should be used whenever no includes are in the stylesheet. However, if
you have includes, you have to be careful when changing included stylesheets
as the changes might not take effect immediately. You should touch the main
stylesheet as well.
In a map:sitemap/map:pipelines/map:pipeline:
<map:transform type="xslt" src="stylesheets/yours.xsl">All <parameter> declarations will be made available in the XSLT stylesheet as xsl:variables.
<parameter name="myparam" value="myvalue"/> </map:transform>
Field Summary | |
protected Map |
logicSheetParameters
Logicsheet parameters (protected because used by subclasses) |
protected ServiceManager |
manager
The service manager instance (protected because used by subclasses) |
protected Map |
objectModel
The object model (protected because used by subclasses) |
protected TransformerHandler |
transformerHandler
The trax TransformerHandler |
protected SourceValidity |
transformerValidity
The validity of the Transformer |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Constructor Summary | |
TraxTransformer()
|
Method Summary | |
void |
configure(Configuration conf)
Configure this transformer. |
void |
dispose()
Disposable |
void |
endDocument()
Fix for stopping hanging threads of Xalan |
Serializable |
getKey()
Generate the unique key. |
protected Map |
getLogicSheetParameters()
Get the parameters for the logicsheet |
SourceValidity |
getValidity()
Generate the validity object. |
void |
recycle()
Recyclable |
void |
service(ServiceManager manager)
Set the current ServiceManager instance used by this
Serviceable . |
void |
setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data. |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Set the SourceResolver , the Map with
the object model, the source and sitemap
Parameters used to process the request. |
void |
startDocument()
Receive notification of the beginning of a document. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startElement, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, 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, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Field Detail |
protected ServiceManager manager
protected Map objectModel
protected Map logicSheetParameters
protected TransformerHandler transformerHandler
protected SourceValidity transformerValidity
Constructor Detail |
public TraxTransformer()
Method Detail |
public void configure(Configuration conf) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void service(ServiceManager manager) throws ServiceException
ServiceManager
instance used by this
Serviceable
.
service
in interface Serviceable
ServiceException
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws SAXException, ProcessingException, IOException
SourceResolver
, the Map
with
the object model, the source and sitemap
Parameters
used to process the request.
setup
in interface SitemapModelComponent
resolver
- The SourceResolver
to find resources within your context.objectModel
- A java.util.Map
that contains the request and session information.src
- The value of the "src" attribute in the sitemap.par
- The sitemap parameters passed into your component.
ProcessingException
- if there is any other unexpected problem.
IOException
- if there is a problem reading files.
SAXException
- if there is a problem reading a SAX stream.public Serializable getKey()
getKey
in interface CacheableProcessingComponent
public SourceValidity getValidity()
getValidity
in interface CacheableProcessingComponent
null
if the
component is currently not cacheable.public void setConsumer(XMLConsumer consumer)
XMLConsumer
that will receive XML data.
setConsumer
in interface XMLProducer
setConsumer
in class AbstractXMLProducer
protected Map getLogicSheetParameters()
public void dispose()
dispose
in interface Disposable
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractXMLProducer
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class AbstractXMLPipe
SAXException
public void startDocument() throws SAXException
AbstractXMLPipe
startDocument
in interface ContentHandler
startDocument
in class AbstractXMLPipe
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |