You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by "Dr. Bhatia Praveen" <pr...@sumpurn.com> on 2009/04/07 09:25:14 UTC

How to do common pipelines?

Hello,
   Would like to use a pipeline, p,  which is commonly used by other 
pipelines, p1, p2, p3.

   How could one achieve in p1, a call to common pipeline p, and then 
continue the processing into pipeline.
 (It sounds more like a functional call. In function parlance, it is 
equivalent to a function calling another function within itself and 
continuing forward after the function returns).

Thanks 


Re: How to do common pipelines?

Posted by "Dr. Bhatia Praveen" <pr...@sumpurn.com>.
Thanks David and Ross.
I could make the pipelines work. It works great!

For others, like me, here is a simplified explanation.

For making a common pipeline PipeP define:
<map:resource name="PipeP">
  .... put your pipeline here....
</map:resource>

In the pipeline P1 or P2 or P3 then you can call:

<map:call name="PipeP"/>

anywhere in between

and it will execute the common pipline PipeP.

Good feature !

Praveen

----- Original Message ----- 
From: "David Crossley" <cr...@apache.org>
To: <us...@forrest.apache.org>
Sent: Thursday, April 09, 2009 11:03 AM
Subject: Re: How to do common pipelines?


> Dr. Bhatia Praveen wrote:
>>
>>   I want to take this example to the next level.
>>   Redirecting the pipeline at the top with map:generate does work.
>>  How to do it in between too?
>
> As Ross said, see the Forrest core sitemaps,
> e.g.
> ]$ cd $FORREST_HOME/main/webapp
> ]$ grep "map:call" *.xmap
> There are many examples of this.
>
> See the documentation about sitemaps
> http://forrest.apache.org/docs/sitemap-explain.html
> and others.
>
> See "map:resource" to define various resources,
> and then "map:call" to use them.
>
> -David
>
>> ... So, from P1 I call pipeline P, transform with
>> mytest.xsl and then how do I call pipeline Q?
>>
>>  I would want something like this :
>> <map:match pattern="**P1.xml">
>> <map:generate src="cocoon:/P.xml"/>
>> <map:transform src="mytest.xsl"/>
>> <map:transform src="cocoon:/Q.xml"/>
>> <map:serialize type="xml"/>
>> </map:match>
>>
>> <map:match pattern="Q.xml">
>>   <map:generate src="test.xml"/>
>>   <map:transform src="test2.xsl"/>
>>   <map:serialize type="xml"/>
>> </map:match>
>>
>>  If this can be made to work, I do not have to repeat code for piplines P
>> and Q and all the other piplines which need slightly modiefied transforms
>> but for P and Q's portion itself.
>


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.42/2042 - Release Date: 04/05/09 
10:54:00


Re: How to do common pipelines?

Posted by David Crossley <cr...@apache.org>.
Dr. Bhatia Praveen wrote:
>
>   I want to take this example to the next level.
>   Redirecting the pipeline at the top with map:generate does work.
>  How to do it in between too?

As Ross said, see the Forrest core sitemaps,
e.g.
]$ cd $FORREST_HOME/main/webapp
]$ grep "map:call" *.xmap
There are many examples of this.

See the documentation about sitemaps
http://forrest.apache.org/docs/sitemap-explain.html
and others.

See "map:resource" to define various resources,
and then "map:call" to use them.

-David

> ... So, from P1 I call pipeline P, transform with 
> mytest.xsl and then how do I call pipeline Q?
> 
>  I would want something like this :
> <map:match pattern="**P1.xml">
> <map:generate src="cocoon:/P.xml"/>
> <map:transform src="mytest.xsl"/>
> <map:transform src="cocoon:/Q.xml"/>
> <map:serialize type="xml"/>
> </map:match>
> 
> <map:match pattern="Q.xml">
>   <map:generate src="test.xml"/>
>   <map:transform src="test2.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
> 
>  If this can be made to work, I do not have to repeat code for piplines P 
> and Q and all the other piplines which need slightly modiefied transforms 
> but for P and Q's portion itself.

Re: How to do common pipelines?

Posted by "Dr. Bhatia Praveen" <pr...@sumpurn.com>.
Ross,
   I want to take this example to the next level.
   Redirecting the pipeline at the top with map:generate does work.
  How to do it in between too? So, from P1 I call pipeline P, transform with 
mytest.xsl and then how do I call pipeline Q?

  I would want something like this :
 <map:match pattern="**P1.xml">
 <map:generate src="cocoon:/P.xml"/>
 <map:transform src="mytest.xsl"/>
 <map:transform src="cocoon:/Q.xml"/>
 <map:serialize type="xml"/>
 </map:match>

 <map:match pattern="Q.xml">
   <map:generate src="test.xml"/>
   <map:transform src="test2.xsl"/>
   <map:serialize type="xml"/>
 </map:match>

  If this can be made to work, I do not have to repeat code for piplines P 
and Q and all the other piplines which need slightly modiefied transforms 
but for P and Q's portion itself.

----- Original Message ----- 
From: "Ross Gardler" <rg...@apache.org>
To: <us...@forrest.apache.org>; "Dr. Bhatia Praveen" 
<pr...@sumpurn.com>
Sent: Wednesday, April 08, 2009 4:17 PM
Subject: Re: How to do common pipelines?


2009/4/8 Dr. Bhatia Praveen <pr...@sumpurn.com>:
> Thanks. It does work.
> For others, like me :) , here is simple example that I could make work:

You are welcome - thanks for following up - very handy for others.

