[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser - Control.py:1.2 __init__.py:1.2 browser.zcml:1.2 control.pt:1.2

Jim Fulton jim@zope.com
Mon, 10 Jun 2002 19:28:41 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv17445/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser

Added Files:
	Control.py __init__.py browser.zcml control.pt 
Log Message:
Merged Zope-3x-branch into newly forked Zope3 CVS Tree.


=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/Control.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+# 
+##############################################################################
+""" Define view component for event service control.
+
+$Id$
+"""
+
+from Zope.Publisher.Browser.BrowserView import BrowserView
+from Zope.ComponentArchitecture.ContextDependent import ContextDependent
+from Zope.Event.IEventService import IEventService
+from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.Proxy.ProxyIntrospection import removeAllProxies
+
+class Control(BrowserView):
+    __used_for__ = IEventService
+
+    def index( self, toggleSubscribeOnBind=0, REQUEST=None):
+        if toggleSubscribeOnBind:
+            cntx=removeAllProxies(self.context)
+            cntx.subscribeOnBind=not cntx.subscribeOnBind
+        return self.__control(REQUEST)
+    
+    __control=PageTemplateFile("control.pt")


=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/__init__.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+# 
+##############################################################################
+"""Local Event Service Browser Views"""
+
+


=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/browser.zcml 1.1 => 1.2 ===
+   xmlns='http://namespaces.zope.org/zope'
+   xmlns:security='http://namespaces.zope.org/security'
+   xmlns:zmi='http://namespaces.zope.org/zmi'
+   xmlns:browser='http://namespaces.zope.org/browser'
+>
+  <browser:defaultView 
+      name="control.html"
+      for="Zope.Event.IEventService+"
+      permission="Zope.ManageServices" 
+      factory=".Control." />
+
+  <zmi:tabs for="Zope.Event.IEventService+">
+    <zmi:tab label="Control" action="@@control.html" />
+  </zmi:tabs>
+
+</zopeConfigure>
+
+
+
+


=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/control.pt 1.1 => 1.2 ===
+<head>
+<style metal:fill-slot="headers" type="text/css">
+<!--
+.ContentListing {
+    width: 100%;
+}
+
+.ContentIcon {
+    width: 20px;
+}
+
+.ContentTitle {
+    text-align: left;
+}
+-->
+</style>
+</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>
+</div>
+</body>
+</html>
+
+
+
+