Den 18. sep. 2006 kl. 13.56 skrev Thorsten Scherler:

This snippet does not work (slightly more complex matching):

     <map:pipeline>
       <map:match pattern="**/*.languages.xml">
           <map:generate src="cocoon://{1}/{2}.xml" />

This should work in all sub dir. Meaning
{$xdocs}/index.de.xml will not match since there is no "/" in the path.
{$xdocs}/sample/index.de.xml should match.

Thanks for the clarification. That explained it:-)

This neither (simple matching followed by i18n matching):

     <map:pipeline>
       <map:match pattern="**.languages.xml">
         <map:match type="i18n" pattern="{1}.*.xml">

Never used the <map:match type="i18n"/> Can you point us to the docu?

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/matching/ LocaleMatcher.html

It is configured in the main sitemap.

I have used it earlier in a Cocoon-based project, and it works (almost) like a charm. For this contract I have one feature request, though:

1) it would be nice if it could return all available locales for the matching document in a sitemap parameter. As it is now, I need to do some sitemap magic to aggregate the list of all candidate documents, then process the aggregation and finally deliver the result. This is error prone and slow, compared to returning a list of found documents by a Java component that needs to do the job anyway.

2) The other feature I would like to add is a sitemap parameter containing the default locale, if specified in the matcher config. Imagine a set of documents written in one of the supported wiki formats:

text.de.jspwiki
text.nn.jspwiki
text.jspwiki

The input is text only, thus there's no way we can tag the content of the last file for which language it contains. Now, for a user being served the .de. variant, how do I tell her what other languages are available? Presently there's no way other than hard-coding the default language somewhere (or provide a forrest variable), where I could just have asked the LocaleMatcher for the value, if it had been provided to me.

(A forrest variable would probably be nice anyway, but does not remove the need for having access to the default locale in the sitemap.)

Most of the above should probably have been directed to one of the Cocoon lists, but I'm not on any of them (have been, but too much irrelevant traffic for me). Both of the requests above should be easy to implement, though, so perhaps some of the Forrest devs have the possiblitity to do it?

Best regards,
Sjur