forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <>
Subject Re: Help with locationmap
Date Sat, 15 Apr 2006 22:26:24 GMT
Ross Gardler wrote:
> Thorsten Scherler wrote:
>> El sáb, 15-04-2006 a las 11:02 +0100, Ross Gardler escribió:
>>> Thorsten Scherler wrote:
>>>> Yes, you need to match in your project sitemap as well since the
>>>> locationmap is not used by default for resolving.
>>>> Add <map:match pattern="remote/**.xml">
>>>> <map:generate src="lm://remote/**.xml"/> <map:serialize type="xml"/>
>>>> </map:match>
>>> I trust that you have made some changes in the dispatcher then. In 
>>> core pretty much all resources are resolved via the locationmap, 
>>> including xml sources.
>> Did not find the code snippet, can you point me to it?
>> I did not made any changes in the dispatcher regarding this matter.
>> However the request cocoon://remote/bla.xml need to be resolved.
> Forrest.xmap:
> <map:match pattern="**.xml">
>          <map:generate src="{lm:project.{0}}"/>
>          <map:serialize type="xml"/>
> </map:match>
> locationmap.xmap:
> <match pattern="project.**">
>   <location src="{project:content.xdocs}{1}" />
> </match>

I should explain more completely, Maurice has:

<remote label="Test remote stuff" href="remote/" tab="welcome">
       <item label="Ot content..." href="index.html" />

There is no need to add anything to the project sitemap, although 
Thorstens solution will work.

However, since the request for "remote/index.xml" is matched by the 
match in forest.xmap (see above) creating a locationmap that conforms to 
the naming standard makes things easier - less files to modify. In other 
words, the projects locationmap entry should be:

<match pattern="project.remote.index.xml">
    <location src="http://localhost:80/index.xml"/>

or more generally:

<match pattern="project.remote.**.xml">
    <location src="http://localhost:80/{1}.xml"/>

This should be clearly documented in the locationmap docs, which have 
not kept apace with the introduction of the naming convention Tim 
recomended some time ago. (adding this thread to Jira)


View raw message