You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bertrand Delacretaz <bd...@codeconsult.ch> on 2002/02/25 14:59:47 UTC

RequestGenerator for "non-data" pipelines (was: read/write DOM Session)

On Monday 25 February 2002 14:26, terracare wrote:
>. . .
> Can you give a typical example of how you might use it for such a
> "non-data" pipeline?

By non-data I meant a pipeline that only uses the request parameters as 
its direct input, for example:

RequestGenerator -> CreateSQL -> SQLTransformer ->. . .

in that case, "CreateSQL" would be an XSLT transform that, based on the 
request parameters, creates suitable XML for SQLTransformer to make a 
database query.

The corresponding sitemap excerpt looks like:

<map:match pattern="sql-query/*.xml">
  <map:generate type="request"/>
  <map:transform src="request-to-sql.xsl"/>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="prodDb"/>
  </map:transform>
   <map:serialize type="xml"/>
</map:match>

Does this help?
-- 
 -- Bertrand Delacrétaz, www.codeconsult.ch
 -- web technologies consultant - OO, Java, XML, C++






---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: RequestGenerator for "non-data" pipelines (was: read/write DOM Session)

Posted by Cédric Damioli <ce...@anyware-tech.com>.
I can add an exemple for "non-data" pipelines, based on the DOM sessions 
I was working on :

<map:match pattern="some_pattern">
  <map:generate type="readDOMGenerator">
    <map:parameter name="some_param" value="some_value"/>
  </map:generate>
  <map:transform .../>
  <map:transform type="writeDOMsession">
    <map:parameter .../>
  </map:transform>
  <map:transform .../> 
  <map:serialize/>
</map:match>

In this typical exemple, your pipeline read current data from session, 
process some stuff, and then save it to session before eventually 
display any result.
The writeDOMsession already exists, as does a readDOMsession which is a 
Transformer able to add the stored data at any point of your current 
pipeline.
I'v also written a very simple readDOMGenerator to be able to begin a 
pipeline with only the stored data.
I've sent this Generator to a Cocoon Committer. He'll decide if it's 
useful or not.

Hope this helps.

Cedric

Bertrand Delacretaz wrote:

>On Monday 25 February 2002 14:26, terracare wrote:
>
>>. . .
>>Can you give a typical example of how you might use it for such a
>>"non-data" pipeline?
>>
>
>By non-data I meant a pipeline that only uses the request parameters as 
>its direct input, for example:
>
>RequestGenerator -> CreateSQL -> SQLTransformer ->. . .
>
>in that case, "CreateSQL" would be an XSLT transform that, based on the 
>request parameters, creates suitable XML for SQLTransformer to make a 
>database query.
>
>The corresponding sitemap excerpt looks like:
>
><map:match pattern="sql-query/*.xml">
>  <map:generate type="request"/>
>  <map:transform src="request-to-sql.xsl"/>
>  <map:transform type="sql">
>    <map:parameter name="use-connection" value="prodDb"/>
>  </map:transform>
>   <map:serialize type="xml"/>
></map:match>
>
>Does this help?
>