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: [email protected]
For additional commands, e-mail: [email protected]