| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd"> |
| |
| <document> |
| <header> |
| <title>Castor Transformer</title> |
| <version>0.9</version> |
| <type>Technical document</type> |
| <authors> |
| <person name="Thorsten Mauch" email="mauch@imkenberg.de"/> |
| </authors> |
| <abstract>This document describes the castor transformer of Cocoon.</abstract> |
| </header> |
| <body> |
| <s1 title="Castor Transformer"> |
| <p>With this transformer, a Bean that is stored in the session,Sitemap, Session, Request or |
| the Conext is marehalled to XML and inserted in the SAX stream at a given position.</p> |
| <ul> |
| <li>Name : CastorTransfomer</li> |
| <li>Class: org.apache.cocoon.transformation.CastorTransformer</li> |
| <li>Cacheable: no.</li> |
| </ul> |
| <p> |
| Configuation: The Castortransformer need to be configured with a default mapping. |
| This mapping is used as long as no other mapping is spezfied as the element |
| </p> |
| |
| <source> |
| <![CDATA[ |
| <map:transformer name="CastorTransformer" src="org.apache.cocoon.transformation.CastorTransformer"> |
| <mapping>castor/mapping.xml</mapping> |
| </map:transformer> |
| |
| ]]> |
| </source> |
| |
| <p> |
| The CastorTransfomer support only one Element <code>castor:InsertBean</code>. This |
| element is replaced with the marshalled object. The Object given through the |
| attrbute <code>name</code> will be searched in the <code>sitemap, request, |
| session</code> and at least in <code>application</code> |
| If the scope is explicitly given, e.g , the object will ge located only here |
| The Attribut <code>mapping</code> specifys the mapping to be used. If not given |
| the default mapping is used |
| </p> |
| <p> |
| |
| <source> |
| <![CDATA[ |
| <zoo xmlns:castor="http://castor.exolab.org/cocoontransfomer"> |
| <castor:InsertBean name="Mouse"/> |
| <castor:InsertBean name="Hamster" mapping="castor/mapping_de.xml"/> |
| <castor:InsertBean name="Elefant" scope="session"/> |
| <castor:InsertBean name="Elefant" scope="request"/> |
| </zoo> |
| |
| ]]> |
| </source> |
| |
| </p> |
| |
| <p> |
| Documentaion about the castor mapping is provided at the Castor Website |
| <link href="http://castor.exolab.org/xml-mapping.html">Castor XML Mapping </link>. |
| |
| </p> |
| </s1> |
| </body> |
| </document> |