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

Gary Poster garyposter@earthlink.net
Tue, 21 May 2002 09:44:10 -0400


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

Added Files:
      Tag: Zope-3x-branch
	Control.py __init__.py browser.zcml control.pt 
Log Message:
A few more bug fixes and tweaks to various event service and service manager files; a very rudimentary view for the event service (it doesn't show much information because not much information is available from the interfaces!).  The event service prototype should be ready for folks to play with a bit now.


=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/Control.py ===
##############################################################################
#
# 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: Control.py,v 1.1.2.1 2002/05/21 13:44:09 poster Exp $
"""

from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
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(ContextDependent, AttributePublisher):

    __implements__ = AttributePublisher.__implements__
    __used_for__ = IEventService

    def index( self, toggleSubscribeOnBind=0, REQUEST=None):
        if toggleSubscribeOnBind:
            cntx=removeAllProxies(self.getContext())
            cntx.subscribeOnBind=not cntx.subscribeOnBind
        return self.__control(REQUEST)
    
    __control=PageTemplateFile("control.pt")


=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/__init__.py ===
##############################################################################
#
# 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"""




=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/browser.zcml ===
<zopeConfigure
   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'
>

<security:protectClass 
   name=".Control+"
   permission_id="Zope.ManageServices" 
   names="index"/>

<browser:defaultView 
   name="control"
   for="Zope.Event.IEventService+"
   factory="Zope.App.OFS.Services.LocalEventService.Views.Browser.Control+" />

<zmi:tabs for="Zope.Event.IEventService+">
  <zmi:tab label="Control" action="control;view"/>
</zmi:tabs>

</zopeConfigure>


=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/control.pt ===
<html metal:use-macro="views/standard_macros/page">
<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>