forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: SourceConf (Re: Removed xdoc copying)
Date Mon, 13 Oct 2003 16:47:49 GMT
Jeff Turner wrote:

> On Mon, Oct 13, 2003 at 11:07:27AM +0200, Nicola Ken Barozzi wrote:
...
>>The sourcemap is a descriptor for an inputmodule. This inputmodule gets 
>>a "virtual" source location and resolves the real location.
>>
>>So from the sitemap, what it sees is just an inputmodule that gives it 
>>the real source to use.
> 
> So taking images as an example, which may be in
> src/documentation/resources/images or
> $FORREST/context/resources/images.
> 
> What does the resources.xmap entry look like?  It is currently:
> 
> <map:match pattern="images/**.*">
>     <map:read src="resources/images/{1}.{2}" mime-type="image/{2}" />
> </map:match>
> 
> Perhaps:
> 
> <map:match pattern="images/**.*">
>     <map:read src="{images:{1}.{2}}" mime-type="image/{2}" />
> </map:match>

<map:match pattern="images/**.*">
     <map:read src="{locationmap:content}" mime-type="image/{2}" />
</map:match>

"content" is a <matches> section for the content. I would add a "raw" 
section and a "skin" section.

> which requires nesting variable resolution?

The resolved pattern is available as:

   uri = ObjectModelHelper.getRequest(objectModel).getSitemapURI();

So in my locationmap I enter with the requested url and exit with the 
source that has to be used for the URL. In this way I am able to cleanly 
move all url resolving out of the sitemap.

What would be really nice is also a mimetype: inputmodule:

<map:match pattern="images/**.*">
     <map:read src="{locationmap:content}" mime-type="{mimetype:}" />
</map:match>

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Mime
View raw message