Ross

>
> <map:match pattern="**P1.xml">
> <map:generate src="cocoon:/P.xml"/>
> <map:serialize type="xml"/>
> </map:match>
>
> This example would call the P pipeline from P1 pipeline.
>
> thanks
> Praveen
>
> ----- Original Message ----- From: "Ross Gardler" <rg...@apache.org>
> To: <us...@forrest.apache.org>; "Dr. Bhatia Praveen"
> <pr...@sumpurn.com>
> Sent: Tuesday, April 07, 2009 8:00 PM
> Subject: Re: How to do common pipelines?
>
>
> 2009/4/7 Dr. Bhatia Praveen <pr...@sumpurn.com>:
>>
>> Hello,
>> Would like to use a pipeline, p, which is commonly used by other
>> pipelines, p1, p2, p3.
>>
>> How could one achieve in p1, a call to common pipeline p, and then
>> continue
>> the processing into pipeline.
>> (It sounds more like a functional call. In function parlance, it is
>> equivalent to a function calling another function within itself and
>> continuing forward after the function returns).
>
> Use the "cocoon:" protocol. See the forrest sitemaps for loads of
> exampls, e.g.
> http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/forrest.xmap
>
> Ross
>
>
>
> --
> Ross Gardler
>
> OSS Watch - supporting open source in education and research
> http://www.oss-watch.ac.uk
>
>
>
> --------------------------------------------------------------------------------
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.238 / Virus Database: 270.11.42/2042 - Release Date: 04/05/09
> 10:54:00
>
>



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk



--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.42/2042 - Release Date: 04/05/09 
10:54:00


Re: How to do common pipelines?

Posted by Ross Gardler <rg...@apache.org>.
2009/4/8 Dr. Bhatia Praveen <pr...@sumpurn.com>:
> Thanks. It does work.
> For others, like me :) ,  here is simple example that I could make work:

You are welcome - thanks for following up - very handy for others.

Ross

>
> <map:match pattern="**P1.xml">
> <map:generate src="cocoon:/P.xml"/>
>  <map:serialize type="xml"/>
> </map:match>
>
> This example would call the P pipeline from P1 pipeline.
>
> thanks
> Praveen
>
> ----- Original Message ----- From: "Ross Gardler" <rg...@apache.org>
> To: <us...@forrest.apache.org>; "Dr. Bhatia Praveen"
> <pr...@sumpurn.com>
> Sent: Tuesday, April 07, 2009 8:00 PM
> Subject: Re: How to do common pipelines?
>
>
> 2009/4/7 Dr. Bhatia Praveen <pr...@sumpurn.com>:
>>
>> Hello,
>> Would like to use a pipeline, p, which is commonly used by other
>> pipelines, p1, p2, p3.
>>
>> How could one achieve in p1, a call to common pipeline p, and then
>> continue
>> the processing into pipeline.
>> (It sounds more like a functional call. In function parlance, it is
>> equivalent to a function calling another function within itself and
>> continuing forward after the function returns).
>
> Use the "cocoon:" protocol. See the forrest sitemaps for loads of
> exampls, e.g.
> http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/forrest.xmap
>
> Ross
>
>
>
> --
> Ross Gardler
>
> OSS Watch - supporting open source in education and research
> http://www.oss-watch.ac.uk
>
>
>
> --------------------------------------------------------------------------------
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.238 / Virus Database: 270.11.42/2042 - Release Date: 04/05/09
> 10:54:00
>
>



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk

Re: How to do common pipelines?

Posted by "Dr. Bhatia Praveen" <pr...@sumpurn.com>.
Thanks. It does work.
For others, like me :) ,  here is simple example that I could make work:

 <map:match pattern="**P1.xml">
 <map:generate src="cocoon:/P.xml"/>
  <map:serialize type="xml"/>
 </map:match>

This example would call the P pipeline from P1 pipeline.

thanks
Praveen

----- Original Message ----- 
From: "Ross Gardler" <rg...@apache.org>
To: <us...@forrest.apache.org>; "Dr. Bhatia Praveen" 
<pr...@sumpurn.com>
Sent: Tuesday, April 07, 2009 8:00 PM
Subject: Re: How to do common pipelines?


2009/4/7 Dr. Bhatia Praveen <pr...@sumpurn.com>:
> Hello,
> Would like to use a pipeline, p, which is commonly used by other
> pipelines, p1, p2, p3.
>
> How could one achieve in p1, a call to common pipeline p, and then 
> continue
> the processing into pipeline.
> (It sounds more like a functional call. In function parlance, it is
> equivalent to a function calling another function within itself and
> continuing forward after the function returns).

Use the "cocoon:" protocol. See the forrest sitemaps for loads of
exampls, e.g. 
http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/forrest.xmap

Ross



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk



--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.42/2042 - Release Date: 04/05/09 
10:54:00


Re: How to do common pipelines?

Posted by Ross Gardler <rg...@apache.org>.
2009/4/7 Dr. Bhatia Praveen <pr...@sumpurn.com>:
> Hello,
>  Would like to use a pipeline, p,  which is commonly used by other
> pipelines, p1, p2, p3.
>
>  How could one achieve in p1, a call to common pipeline p, and then continue
> the processing into pipeline.
> (It sounds more like a functional call. In function parlance, it is
> equivalent to a function calling another function within itself and
> continuing forward after the function returns).

Use the "cocoon:" protocol. See the forrest sitemaps for loads of
exampls, e.g. http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/forrest.xmap

Ross



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk