[Zope3-checkins] CVS: Zope3/src/zope/publisher/interfaces - browser.py:1.4 http.py:1.14

Albertas Agejevas alga@codeworks.lt
Tue, 15 Apr 2003 05:37:59 -0400


Update of /cvs-repository/Zope3/src/zope/publisher/interfaces
In directory cvs.zope.org:/tmp/cvs-serv21534/src/zope/publisher/interfaces

Modified Files:
	browser.py http.py 
Log Message:
Virtual Hosting support in the request.

Added a new namespace ++vh++ with a handler which sets the server URL and
the application URL in the request.

Functional tests for virtual hosting.

Vrtual hosting support in @@absoulute_url is not implemented yet.



=== Zope3/src/zope/publisher/interfaces/browser.py 1.3 => 1.4 ===
--- Zope3/src/zope/publisher/interfaces/browser.py:1.3	Fri Apr 11 06:08:09 2003
+++ Zope3/src/zope/publisher/interfaces/browser.py	Tue Apr 15 05:37:28 2003
@@ -94,41 +94,6 @@
         """
 
 
-class IVirtualHostRequest(Interface):
-    """The support for virtual hosts in Zope is very important.
-
-    In order to make virtual hosts working, we need to support several
-    methods in our Request object. This interface defines the required
-    methods.
-    """
-
-    def setVirtualRoot(path, hard=0):
-        """Treat the current publishing object as a VirtualRoot.
-        """
-
-
-    def convertPhysicalPathToVirtualPath(path):
-        """Remove the path to the VirtualRoot from a physical path.
-        """
-
-
-    def convertPhysicalPathToURL(path, relative=0):
-        """Convert a physical path into a URL in the current context.
-        """
-
-
-    def getPhysicalPathFromURL(URL):
-        """Convert a URL into a physical path in the current context.
-
-        If the URL makes no sense in light of the current virtual
-        hosting context, a ValueError is raised.
-        """
-
-    def getEffectiveURL():
-        """Return the effective URL.
-        """
-
-
 class IBrowserRequest(IHTTPRequest):
     """Browser-specific Request functionality.
 


=== Zope3/src/zope/publisher/interfaces/http.py 1.13 => 1.14 ===
--- Zope3/src/zope/publisher/interfaces/http.py:1.13	Sat Mar 29 12:00:46 2003
+++ Zope3/src/zope/publisher/interfaces/http.py	Tue Apr 15 05:37:28 2003
@@ -46,8 +46,35 @@
     "HTTP View"
 
 
+class IVirtualHostRequest(Interface):
+    """The support for virtual hosts in Zope is very important.
 
-class IHTTPApplicationRequest(IApplicationRequest):
+    In order to make virtual hosts working, we need to support several
+    methods in our Request object. This interface defines the required
+    methods.
+    """
+
+    def setVirtualHostRoot():
+        """Marks the currently traversed object as the root of a
+        virtual host.
+
+        Should be called during traversal."""
+
+    def setApplicationNames(names):
+        """Set the names which compose the application path.
+
+        These are the path elements that appear in the beginning of
+        the generated URLs."""
+
+    def setApplicationServer(host, proto='http', port=None):
+        """Override the host, protocol and port parts of generated URLs.
+
+        This affects automatically inserted <base> tags and URL getters
+        in the request, but not things like @@absolute_url views.
+        """
+
+
+class IHTTPApplicationRequest(IApplicationRequest, IVirtualHostRequest):
     """HTTP request data.
 
     This object provides access to request data.  This includes, the