forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Javascript file processing...
Date Wed, 04 Jan 2006 23:58:37 GMT
CFAS Webmaster wrote:
> Hmm...
> 
> David Crossley wrote:

...

>> You can see that default match at main/webapp/resources.xmap
>> line 153 ...
>> <!-- @deprecated -->
>> <map:match pattern="**.js">
>> <map:read src="resources/scripts/{1}.js" 
>> mime-type="application/x-javascript" />
>> </map:match>
>>
>> I wonder if we should change that so that it first
>> looked in sub-directories and then looked at the
>> top-level of resources/scripts/
>>  
>>
> That would be nice for me, but is it the "right" thing to do for the 
> general case?

In 0.8-dev this should be replaced by a locationmap match. There is no 
problem adding additional locations either in Forrest core where 
relevant or an overrided value in the projects own locationmap.

>> Otherwise Paul, as always you can over-ride any
>> match as Ross describes below.
>>  
>>
> I'd take you up on that, but it doesn't work.  I think I've found the 
> "right place" for it, but it doesn't change the behavior.
> 
> ...
> <map:pipelines>
>  <map:pipeline>
> ...
>    <map:match pattern="dues.js">
>      <map:read src="{project:content}/Committees/dues.js" 
> mime-type="text/plain"/>
>    </map:match>
>  </map:pipeline>
> </map:pipelines>
> 
> If map:match pattern... is placed almost anywhere else in the file it 
> doesn't validate.  No matter where it's placed, it doesn't change the 
> behavior of Cocoon.  :(

You don't say which file you are placing this in. It should be in your 
project sitemap.xmap file, inside the pipelines element. See 
http://forrest.apache.org/docs_0_80/project-sitemap.html which has links 
to further docs.

If that is where you are putting it then be aware of Davids observation 
that if your request is relative you will need to accomodate for that 
(the above match is an absolute match):

<map:match pattern="**/dues.js">

Ross

Mime
View raw message