[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Object Publishing

webmaster@zope.org webmaster@zope.org
Wed, 25 Sep 2002 19:35:09 -0400

A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx#5-23


          If you publish an instance of the 'Example' class with the
          URL 'http://zope/example', then the relative link to method
          'one' will be 'http://zope/one', instead of the correct
          link, 'http://zope/example/one'.

            % Anonymous User - Feb. 28, 2002 2:30 pm - I believe it is still unclear just why the address of the the method "one" is not http://zope/example/one.

            % Anonymous User - July 17, 2002 5:47 pm:
             Relative links replace the last component of the URL. From http://zope/example, a relative link to href="one"
             takes you to http://zope/one. From http://zope/example/, a relative link to href="one" would take you to
             http://zope/example/one. Seemed clear enough to me.

            % limaye - Sep. 25, 2002 7:35 pm:
             For the link http://zope/example/introduction - where introduction is a zope object [contained in folder
             example] could have reference to relative links "one", "two" so on. Now the relative link at the level of
             introduction [i.e. in folder example - read on] would be interpreted by zope as http://zope/example/one,
             http://zope/example/two etc. But now consider the case that you give http://zope/example [in this case assume
             that there is no node following it and assume that there is a default method called index_html]; Further
             assume that index_html duplicates the content of introduction above - then in this scenario "one", "two"
             would be interpreted relative node "example" and subsequently it would be replaced by zope as http://zope/one
             and http://zope/two - which is not what you wanted. If you consider the / as signifying the folder object
             then http://zope/example can be interpreted as example contained in folder zope. While http://zope/example/
             would be interpreted as objects contained in folder example and hence the relative link "one" would be
             interpreted correctly relative to http://zope/example/ to mean relative to folder example; while in the case
             of http://zope/example a relative link "one" would be interpreted relative to folder zope. I hope this
             explanation helps.