You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2003/09/05 10:26:23 UTC

Easy way to transformer parameters into a pipeline ??

Hi,
I'd like to transfer parameters some parameters from components to another 
into the same pipeline ?

For example :
<map:pipeline>
<map:match ....>
   <map:generator .../>
   <map:transformer .../>
   <map:transformer .../>
   <map:serializer .../>
</map:match>
</map:pipeline>


I need that because in the first one, I 'll create some parameter that I 
need to use next.
The session does not work because the component are launch in parallel.


If you have some idea with several pipeline or any great idea are welcome!!!

Thanks in advance.
Lionel



Lionel CRINE
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: Easy way to transformer parameters into a pipeline ??

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 05.Sep.2003 -- 03:30 PM, Reinhard Poetz wrote:
> > From: Lionel Crine [mailto:crine@4dconcept.fr] 
> > Sent: Friday, September 05, 2003 1:33 PM
> > To: users@cocoon.apache.org
> > Subject: RE: Easy way to transformer parameters into a pipeline ??
> > 
> > 
> > At 10:54 05/09/2003 +0200, you wrote:
> > >Do you have two different pipelines and you want to exchange 
> > parameters 
> > >or do you have one pipeline and you want to pass *within* it?
> > 
> > The second case is the most important. (on pipeline).
> > 
> > 
> > I supposed that in the second case I can use <map:file></map:file>
> > 
> > 
> > So any idea ?
> > 
> I would use the request object:
> 
>  request.setAttribute( "attrName", object );

Passing parameters down the pipe out-of-band (IOW by not adding a tag
that travels down the pipe in-band like the rest of the data) is a
dangerous thing as you have no idea about the actual
schedule. Usually, a SAX event callback is completely propagated down
the pipe before the next callback is invoked. However, by using
buffers one pipeline stage may complete before the next is started.

So, you can use request attributes (or session attributes, an external
file, ...) to pass parameters out-of-band, provided it is not needed
for the following stage any earlier than the tag that causes the
parameter to be set.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: Easy way to transformer parameters into a pipeline ??

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 05.Sep.2003 -- 04:54 PM, Lionel Crine wrote:
> 
>  wrote:
> >Passing parameters down the pipe out-of-band (IOW by not adding a tag
> >that travels down the pipe in-band like the rest of the data) is a
> >dangerous thing as you have no idea about the actual
> >schedule. Usually, a SAX event callback is completely propagated down
> >the pipe before the next callback is invoked. However, by using
> >buffers one pipeline stage may complete before the next is started.
>
> I have a general idea of what you're talking about.
> Can you be more precise. How can I bufferize the stages ?

For one, Cocoon does it for you through the caching system. It can be
tuned in various way, still a component that issues data out-of-band
must not implement cachable for example.

Another opportunity to buffer the transformation is when debugging
your pipelines and write the result of a stage to a file....

> >So, you can use request attributes (or session attributes, an external
> >file, ...) to pass parameters out-of-band, provided it is not needed
> >for the following stage any earlier than the tag that causes the
> >parameter to be set.
> 
> I didn't understand that.

naïve, but wrong:

 time     stage n      stage n+1
  0        <foo>
  1        <bar>
  2        </bar>
  3        </foo>------------------------sets parameter
  4                     <foo>------------needs parameter
  5                     <bar>
  6                     </bar>
  7                     </foo>

actual schedule:

 time     stage n      stage n+i

  0        <foo>
  1                     <foo>------------needs parameter, which parameter??
  2        <bar>
  3                     <bar>
  4        </bar>
  5                     </bar>
  6        </foo>------------------------sets parameter
  7                     </foo>

HTH

	Chris.

PS It would be nice if you could reply below the original message. It
makes it so much easier to follow an argument because you can just
read top to bottom.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: Easy way to transformer parameters into a pipeline ??

Posted by Lionel Crine <cr...@4dconcept.fr>.
I have a general idea of what you're talking about.
Can you be more precise. How can I bufferize the stages ?


 > >provided it is not needed
 > >for the following stage any earlier than the tag that causes the
 > >parameter to be set.

I didn't understand that.



  wrote:
>On 05.Sep.2003 -- 03:30 PM, Reinhard Poetz wrote:
> > > From: Lionel Crine [mailto:crine@4dconcept.fr]
> > > Sent: Friday, September 05, 2003 1:33 PM
> > > To: users@cocoon.apache.org
> > > Subject: RE: Easy way to transformer parameters into a pipeline ??
> > >
> > >
> > > At 10:54 05/09/2003 +0200, you wrote:
> > > >Do you have two different pipelines and you want to exchange
> > > parameters
> > > >or do you have one pipeline and you want to pass *within* it?
> > >
> > > The second case is the most important. (on pipeline).
> > >
> > >
> > > I supposed that in the second case I can use <map:file></map:file>
> > >
> > >
> > > So any idea ?
> > >
> > I would use the request object:
> >
> >  request.setAttribute( "attrName", object );
>
>Passing parameters down the pipe out-of-band (IOW by not adding a tag
>that travels down the pipe in-band like the rest of the data) is a
>dangerous thing as you have no idea about the actual
>schedule. Usually, a SAX event callback is completely propagated down
>the pipe before the next callback is invoked. However, by using
>buffers one pipeline stage may complete before the next is started.
>
>So, you can use request attributes (or session attributes, an external
>file, ...) to pass parameters out-of-band, provided it is not needed
>for the following stage any earlier than the tag that causes the
>parameter to be set.
>
>         Chris.
>--
>C h r i s t i a n       H a u l
>haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
>---------------------------------------------------------------------
>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


