[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - adapter.py:1.3 configure.zcml:1.8 event.py:1.3 eventcontrol.pt:1.3 hub.py:1.3 view.py:1.3

Steve Alexander steve@cat-box.net
Mon, 30 Dec 2002 09:03:55 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv23914/src/zope/app/browser/services

Modified Files:
	adapter.py configure.zcml event.py eventcontrol.pt hub.py 
	view.py 
Log Message:
Large refactoring of the event service.


=== Zope3/src/zope/app/browser/services/adapter.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/adapter.py:1.2	Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/adapter.py	Mon Dec 30 09:02:54 2002
@@ -31,7 +31,7 @@
 from zope.publisher.browser import BrowserView
 from zope.app.interfaces.services.interfaces \
      import IAdapterConfiguration, IAdapterConfigurationInfo
-from zope.event import publish
+from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
 from zope.app.interfaces.services.configuration import IConfiguration
 from zope.app.services.adapter import AdapterConfiguration


=== Zope3/src/zope/app/browser/services/configure.zcml 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.7	Sun Dec 29 08:29:28 2002
+++ Zope3/src/zope/app/browser/services/configure.zcml	Mon Dec 30 09:02:54 2002
@@ -83,7 +83,7 @@
 
   <browser:view 
       permission="zope.ManageServices" 
-      for="zope.interfaces.event.IEventService+"
+      for="zope.app.interfaces.services.event.IEventService"
       factory="zope.app.browser.services.event.Control">
 
       <browser:page name="index.html" attribute="index" />
@@ -91,17 +91,21 @@
   </browser:view>
 
   <browser:menuItems
-      menu="zmi_views" for="zope.interfaces.event.IEventService+">
+      menu="zmi_views" for="zope.app.interfaces.services.event.IEventService">
     <browser:menuItem title="Control" action="@@index.html" />
-    </browser:menuItems>
+  </browser:menuItems>
 
   <browser:menuItem menu="add_component" 
       for="zope.app.interfaces.container.IAdding"
       action="Events"  title="Event Service"
-      description="An event service: use sparingly" />
+      description="An event service. One of these in the root is usually enough"
+      />
 
-  <browser:icon name="zmi_icon" for="zope.interfaces.event.IEventService+" 
-              file="event_service.gif" />
+  <browser:icon
+      name="zmi_icon"
+      for="zope.app.interfaces.services.event.IEventService" 
+      file="event_service.gif"
+      />
 
 <!-- Role Service -->
 
@@ -516,18 +520,20 @@
 
 <browser:defaultView 
     name="index.html"
-    for="zope.app.interfaces.services.hub.IObjectHub+" />
+    for="zope.app.interfaces.services.hub.IObjectHub" />
 
 <browser:view 
     permission="zope.ManageServices" 
-    for="zope.app.interfaces.services.hub.IObjectHub+"
+    for="zope.app.interfaces.services.hub.IObjectHub"
     factory="zope.app.browser.services.hub.Control">
 
     <browser:page name="index.html" attribute="index" />
 
 </browser:view>
 
-<browser:menuItems menu="zmi_views" for="zope.app.interfaces.services.hub.IObjectHub+">
+<browser:menuItems
+    menu="zmi_views"
+    for="zope.app.interfaces.services.hub.IObjectHub">
   <browser:menuItem title="Control" action="@@index.html" />
 </browser:menuItems>
 


=== Zope3/src/zope/app/browser/services/event.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/event.py:1.2	Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/event.py	Mon Dec 30 09:02:54 2002
@@ -17,18 +17,14 @@
 """
 
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.interfaces.event import IEventService
-from zope.proxy.introspection import removeAllProxies
+from zope.app.interfaces.services.event import IEventService
 from zope.publisher.browser import BrowserView
 
 
 class Control(BrowserView):
     __used_for__ = IEventService
 
-    def index(self, toggleSubscribeOnBind=False):
-        if toggleSubscribeOnBind:
-            cntx = removeAllProxies(self.context)
-            cntx.subscribeOnBind = not cntx.subscribeOnBind
+    def index(self):
         return self.__control()
 
-    __control = ViewPageTemplateFile("control.pt")
+    __control = ViewPageTemplateFile("eventcontrol.pt")


=== Zope3/src/zope/app/browser/services/eventcontrol.pt 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/eventcontrol.pt:1.2	Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/eventcontrol.pt	Mon Dec 30 09:02:54 2002
@@ -18,18 +18,7 @@
 </head>
 <body>
 <div metal:fill-slot="body">
-<p>Subscribe on bind: <span tal:condition="context/subscribeOnBind">ON (this
-  event service will try to subscribe to the nearest parent local event service
-  whenever it is bound into service by its service manager; <strong>it will
-  receive events from its parent</strong> if it is bound now)</span><span
-  tal:condition="not:context/subscribeOnBind">OFF (this
-  event service will <em>not</em> try to subscribe to the nearest parent
-  local event service whenever it is bound into service by its service manager;
-  <strong>it will <em>not</em> receive events from its parent</strong> if it is
-  bound now)</span></p>
-  <form method="post">
-  <input type="submit" value="Toggle" name="toggleSubscribeOnBind" />
-  </form>
+<p>This is an event service.</p>
 </div>
 </body>
 </html>


=== Zope3/src/zope/app/browser/services/hub.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/hub.py:1.2	Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/hub.py	Mon Dec 30 09:02:54 2002
@@ -27,4 +27,4 @@
     def index(self):
         return self.__control()
 
-    __control = ViewPageTemplateFile("control.pt")
+    __control = ViewPageTemplateFile("hubcontrol.pt")


=== Zope3/src/zope/app/browser/services/view.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/view.py:1.2	Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/view.py	Mon Dec 30 09:02:54 2002
@@ -33,7 +33,7 @@
      import IViewConfiguration, IViewConfigurationInfo
 from zope.app.interfaces.services.interfaces \
      import IPageConfiguration, IPageConfigurationInfo
-from zope.event import publish
+from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
 from zope.app.interfaces.services.configuration import IConfiguration
 from zope.app.services.view import ViewConfiguration, PageConfiguration