Nicola Ken Barozzi wrote:
Sylvain Wallez wrote:
<snip/>
But if you look at SitemapLanguage, which is a subclass of DefaultTreeBuilder, you will notice that its createComponentManager() method creates a new CocoonComponentManager and configures it with <map:components>. So <map:components> defines components of the sitemap just a cocoon.xconf defines them for the Cocoon object.
Yeah, this is it! So I need to change the CocoonComponentManager to be able to handle the creation of stuff from the loaded blocks.
Adding a custom classloader to the sitemap to handle blocks should thus be just a matter of giving that custom classloader to the created CM.
Ok. Since we will have a map:blocks section, what do you propose to do in code? IE where to load the blocks? Probably simply pass also that info to the CocoonComponentManager?
CocoonComponentManager (CCM) -- actually ECM, its parent class -- already has a constructor with the ClassLoader that's to be used to load components. We just have to write a BlockClassLoader that extends ParanoidClassLoader and give it to CCM.
Cut, paste, glue, and we're done ;-)
Does this answer your question ?
Thanks :-D
http://wiki.cocoondev.org/Wiki.jsp?page=InterpretedSitemapInternals
Thanks ! I should have done it myself and just replied with this link ;-) Sylvain -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]