forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: Removed xdoc copying (Re: cvs commit: ...)
Date Mon, 13 Oct 2003 10:29:32 GMT
Hi Nicola,

Last friday a collegue asked me for almost exactly this! We need it for more powerful semantic
linking than the current modules support. So perhaps we can work together in creating this
thing? Do you already have code somewhere? I'd like to take a look at it. One thing I'd like
to add is a way to configure the module as to whether to do resource exists checking.

Regards, Unico

Nicola Ken Barozzi wrote:
> 
> 
> Jeff Turner wrote:
> 
> > On Sun, Oct 12, 2003 at 05:17:31PM +0200, Nicola Ken Barozzi wrote:
> ...
> >>In my sourcemap proposal, this is exactly what happens. The 
> sourcemap
> >>tells me the real place of the file when I request a 
> virtual place, by
> >>also using resource exists. I'll commit it as soon as it's finished
> >>(still working on the syntax as the current one still sucks).
> > 
> > So how does it happen?  ResourceExists actions, or 
> ResourceExists input
> > modules?
> 
> 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.
> 
> Probably the proposed syntax is still too opaque, maybe this 
> will be a 
> bit clearer. Note that the below snippet is exactly the same 
> I already 
> sent to this list, just with a cleaner syntax.
> 
> <!-- the @default attribute says what default matcher is used to
>       mount, and the @base prefixes all sources.
>       Sources are resolves relative to the sourceconf location -->
> 
>   <sourceconf xmlns:smap="http://apache.org/forrest/sourceconf/1.0"
>               default="wildcard"
>               base=".">
> 
>        <!-- Asked for **.gif, return content/xdocs/{1}.gif -->
>        <mount pattern="**.gif">
>           <location src="content/xdocs/{1}.gif">
>        </mount>
> 
>        <!-- Asked for **.xml, return the first location that 
> exists -->
>        <mount pattern="**.xml">
>           <location src="content/xdocs/{1}.ihtml">
>           <location src="content/xdocs/{1}{2}.txt">
>           <location src="{default}">
>        </mount>
> 
>    </sourceconf >
> 
> When I load this inputmodule I can specify a default 
> sourceconf, so that 
> {default} can explicitly call the default version.
> 
> This had the benefit that users can add mount points easily.
> 
> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>              - verba volant, scripta manent -
>     (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> 
> 
> 

Mime
View raw message