Hash: SHA1

On 13 Nov 2006, at 16:22, Jens Vagelpohl wrote:
I have to run off right now, but a quick look over GSLocalAddons suggests it should be part of the main CMF Default GS profile, and doing it with GenericSetup certainly is the way to go. Why did Hanno not put it into the CMF base profile right from the start, dangit!

So I'm currently stealing^H^H^H^H^H^H^H integrating Hanno's code from GSLocalAddons into CMFCore and CMFDefault. I'm running into an issue with the site/site manager registration, though. It does not work when instantiating the site, but it does when going to the setup tool in the newly created site afterwards and telling it to import all steps.

Analogous to the way it is done in Plone I have parked the site/site manager stuff in CMFDefault.setuphandlers.importVarious for now, which now contains code like this:

- ---------------------------------------
from Products.Five.component import enableSite
from Products.Five.component.interfaces import IObjectManagerSite
from zope.component.globalregistry import base
from zope.component.persistentregistry import PersistentComponents

def importVarious(context):
    """ Import various settings.
    site = context.getSite()

    # Make the portal a Zope3 site and create a site manager.
    enableSite(site, iface=IObjectManagerSite)
    components = PersistentComponents()
    components.__bases__ = (base,)
- ------------------------------------------

My new handler for the component registry is all set up and registered correctly, and the "various" import step that calls importVarious is set as a dependency for the component registry import step. The dependency works, it is indeed run right before my new step. However, registration fails, because a call to zope.app.component.hooks.getSite in my component registry setup handler returns None, as if the registration in importVarious had not been done. When re-running all steps manually from the setup tool afterwards it magically works and the component registry is populated...


Version: GnuPG v1.4.1 (Darwin)

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

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

Reply via email to