[Zope-Checkins] CVS: Zope/lib/python/Products/Sessions/help - SessionInterfaces.py:1.11 browser-add.stx:1.7 browser-change.stx:1.6

Chris McDonough chrism@zope.com
Mon, 19 Aug 2002 15:50:48 -0400


Update of /cvs-repository/Zope/lib/python/Products/Sessions/help
In directory cvs.zope.org:/tmp/cvs-serv24326/help

Modified Files:
	SessionInterfaces.py browser-add.stx browser-change.stx 
Log Message:
Added the capability for browser ids to be encoded in URLs.

When a set of knobs is set on the browser_id_manager "settings" screen,
("look for browser id name in..." and 'automatically encode browser ids..."),
a traversal hook is installed in the browser id manager's container which
causes a) the request to be searched for a browser id name and a browser
id as the first two elements of the URL path and b) for Zope-generated URLs
to contain these path elements.

Various documentation and interface updates.  No interface methods
were harmed in the filming of this checkin, but a few were added or extended
with defaults.



=== Zope/lib/python/Products/Sessions/help/SessionInterfaces.py 1.10 => 1.11 ===
--- Zope/lib/python/Products/Sessions/help/SessionInterfaces.py:1.10	Wed Aug 14 18:25:09 2002
+++ Zope/lib/python/Products/Sessions/help/SessionInterfaces.py	Mon Aug 19 15:50:17 2002
@@ -32,12 +32,24 @@
     visitors, and for servicing requests from Session Data Managers
     related to the browser id.
     """
-    def encodeUrl(url):
+    def encodeUrl(url, style='querystring'):
         """
         Encodes a provided URL with the current request's browser id
-        and returns the result.  For example, the call
-        encodeUrl('http://foo.com/amethod') might return
-        'http://foo.com/amethod?_ZopeId=as9dfu0adfu0ad'.
+        and returns the result.  Two forms of URL-encoding are supported:
+        'querystring' and 'inline'.  'querystring' is the default.
+
+        If the 'querystring' form is used, the browser id name/value pair
+        are postfixed onto the URL as a query string.  If the 'inline'
+        form is used, the browser id name/value pair are prefixed onto
+        the URL as the first two path segment elements.
+
+        For example:
+
+         The call encodeUrl('http://foo.com/amethod', style='querystring')
+         might return 'http://foo.com/amethod?_ZopeId=as9dfu0adfu0ad'.
+
+         The call encodeUrl('http://foo.com/amethod, style='inline')
+         might return 'http://foo.com/_ZopeId/as9dfu0adfu0ad/amethod'.
 
         Permission required: Access contents information
 


=== Zope/lib/python/Products/Sessions/help/browser-add.stx 1.6 => 1.7 ===
--- Zope/lib/python/Products/Sessions/help/browser-add.stx:1.6	Sat Nov 17 11:07:41 2001
+++ Zope/lib/python/Products/Sessions/help/browser-add.stx	Mon Aug 19 15:50:17 2002
@@ -15,14 +15,21 @@
 
     Title -- the browser id manager title.
 
-    Look for browser id name in -- the cookie name and/or form variable name
-    used for this browser id manager instance.  This will be the
+    Browser Id Name -- the cookie name and/or form variable
+    name used for this browser id manager instance.  This will be the
     name looked up in the 'cookies' or 'form' REQUEST namespaces
     when the browser id manager attempts to find a cookie or form
     variable with a browser id in it.
 
-    Browser id location -- select from one of the available
-    lookup ordering schemes involving cookies and forms
+    Look for Browser Id In -- choose any of 'Forms and Query Strings',
+    'URLs', or 'Cookies'.  The browser id name/value will be looked
+    for within these places.
+
+    Automatically Encode Zope-Generated URLs With A Browser Id -- if
+    this is selected, URLs generated by Zope (such as URLs which come
+    as a result of calling an object's 'absolute_url' method) will be
+    encoded with a browser name and browser id as the first two
+    elements of the URL path.
 
     Cookie path -- this is the 'path' element which should be sent
     in the session token cookie.  For more information, see the


=== Zope/lib/python/Products/Sessions/help/browser-change.stx 1.5 => 1.6 ===
--- Zope/lib/python/Products/Sessions/help/browser-change.stx:1.5	Sat Nov 17 11:07:41 2001
+++ Zope/lib/python/Products/Sessions/help/browser-change.stx	Mon Aug 19 15:50:17 2002
@@ -4,14 +4,20 @@
 
     Title -- the browser id manager title.
 
-    Browser id name -- the cookie name and/or form variable name
+    Browser id name -- the cookie or forms variable name
     used for this browser id manager instance.  This will be the
-    name looked up in the 'cookies' or 'form' REQUEST namespaces
-    when the browser id manager attempts to find a cookie or form
-    variable with a browser id in it.
+    name looked up in the namespaces specified by "Look for browser
+    id name in" (below).
 
-    Look for browser id name in -- select from one of the available
-    lookup ordering schemes involving cookies and forms
+    Look for Browser Id In -- choose any of 'Forms and Query Strings',
+    'URLs', or 'Cookies'.  The browser id name/value will be looked
+    for within these places.
+
+    Automatically Encode Zope-Generated URLs With A Browser Id -- if
+    this is selected, URLs generated by Zope (such as URLs which come
+    as a result of calling an object's 'absolute_url' method) will be
+    encoded with a browser name and browser id as the first two
+    elements of the URL path.
 
     Cookie path -- this is the 'path' element which should be sent
     in the session token cookie.  For more information, see the