cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: Hivemind integration - how to access cocoon context?
Date Tue, 20 Dec 2005 09:47:39 GMT
Le 19 déc. 05, à 19:19, David Legg a écrit :

> I would like to organize a Cocoon app as a set of Hivemind components 
> (as recommended by the Bricks CMS demo).
> I've very quickly run into a problem...  one of the components needs 
> to read some data from a file and therefore needs access to the Cocoon 
> context so it can look for this file without having to hard code the 
> absolute file location.
> Unfortunately, the Bricks demo doesn't cover this aspect of Hivemind 
> integration into Cocoon.  Are there any other examples about that 
> would help me?...

You're right that currently, in Bricks, the HiveMind component manager 
is completely separate from Cocoon's, this deserves to be improved.

I'm no guru on Cocoon internals, so maybe one of those people would 
have a better idea, but what I'd do is to build the HiveMind Registry 
in a different way: creating the Registry in a Cocoon component which 
implements ThreadSafe and Contextualizable would allow you to inject 
the Cocoon Context (and other components if needed) into the Registry 
when it's initialized. And you can still add the Registry as a context 
attribute to be backwards-compatible with the current Bricks code.

I haven't checked how to inject components programmatically into the 
HiveMind Registry, but there's probably a way. Worst case, you could 
modify the bricks-cms ApplicationComponentManager class to give access 
to the Context, injected by your Contextualizable initializer class.

I'd be happy to integrate any improvements in bricks-cms about this, in 
order to build a better bridge between the HiveMind and Cocoon 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message