Felix Knecht pisze:
Jean-Christophe Kermagoret schrieb:
Thanks for the reply,
I thought it was blockcontext role.
Why using servlet instead ?
Is blockcontext useful anymore in sitemaps ?
I'm not sure, but I think this has changed because blocks-fw is already
deprecated and servlet-service is the new one.
Maybe Grzegorz can give more information about this.
Ah, I didn't notice that blockcontext: source is used in sitemap. It's
important to say that it should be *never* used in sitemap.
Quoting Daniel's mail[1]:
It is also possible to access static resources from a block using the
blockcontext protocol. It is however not the recommended way as a block
is intended to be an isolated unit that only should be accessed through
its "public" API in form of the block protocol. The blockcontext
protocol is more intended for internal use in Cocoon and for setting up
the blockcontext property i the block servlet configuration.
The block protocol mentioned in his comment is now a servlet protocol and it should be used (with servlet connections properly set) in order
to access other blocks' resources. The public API mentioned in the quotation become, then, several sitemap matchers that enable other blocks
to access resources that are meant to be public.
Some background:
Blocks framework was replaced by Servlet Service Framework as a generalization and refinement of original idea. In servlet-service-fw every
block is a ordinal servlet that is registered at certain mount path. Such generalization of block concept enables one to integrate other
solutions[2] very seamlessly with your Cocoon-based application. The added value from Cocoon is that sitemap is very convenient way to
program servlets and servlet-service-fw introduces advanced concepts like blocks (servlets) inheritance and polymorphism.
Hope that helps.
[1] http://article.gmane.org/gmane.text.xml.cocoon.devel/68522
[2] http://thread.gmane.org/gmane.text.xml.cocoon.devel/73908/focus=74083
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/