forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r691518 - /forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap
Date Wed, 03 Sep 2008 05:35:59 GMT
Author: sjur
Date: Tue Sep  2 22:35:58 2008
New Revision: 691518

URL: http://svn.apache.org/viewvc?rev=691518&view=rev
Log:
Added i18n matching to the source file lookup, thus allowing l10n of page content for wiki-format
pages:

somedoc.en.jspwiki
somedoc.es.jspwiki
etc

can be used to serve localised content using the simple markup format of wikis.

Also added some comments.

We have used this setup for jspwiki for months at our site, so should work without problems.
But it is not tested for the other wiki formats.

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap?rev=691518&r1=691517&r2=691518&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap Tue Sep  2 22:35:58
2008
@@ -35,57 +35,68 @@
   <map:resources>
     <map:resource name="file-resolver">
       <map:select type="exists">
+        <!-- Moinwiki Markup -->
         <map:when test="{lm:project.{uri}.moinwiki}">
           <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
-            <map:generate type="text2xml" src="{lm:project.{1}{2}.moinwiki}" />
+            <map:match type="i18n" pattern="{lm:project.{1}{2}.*.moinwiki}">
+            <map:generate type="text2xml" src="{source}" />
             <map:transform type="lexer"   src="cocoon:/moinwiki.xlex"/>
             <map:transform type="parser"  src="cocoon:/moinwiki.xgrm"/>
             <map:transform type="xsltc" 
               src="{lm:wiki.transform.moinwiki.xdoc}">
-              <map:parameter name="name" value="{2}" />
+              <map:parameter name="name" value="{../2}" />
               <map:parameter name="spaceless-filenames" value="true"/>
             </map:transform>
             <map:serialize type="xml-document"/>
+            </map:match>
           </map:match>
         </map:when>
+        <!-- JSPWiki Markup -->
         <map:when test="{lm:project.{uri}.jspwiki}">
           <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
-            <map:generate type="text2xml" src="{lm:project.{1}{2}.jspwiki}" />
+            <map:match type="i18n" pattern="{lm:project.{1}{2}.*.jspwiki}">
+            <map:generate type="text2xml" src="{source}" />
             <map:transform type="lexer"   src="cocoon:/wiki.xlex"/>
             <map:transform type="parser"  src="cocoon:/wiki.xgrm"/>
             <map:transform type="xsltc" 
               src="{lm:wiki.transform.wiki.xdoc}">
-              <map:parameter name="name" value="{2}" />
+              <map:parameter name="name" value="{../2}" />
               <map:parameter name="spaceless-filenames" value="true"/>
             </map:transform>
             <map:serialize type="xml-document"/>
+            </map:match>
           </map:match>
         </map:when>
+        <!-- CWiki Markup -->
         <map:when test="{lm:project.{uri}.cwiki}">
           <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
-            <map:generate type="text2xml" src="{lm:project.{1}{2}.cwiki}" />
+            <map:match type="i18n" pattern="{lm:project.{1}{2}.*.cwiki}">
+            <map:generate type="text2xml" src="{source}" />
             <map:transform type="lexer"   src="cocoon:/wiki.xlex"/>
             <map:transform type="parser"  src="cocoon:/wiki.xgrm"/>
             <map:transform type="xsltc" 
               src="{lm:wiki.transform.wiki.xdoc}">
-              <map:parameter name="name" value="{2}" />
+              <map:parameter name="name" value="{../2}" />
               <map:parameter name="spaceless-filenames" value="true"/>
             </map:transform>
             <map:serialize type="xml-document"/>
+            </map:match>
           </map:match>
         </map:when>
         <!-- Google Code Wiki Markup -->
         <map:when test="{lm:project.{uri}.wiki}">
           <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
-            <map:generate type="text2xml" src="{lm:project.{1}{2}.wiki}" />
+            <map:match type="i18n" pattern="{lm:project.{1}{2}.*.wiki}">
+            <map:generate type="text2xml" src="{source}" />
             <map:transform type="lexer"   src="cocoon:/googlewiki.xlex"/>
             <map:transform type="parser"  src="cocoon:/googlewiki.xgrm"/>
             <map:transform type="xsltc" 
               src="{lm:wiki.transform.googlewiki.xdoc}">
-              <map:parameter name="name" value="{2}" />
+              <map:parameter name="name" value="{../2}" />
               <map:parameter name="spaceless-filenames" value="true"/>
             </map:transform>
             <map:serialize type="xml-document"/>
+            </map:match>
           </map:match>
         </map:when>
       </map:select>



Mime
View raw message