Felix Knecht pisze:
Grzegorz Kossakowski schrieb:
Yes, but I was wondering if we couldn't put following pipeline in
samples-style-default's sitemap:
<map:match pattern="service/simple-samples2html">
<map:generate src="servlet-consumer:"/>
<map:transform src="stylesheets/system/xml2html.xslt"/>
<map:transform type="servletLinkRewriter" />
<map:serialize type="html"/>
</map:match>
and for example, in imageop's sitemap instead of:
<map:match pattern="">
<map:generate src="samples.xml"/>
<map:transform
src="servlet:style-default:/common/style/xsl/html/simple-samples2html.xsl"
/>
<map:transform type="servletLinkRewriter" />
<map:serialize/>
</map:match>
we could have:
<map:match pattern="">
<map:generate src="samples.xml"/>
<map:serialize type="servletService">
<map:parameter name="service"
value="servlet:style-default:/service/simple-samples2html"/>
</map:serialize>
</map:match>
I haven't knew this construct of serializer and parameter.
In COCOON-2046 issue[1] you will find references to the threads discussing
whole concept. Here you will find basic samples:
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-sample/src/main/resources/COB-INF/test1/sitemap.xmap
This way, we could use _service_ to style samples and the same way get
more flexibility because we could change the service in one place in
any way we like (e.g. add more transformers if needed).
I wonder if we really need this, and if it's a Flexibility Syndrome.
It's true, we would have more flexibility, but is it still
understandable for common users? The more flexibility we get the more
complex a part of the pipeline will be to read. Do we really want to
'misuse' the serializer as a kind of merged thing of transformer and
serializer in one?
Whole concept of postable source and servlet service is exactly about this: I call the service that styles samples and returns html but I
don't care how it's done.
I don't think that this is much harder to understand than what you do now.
Even if we'd get more flexibility I prefer the current way.
As I previously said, I'm not sure if we need this either, so I won't push you
to use services.
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/