[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - IViewService.py:1.1.2.2

Jim Fulton jim@zope.com
Thu, 10 Jan 2002 10:33:14 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv25469

Modified Files:
      Tag: Zope-3x-branch
	IViewService.py 
Log Message:
Added a getRequestView method that uses the request to specify (imply)
the view type and skin.


=== Zope3/lib/python/Zope/ComponentArchitecture/IViewService.py 1.1.2.1 => 1.1.2.2 ===
         raised if the component can't be found.
         """
+
+    def getRequestView(object, name, request, default=None):
+        """Look up a named view for a given request
+
+        The request must implement IViewRequest.
+
+        The object also provides a place to look for placeful views.
+
+        A Zope.ComponentArchitecture.ComponentLookupError will be
+        raised if the component can't be found.
+        """
+
+class IViewRequest(Interface):
+    """An IViewRequest provides methods for getting view meta data.
+    """
+
+    def getViewType():
+        """Get a view type
+
+        The view type is expressed as an interface, as would be passed
+        to IViewService.getView.
+        """
+
+    def getViewSkin():
+        """Get the skin to be used for a request.
+
+        The skin is a string as would be passed
+        to IViewService.getView.
+        """