cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Egolf <geg...@bju.edu>
Subject Re: Recursive resources...
Date Fri, 13 Feb 2004 20:37:07 GMT
I may be misunderstanding what the ResourceExistsSelector does, but I 
don't think it will work.  I need something that will look in an 
arbitrary number of parent directories.  I guess I wasn't very clear on 
that.

Let's say that I have a directory structure with 4 levels of 
subdirectories.  If I make a request for "foo.xml" in the 4th level but 
there's not one in that directory.  I want the 
resource/selector/whatever to travel up the directory tree looking in 
each parent directory for the file.  There will always be one in the 
root, but I want the one closest to the requested file's depth.

Thanks,
Gabe

Geoff Howard wrote:

> Sounds like the resource exists selector would accomplish what you 
> want without recursion: 
> http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsSelector
>
> Does that work for you?
>
> Geoff
>
> Gabriel Egolf wrote:
>
>> Hi all,
>>
>> I have what I hope is a simple question.  Is it possible to create a 
>> resource that calls itself?  Here's an example of what I'm thinking.
>>
>> <map:resource name="foo">
>>  <map:act type="resource-exists">
>>    <map:parameter name="src" value="{../path}/foo.xml"/>
>>    <map:generate src="{../path}/foo.xml"/>
>>    <map:serialize type="xml"/>
>>  </map:act>
>>  <map:call resource="foo">
>>    <map:parameter name="path" value="{path}/../"/>
>>  </map:call>
>> </map:resource>
>> ..
>> <map:match pattern="**/foo.xml">
>>  <map:call resource="navigation">
>>    <map:parameter name="path" value="{1}"/>
>>  </map:call>
>> </map:match>
>>
>> What I'm hoping to accomplish is to look for a file "foo.xml" in a 
>> given directory passed as the parameter "path".  If the file exists, 
>> generate it.  If the file doesn't exist, look in the parent directory 
>> for it.
>>
>> So far, I haven't had any luck with this.  Instead of calling the 
>> resource again, I'm getting a 404 - Resource Not Found page.  Yes, 
>> the file does exist in the parent directory.  :)
>>
>> I appreciate any and all help with this.
>>
>> Gabriel Egolf
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>> .
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message