[Zope] traversal problems

Mario Bianchi kammamuri_mb@hotmail.com
Mon, 16 Sep 2002 17:03:15 +0000


Hello,
I have problems with traversal and the default Zope session data manager.

My goal is to have many session data managers and a 'router' object that 
(when traversed) routes a user's web request to a new path that traverses 
the right session data manager (and thus makes it set the lazy object 
SESSION, if it is referenced in the original request).

To achieve this, I wrote a SimpleItem class (called Prova for now) with a 
__bobo_traverse__ method that does nothing but returning an 
unrestrictedTraverse on the new path (which is the original one splitted in 
the middle and joined with the path that traverses the session data manager 
of interest).

To make an example, let's say I put a bunch of session data managers each in 
a folder named /mySite/sdm#Folder. If the original request was:

	/mySite/folder1/prova/myDTMLMethod

where myDTMLMethod sets the SESSION object, the Prova object (the router), 
when traversed, decides that session data manager #1 should handle this 
session, and returns:
unrestrictedTraverse('/mySite/sdm1Folder/folder1/prova/myDTMLMethod')

Unfortunately, this doesn't work: the SESSION object is not (lazily) 
appended to the REQUEST, but I can't figure out why.

Also, I don't know if this is the right way of implementing the behaviour 
described above or should I use response.redirect() instead.

I tried the first scheme by hand, as well, calling directly the URL
/mySite/sdm1Folder/folder1/myDTMLMethod
from a web browser and everything works fine: this time the SESSION object 
is created and appended to REQUEST.

Thanks in advance for kindly helping, cheers,
	Mario.


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com