[CMF-checkins] SVN: CMF/trunk/ - switched to ZCML for registering
setup profiles
Yvo Schubbe
y.2006_ at wcm-solutions.de
Wed Jun 7 12:45:26 EDT 2006
Log message for revision 68513:
- switched to ZCML for registering setup profiles
Changed:
U CMF/trunk/CMFActionIcons/__init__.py
A CMF/trunk/CMFActionIcons/configure.zcml
U CMF/trunk/CMFCalendar/__init__.py
U CMF/trunk/CMFCalendar/configure.zcml
U CMF/trunk/CMFCalendar/tests/test_Calendar.py
U CMF/trunk/CMFCore/tests/base/testcase.py
U CMF/trunk/CMFDefault/__init__.py
U CMF/trunk/CMFDefault/configure.zcml
A CMF/trunk/CMFDefault/profiles.zcml
U CMF/trunk/CMFDefault/tests/test_DiscussionReply.py
U CMF/trunk/CMFDefault/tests/test_Image.py
U CMF/trunk/CMFDefault/tests/test_Portal.py
U CMF/trunk/CMFDefault/tests/test_join.py
U CMF/trunk/CMFTopic/__init__.py
U CMF/trunk/CMFTopic/configure.zcml
U CMF/trunk/CMFTopic/tests/test_DateC.py
U CMF/trunk/CMFUid/__init__.py
A CMF/trunk/CMFUid/configure.zcml
U CMF/trunk/DCWorkflow/__init__.py
U CMF/trunk/DCWorkflow/configure.zcml
-=-
Modified: CMF/trunk/CMFActionIcons/__init__.py
===================================================================
--- CMF/trunk/CMFActionIcons/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFActionIcons/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -18,29 +18,16 @@
"""
from Products.CMFCore.DirectoryView import registerDirectory
-from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import ToolInit
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import ActionIconsTool
-actionicons_globals = globals()
-registerDirectory( 'skins', actionicons_globals )
+registerDirectory('skins', globals())
-def initialize( context ):
+def initialize(context):
ToolInit( meta_type='CMF Action Icons Tool'
, tools=( ActionIconsTool.ActionIconsTool, )
, icon="tool.gif"
).initialize( context )
-
- profile_registry.registerProfile('actionicons',
- 'CMFActionIcons',
- 'Adds action icon tool / settings.',
- 'profiles/actionicons',
- 'CMFActionIcons',
- EXTENSION,
- for_=ISiteRoot,
- )
Added: CMF/trunk/CMFActionIcons/configure.zcml
===================================================================
--- CMF/trunk/CMFActionIcons/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFActionIcons/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -0,0 +1,16 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_default">
+
+ <!-- profiles -->
+
+ <genericsetup:registerProfile
+ name="actionicons"
+ title="CMFActionIcons"
+ description="Adds action icon tool / settings."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+</configure>
Property changes on: CMF/trunk/CMFActionIcons/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFCalendar/__init__.py
===================================================================
--- CMF/trunk/CMFCalendar/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFCalendar/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -15,50 +15,31 @@
$Id$
"""
-import utils
-from Products.CMFCore import utils
-from Products.CMFCore.interfaces import ISiteRoot
+from Products.CMFCore.utils import ContentInit
+from Products.CMFCore.utils import ToolInit
from Products.CMFCore.DirectoryView import registerDirectory
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import Event
import CalendarTool
from permissions import AddPortalContent
-contentConstructors = (Event.addEvent,)
-tools = ( CalendarTool.CalendarTool, )
+# Make sure security is initialized
+import utils
# Make the skins available as DirectoryViews
registerDirectory('skins', globals())
def initialize(context):
- utils.ToolInit('CMF Calendar Tool', tools=tools, icon='tool.gif',
- ).initialize( context )
+ ToolInit( 'CMF Calendar Tool'
+ , tools=(CalendarTool.CalendarTool,)
+ , icon='tool.gif'
+ ).initialize( context )
# BBB: register oldstyle constructors
- utils.ContentInit( 'CMF Calendar Content'
- , content_types=()
- , permission=AddPortalContent
- , extra_constructors=contentConstructors
- ).initialize( context )
-
- profile_registry.registerProfile('default',
- 'CMFCalendar',
- 'Adds calendar support.',
- 'profiles/default',
- 'CMFCalendar',
- EXTENSION,
- for_=ISiteRoot,
- )
-
- profile_registry.registerProfile('views_support',
- 'Experimental CMFCalendar Browser Views',
- 'Hooks up the browser views.',
- 'profiles/views_support',
- 'CMFCalendar',
- EXTENSION,
- for_=ISiteRoot,
- )
+ ContentInit( 'CMF Calendar Content'
+ , content_types=()
+ , permission=AddPortalContent
+ , extra_constructors=(Event.addEvent,)
+ ).initialize( context )
Modified: CMF/trunk/CMFCalendar/configure.zcml
===================================================================
--- CMF/trunk/CMFCalendar/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFCalendar/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -1,6 +1,8 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:five="http://namespaces.zope.org/five">
+ xmlns:five="http://namespaces.zope.org/five"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_calendar">
<!-- Load CMFDefault.skin first, we use the layer named "cmf" it defines -->
<include package="Products.CMFDefault.skin"/>
@@ -20,4 +22,22 @@
name="cmf.event"
/>
+ <!-- profiles -->
+
+ <genericsetup:registerProfile
+ name="default"
+ title="CMFCalendar"
+ description="Adds calendar support."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+ <genericsetup:registerProfile
+ name="views_support"
+ title="Experimental CMFCalendar Browser Views"
+ description="Hooks up the browser views."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
</configure>
Modified: CMF/trunk/CMFCalendar/tests/test_Calendar.py
===================================================================
--- CMF/trunk/CMFCalendar/tests/test_Calendar.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFCalendar/tests/test_Calendar.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -21,7 +21,6 @@
ZopeTestCase.installProduct('Five', 1)
ZopeTestCase.installProduct('CMFCore', 1)
ZopeTestCase.installProduct('CMFDefault', 1)
-ZopeTestCase.installProduct('CMFCalendar', 1)
ZopeTestCase.utils.setupCoreSessions()
import locale
@@ -137,8 +136,8 @@
newSecurityManager( None, UnrestrictedUser('god', 'god', ['Manager'], '') )
factory = app.manage_addProduct['CMFDefault'].addConfiguredSite
- factory('CalendarTest', 'CMFDefault:default', snapshot=False,
- extension_ids=('CMFCalendar:default',))
+ factory('CalendarTest', 'Products.CMFDefault:default', snapshot=False,
+ extension_ids=('Products.CMFCalendar:default',))
self.Site = app.CalendarTest
self.Tool = app.CalendarTest.portal_calendar
Modified: CMF/trunk/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/trunk/CMFCore/tests/base/testcase.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFCore/tests/base/testcase.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -70,6 +70,7 @@
import Products
zcml.load_config('meta.zcml', Products.Five)
+ zcml.load_config('meta.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.GenericSetup)
Modified: CMF/trunk/CMFDefault/__init__.py
===================================================================
--- CMF/trunk/CMFDefault/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -16,13 +16,9 @@
"""
from Products.CMFCore.DirectoryView import registerDirectory
-from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import ToolInit
from Products.CMFCore.utils import ContentInit
from Products.CMFCore.utils import registerIcon
-from Products.GenericSetup import BASE
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import DefaultWorkflow
import DiscussionTool
@@ -83,33 +79,6 @@
, extra_constructors=contentConstructors
).initialize( context )
- profile_registry.registerProfile('default',
- 'CMFDefault Site',
- 'Profile for a default CMFSite.',
- 'profiles/default',
- 'CMFDefault',
- BASE,
- for_=ISiteRoot,
- )
-
- profile_registry.registerProfile('sample_content',
- 'Sample CMFDefault Content',
- 'Content for a sample CMFSite.',
- 'profiles/sample_content',
- 'CMFDefault',
- EXTENSION,
- for_=ISiteRoot,
- )
-
- profile_registry.registerProfile('views_support',
- 'Experimental CMFDefault Browser Views',
- 'Hooks up the browser views.',
- 'profiles/views_support',
- 'CMFDefault',
- EXTENSION,
- for_=ISiteRoot,
- )
-
context.registerClass( Portal.CMFSite
, constructors=(factory.addConfiguredSiteForm,
factory.addConfiguredSite)
Modified: CMF/trunk/CMFDefault/configure.zcml
===================================================================
--- CMF/trunk/CMFDefault/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -7,4 +7,6 @@
<include file="content.zcml"/>
+ <include file="profiles.zcml"/>
+
</configure>
Added: CMF/trunk/CMFDefault/profiles.zcml
===================================================================
--- CMF/trunk/CMFDefault/profiles.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/profiles.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -0,0 +1,29 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_default">
+
+ <genericsetup:registerProfile
+ name="default"
+ title="CMFDefault Site"
+ description="Profile for a default CMFSite."
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+ <genericsetup:registerProfile
+ name="views_support"
+ title="Experimental CMFDefault Browser Views"
+ description="Hooks up the browser views."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+ <genericsetup:registerProfile
+ name="sample_content"
+ title="Sample CMFDefault Content"
+ description="Content for a sample CMFSite."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+</configure>
Property changes on: CMF/trunk/CMFDefault/profiles.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFDefault/tests/test_DiscussionReply.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_DiscussionReply.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/tests/test_DiscussionReply.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -47,7 +47,7 @@
zcml.load_config('configure.zcml', Products.DCWorkflow)
try:
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
- factory('cmf', 'CMFDefault:default', snapshot=False)
+ factory('cmf', 'Products.CMFDefault:default', snapshot=False)
self.portal = self.root.cmf
# Become a Manager
self.uf = self.portal.acl_users
Modified: CMF/trunk/CMFDefault/tests/test_Image.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Image.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/tests/test_Image.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -125,7 +125,7 @@
zcml.load_config('configure.zcml', Products.DCWorkflow)
try:
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
- factory('cmf', 'CMFDefault:default', snapshot=False)
+ factory('cmf', 'Products.CMFDefault:default', snapshot=False)
self.site = self.root.cmf
newSecurityManager(None, OmnipotentUser().__of__(self.site))
self.site.invokeFactory('File', id='file')
Modified: CMF/trunk/CMFDefault/tests/test_Portal.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Portal.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/tests/test_Portal.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -39,7 +39,8 @@
from Products.CMFDefault.factory import addConfiguredSite
- addConfiguredSite(self.root, id, 'CMFDefault:default', snapshot=False)
+ addConfiguredSite(self.root, id, 'Products.CMFDefault:default',
+ snapshot=False)
return getattr( self.root, id )
def _makeContent( self, site, portal_type, id='document', **kw ):
Modified: CMF/trunk/CMFDefault/tests/test_join.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_join.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFDefault/tests/test_join.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -49,7 +49,7 @@
def _makePortal(self):
# Create a portal instance suitable for testing
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
- factory('site', 'CMFDefault:default', snapshot=False)
+ factory('site', 'Products.CMFDefault:default', snapshot=False)
return self.root.site
Modified: CMF/trunk/CMFTopic/__init__.py
===================================================================
--- CMF/trunk/CMFTopic/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFTopic/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -15,11 +15,8 @@
$Id$
"""
-from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import ContentInit
from Products.CMFCore.DirectoryView import registerDirectory
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import Topic
from permissions import AddTopics
@@ -46,12 +43,3 @@
, permission=AddTopics
, extra_constructors=(Topic.addTopic,)
).initialize( context )
-
- profile_registry.registerProfile('default',
- 'CMFTopic',
- 'Adds topic portal type.',
- 'profiles/default',
- 'CMFTopic',
- EXTENSION,
- for_=ISiteRoot,
- )
Modified: CMF/trunk/CMFTopic/configure.zcml
===================================================================
--- CMF/trunk/CMFTopic/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFTopic/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -1,6 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="cmf_default">
<permission
@@ -21,6 +22,16 @@
name="cmf.topic"
/>
+ <!-- profiles -->
+
+ <genericsetup:registerProfile
+ name="default"
+ title="CMFTopic"
+ description="Adds topic portal type."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
<!-- exportimport -->
<adapter
Modified: CMF/trunk/CMFTopic/tests/test_DateC.py
===================================================================
--- CMF/trunk/CMFTopic/tests/test_DateC.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFTopic/tests/test_DateC.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -174,7 +174,7 @@
zcml.load_config('configure.zcml', Products.DCWorkflow)
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
- factory('site', 'CMFDefault:default', snapshot=False)
+ factory('site', 'Products.CMFDefault:default', snapshot=False)
self.site = self.root.site
self.site._setObject( 'topic', Topic('topic') )
self.topic = self.site.topic
Modified: CMF/trunk/CMFUid/__init__.py
===================================================================
--- CMF/trunk/CMFUid/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFUid/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -16,9 +16,6 @@
"""
from Products.CMFCore import utils
-from Products.CMFCore.interfaces import ISiteRoot
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import UniqueIdAnnotationTool
import UniqueIdGeneratorTool
@@ -37,12 +34,3 @@
, tools=tools
, icon='tool.gif'
).initialize(context)
-
- profile_registry.registerProfile('default',
- 'CMFUid',
- 'Adds UID support.',
- 'profiles/default',
- 'CMFUid',
- EXTENSION,
- for_=ISiteRoot,
- )
Added: CMF/trunk/CMFUid/configure.zcml
===================================================================
--- CMF/trunk/CMFUid/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/CMFUid/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -0,0 +1,16 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_default">
+
+ <!-- profiles -->
+
+ <genericsetup:registerProfile
+ name="default"
+ title="CMFUid"
+ description="Adds UID support."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+</configure>
Property changes on: CMF/trunk/CMFUid/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/DCWorkflow/__init__.py
===================================================================
--- CMF/trunk/DCWorkflow/__init__.py 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/DCWorkflow/__init__.py 2006-06-07 16:45:25 UTC (rev 68513)
@@ -15,10 +15,7 @@
$Id$
"""
-from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import registerIcon
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
import DCWorkflow, States, Transitions, Variables, Worklists, Scripts
@@ -44,11 +41,3 @@
Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
registerIcon(Scripts.Scripts,
'images/script.gif', globals())
-
- profile_registry.registerProfile('revision2',
- 'CMF Default Workflow [Revision 2]',
- 'Adds revision 2 of default workflow.',
- 'profiles/revision2',
- 'DCWorkflow',
- EXTENSION,
- for_=ISiteRoot)
Modified: CMF/trunk/DCWorkflow/configure.zcml
===================================================================
--- CMF/trunk/DCWorkflow/configure.zcml 2006-06-07 16:24:12 UTC (rev 68512)
+++ CMF/trunk/DCWorkflow/configure.zcml 2006-06-07 16:45:25 UTC (rev 68513)
@@ -1,7 +1,8 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
- >
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_default">
<include package=".browser"/>
@@ -13,6 +14,18 @@
global="False"
/>
+ <!-- profiles -->
+
+ <genericsetup:registerProfile
+ name="revision2"
+ title="CMF Default Workflow [Revision 2]"
+ description="Adds revision 2 of default workflow."
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFCore.interfaces.ISiteRoot"
+ />
+
+ <!-- exportimport -->
+
<adapter factory=".exportimport.DCWorkflowDefinitionBodyAdapter"/>
</configure>
More information about the CMF-checkins
mailing list