cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
Subject [2.2] Servlet service: polymorphism and connections
Date Fri, 20 Feb 2009 16:26:43 GMT
Hi Cocoon devs,

I wonder if the servlet service framework can be used to implement the 
following scenario:

There is an "abstract" block called "document-type" (think of a document 
type for a CMS, actually it's about Lenya). This block declares (in the 
sense of a convention) particular services, without actually 
implementing them, e.g.

   /services/schema.rng (provide Relax NG schema for validation)

Other generic blocks operate on arbitrary document types. E.g., the 
"editor" block could invoke a validation step before a document is 
saved. Now I imagine something like this in the editor block sitemap:

   <!-- {1} is the block name of the actual document type -->
   <map:match pattern="schema/{*}">
     <map:read src="servlet:{1}:/services/schema.rng"/>
   </map:match>

I guess this works if the block servlet declaration of the editor block 
contains connections to all actual document type blocks (extending the 
"document-type" block) that exist in the application. But since the CMS 
should be easily extensible with new document types, I think we can't 
require to register each document type with each generic block that 
operates on document types.

Does it make sense at all to implement such a scenario using the servlet 
service framework? If yes, is there a way to achieve this behaviour 
using the current implementation? Could I just register the service 
connections programmatically (e.g., using a standard init-method of a 
bean in the actual document type blocks)?

Thanks a lot in advance for any comments!

BTW, sorry for posting this to the dev list, but actually I'm afraid the 
current SSF doesn't support this, and I'd be interested in your opinions 
if this concept should be supported at all.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Mime
View raw message