[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Advanced
Zope Scripting
webmaster at zope.org
webmaster at zope.org
Wed Dec 10 11:50:59 EST 2003
A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx#4-0
---------------
Zope breaks apart the URL and compares it to the object
hierarchy, working backwards until it finds a match for each
part. This process is called *URL traversal*. For example, when
you give Zope the URL *Zoo/LargeAnimals/hippo/feed*, it starts
at the root folder and looks for an object named *Zoo*. It then
moves to the *Zoo* folder and looks for an object named
*LargeAnimals*. It moves to the *LargeAnimals* folder and looks
for an object named *hippo*. It moves to the *hippo* object and
looks for an object named *feed*. The *feed* script cannot be
found in the *hippo* object and is located in the *Zoo* folder
by using acquisition. Zope always starts looking for an object
in the last object it traversed, in this case *hippo*.
Since *hippo* does not contain anything, Zope backs up to
*hippo's* immediate container, *LargeAnimals*. The *feed*
script is not there, so Zope backs up to *LargeAnimals'*
container, *Zoo*, where *feed* is finally found.
% Anonymous User - Dec. 10, 2003 11:50 am:
I was thoroughly impressed with most of what I'd seen in Zope, but not so much with this feature. Perhaps
it's convenient, but it's also quite dangerous in general I think. The examples of "feed" and "wash" are are
called "unsafe" methods in Web architecture terms (http://www.w3.org/TR/webarch/); that is, they change the
state of the object. Therefore they, shouldn't be invoked with GET, as Googlebot might come along and
accidentally feed your hippos. If you want to change the hippo directly to the fed state, use PUT with a
document which represents the state of that fed hippo. If you just want to give him food (that he may or may
not choose to eat), use POST with a description of the food. -- http://www.markbaker.ca
More information about the ZDP
mailing list