forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: Getting locationmap working
Date Tue, 22 Feb 2005 09:39:22 GMT
Ross Gardler wrote:
> I need the locationmap on a project in a couple of months time. I've 
> tried to get the code in SVN working, but failed as it requires a little 
> more knowledge of Cocoon than I currently have, so a little help please.

I don't know if I have to be happy that you are doing it or sad that you 
are finding problems... ;-)

Let me see if I can be of help, and sorry for the late come-in.

> Here's what I have done (based on 
> ):
> Created a locationmap.xml file which contains the followin link:
> <a 
> href="lm:plugin/org.apache.forrest.plugin.PDF-output/index.html">plugin 
> documentation</a>
> Created a locationmap.xmap file with the following locator (the 
> components section is identical to that in the mail linked to above):
>   <locator base=".">
>     <match pattern="**.html">
>       <match pattern="plugin/**.html">
>         <location src="plugindir/{1}.html" />
>       </match>
>       <location src="{1}.html" />
>     </match>
>   </locator>
> (the location is wrong, I just want to see the link being rewritten at 
> this stage)
> I can retrieve the file with no problem and I know the locationmap is 
> being processed. However, no match is made and so no link rewriting is 
> done. I've looked at what is going on inside the LocationMapModule, it 
> is getting "plugin/org.apache.forrest.plugin.PDF-output/index.html" as 
> the hint, but it is not matching the pattern "**.html". I even made the 
> pattern the same as the hint, but still no match.

A locationmap is a special sitemap. What you need to do is to debug 
inside the locationmap and see what is happening in the <locator> matches.

I know it's a trivial suggestion, but does this work?

    <locator base=".">
      <match pattern="**">
        <location src="plugindir/{1}" />

Nicola Ken Barozzi         
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

View raw message