[Zope-dev] Re: Subpath traversal interface (was RE: ANN: Pyth on Methods 0.1.7 up and over to DC) and over to DC)

Michel Pelletier michel@digicool.com
Tue, 14 Dec 1999 17:40:14 -0500


> -----Original Message-----
> From: Evan Simpson [mailto:evan@4-am.com]
> Sent: Tuesday, December 14, 1999 2:59 PM
> To: Michel Pelletier
> Cc: 'Phillip J. Eby'; zope-dev@zope.org
> Subject: Re: [Zope-dev] Re: Subpath traversal interface (was RE: ANN:
> Python Methods 0.1.7 up and over to DC) and over to DC)
> 
> 
> It's a wafer-thin cost, really! :-)

it was Jim's objection, but I see the logic.

> I'll be interested to see your implementation.  Both 
> SiteRoots and Access
> Rules depend abjectly on the hook.  SiteRoots hook into their 
> containers'
> traversal so that they can call REQUEST.setURL.

We just do this from __bobo_traverse__ if self.base ==
REQUEST['SERVER_URL'].

>  Designating 
> an object as
> an Access Rule causes it to be called before its container is entered,
> which allows the path foolery necessary for (my version of) virtual
> hosting.

Most of the path foolery I think you're talking about is not needed now
because absolute_url is now recursive.  The Rule thing though, that
might need to hook, I'd have to bug Jim about it.

> When I was first designing SiteAccess, I considered hooking
> __bobo_traverse__, but I was really worried about what to do 
> if a container
> already implemented it,

Then that container can't be a SiteObject.

> or if a SiteRoot and an Access Rule 
> wanted to share
> the same container.

SiteRoots are containers, and we haven't implimented Access Rules yet...

>   It would be great if __bobo worked like 
> __before, but
> I imagine that it's a bit late to be changing that one.

How would you like the behavior to change?
 
> I have been struggling with the new absolute_url 
> implementation, by the
> way.  It makes perfect sense, and would work fine with a 
> virtual hosting
> solution which can insert an object into the acquisition 
> chain.  Sadly,
> mine can't.

Maybe Jim can explain this better, but we find a very pleasent
isomorphism between SiteObjects, Portal Objects, and virtual hosting,
this is why we have a new object type that gets 'inserted' into the
chain.  Since a Siteobject works just like a folder, except for the URL
rewriting (and that doesn't happen if the SERVER_URL doesn't match the
base URL of the virtual host) then you are really only inserting a
folder, but a sorta special folder that knows some tricks.

-Michel