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: Removed xdoc copying (Re: cvs commit: ...)
Date Mon, 13 Oct 2003 09:07:27 GMT
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