forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Getting locationmap working
Date Thu, 17 Feb 2005 17:31:32 GMT
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.

Here's what I have done (based on 
http://marc.theaimsgroup.com/?l=forrest-dev&m=106638780801095&w=2 ):



Added the following to forrest-core.xconf:

     <component-instance
       class="org.apache.forrest.locationmap.LocationMapModule"
       logger="core.modules.mapper" name="lm">
       <!-- FIXME: hard coded path - how do we get this from the 
property @project.home@/@project.locationmap@ -->
       <file src="D:\openSource\forrest\docs-author\location.xmap"/>
     </component-instance>



Added "lm" to the schemes element of the linkrewriter config and added 
the locationmapmodule to it:

<map:transformer name="linkrewriter" 
logger="sitemap.transformer.linkrewriter" 
src="org.apache.cocoon.transformation.LinkRewriterTransformer">
         <link-attrs>href src</link-attrs>
         <schemes>site ext lm</schemes>

         <input-module name="lm">
...



Added a test matcher to sitemap.xmap:

<map:match pattern="testingLocationMap/**.xml">
   <map:generate src="{project:content.xdocs}/{1}.xml"/>
   <map:transform type="linkrewriter"/>
   <map:serialize type="xml"/>
</map:match>



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.

Any idea what I am doing wrong?

Ross




Mime
View raw message