cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] ResourceExistsSelector ResourceExistsAction Fri Sep 5 15:00:03 2003
Date Fri, 05 Sep 2003 13:00:03 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsSelector , version: 1 on Fri Sep
 5 12:46:46 2003 by ArjeCahn

New page created:
+ Selects the first of a set of Resources (usually files) that exists in the context. \\
+ \\
+ The 'test' expression is interpreted as a context-rooted ('/' = context) path, resolved
by the servlet container, not a Source. \\
+ \\
+ A parameter,
+ {{{<map:parameter src="prefix" value="/"/>}}}\\
+ 
+ may be supplied to the selector instance. This prefix is prepended to all test expressions
before evaluation. The default prefix is '/', meaning that all expressions are context root-relative,
unless explicitly overridden.
+ \\
+ For example, we could define a ResourceExistsSelector with: 
+ \\
+ {{{ <map:selector name="resource-exists"
+                logger="sitemap.selector.resource-exists"
+                src="org.apache.cocoon.selection.ResourceExistsSelector" />}}}
+ \\
+ And use it to build a PDF from XSL:FO or a higher-level XML format with: 
+ \\
+ {{{<map:match pattern="**.pdf">
+     <map:select type="resource-exists">
+        <map:when test="context/xdocs/{1}.fo">
+           <map:generate src="content/xdocs/{1}.fo" />
+        </map:when>
+        <map:otherwise>
+          <map:generate src="content/xdocs/{1}.xml" />
+          <map:transform src="stylesheets/document2fo.xsl" />
+        </map:otherwise>
+     </map:select>
+     <map:serialize type="fo2pdf" />
+ }}}
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsAction , version: 8 on Fri Sep
 5 12:42:43 2003 by ArjeCahn

- !This action is being slowly phased out in favor of the ResourceExistsSelector
+ !This action is being slowly phased out in favor of the [ResourceExistsSelector]
?                                                         +                      +




Mime
View raw message