[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/HTTP - HTTPRequest.py:1.1.2.20.2.1 HTTPResponse.py:1.1.2.13.2.1 BrowserPayload.py:NONE

Stephan Richter srichter@cbu.edu
Sun, 3 Mar 2002 23:36:44 -0500


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

Modified Files:
      Tag: srichter-OFS_Formulator-branch
	HTTPRequest.py HTTPResponse.py 
Removed Files:
      Tag: srichter-OFS_Formulator-branch
	BrowserPayload.py 
Log Message:
Here are some of the changes made:

- Payload now keeps trakc of View Type

- Reimplementation of {set|get}ViewType in HTTPRequest, to overload the 
  standard BaseRequest one to look in the payload vor the View Type

- Implemented XMLRPCPayload

- Created IXMLRPCPublisher interface

- Implemenyed new Publisher interface in MethodPublisher

- Created xmlrpc ZCML namespace

- Move Payloads out of HTTP directory into Browser and XMLRPC


ToDo:

- Write and update tests. (nothing done yet)

- Update interfaces and create new ones

- Work on Authentication of XML-RPC

- Get rid of the 'Hacker' lines

- More refactoring needs to be done.



=== Zope3/lib/python/Zope/Publisher/HTTP/HTTPRequest.py 1.1.2.20 => 1.1.2.20.2.1 ===
 
 from Zope.Publisher.BaseRequest import BaseRequest
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher 
 
 from HTTPResponse import HTTPResponse
 from cgi_names import isCGI_NAME, hide_key
@@ -84,6 +83,7 @@
 
     __implements__ = BaseRequest.__implements__, IHTTPCredentials, IHTTPRequest
 
+    __allow_access_to_unprotected_subobjects__ = 1
 
     _auth = None          # The value of the HTTP_AUTHORIZATION header.
     _computed_urls = ()   # Names of computed URLx variables
@@ -234,6 +234,24 @@
         return self.SERVER_URL
 
 
+    ###############################################################
+    # XXX HACK!!! Please fix me soon! However, I thin payload
+    #     should know about the view-type, not HTTPRequest
+
+    def getViewType(self):
+        '''See interface IViewRequest'''
+
+        return self.payload._viewtype
+
+
+    def setViewType(self, viewtype):
+        ''' set the view type '''
+
+        self.payload._viewtype = viewtype
+
+    ################################################################
+
+
     def __init__(self, payload, response, body_instream, environ):
         BaseRequest.__init__(self, response, body_instream)
         self.payload = payload
@@ -394,6 +412,7 @@
         if v is _marker:
             v = self.common.get(key, _marker)
         return default
+    get.__permission__ = 'Zope.Public'
 
     def __getitem__(self, key):
         res = self.get(key, _marker)
@@ -480,10 +499,6 @@
         self.response.setHeader("WWW-Authenticate", challenge, 1)
         self.response.setStatus(401)
 
-
-    # _viewtype is overridden from the BaseRequest 
-    #  to implement IBrowserPublisher
-    _viewtype = IBrowserPublisher
 
 
 base64 = None


=== Zope3/lib/python/Zope/Publisher/HTTP/HTTPResponse.py 1.1.2.13 => 1.1.2.13.2.1 ===
     """
 
+    __allow_access_to_unprotected_subobjects__ = 1
+
     accumulated_headers = None
     base = None
     realm = 'Zope'

=== Removed File Zope3/lib/python/Zope/Publisher/HTTP/BrowserPayload.py ===