[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/Views/Browser - Control.py:1.1 __init__.py:1.1 configure.zcml:1.1 control.pt:1.1
Gary Poster
gary@modernsongs.com
Mon, 21 Oct 2002 02:14:48 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv13005/Zope/App/OFS/Services/LocalObjectHub/Views/Browser
Added Files:
Control.py __init__.py configure.zcml control.pt
Log Message:
sorry for the huge honking checkin.
Adds a simple local objecthub implementation and made ObjectHub a service
Modifies the main objecthub as we have been discussing:
* objecthub attribute is hubid, not hid (sorry Jim, I'll change it back if you want but there were a lot of "yay"s and no "nay"s :-)
* no more IObjectAddedHubEvent
* IObjectRemovedEvent now (hopefully) actually has the effect on the ObjectHub that is described in the interface, and that we agreed upon, namely (assuming removed object was cataloged in objecthub) removing catalog of object in objecthub and sending out an IObjectRemovedHubEvent, subclass of IObjectUnregisteredHubEvent, to the ObjectHub subscribers
I tried to spruce up the LocalEventService a bit but the code still looks as opaque as ever, I'm afraid. Among other small improvements, though, at least you actually can see the silly "user interface" now without a traceback. Now for a *real* user interface sometime. :-)
Fixed a few typos while I was at it as well...and I'm sure made my share of new ones :-)
=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/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 object hub.
$Id: Control.py,v 1.1 2002/10/21 06:14:46 poster Exp $
"""
from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.ComponentArchitecture.ContextDependent import ContextDependent
from Zope.ObjectHub.IObjectHub import IObjectHub
from Zope.App.PageTemplate import ViewPageTemplateFile
from Zope.Proxy.ProxyIntrospection import removeAllProxies
class Control(BrowserView):
__used_for__ = IObjectHub
def index( self ):
return self.__control()
__control=ViewPageTemplateFile("control.pt")
=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/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 Object Hub Views"""
=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/Views/Browser/configure.zcml ===
<zopeConfigure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
package="Zope.App.OFS.Services.LocalObjectHub">
<browser:defaultView
name="index.html"
for="Zope.ObjectHub.IObjectHub+" />
<browser:view
permission="Zope.ManageServices"
for="Zope.ObjectHub.IObjectHub+"
factory=".Views.Browser.Control.">
<browser:page name="index.html" attribute="index" />
</browser:view>
<browser:menuItems menu="zmi_views" for="Zope.ObjectHub.IObjectHub+">
<browser:menuItem title="Control" action="@@index.html" />
</browser:menuItems>
<browser:menuItem menu="add_component" for="Zope.App.OFS.Container.IAdding."
action="ObjectHub" title='ObjectHub'
description='An object hub, for cataloging, unique object ids, and more: use sparingly' />
<browser:icon name="zmi_icon" for="Zope.ObjectHub.IObjectHub+"
file="./objecthub.gif" />
</zopeConfigure>
=== Added File Zope3/lib/python/Zope/App/OFS/Services/LocalObjectHub/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">
This is an object hub.
</div>
</body>
</html>