[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/LocalEventService - LocalEventService.py:1.1.2.1 __init__.py:1.1.2.1 localEventService.zcml:1.1.2.1

Gary Poster garyposter@earthlink.net
Mon, 22 Apr 2002 15:03:24 -0400


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

Added Files:
      Tag: Zope-3x-branch
	LocalEventService.py __init__.py localEventService.zcml 
Log Message:
1. As per ZopeTop discussion, moved Addable out of ZMI into the Services folder, and turned it into a true service (this involved a lot of small changes, particularly in the folders and a number of tests) and gave it some hooks
2. used SteveA's ContextWrapper.ContextMethod to make the ServiceManager and Services placefully look up to parent placeful equivalents
3. Made Event into a more standard service, and gave it some hooks
4. Built the beginning of a placeful EventService (will need tests, and views, and EventChannels, and more meat; just wanted to check this in for now)
5. made it so you can't add an item to a folder with a blank string id, and updated the folder interface
6. some typos fixed here and there
7. a few more tests here and there

I'm checking this in then checking it out again to check my work; also tagged previous version as gary-service_update.



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

Revision information:
$Id: LocalEventService.py,v 1.1.2.1 2002/04/22 19:03:22 poster Exp $
"""

from Persistence import Persistent
from Zope.Event.IEventService import IEventService
from Zope.Event.EventService import EventService
from Zope.ContextWrapper import ContextMethod
from Zope.ComponentArchitecture import getNextService

class LocalEventService(EventService, Persistent):
        
    def publishEvent(wrapped_self, event):

        self.notify(event)
        getNextService(wrapped_self, 'EventService').publishEvent(event)
    
    publishEvent=ContextMethod(publishEvent)
    
    

    


=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/__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"""




=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/localEventService.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'
   xmlns:service='http://namespaces.zope.org/service'
>

<service:factoryFromClass name='EventService'
             class='.LocalEventService+'
             permission_id='Zope.ManageServices'
             title='Event Service'
             description='An event service: use sparingly' />

</zopeConfigure>