[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - IZMIViewService.py:1.1.2.2.14.1 ZMIViewUtility.py:1.1.2.7.8.1
Jim Fulton
jim@zope.com
Wed, 29 May 2002 11:10:19 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/ZMI
Modified Files:
Tag: Zope3InWonderland-branch
IZMIViewService.py ZMIViewUtility.py
Log Message:
- Added permission_id attribute to adapter and utility directives.
- Got rid of old getView, getResource, and getDefaultViewName.
Renamed getRequestView to getView (and so on).
Changed view interface to use context, rather than getContext.
Introduced notion of presentation types (e.g. IBrowserPresentation,
which is cleaner than IBrowserPublisher).
- Began converting to get/queryFoo, which is much nicer.
- Many formatting fixups.
=== Zope3/lib/python/Zope/App/ZMI/IZMIViewService.py 1.1.2.2 => 1.1.2.2.14.1 ===
def getViews(object):
- """ return a sequence of tuples consisting of label, path for zmi
- management views of an object """
+ """Return UI views for an object
+
+ Return a sequence of tuples consisting of label, path for zmi
+ management views of an object """
-
\ No newline at end of file
+
=== Zope3/lib/python/Zope/App/ZMI/ZMIViewUtility.py 1.1.2.7 => 1.1.2.7.8.1 ===
from Zope.ComponentArchitecture.ContextDependent import ContextDependent
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.ComponentArchitecture import getService
from Zope.App.ZopePublication.PublicationTraverse \
import PublicationTraverser
from Zope.Exceptions import Unauthorized
-class ZMIViewUtility(ContextDependent):
- __implements__ = IBrowserPublisher
-
- def setViewRequest(self, request):
- self.__request = request
+class ZMIViewUtility(BrowserView):
def getZMIViews(self):
- context = self.getContext()
+ context = self.context
zmi_view_service = getService(context, 'ZMIViewService')
zmi_views=[]
traverser = PublicationTraverser()
@@ -41,7 +37,7 @@
action=view[1]
if action:
try:
- traverser.traversePath(self.__request, context, action)
+ traverser.traversePath(self.request, context, action)
except Unauthorized:
continue # Skip unauthorized
zmi_views.append({'label': label, 'action': "../%s" % action})