You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ni...@apache.org on 2002/03/26 09:08:49 UTC

cvs commit: xml-cocoon2/src/scratchpad/webapp/samples/castor/castor-mappings test-mapping.xml test-mapping_de.xml

nicolaken    02/03/26 00:08:49

  Modified:    src/webapp/samples samples.xml
  Added:       src/scratchpad/webapp/mount/castor/doc castortransformer.xml
               src/scratchpad/webapp/mount/castor sitemap.xmap test.xml
               src/scratchpad/webapp/mount/castor/castor-mappings
                        test-mapping.xml test-mapping_de.xml
  Removed:     src/scratchpad/webapp/samples/castor/doc
                        castortransformer.xml
               src/scratchpad/webapp/samples/castor sitemap.xmap test.xml
               src/scratchpad/webapp/samples/castor/castor-mappings
                        test-mapping.xml test-mapping_de.xml
  Log:
  Moved castor scratchpad sample from /samples to /mount as other samples.
  Now the refactored sample page points to the mount dir, thus
  showing available scratchpad components to test.
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/castor/doc/castortransformer.xml
  
  Index: castortransformer.xml
  ===================================================================
  <?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>
  
  
  
  1.3       +2 -2      xml-cocoon2/src/webapp/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/samples.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- samples.xml	20 Mar 2002 05:12:55 -0000	1.2
  +++ samples.xml	26 Mar 2002 08:08:49 -0000	1.3
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="iso-8859-1"?>
   
  -<!-- CVS: $Id: samples.xml,v 1.2 2002/03/20 05:12:55 vgritsenko Exp $ -->
  +<!-- CVS: $Id: samples.xml,v 1.3 2002/03/26 08:08:49 nicolaken Exp $ -->
   
   <samples xmlns:xlink="http://www.w3.org/1999/xlink">
   
  @@ -114,7 +114,7 @@
     </group>
     
     <group name="Scratchpad samples">
  -   <sample name="Try Scratchpad" href="scratchpad">
  +   <sample name="Try Scratchpad" href="../mount/">
       Here is a peek of what the next release of Cocoon will bring.
       To test these samples, you mus have built cocoon with "build (sh|bat) installscratchpadwar".
      </sample>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/castor/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  	<!-- =========================== Components ================================ -->
  	<map:components>
  		<map:generators default="file"/>
  		<map:transformers default="xslt">
  			<map:transformer name="castor" src="org.apache.cocoon.transformation.CastorTransformer">
  				<mapping>castor-mappings/test-mapping.xml</mapping>
  			</map:transformer>
  		</map:transformers>
  		<map:readers default="resource"/>
  		<map:serializers default="xml"/>
  		<map:selectors default="browser"/>
  
  		<map:matchers default="wildcard">
  			<map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  		</map:matchers>
  		<map:actions>
  			
  			<map:action name="TestBeanAction" src="org.apache.cocoon.samples.castor.TestBeanAction"/>
  		</map:actions>
  	</map:components>
  	<!-- =========================== Pipelines ================================= -->
  	<map:pipelines>
  		<map:pipeline>
  			<map:match pattern="*">
  				<map:act type="TestBeanAction"/>
  				<map:generate src="test.xml"/>
  				<map:transform type="castor"/>	
  				<map:serialize/>
  			</map:match>	
  		</map:pipeline>
  	</map:pipelines>
  </map:sitemap>
  <!-- end of file -->
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/castor/test.xml
  
  Index: test.xml
  ===================================================================
  <?xml version="1.0"?>
  <zoo xmlns:castor="http://castor.exolab.org/cocoontransfomer">
  	<castor:InsertBean name="Mouse"/> 
  	<castor:InsertBean name="Lion"/> 
  	<castor:InsertBean name="Hamster" mapping="castor-mappings/test-mapping_de.xml"/>
  	<castor:InsertBean name="Wale"/>
  	<castor:InsertBean name="Elefant" scope="session"/> 
  	<castor:InsertBean name="Elefant" scope="request"/> 
  </zoo>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/castor/castor-mappings/test-mapping.xml
  
  Index: test-mapping.xml
  ===================================================================
  <mapping>
          <class name="org.apache.cocoon.samples.castor.TestBean">
                  <map-to xml="animal"/>
                  
                  <field name="name" type="java.lang.String">
                          <bind-xml name="name" node="element"/>
                  </field>
          
                  <field name="scope" type="java.lang.String">
                          <bind-xml name="scope" node="element"/>
                  </field>                
          </class>
  </mapping>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/castor/castor-mappings/test-mapping_de.xml
  
  Index: test-mapping_de.xml
  ===================================================================
  <mapping>
          <class name="org.apache.cocoon.samples.castor.TestBean">
                  <map-to xml="Tier"/>
                  
                  <field name="name" type="java.lang.String">
                          <bind-xml name="Name" node="element"/>
                  </field>
          
                  <field name="scope" type="java.lang.String">
                          <bind-xml name="Herkunft" node="element"/>
                  </field>                
          </class>
  </mapping>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org