While I don't have time at this very moment to address this in great
detail, I will mention a few comments.

On Mon, 2007-08-01 at 15:40 +0100, Philipp von Weitershausen wrote:
> Using PersistentComponents() as the component registry (a.k.a. site 
> manager) for local sites isn't enough. That's because it doesn't 
> understand about containment hierarchies. Imagine this folder hierarchy:
> /root_site/
> +  cmf_site/
>     +  somefolder/
>     +  anotherfolder/
>     +  sitefolder/
>     +  +   stuff_in_here
> "cmf_site" is obviously a site. Let's say "root_site" and "sitefolder" 
> are also sites (yes, Zope3-style sites can be nested). That's not to say 
> that sitefolder is another CMF Site, it's just a Zope3-style ISite 
> (regular zope 2 folders can be sites in Zope 2.10).
> You would expect component lookup at "stuff_in_here" to
> * first lookup stuff in "sitefolder",
> * then in "cmf_site",
> * then in "root_site",
> * and finally in the global registry
> If you use PersistentComponents() this won't automatically happen!

This is a major problem.  This means that if someone is traversing to
sitefolder and some view code calls getUtility(ICatalog) (instead of the
deprecated getToolByName(context, 'portal_catalog') then the lookup will
fail if sitefolder doesn't provide the utility (and it probably won't
provide it).

> We need a LocalSiteManager implementation for Zope 2 (mostly because of 
> the __bases__ thing, but perhaps also because we then have a designated 
> place for local components instead of the portal root).


> As a bonus, the Zope 2 LocalSiteManager could also mix in ObjectManager.

Right, would be nice as well.

> Since Five is feature-frozen and new stuff should be added in Python 
> packages anyway, my suggestion is to put this thing into a 
> five.localsitemanager package which would then be used by CMF 2.1, Plone 
> 3, etc.. It could possibly be included into the Zope 2.11 release.

This would be the best approach (creating five.localsitemanager) in my
opinion.  But, this means CMF will either require (or distribute)
five.localsitemanager.  (Plone will have the same issue)  I'm not sure
where we stand on this.

> I'd like to avoid making a Five 1.6.



Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net

Attachment: signature.asc
Description: This is a digitally signed message part

Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to