You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ali Mahdoui <ma...@hotmail.de> on 2010/06/10 11:19:50 UTC
Aggregated Transformer
Hi,
The answer to my question is sure simple but i dont find out how i ca do it.
i am writing a cocoon block that has three sax transformers which should be always called after each other.
I there a possibility to aggregate these transformers in only one? this will make the usage of my block with other cocoon blocks much easier.
Thank you for any advice!
Ali
_________________________________________________________________
http://redirect.gimas.net/?n=M1006xWMAkt2
Gewinnen Sie eins von drei tollen WM-Hotmail-Fan-Paketen!
RE: Aggregated Transformer
Posted by Ali Mahdoui <ma...@hotmail.de>.
That is exactly what i nedd thanks!!!!
Ali
> Subject: RE: Aggregated Transformer
> Date: Fri, 11 Jun 2010 09:19:31 +0200
> From: robby.pelssers@ciber.com
> To: users@cocoon.apache.org
>
> With Cocoon 2.2 (http://cocoon.apache.org/2.2/1291_1_1.html)
> you can actually create a transformer service which could look something like:
>
>
> If the snippet below would be your transformer service
>
> <?xml version="1.0" encoding="UTF-8"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="chainedTransformer-service">
> <map:generate src="service-consumer:"/>
> <map:transform type="myTransformer1"/>
> <map:transform type="myTransformer2"/>
> <map:transform type="myTransformer3"/>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
>
>
> And this would be the block calling the service:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="callingTransformationService">
> <map:generate src="demo/welcome.xml"/>
> <map:transform type="servletService">
> <map:parameter name="service"
> value="servlet:myBlock2:/chainedTransformer-service"/>
> </map:transform>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
>
>
>
> Is that more or less what you are trying to accomplish?
>
> Kind regards,
> Robby Pelssers
>
>
>
>
> -----Original Message-----
> From: Robby Pelssers [mailto:robby.pelssers@ciber.com]
> Sent: Friday, June 11, 2010 9:13 AM
> To: users@cocoon.apache.org; lmorandini@ieee.org
> Subject: RE: Aggregated Transformer
>
> Is it not possible to define a resource which includes these 3 transformers?
>
> http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html
>
>
> <map:resources>
> <map:resource name="chainedTransformer">
> <map:transform type="myTransformer1"/>
> <map:transform type="myTransformer2"/>
> <map:transform type="myTransformer3"/>
> </map:resource>
> </map:resources>
>
>
> And just call this chainedTransformer?
>
> Robby
>
> -----Original Message-----
> From: Luca Morandini [mailto:lmorandini@ieee.org]
> Sent: Friday, June 11, 2010 1:36 AM
> To: users@cocoon.apache.org
> Subject: Re: Aggregated Transformer
>
> On 10/06/10 11:19, Ali Mahdoui wrote:
> > Hi,
> > The answer to my question is sure simple but i dont find out how i ca do it.
> > i am writing a cocoon block that has three sax transformers which should
> > be always called after each other.
> > I there a possibility to aggregate these transformers in only one? this
> > will make the usage of my block with other cocoon blocks much easier.
>
> Not sure I understood this.
>
> If you put this transformation stages in a pipeline, then the pipeline contents
> are hidden from calling blocks... how having only one transformation stage can
> ease the usage ?
>
> Regards,
>
> --------------------
> Luca Morandini
> www.lucamorandini.it
> --------------------
>
>
> ---------------------------------------------------------------------
> 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
>
_________________________________________________________________
http://redirect.gimas.net/?n=M1006xHMTL4
Künftig E-Mails über Hotmail ohne Werbung versenden!
RE: Aggregated Transformer
Posted by Robby Pelssers <ro...@ciber.com>.
With Cocoon 2.2 (http://cocoon.apache.org/2.2/1291_1_1.html)
you can actually create a transformer service which could look something like:
If the snippet below would be your transformer service
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:match pattern="chainedTransformer-service">
<map:generate src="service-consumer:"/>
<map:transform type="myTransformer1"/>
<map:transform type="myTransformer2"/>
<map:transform type="myTransformer3"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
And this would be the block calling the service:
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:match pattern="callingTransformationService">
<map:generate src="demo/welcome.xml"/>
<map:transform type="servletService">
<map:parameter name="service"
value="servlet:myBlock2:/chainedTransformer-service"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
Is that more or less what you are trying to accomplish?
Kind regards,
Robby Pelssers
-----Original Message-----
From: Robby Pelssers [mailto:robby.pelssers@ciber.com]
Sent: Friday, June 11, 2010 9:13 AM
To: users@cocoon.apache.org; lmorandini@ieee.org
Subject: RE: Aggregated Transformer
Is it not possible to define a resource which includes these 3 transformers?
http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html
<map:resources>
<map:resource name="chainedTransformer">
<map:transform type="myTransformer1"/>
<map:transform type="myTransformer2"/>
<map:transform type="myTransformer3"/>
</map:resource>
</map:resources>
And just call this chainedTransformer?
Robby
-----Original Message-----
From: Luca Morandini [mailto:lmorandini@ieee.org]
Sent: Friday, June 11, 2010 1:36 AM
To: users@cocoon.apache.org
Subject: Re: Aggregated Transformer
On 10/06/10 11:19, Ali Mahdoui wrote:
> Hi,
> The answer to my question is sure simple but i dont find out how i ca do it.
> i am writing a cocoon block that has three sax transformers which should
> be always called after each other.
> I there a possibility to aggregate these transformers in only one? this
> will make the usage of my block with other cocoon blocks much easier.
Not sure I understood this.
If you put this transformation stages in a pipeline, then the pipeline contents
are hidden from calling blocks... how having only one transformation stage can
ease the usage ?
Regards,
--------------------
Luca Morandini
www.lucamorandini.it
--------------------
---------------------------------------------------------------------
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: Aggregated Transformer
Posted by Luca Morandini <lm...@ieee.org>.
On 11/06/10 09:12, Robby Pelssers wrote:
> Is it not possible to define a resource which includes these 3 transformers?
>
> http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html
>
> <map:resources>
> <map:resource name="chainedTransformer">
> <map:transform type="myTransformer1"/>
> <map:transform type="myTransformer2"/>
> <map:transform type="myTransformer3"/>
> </map:resource>
> </map:resources>
>
> And just call this chainedTransformer?
That was my initial idea too ;)
But resources are useful to reduce redundancy in case of repeated pipeline
fragments to call from many pipelines. Ali's problem seems different: he wants
something to ease the call from *other blocks*... hence my perplexity,
Ali, do you mind sharing the relevant pipeline fragments ?
Regards,
P.S.
By the way, I never tried calling resources from blocks other than the one
defining it.
--------------------
Luca Morandini
www.lucamorandini.it
--------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Aggregated Transformer
Posted by Robby Pelssers <ro...@ciber.com>.
Is it not possible to define a resource which includes these 3 transformers?
http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html
<map:resources>
<map:resource name="chainedTransformer">
<map:transform type="myTransformer1"/>
<map:transform type="myTransformer2"/>
<map:transform type="myTransformer3"/>
</map:resource>
</map:resources>
And just call this chainedTransformer?
Robby
-----Original Message-----
From: Luca Morandini [mailto:lmorandini@ieee.org]
Sent: Friday, June 11, 2010 1:36 AM
To: users@cocoon.apache.org
Subject: Re: Aggregated Transformer
On 10/06/10 11:19, Ali Mahdoui wrote:
> Hi,
> The answer to my question is sure simple but i dont find out how i ca do it.
> i am writing a cocoon block that has three sax transformers which should
> be always called after each other.
> I there a possibility to aggregate these transformers in only one? this
> will make the usage of my block with other cocoon blocks much easier.
Not sure I understood this.
If you put this transformation stages in a pipeline, then the pipeline contents
are hidden from calling blocks... how having only one transformation stage can
ease the usage ?
Regards,
--------------------
Luca Morandini
www.lucamorandini.it
--------------------
---------------------------------------------------------------------
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: Aggregated Transformer
Posted by Luca Morandini <lm...@ieee.org>.
On 10/06/10 11:19, Ali Mahdoui wrote:
> Hi,
> The answer to my question is sure simple but i dont find out how i ca do it.
> i am writing a cocoon block that has three sax transformers which should
> be always called after each other.
> I there a possibility to aggregate these transformers in only one? this
> will make the usage of my block with other cocoon blocks much easier.
Not sure I understood this.
If you put this transformation stages in a pipeline, then the pipeline contents
are hidden from calling blocks... how having only one transformation stage can
ease the usage ?
Regards,
--------------------
Luca Morandini
www.lucamorandini.it
--------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org