forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <sju...@mac.com>
Subject i18n enhancements of wiki plugin
Date Wed, 17 Jan 2007 11:39:09 GMT
Hello all,

I would like to enhance the wiki plugin to allow i18n content  
parallel to what is possible with standard XDoc content (ie  
index.en.xml, index.no.xml to have two versions of the index.html  
page). Unfortunately, I'm not able to get it to work. The crucial  
part should be this match in $FORREST_HOME/plugins/ 
org.apache.forrest.plugin.input.wiki/input.xmap:

         <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:match>
         </map:when>

which I changed to:

         <map:when test="{lm:project.{uri}.jspwiki}">
           <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">
             <map:match type="i18n" pattern="{lm:project.{1} 
{2}.*.jspwiki}"> <== 1. mod
             <map:generate type="text2xml" src="{source}" / 
 >                 <== 2. mod
             <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}" / 
 >                  <== 3. mod
               <map:parameter name="spaceless-filenames" value="true"/>
             </map:transform>
             <map:serialize type="xml-document"/>
             </map:match>
           </ 
map:match>                                                      <==  
closing match
         </map:when>

Now, it *continues* to work with plain content like index.jspwiki.  
But as soon as I localise it to index.no.jspwiki, I get a file-not- 
found error. I don't understand why... :-(

Whether I specify {2} or {../2} in 3. mod does not seem to make a  
difference, although it should. Can anyone see what I'm doing wrong  
here?

Sjur


Mime
View raw message