Registration of the default Zope profile does not seem to work anymore. It is probably due to Plone hot fix from 2011-02-08. Here we have implemented an alternative way to register the profile, which works even with the hotfix.

This commit is contained in:
Gaetan Delannay 2011-03-03 09:55:20 +01:00
parent 7294cc0c4d
commit fd9dd569db
3 changed files with 8 additions and 8 deletions

View file

@ -621,9 +621,14 @@ class ZopeInstaller:
def finalizeInstallation(self): def finalizeInstallation(self):
'''Performs some final installation steps.''' '''Performs some final installation steps.'''
cfg = self.config
# Apply customization policy if any # Apply customization policy if any
cp = self.config.CustomizationPolicy cp = cfg.CustomizationPolicy
if cp and hasattr(cp, 'register'): cp.register(context) if cp and hasattr(cp, 'register'): cp.register(context)
# Install the default profile
cfg.profile_registry.registerProfile(self.productName, self.productName,
'Installation of %s' % self.productName, 'profiles/default',
self.productName, cfg.EXTENSION, for_=cfg.IPloneSiteRoot)
def install(self): def install(self):
self.logger.info('is being installed...') self.logger.info('is being installed...')

View file

@ -24,6 +24,7 @@ from Products.CMFCore import utils as cmfutils
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.PloneBatch import Batch from Products.CMFPlone.PloneBatch import Batch
from Products.CMFPlone.utils import ToolInit from Products.CMFPlone.utils import ToolInit
from Products.CMFPlone.interfaces import IPloneSiteRoot
from Products.CMFCore import DirectoryView from Products.CMFCore import DirectoryView
from Products.CMFCore.DirectoryView import manage_addDirectoryView from Products.CMFCore.DirectoryView import manage_addDirectoryView
from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
@ -32,6 +33,7 @@ from Products.Archetypes.Extensions.utils import installTypes
from Products.Archetypes.Extensions.utils import install_subskin from Products.Archetypes.Extensions.utils import install_subskin
from Products.Archetypes.config import TOOL_NAME as ARCHETYPETOOLNAME from Products.Archetypes.config import TOOL_NAME as ARCHETYPETOOLNAME
from Products.Archetypes import listTypes, process_types from Products.Archetypes import listTypes, process_types
from Products.GenericSetup import EXTENSION, profile_registry
import appy.gen import appy.gen
import logging import logging
logger = logging.getLogger('<!applicationName!>') logger = logging.getLogger('<!applicationName!>')

View file

@ -1,13 +1,6 @@
<configure xmlns="http://namespaces.zope.org/zope" <configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser" xmlns:browser="http://namespaces.zope.org/browser"
xmlns:five="http://namespaces.zope.org/five" xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="<!applicationName!>"> i18n_domain="<!applicationName!>">
<!deprecated!> <!deprecated!>
<genericsetup:registerProfile name="default"
title="<!applicationName!>" description=""
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>
</configure> </configure>