mpo 2003/08/11 00:00:42
Modified: src/documentation/xdocs/userdocs/concepts sitemap.xml Log: Changed the usage description of <map:call resource=".."> to be in sync with "resource can be any portion of the pipe, not just the end". This behaviour was introduced by the treeprocessor, and is now generaly perceived as useful. Revision Changes Path 1.2 +40 -13 cocoon-2.1/src/documentation/xdocs/userdocs/concepts/sitemap.xml Index: sitemap.xml =================================================================== RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/concepts/sitemap.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sitemap.xml 9 Mar 2003 00:08:18 -0000 1.1 +++ sitemap.xml 11 Aug 2003 07:00:42 -0000 1.2 @@ -693,24 +693,51 @@ <p> When calling a resource, arbitrary parameters can be specified. They will be available to the processing later on, just like the parameters set by e.g. matchers or actions. Calling a - resource always creates a new map of parameters. Like redirects, - calls to a resource never return.</p> + resource always creates a new map of parameters. </p> + <note>The behaviour of resources has slightly changed due to the + introduction of the TreeProcessor in Cocoon. Since 2.1 the sitemap + interpreter strategy allows for the Resources to be templating any composed + portion of a pipeline. (Prior to 2.1 Resources were 'ending' pipelines + and as such a call of resource was said 'not to return')</note> <p> - The following example calls a sitemap resource: + The following example shows how to define and call sitemap resources: </p> <source><![CDATA[ <map:resources> - <map:resource name="resource-1"> - <map:generate src="resources/{target}.xml"> - ... -</map:resource> + <map:resource name="generate-data" > + <map:generate type="my-specific-parser" src="{input-src}" /> + </map:resource> + + <map:resource name="transform-data2svg" > + <map:transform src="xsl/data2svg.xsl" /> + </map:resource> + + <map:resource name="transform-data2html" > + <map:transform src="xsl/data2html.xsl" /> + </map:resource> + + <map:resource name="pipe-data-raw"> + <map:read mime-type="text/plain" src="{input-src}" /> + </map:resource> +</map:resources> + <map:pipeline> - <map:match pattern="forward-to"> - <map:call resource="resource-1"> - <map:parameter name="target" value="target-1"/> - </map:call> - ... -</map:pipeline> ]]></source> + <map:match pattern="styled-data/*/*"> + <map:call resource="generate-data"> + <map:parameter name="input-src" value="{2}"/> + </map:call> + <map:call resource="transform-data2{1}" /> + <map:serialize /> + </map:match> + + <map:match pattern="raw-data/*" > + <map:call resource="pipe-data-raw"> + <map:parameter name="input-src" value="{1}"/> + </map:call> + </map:match> + +</map:pipeline> + ]]></source> </s2> <s2 title="Mounting sitemaps"> <p>