[Zope] Help needed with __bobo_traverse__

Dieter Maurer dieter@handshake.de
Wed, 20 Feb 2002 22:27:50 +0100


jkinsley writes:
 > I have a Product, myObject, that is acting as a Site Root (containing 
 > a Site Root object).
 > 
 > So now http://localhost/myObject/rest/of/path/ is accessable as 
 > http://localhost/rest/of/path/
 > 
 > Now then I want to add an optional 'virtual sub-object' in the path 
 > so that when http://localhost/refid/rest/of/path/ is called the 
 > following will happen.
 > 
 > 	1. I can extract refid (the virtual sub-object)
 > 
 > 	2. Do a database lookup with refid
 > 
 > 	3. Set session data based on lookup results
 > 
 > 	4. Return a response as if http://localhost/rest/of/path/ 
 > 	   were called without the refid segment in the path
 > 
 > I have created a __bobo_traverse__ method in myObject and 
 > accomplished the first three steps, but I have no idea what to return 
 > to complete step four.
I think you have already be told about the "__before_publishing_traverse__"
hook.

I would probably use a SiteAccess AccessRule. It internally
uses the above hook.


Dieter