[CMF-checkins] SVN: CMF/trunk/C Use the new 'for_' argument in GenericSetup's profile registry API to indicate that profiles are intended for CMFCore's ISiteRoot sites.

Tres Seaver tseaver at palladion.com
Mon Nov 21 13:12:08 EST 2005


Log message for revision 40302:
  Use the new 'for_' argument in GenericSetup's profile registry API to indicate that profiles are intended for CMFCore's ISiteRoot sites.
  
  

Changed:
  U   CMF/trunk/CHANGES.txt
  U   CMF/trunk/CMFActionIcons/__init__.py
  U   CMF/trunk/CMFCalendar/__init__.py
  U   CMF/trunk/CMFDefault/__init__.py
  U   CMF/trunk/CMFDefault/factory.py
  U   CMF/trunk/CMFTopic/__init__.py
  U   CMF/trunk/CMFUid/__init__.py

-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CHANGES.txt	2005-11-21 18:12:07 UTC (rev 40302)
@@ -2,11 +2,9 @@
 
   New Features
 
-    - GenericSetup:  added 'for_' argument to profile registry operations.
-      A profile may be registered and queried as appropriate to a specific
-      site interface;  the default value, 'None', indicates that the profile
-      is relevant to any site.  Note that this is essentially an adapter
-      lookup;  perhaps we should reimplement it so.
+    - CMFActionIcons, CMFCalendar, CMFDefault, CMFTopic, CMFUid:
+      use the new 'for_' argument in GenericSetup's profile registry API
+      to indicate that profiles are intended for CMFCore's ISiteRoot sites.
 
     - CMFTopic:  added specialized GenericSetup support for topics, to
       allow capturing criteria in a single XML file.

Modified: CMF/trunk/CMFActionIcons/__init__.py
===================================================================
--- CMF/trunk/CMFActionIcons/__init__.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFActionIcons/__init__.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -21,6 +21,7 @@
 try:
     from Products.CMFSetup import EXTENSION
     from Products.CMFSetup import profile_registry
+    from Products.CMFCore.interfaces import ISiteRoot
     has_profile_registry = True
 except ImportError:
     has_profile_registry = False
@@ -44,4 +45,6 @@
                                          'Adds action icon tool / settings.',
                                          'profiles/actionicons',
                                          'CMFActionIcons',
-                                         EXTENSION)
+                                         EXTENSION,
+                                         for_=ISiteRoot,
+                                        )

Modified: CMF/trunk/CMFCalendar/__init__.py
===================================================================
--- CMF/trunk/CMFCalendar/__init__.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFCalendar/__init__.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -19,6 +19,7 @@
 
 import utils
 from Products.CMFCore import utils
+from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFCore.DirectoryView import registerDirectory
 from Products.GenericSetup import EXTENSION
 from Products.GenericSetup import profile_registry
@@ -62,4 +63,6 @@
                                      'Adds calendar support.',
                                      'profiles/default',
                                      'CMFCalendar',
-                                     EXTENSION)
+                                     EXTENSION,
+                                     for_=ISiteRoot,
+                                    )

Modified: CMF/trunk/CMFDefault/__init__.py
===================================================================
--- CMF/trunk/CMFDefault/__init__.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFDefault/__init__.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -16,6 +16,7 @@
 """
 
 from Products.CMFCore.DirectoryView import registerDirectory
+from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFCore.utils import initializeBasesPhase1
 from Products.CMFCore.utils import initializeBasesPhase2
 from Products.CMFCore.utils import ToolInit
@@ -114,14 +115,18 @@
                                      'Profile for a default CMFSite.',
                                      'profiles/default',
                                      'CMFDefault',
-                                     BASE)
+                                     BASE,
+                                     for_=ISiteRoot,
+                                    )
 
     profile_registry.registerProfile('sample_content',
                                      'Sample CMFDefault Content',
                                      'Content for a sample CMFSite.',
                                      'profiles/sample_content',
                                      'CMFDefault',
-                                     EXTENSION)
+                                     EXTENSION,
+                                     for_=ISiteRoot,
+                                    )
 
     context.registerClass( Portal.CMFSite
                          , constructors=(factory.addConfiguredSiteForm,

Modified: CMF/trunk/CMFDefault/factory.py
===================================================================
--- CMF/trunk/CMFDefault/factory.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFDefault/factory.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -17,6 +17,7 @@
 
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFCore.utils import getToolByName
 from Products.GenericSetup import EXTENSION
 from Products.GenericSetup import profile_registry
@@ -36,7 +37,7 @@
     base_profiles = []
     extension_profiles = []
 
-    for info in profile_registry.listProfileInfo():
+    for info in profile_registry.listProfileInfo(for_=ISiteRoot):
         if info.get('type') == EXTENSION:
             extension_profiles.append(info)
         else:

Modified: CMF/trunk/CMFTopic/__init__.py
===================================================================
--- CMF/trunk/CMFTopic/__init__.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFTopic/__init__.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -19,6 +19,7 @@
 
 from ZClasses import createZClassForBase
 
+from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFCore.utils import ContentInit
 from Products.CMFCore.DirectoryView import registerDirectory
 from Products.GenericSetup import EXTENSION
@@ -64,4 +65,6 @@
                                      'Adds topic portal type.',
                                      'profiles/default',
                                      'CMFTopic',
-                                     EXTENSION)
+                                     EXTENSION,
+                                     for_=ISiteRoot,
+                                    )

Modified: CMF/trunk/CMFUid/__init__.py
===================================================================
--- CMF/trunk/CMFUid/__init__.py	2005-11-21 17:07:42 UTC (rev 40301)
+++ CMF/trunk/CMFUid/__init__.py	2005-11-21 18:12:07 UTC (rev 40302)
@@ -18,6 +18,7 @@
 from sys import modules
 
 from Products.CMFCore import utils
+from Products.CMFCore.interfaces import ISiteRoot
 from Products.GenericSetup import EXTENSION
 from Products.GenericSetup import profile_registry
 
@@ -51,4 +52,6 @@
                                      'Adds UID support.',
                                      'profiles/default',
                                      'CMFUid',
-                                     EXTENSION)
+                                     EXTENSION,
+                                     for_=ISiteRoot,
+                                    )



More information about the CMF-checkins mailing list