[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ObjectHub/Views/Browser - Control.py:1.1 __init__.py:1.1 configure.zcml:1.1 control.pt:1.1

Gary Poster gary@modernsongs.com
Tue, 29 Oct 2002 22:47:50 -0500


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

Added Files:
	Control.py __init__.py configure.zcml control.pt 
Log Message:
This checkin cleans up the ObjectHub system.

First of all, the Zope.ObjectHub and Zope.App.OFS.Services.LocalObjectHub packages are gone, replaced by Zope.App.OFS.Services.ObjectHub, as per discussion with Jim and Steve.

Second, the hub events have been modified to match Jim's approach with the ObjectEvents (i.e., events are usually handed an object at the get go whenever possible).  Incidentally, this also coincides with making the "moved" hub event implementation actually coincide with the interface (by including fromLocation).  This is as per discussion with Jim.

Third, lookupLocation and lookupHubid have been switched to getLocation and getHubid.  This is a bit of a ninja-checkin or whatever the term is since I didn't bandy this change about beforehand.  :-(  Sorry.  If folks say nay then I will take responsibility for removing this change.

I think that's about it.




=== Added File Zope3/lib/python/Zope/App/OFS/Services/ObjectHub/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/30 03:47:48 poster Exp $
"""

from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.ComponentArchitecture.ContextDependent import ContextDependent
from Zope.App.OFS.Services.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/ObjectHub/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/ObjectHub/Views/Browser/configure.zcml ===
<zopeConfigure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    package="Zope.App.OFS.Services.ObjectHub">

<browser:defaultView 
    name="index.html"
    for=".IObjectHub+" />

<browser:view 
    permission="Zope.ManageServices" 
    for=".IObjectHub+"
    factory=".Views.Browser.Control.">

    <browser:page name="index.html" attribute="index" />

</browser:view>

<browser:menuItems menu="zmi_views" for=".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=".IObjectHub+" 
            file="./objecthub.gif" />

</zopeConfigure>






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