Author: sjur
Date: Fri Jan 18 10:14:40 2013
New Revision: 1435066

URL: http://svn.apache.org/viewvc?rev=1435066&view=rev
Log:
Made i18n support in the wiki plugin configurable, by way of an xml 
configuration file. The default is false. Commit of some code changes I have 
had locally for years - literally! Forrest has been in use all the time, so 
there should be no big issues connected to this new feature.

Added:
    
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml
   (with props)
Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap
    forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml

Added: 
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml
URL: 
http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml?rev=1435066&view=auto
==============================================================================
--- 
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml
 (added)
+++ 
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml
 Fri Jan 18 10:14:40 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<properties>
+<!-- Property to specify whether locale-based file matching should
+     be allowed, e.g. whether the plugin should also look for files
+     of type document.en.jspwiki, and not only document.jspwiki.
+     Values are 'true' or 'false'. -->
+  <property name="input.wiki.allowLocaleBasedFiles" value="false"/>
+</properties>

Propchange: 
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/default.plugin.properties.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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=1435066&r1=1435065&r2=1435066&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 Fri 
Jan 18 10:14:40 2013
@@ -35,57 +35,104 @@
   <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: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="spaceless-filenames" value="true"/>
-            </map:transform>
-            <map:serialize type="xml-document"/>
+            <map:select type="config">
+              <map:parameter name="value" value="{properties:forrest.i18n}"/>
+              <!-- i18n turned on -->
+              <map:when test="true">
+                <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="spaceless-filenames" value="true"/>
+                  </map:transform>
+                  <map:serialize type="xml-document"/>
+                </map:match>
+              </map:when>
+              <!-- i18n turned off --> 
+              <map:otherwise>
+                <map:generate type="text2xml" 
src="{lm:project.{1}{2}.moinwiki}" />
+                <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="spaceless-filenames" value="true"/>
+                </map:transform>
+                <map:serialize type="xml-document"/>
+              </map:otherwise>
+            </map:select>
           </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: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="spaceless-filenames" value="true"/>
-            </map:transform>
-            <map:serialize type="xml-document"/>
+            <map:select type="config">
+              <map:parameter name="value" value="{properties:forrest.i18n}"/>
+              <!-- i18n turned on -->
+              <map:when test="true">
+                <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="spaceless-filenames" value="true"/>
+                  </map:transform>
+                  <map:serialize type="xml-document"/>
+                </map:match>
+              </map:when>
+              <!-- i18n turned off --> 
+              <map:otherwise>
+                <map:generate type="text2xml" 
src="{lm:project.{1}{2}.jspwiki}" />
+                <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="spaceless-filenames" value="true"/>
+                </map:transform>
+                <map:serialize type="xml-document"/>
+              </map:otherwise>
+            </map:select>
           </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>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml
URL: 
http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml?rev=1435066&r1=1435065&r2=1435066&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml 
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml Fri 
Jan 18 10:14:40 2013
@@ -23,6 +23,10 @@
   </developers>
   <changes>
     <release version="0.2-dev" date="not-released">
+      <action type="add" context="code" dev="SNM">
+        Made i18n support in the wiki plugin configurable, by way of an xml
+        configuration file. The default is false.
+      </action>
       <action type="fix" context="code" dev="SNM">
         Added support for definition list constructs 
(<code>;Term:definition</code>).
         Fixed numerous spacing bugs: extra or missing spaces after inline 
elements.