RE: [Zope-dev] Re: Subpath traversal interface (was RE: ANN: Pyth on Methods 0.1.7 up and over to DC) and over to DC)
-----Original Message----- From: Evan Simpson [mailto:evan@4-am.com]
On another note, the capability described above is actually quite similar to the __before_traverse__ behavior which SiteAccess hacks into the traversal machinery. An Access Rule can look ahead one or more path elements, and then easily manipulate, add, or remove them. Also, multiple objects can hook into the same folder's __b_t__ chain without colliding and with controllable invocation order, which is part of why I invented it rather than overriding __bobo_traverse__. Any chance that DC could incorporate it (the __before_traverse__, I mean)? It's quite clean and well tested at this point, and I could stop nervously examining each release of Zope to see if it will break SiteAccess.
The reason why we didn't roll it in is that we didn't want Yet Another Hook adding a per-traveral cost, and we could impliment SiteObjects without them. Whether or not we can impliment all your other features without is another question. What feature of SiteAccess uses the before hook? We were able to emulate the virtualhosting behavior with code silimar to yours (I stole some of yours actually) without havign to define the before hook. -Michel
Michel Pelletier wrote:
The reason why we didn't roll it in is that we didn't want Yet Another Hook adding a per-traveral cost, and we could impliment SiteObjects without them. Whether or not we can impliment all your other features without is another question. What feature of SiteAccess uses the before hook? We were able to emulate the virtualhosting behavior with code silimar to yours (I stole some of yours actually) without havign to define the before hook.
It's a wafer-thin cost, really! :-) 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. 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. 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, or if a SiteRoot and an Access Rule wanted to share the same container. It would be great if __bobo worked like __before, but I imagine that it's a bit late to be changing that one. 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. Cheers, Evan @ 4-am
participants (2)
-
Evan Simpson -
Michel Pelletier