[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - ZMIViewUtility.py:1.3 configure.zcml:1.2 meta.zcml:1.2 ZMIViewService.py:NONE

Jim Fulton jim@zope.com
Tue, 18 Jun 2002 15:35:30 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv23687/lib/python/Zope/App/ZMI

Modified Files:
	ZMIViewUtility.py configure.zcml meta.zcml 
Removed Files:
	ZMIViewService.py 
Log Message:
implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ContentSensitiveBrowserMenuConfigurationDirectives



=== Zope3/lib/python/Zope/App/ZMI/ZMIViewUtility.py 1.2 => 1.3 ===
         context = self.context
         request = self.request
-        zmi_view_service = getService(context, 'ZMIViewService')
-        zmi_views=[]
-        traverser = PublicationTraverser()
-        for view in zmi_view_service.getViews(context):
-            label=view[0]
-            action=view[1]
-            if action:
-                try:
-                    # tickle the security proxy's checker
-                    # we're assuming that view pages are callable
-                    # this is a pretty sound assumption
-                    traverser.traversePath(request, context, action).__call__
-                except (Unauthorized, Forbidden):
-                    continue # Skip unauthorized or forbidden
-            zmi_views.append({'label': label, 'action': "%s" % action})
-
-        return zmi_views
+        browser_menu_service = getService(context, 'BrowserMenu')
+        return browser_menu_service.getMenu('zmi_views',
+                                            self.context,
+                                            self.request)
     


=== Zope3/lib/python/Zope/App/ZMI/configure.zcml 1.1 => 1.2 ===
 >
 
-  <serviceType id="ZMIViewService"
-               interface=".IZMIViewService." />
-
-  <service serviceType="ZMIViewService"
-           component=".ZMIViewService.ZMIViews" />
+  <browser:menu id="zmi_views" 
+                title="Menu for displaying alternate representations
+                       of an object" />
 
   <browser:view name="standard_macros"
                 permission="Zope.View"


=== Zope3/lib/python/Zope/App/ZMI/meta.zcml 1.1 => 1.2 ===
   <directives namespace="http://namespaces.zope.org/zmi">
 
-    <directive name="tabs" attributes="for"
-               handler="Zope.App.ZMI.TabsDirective.">
-        <subdirective name="tab" attributes="label action label" />
-    </directive>
-
     <directive name="icon" attributes="for file image alt layer"
                handler="Zope.App.ZMI.IconDirective." />
   </directives>

=== Removed File Zope3/lib/python/Zope/App/ZMI/ZMIViewService.py ===