RE: Easy way to transformer parameters into a pipeline ??

Posted by Reinhard Poetz <re...@apache.org>.
I would use the request object:

 request.setAttribute( "attrName", object );

Reinhard

> -----Original Message-----
> From: Lionel Crine [mailto:crine@4dconcept.fr] 
> Sent: Friday, September 05, 2003 1:33 PM
> To: users@cocoon.apache.org
> Subject: RE: Easy way to transformer parameters into a pipeline ??
> 
> 
> At 10:54 05/09/2003 +0200, you wrote:
> >Do you have two different pipelines and you want to exchange 
> parameters 
> >or do you have one pipeline and you want to pass *within* it?
> 
> The second case is the most important. (on pipeline).
> 
> 
> I supposed that in the second case I can use <map:file></map:file>
> 
> 
> So any idea ?
> 
> 
> 
> >Reinhard
> >
> > > -----Original Message-----
> > > From: Lionel Crine [mailto:crine@4dconcept.fr]
> > > Sent: Friday, September 05, 2003 10:26 AM
> > > To: users@cocoon.apache.org
> > > Subject: Easy way to transformer parameters into a pipeline ??
> > >
> > >
> > > Hi,
> > > I'd like to transfer parameters some parameters from 
> components to 
> > > another into the same pipeline ?
> > >
> > > For example :
> > > <map:pipeline>
> > > <map:match ....>
> > >    <map:generator .../>
> > >    <map:transformer .../>
> > >    <map:transformer .../>
> > >    <map:serializer .../>
> > > </map:match>
> > > </map:pipeline>
> > >
> > >
> > > I need that because in the first one, I 'll create some parameter 
> > > that I need to use next.
> > > The session does not work because the component are launch in
> > > parallel.
> > >
> > >
> > > If you have some idea with several pipeline or any great idea are 
> > > welcome!!!
> > >
> > > Thanks in advance.
> > > Lionel
> > >
> > >
> > >
> > > Lionel CRINE
> > > Société : 4DConcept
> > > 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> > > Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > 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
> 


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


RE: Easy way to transformer parameters into a pipeline ??

Posted by Lionel Crine <cr...@4dconcept.fr>.
At 10:54 05/09/2003 +0200, you wrote:
>Do you have two different pipelines and you want to exchange parameters
>or do you have one pipeline and you want to pass *within* it?

The second case is the most important. (on pipeline).


I supposed that in the second case I can use <map:file></map:file>


So any idea ?



>Reinhard
>
> > -----Original Message-----
> > From: Lionel Crine [mailto:crine@4dconcept.fr]
> > Sent: Friday, September 05, 2003 10:26 AM
> > To: users@cocoon.apache.org
> > Subject: Easy way to transformer parameters into a pipeline ??
> >
> >
> > Hi,
> > I'd like to transfer parameters some parameters from
> > components to another
> > into the same pipeline ?
> >
> > For example :
> > <map:pipeline>
> > <map:match ....>
> >    <map:generator .../>
> >    <map:transformer .../>
> >    <map:transformer .../>
> >    <map:serializer .../>
> > </map:match>
> > </map:pipeline>
> >
> >
> > I need that because in the first one, I 'll create some
> > parameter that I
> > need to use next.
> > The session does not work because the component are launch in
> > parallel.
> >
> >
> > If you have some idea with several pipeline or any great idea
> > are welcome!!!
> >
> > Thanks in advance.
> > Lionel
> >
> >
> >
> > Lionel CRINE
> > Société : 4DConcept
> > 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> > Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> >
> >
> > ---------------------------------------------------------------------
> > 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


RE: Easy way to transformer parameters into a pipeline ??

Posted by Reinhard Poetz <re...@apache.org>.
Do you have two different pipelines and you want to exchange parameters
or do you have one pipeline and you want to pass *within* it?

Reinhard

> -----Original Message-----
> From: Lionel Crine [mailto:crine@4dconcept.fr] 
> Sent: Friday, September 05, 2003 10:26 AM
> To: users@cocoon.apache.org
> Subject: Easy way to transformer parameters into a pipeline ??
> 
> 
> Hi,
> I'd like to transfer parameters some parameters from 
> components to another 
> into the same pipeline ?
> 
> For example :
> <map:pipeline>
> <map:match ....>
>    <map:generator .../>
>    <map:transformer .../>
>    <map:transformer .../>
>    <map:serializer .../>
> </map:match>
> </map:pipeline>
> 
> 
> I need that because in the first one, I 'll create some 
> parameter that I 
> need to use next.
> The session does not work because the component are launch in 
> parallel.
> 
> 
> If you have some idea with several pipeline or any great idea 
> are welcome!!!
> 
> Thanks in advance.
> Lionel
> 
> 
> 
> Lionel CRINE
> Société : 4DConcept
> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> 
> 
> ---------------------------------------------------------------------
> 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