[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/VFS - VFSRequest.py:1.1.4.1.10.1 metaConfigure.py:1.1.4.2.8.1

Jim Fulton jim@zope.com
Wed, 29 May 2002 11:10:25 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/VFS
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/Publisher/VFS

Modified Files:
      Tag: Zope3InWonderland-branch
	VFSRequest.py metaConfigure.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/Publisher/VFS/VFSRequest.py 1.1.4.1 => 1.1.4.1.10.1 ===
     __implements__ = BaseRequest.__implements__, IVFSCredentials
 
-    # _viewtype is overridden from the BaseRequest 
+    # _presentation_type is overridden from the BaseRequest 
     # to implement IVFSPublisher
-    _viewtype = IVFSPublisher
+    _presentation_type = IVFSPublisher
 
 
     def __init__(self, body_instream, outstream, environ, response=None):


=== Zope3/lib/python/Zope/Publisher/VFS/metaConfigure.py 1.1.4.2 => 1.1.4.2.8.1 ===
 $Id$
 """
-from Zope.ComponentArchitecture.metaConfigure import handler
-from Zope.Configuration.Action import Action
-from IVFSPublisher import IVFSPublisher
-
+from Zope.ComponentArchitecture.metaConfigure import view as _view
     
-def view(_context, name, factory, for_=None, layer=''):
-    if for_ is not None:
-        for_ = _context.resolve(for_)
-    factory = map(_context.resolve, factory.split(' '))
+def view(_context, **__kw):
+    return _view(_context, type='Zope.Publisher.VFS.IVFSPublisher.', **__kw)
+
 
-    return [
-        Action(
-            discriminator = ('defaultViewName', for_, name, IVFSPublisher),
-            callable = handler,
-            args = ('Views', 'setDefaultViewName', for_, IVFSPublisher, name),
-            ),
-        Action(
-            discriminator = ('view', for_, name, IVFSPublisher, layer),
-            callable = handler,
-            args = ('Views', 'provideView', for_, name, IVFSPublisher, factory,
-layer),             )
-        ]