You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/06/23 12:14:29 UTC
cvs commit: xml-forrest/src/resources/conf forrest.xmap navigation.xmap raw.xmap sitemap.xmap static.xmap
jefft 2003/06/23 03:14:28
Modified: src/resources/conf forrest.xmap navigation.xmap raw.xmap
sitemap.xmap static.xmap
Log:
Use ResourceExistsSelector instead of ResourceExistsAction. It looks cleaner
and is probably a bit faster.
Revision Changes Path
1.19 +41 -34 xml-forrest/src/resources/conf/forrest.xmap
Index: forrest.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/forrest.xmap,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- forrest.xmap 9 Jun 2003 10:27:39 -0000 1.18
+++ forrest.xmap 23 Jun 2003 10:14:26 -0000 1.19
@@ -142,12 +142,13 @@
<!-- ============================================================ -->
<map:match pattern="**body-*.html">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/xdocs/{1}{2}.ehtml" />
- <map:generate src="content/xdocs/{../1}{../2}.ehtml" />
- <map:transform src="resources/stylesheets/html2htmlbody.xsl" />
- <map:serialize type="xml" />
- </map:act>
+ <map:select type="exists">
+ <map:when test="content/xdocs/{1}{2}.ehtml">
+ <map:generate src="content/xdocs/{1}{2}.ehtml" />
+ <map:transform src="resources/stylesheets/html2htmlbody.xsl" />
+ <map:serialize type="xml" />
+ </map:when>
+ </map:select>
</map:match>
<!-- ============================================================ -->
@@ -156,37 +157,43 @@
<map:match pattern="**.xml">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/xdocs/{1}.ihtml" />
- <map:generate src="content/xdocs/{../1}.ihtml" type="html" />
- <map:transform src="resources/stylesheets/html2document.xsl" />
- <map:transform type="idgen" />
- <map:serialize type="xml"/>
- </map:act>
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/xdocs/{1}.cwiki" />
- <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
- <map:generate type="text2xml" src="content/xdocs/{1}{2}.cwiki" />
- <map:transform type="lexer" src="resources/grammars/wiki.xlex"/>
- <map:transform type="parser" src="resources/grammars/wiki.xgrm"/>
- <!-- Dynamically generated equivalents. Matchers need to be added to
- the root sitemap for this to work.
- <map:transform type="lexer" src="cocoon:/wiki.xlex"/>
- <map:transform type="parser" src="cocoon:/wiki.xgrm"/>
- -->
- <map:transform src="resources/stylesheets/wiki2document.xsl">
- <map:parameter name="name" value="{2}" />
- </map:transform>
+ <map:select type="exists">
+
+ <map:when test="content/xdocs/{1}.ihtml">
+ <map:generate src="content/xdocs/{1}.ihtml" type="html" />
+ <map:transform src="resources/stylesheets/html2document.xsl" />
<map:transform type="idgen" />
<map:serialize type="xml"/>
- </map:match>
- </map:act>
+ </map:when>
+
+ <map:when test="content/xdocs/{1}.cwiki">
+ <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
+ <map:generate type="text2xml" src="content/xdocs/{1}{2}.cwiki" />
+ <map:transform type="lexer" src="resources/grammars/wiki.xlex"/>
+ <map:transform type="parser" src="resources/grammars/wiki.xgrm"/>
+ <!-- Dynamically generated equivalents. Matchers need to be added to
+ the root sitemap for this to work.
+ <map:transform type="lexer" src="cocoon:/wiki.xlex"/>
+ <map:transform type="parser" src="cocoon:/wiki.xgrm"/>
+ -->
+ <map:transform src="resources/stylesheets/wiki2document.xsl">
+ <map:parameter name="name" value="{2}" />
+ </map:transform>
+ <map:transform type="idgen" />
+ <map:serialize type="xml"/>
+ </map:match>
+ </map:when>
+
+ <map:otherwise>
+ <map:generate src="content/xdocs/{1}.xml" />
+ <map:call resource="transform-to-document">
+ <map:parameter name="src" value="content/xdocs/{1}.xml" />
+ </map:call>
+ <map:serialize type="xml"/>
+ </map:otherwise>
+
+ </map:select>
- <map:generate src="content/xdocs/{1}.xml" />
- <map:call resource="transform-to-document">
- <map:parameter name="src" value="content/xdocs/{1}.xml" />
- </map:call>
- <map:serialize type="xml"/>
</map:match>
1.9 +17 -12 xml-forrest/src/resources/conf/navigation.xmap
Index: navigation.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/navigation.xmap,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- navigation.xmap 9 Jun 2003 10:27:39 -0000 1.8
+++ navigation.xmap 23 Jun 2003 10:14:27 -0000 1.9
@@ -15,22 +15,27 @@
<map:match pattern="**book-*">
- <map:act type="resource-exists">
- <!-- If a hand-created book.xml exists, use it -->
- <map:parameter name="url" value="content/xdocs/{1}book.xml" />
- <map:generate src="content/xdocs/{../1}book.xml" />
- <map:serialize type="xml"/>
- </map:act>
+ <map:select type="exists">
- <!-- If no book.xml, generate it from the linkmap. -->
- <map:generate src="cocoon://{1}menulinks-{2}" />
- <!-- The above generates the subset of the linkmap relevant to our directory. -->
- <map:transform src="resources/stylesheets/site2book.xsl" />
- <map:serialize type="xml"/>
+ <map:when test="content/xdocs/{1}book.xml">
+ <!-- If a hand-created book.xml exists, use it -->
+ <map:parameter name="url" value="content/xdocs/{1}book.xml" />
+ <map:generate src="content/xdocs/{../1}book.xml" />
+ <map:serialize type="xml"/>
+ </map:when>
+
+ <map:otherwise>
+ <!-- If no book.xml, generate it from the linkmap. -->
+ <map:generate src="cocoon://{1}menulinks-{2}" />
+ <!-- The above generates the subset of the linkmap relevant to our directory. -->
+ <map:transform src="resources/stylesheets/site2book.xsl" />
+ <map:serialize type="xml"/>
+ </map:otherwise>
+
+ </map:select>
</map:match>
</map:pipeline>
-
</map:pipelines>
</map:sitemap>
1.5 +58 -56 xml-forrest/src/resources/conf/raw.xmap
Index: raw.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/raw.xmap,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- raw.xmap 9 Apr 2003 04:20:16 -0000 1.4
+++ raw.xmap 23 Jun 2003 10:14:27 -0000 1.5
@@ -24,62 +24,64 @@
<!-- ============================================================ -->
<map:match pattern="**">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/{1}" />
- <map:match pattern="**.html">
- <!--
- Use this instead if you want JTidy to clean up your HTML
- <map:generate type="html" src="content/{0}" />
- <map:serialize type="html"/>
- -->
- <map:read src="content/{0}" mime-type="text/html"/>
- </map:match>
-
- <map:match pattern="**.xml">
- <map:generate type="file" src="content/{0}" />
- <map:serialize type="xml" />
- </map:match>
-
- <map:match pattern="skin/**.css">
- <map:read src="content/{1}.css" mime-type="text/css" />
- </map:match>
-
- <map:match pattern="**.js">
- <map:read src="content/{0}" mime-type="application/javascript" />
- </map:match>
-
- <map:match pattern="**.gif">
- <map:read src="content/{0}" mime-type="image/gif" />
- </map:match>
-
- <map:match pattern="**.png">
- <map:read src="content/{0}" mime-type="image/png" />
- </map:match>
-
- <map:match pattern="**.jpg">
- <map:read src="content/{0}" mime-type="image/jpeg" />
- </map:match>
-
- <map:match pattern="**.jpeg">
- <map:read src="content/{0}" mime-type="image/jpeg" />
- </map:match>
-
- <map:match pattern="**.pdf">
- <map:read src="content/{0}" mime-type="application/pdf" />
- </map:match>
-
- <map:match pattern="**.swf">
- <map:read src="content/{0}" mime-type="application/x-shockwave-flash" />
- </map:match>
-
- <map:match pattern="**.txt">
- <map:read src="content/{0}" mime-type="text/plain" />
- </map:match>
-
- <map:match pattern="**">
- <map:read src="content/{1}"/>
- </map:match>
- </map:act>
+ <map:select type="exists">
+ <map:when test="content/{1}">
+ <map:match pattern="**.html">
+ <!--
+ Use this instead if you want JTidy to clean up your HTML
+ <map:generate type="html" src="content/{0}" />
+ <map:serialize type="html"/>
+ -->
+ <map:read src="content/{0}" mime-type="text/html"/>
+ </map:match>
+
+ <map:match pattern="**.xml">
+ <map:generate type="file" src="content/{0}" />
+ <map:serialize type="xml" />
+ </map:match>
+
+ <map:match pattern="skin/**.css">
+ <map:read src="content/{1}.css" mime-type="text/css" />
+ </map:match>
+
+ <map:match pattern="**.js">
+ <map:read src="content/{0}" mime-type="application/javascript" />
+ </map:match>
+
+ <map:match pattern="**.gif">
+ <map:read src="content/{0}" mime-type="image/gif" />
+ </map:match>
+
+ <map:match pattern="**.png">
+ <map:read src="content/{0}" mime-type="image/png" />
+ </map:match>
+
+ <map:match pattern="**.jpg">
+ <map:read src="content/{0}" mime-type="image/jpeg" />
+ </map:match>
+
+ <map:match pattern="**.jpeg">
+ <map:read src="content/{0}" mime-type="image/jpeg" />
+ </map:match>
+
+ <map:match pattern="**.pdf">
+ <map:read src="content/{0}" mime-type="application/pdf" />
+ </map:match>
+
+ <map:match pattern="**.swf">
+ <map:read src="content/{0}" mime-type="application/x-shockwave-flash" />
+ </map:match>
+
+ <map:match pattern="**.txt">
+ <map:read src="content/{0}" mime-type="text/plain" />
+ </map:match>
+
+ <map:match pattern="**">
+ <map:read src="content/{1}"/>
+ </map:match>
+
+ </map:when>
+ </map:select>
</map:match>
</map:pipeline>
1.103 +19 -17 xml-forrest/src/resources/conf/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/sitemap.xmap,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- sitemap.xmap 19 Jun 2003 10:51:49 -0000 1.102
+++ sitemap.xmap 23 Jun 2003 10:14:27 -0000 1.103
@@ -78,9 +78,9 @@
<map:matcher name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcher"/>
</map:matchers>
- <map:actions>
- <map:action logger="sitemap.action.resource-exists" name="resource-exists" src="org.apache.cocoon.acting.ResourceExistsAction"/>
- </map:actions>
+ <map:selectors>
+ <map:selector logger="sitemap.selector.exists" name="exists" src="org.apache.cocoon.selection.ResourceExistsSelector" />
+ </map:selectors>
<map:pipes default="caching">
<map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
@@ -192,16 +192,17 @@
</map:match>
<map:match pattern="**body-*.html">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/xdocs/{1}{2}.ehtml" />
- <map:generate src="content/xdocs/{../1}{../2}.ehtml" />
- <map:transform src="resources/stylesheets/html2htmlbody.xsl" />
- <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
- <map:parameter name="link-attrs" value="href src"/>
- <map:parameter name="schemes" value="site ext"/>
- </map:transform>
- <map:serialize type="xml" />
- </map:act>
+ <map:select type="exists">
+ <map:when test="content/xdocs/{1}{2}.ehtml">
+ <map:generate src="content/xdocs/{1}{2}.ehtml" />
+ <map:transform src="resources/stylesheets/html2htmlbody.xsl" />
+ <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
+ <map:parameter name="link-attrs" value="href src"/>
+ <map:parameter name="schemes" value="site ext"/>
+ </map:transform>
+ <map:serialize type="xml" />
+ </map:when>
+ </map:select>
</map:match>
<!-- Default matches -->
@@ -261,10 +262,11 @@
<!-- +==========================================================+ -->
<map:match type="regexp" pattern="^.+$">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/{0}" />
- <map:mount uri-prefix="" src="raw.xmap" check-reload="yes" />
- </map:act>
+ <map:select type="exists">
+ <map:when test="content/{0}">
+ <map:mount uri-prefix="" src="raw.xmap" check-reload="yes" />
+ </map:when>
+ </map:select>
</map:match>
<map:match pattern="*.html">
1.8 +9 -7 xml-forrest/src/resources/conf/static.xmap
Index: static.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/static.xmap,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- static.xmap 25 May 2003 23:28:10 -0000 1.7
+++ static.xmap 23 Jun 2003 10:14:27 -0000 1.8
@@ -74,13 +74,15 @@
</map:match>
<map:match pattern="images/**.png">
- <map:act type="resource-exists">
- <map:parameter name="url" value="resources/images/{1}.svg" />
- <map:generate src="resources/images/{../1}.svg" />
- <map:serialize type="svg2png" />
- </map:act>
-
- <map:read src="resources/images/{1}.png" mime-type="image/png" />
+ <map:select type="exists">
+ <map:when test="resources/images/{1}.svg">
+ <map:generate src="resources/images/{1}.svg" />
+ <map:serialize type="svg2png" />
+ </map:when>
+ <map:otherwise>
+ <map:read src="resources/images/{1}.png" mime-type="image/png" />
+ </map:otherwise>
+ </map:select>
</map:match>
<map:match pattern="images/**.*">