You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robby Pelssers <ro...@ciber.nl> on 2009/05/11 14:42:53 UTC
cocoon 3 sample: remark about usage of servlet-service demo
Hi all,
Taking a quick look at the cocoon 3 sample I noticed that the
"transformer-pipeline" and "serializer-pipeline" are sort of the same
except for myParam which get's another value.
I noticed as well that I can't leave out the <map:serialize type="xml"/>
from the transformer-pipeline. Otherwise I get following exception
"java.lang.IllegalStateException: Cannot execute pipeline, last pipeline
component is no finisher".
So is it fair to conclude that every 'transformation servlet service' is
inherent also a 'serializer servlet service'?
And what bugs me a bit is that [1] throws in a free transformer...
"simple.xslt". [2] This makes things a bit confusing in my opinion.
It seems that these servlet-services actually do more then their names
imply.
<map:match pattern="ssf/transformer-pipeline">
<map:generate type="service-consumer" />
<map:transform src="sax-pipeline/simple.xslt">
<map:parameter name="myParam" value="transformer-pipeline" />
</map:transform>
<map:serialize type="xml" />
</map:match>
<map:match pattern="ssf/serializer-pipeline">
<map:generate type="service-consumer" />
<map:transform src="sax-pipeline/simple.xslt"> [2]
<map:parameter name="myParam" value="serializer-pipeline" />
</map:transform>
<map:serialize type="xml" />
</map:match>
<map:match pattern="ssf/calling-a-transformer-servlet-service">
<map:generate src="sax-pipeline/simple.xml" />
<map:transform type="servlet-service">
<map:parameter name="service"
value="servlet:/ssf/transformer-pipeline" />
</map:transform>
<map:serialize type="xml" />
</map:match>
<map:match pattern="ssf/calling-a-serializer-servlet-service">
<map:generate src="sax-pipeline/simple.xml" />
<map:serialize type="servlet-service">
<map:parameter name="service"
value="servlet:/ssf/serializer-pipeline" /> [1]
</map:serialize>
</map:match>
Cheers,
Robby
RE: cocoon 3 sample: remark about usage of servlet-service demo
Posted by Robby Pelssers <ro...@ciber.nl>.
Well,
If I take a look at for instance the servlet-service snippet below which I renamed to "myservice-pipeline"
<map:match pattern="ssf/myservice-pipeline">
<map:generate type="service-consumer" />
<map:transform src="sax-pipeline/simple.xslt"> [2]
<map:parameter name="myParam" value="serializer-pipeline" />
</map:transform>
<map:serialize type="xml" />
</map:match>
It includes an extra transformation step. So it's not really uniquely defined as either a serializer OR transformer service. It can be invoked by
<map:transform type="servlet-service">
<map:parameter name="service" value="servlet:/ssf/myservice-pipeline" />
</map:transform>
OR
<map:serialize type="servlet-service">
<map:parameter name="service" value="servlet:/ssf/myservice-pipeline" />
</map:serialize>
Both invocations of this service would work. That's what I mean with ambiguous names.
Robby
-----Original Message-----
From: Reinhard Pötz [mailto:reinhard@apache.org]
Sent: Monday, May 11, 2009 10:20 PM
To: users@cocoon.apache.org
Subject: Re: cocoon 3 sample: remark about usage of servlet-service demo
Robby Pelssers wrote:
> Hi all,
>
> Taking a quick look at the cocoon 3 sample I noticed that the
> “transformer-pipeline” and “serializer-pipeline” are sort of the same
> except for myParam which get’s another value.
>
> I noticed as well that I can’t leave out the <map:serialize
> type=”xml”/> from the transformer-pipeline. Otherwise I get following
> exception “java.lang.IllegalStateException: Cannot execute pipeline,
> last pipeline component is no finisher”.
>
> So is it fair to conclude that every ‘transformation servlet service’ is
> inherent also a ‘serializer servlet service’?
yes
> And what bugs me a bit is that [1] throws in a /free/ transformer…
> “simple.xslt”. [2] This makes things a bit confusing in my opinion.
> It seems that these servlet-services actually do more then their names
> imply.
sorry, I can't follow you here. What do the names imply in your opinion?
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member reinhard@apache.org
________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cocoon 3 sample: remark about usage of servlet-service demo
Posted by Reinhard Pötz <re...@apache.org>.
Robby Pelssers wrote:
> Hi all,
>
> Taking a quick look at the cocoon 3 sample I noticed that the
> “transformer-pipeline” and “serializer-pipeline” are sort of the same
> except for myParam which get’s another value.
>
> I noticed as well that I can’t leave out the <map:serialize
> type=”xml”/> from the transformer-pipeline. Otherwise I get following
> exception “java.lang.IllegalStateException: Cannot execute pipeline,
> last pipeline component is no finisher”.
>
> So is it fair to conclude that every ‘transformation servlet service’ is
> inherent also a ‘serializer servlet service’?
yes
> And what bugs me a bit is that [1] throws in a /free/ transformer…
> “simple.xslt”. [2] This makes things a bit confusing in my opinion.
> It seems that these servlet-services actually do more then their names
> imply.
sorry, I can't follow you here. What do the names imply in your opinion?
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member reinhard@apache.org
________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cocoon 3 sample: remark about usage of servlet-service demo
Posted by Steven Dolg <st...@indoqa.com>.
Robby Pelssers schrieb:
>
> Hi all,
>
> Taking a quick look at the cocoon 3 sample I noticed that the
> “transformer-pipeline” and “serializer-pipeline” are sort of the same
> except for myParam which get’s another value.
>
> I noticed as well that I can’t leave out the <map:serialize
> type=”xml”/> from the transformer-pipeline. Otherwise I get following
> exception “java.lang.IllegalStateException: Cannot execute pipeline,
> last pipeline component is no finisher”.
>
Yes. Every pipeline needs a Finisher.
Since a call using a servlet-service is no different to a call from a
browser or other client, there are no exceptions for those pipelines.
> So is it fair to conclude that every ‘transformation servlet service’
> is inherent also a ‘serializer servlet service’?
>
> And what bugs me a bit is that [1] throws in a /free/ transformer…
> “simple.xslt”. [2] This makes things a bit confusing in my opinion. It
> seems that these servlet-services actually do more then their names imply.
>
I'm not sure what you mean with "free" transformer.
Actually the transformer is not thrown in by [1] but rather defined at [2].
Because if you remove [2] there will be no transformer but still the
servet-service.
The purpose of servlet-services is to allow to call another servlet.
Either to delegate the processing or retrieve input.
If the other servlet is a Cocoon sitemap servlet as well, it will use
pipelines and those pipeline can use transformers, of course.
The samples contain some amount of duplication to demonstrate the
various approaches that are possible.
We do not necessarily suggest that each and every application should use
everything mentioned there.
>
> <map:match pattern="ssf/transformer-pipeline">
>
> <map:generate type="service-consumer" />
>
> <map:transform src="sax-pipeline/simple.xslt">
>
> <map:parameter name="myParam" value="transformer-pipeline" />
>
> </map:transform>
>
> <map:serialize type="xml" />
>
> </map:match>
>
> <map:match pattern="ssf/serializer-pipeline">
>
> <map:generate type="service-consumer" />
>
> <map:transform src="sax-pipeline/simple.xslt"> [2]
>
> <map:parameter name="myParam" value="serializer-pipeline" />
>
> </map:transform>
>
> <map:serialize type="xml" />
>
> </map:match>
>
> <map:match pattern="ssf/calling-a-transformer-servlet-service">
>
> <map:generate src="sax-pipeline/simple.xml" />
>
> <map:transform type="servlet-service">
>
> <map:parameter name="service" value="servlet:/ssf/transformer-pipeline" />
>
> </map:transform>
>
> <map:serialize type="xml" />
>
> </map:match>
>
> <map:match pattern="ssf/calling-a-serializer-servlet-service">
>
> <map:generate src="sax-pipeline/simple.xml" />
>
> <map:serialize type="servlet-service">
>
> <map:parameter name="service" value="servlet:/ssf/serializer-pipeline"
> /> [1]
>
> </map:serialize>
>
> </map:match>
>
> Cheers,
>
> Robby
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org