cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Geindre <sebastien.gein...@meteo.fr>
Subject Re: Pass parameters to a generator
Date Tue, 05 Dec 2006 09:16:53 GMT
Ard Schrijvers wrote:
>> Hi,
>>
>> Is it possible to give parameters to a directory generator ? 
>> and how to ?
>>
>> Imagine, cocoon receive a httprequest with post data,
>> first, we transform the data included in th request
>>
>> <map:generate type="stream">
>> 	<map:parameter name="form-name" value="requestData"/>
>> </map:generate>
>>
>> Then transform it to have better meta-data
>>
>> <map:transform src="stylesheets/request2meta.xsl"/>
>>
>> Then i 'd like to read the content of the directory pointed 
>> by meta-data
>>     
>
> If I understand correctly, you know what parameters to expect in the post? Why do all
the stuff above, if you can use request-param input module? If you have to do much logic with
the parameters, then the easiest way, is to implement your own input module, that just does
all the logic and returns the thing you want: 
>
> <map:parameter type="directory" src="{meta:directory}"/>, and add to cocoon.xconf
a meta input-module that does the trick. Look at other input modules, it is really simple.
>
> Regards Ard
>   
Thanks for your answer.
But is it possible to have 2 generator s in one pipeline ?

<map:generate type="stream">
   <map:parameter name="form-name" value="requestData"/>
</map:generate>
<map:transform src="request2meta.xsl"/>
<map:generate type="directory" src="{meta/validityTime}">
   <map:parameter name="depth" value="2"/>
</map:generate>

I try to be more precise...
First the request hold XML data (requestData POST) contains a date and a 
delay.
the request2meta.xsl compute date+delay=validityTime, it is 
ok.(meta/validityTime)

and then i need to parse the directory named 'dateOf(validityTime)'
in order to get the earliest file in this repository.
>   
>> <map:generate type="directory" src="{meta/directory}">
>>     <map:parameter name="depth" value="2"/>
>> </map:generate>
>>
>> will it work ??
>> how is it possible to 'feed' a generator ?
>>
>> Thanx.
>> Seb
>>
>>
>> ---------------------------------------------------------------------
>> 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