Author: jmorliaguet
Date: Sun Nov  6 23:06:19 2005
New Revision: 29026

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml
Log:

- we register themes as local utilities



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py        
Sun Nov  6 23:06:19 2005
@@ -20,6 +20,8 @@
 import urllib
 
 from zope.app import zapi
+from zope.app.component.interfaces.registration import ActiveStatus
+from zope.app.component.site import UtilityRegistration
 from zope.app.container.interfaces import INameChooser
 from zope.app.publisher.browser import BrowserView
 from zope.interface import implements
@@ -68,6 +70,12 @@
         theme.title = name.replace('-', ' ')
         container[name] = theme
 
+        # register the theme as a local utility
+        reg_manager = container.registrationManager
+        theme_reg = UtilityRegistration(name, ITheme, theme)
+        reg_manager.addRegistration(theme_reg)
+        theme_reg.status = ActiveStatus
+
         # Add a page
         theme['page'] = ThemePage('Default page')
         # Add the page blocks

Modified: z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     Sun Nov  6 
23:06:19 2005
@@ -17,13 +17,9 @@
         set_schema=".interfaces.IThemeManagement"
         />
 
-    <allow
-        interface="zope.app.container.interfaces.IReadContainer"
-        />
-
     <require
         permission="zope.ManageSite"
-        interface="zope.app.container.interfaces.IWriteContainer"
+        
interface="zope.app.component.interfaces.registration.IRegisterableContainer"
         />
 
   </localUtility>

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml    Sun Nov 
 6 23:06:19 2005
@@ -134,21 +134,17 @@
       type="zope.app.content.interfaces.IContentType"
   />
 
-  <content class=".theme.Theme">
-
-    <implements
-        interface=".interfaces.IPageContainer"
-        />
+  <localUtility class=".theme.Theme">
 
     <factory
         id="theme.Theme"
         title="Theme"
         description="A Theme" />
 
-  </content>
-
-
-  <localUtility class=".theme.Theme">
+    <implements
+        interface=".interfaces.IPageContainer
+                   
zope.app.component.interfaces.registration.IRegisterableContainer"
+        />
 
     <require
         permission="zope.ManageSite"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to