forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <sju...@mac.com>
Subject Re: svn commit: r691518 - /forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/input.xmap
Date Fri, 12 Sep 2008 07:10:20 GMT
Den 12. sep. 2008 kl. 00.24 skrev Ross Gardler:

> sjur@apache.org wrote:
>> 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.
>
> -1
>
> This causes problems when pulling content from a live wiki rather  
> from a local server.
>
> I'm reverting this change until we find a workaround for this as it  
> just broke about a dozen sites for me.

I'm very sorry for that :(

> I strongly suspect this was the problem Pablo was desribing on the  
> user list as well in which he reported it worked with local files  
> but not remote files.
>
> (NB Pablo is with our team for a few months so I'll try this with  
> him tomorrow)

Apologies to Pablo as well.

Would a conditional sitemap along the lines of the following be a  
possible solution?

<!-- Moinwiki Markup -->
<map:when test="{lm:project.{uri}.moinwiki}">
   <map:match type="regexp" pattern="^(.*?)([^/]*).xml$">

     <map:select type="config">
       <map:parameter name="value" value="{properties:forrest.i18n}"/>

       <map:when test="true"> <!-- i18n turned on -->
         <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>

       <map:otherwise> <!-- i18n turned off -->
         <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>

That is, do as before unless i18n has been turned on in  
forrest.properties.

WDYT?

Best regards,
Sjur


Mime
View raw message