Re: [Zope-dev] Re: Zope 2.7.0 b3 regressions
On Monday 08 December 2003 21:21, Paul Winkler wrote: On Mon, Dec 08, 2003 at 08:24:04PM +0100, Dieter Maurer wrote: Maybe, my contribution has not been read. Thus, I try again: / + absolute_url(1) should implement the notion of absolute-path URL reference (see RFC2396 section 5). This means, that the receiving browser should be able to retrieve the object correctly given this URL reference. Yup. But while we're on the subject... Why doesn't absolute_url(1) include a leading slash? I don't think I've ever seen a use of absolute_url(1) that didn't have to add the slash. What was the rationale originally? Because dtml-var BASEPATH1/dtml-var absolute_url(1) looks nicer than without the slash ? -- Toby Dickenson ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Zope 2.7.0 b3 regressions
Toby Dickenson wrote: Because dtml-var BASEPATH1/dtml-var absolute_url(1) looks nicer than without the slash ? OT: Seeing as that would actually have to be written dtml-var REQUEST.BASEPATH1 html_quote/dtml-var absolute_url(1) html_quote to get anywhere close to reliable and secure behavior, calling dtml-anything nice seems to be a bit moot--bug 813 lives on. ...but anyway, I have no opinion on the absolute_url api one way or the other, its been so carry on... ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] WebDAV Collection/Resource Chameleon Question
Eric Roby wrote: We are trying to make a 'folderish' (WebDAV Collection) class appear as a WebDAV Resource to WebDAV clients. I won't go into the reasons why we want to do this unless someone is interested. We have made several attempts at this but have been unsuccessful to date. Rather than go into all the gory details about what we have tried I am asking if anyone could tell me if it is even technically possible to trick the WebDAV machinery (server/client) into treating this class in this way? Yes. Oh, you want to know how too_ Hang, on I'll look up the code You need to set a bunch of attributes on the class: isPrincipiaFolderish = 0 __dav_collection__ = 0 isAnObjectManager = 0 As I remember, any of these set to 1 will make the Collection object behave like a collection. Setting isPrincipiaFolderish to 0 will make the folder dissapear from the ZMI-tree too, but the othger ones have no real side effects. I don't remember the details to WHY this is like this, so you can experiment with removing some of these settings, I may misremember. //Lennart ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Zope 2.7.0 b3 regressions
Hi Stefan! Stefan H. Holek wrote: absolute_url(1) was broken (by my definition of broken) basically since the introduction of VHM, which means the better part of 2 years. Naturally, there is code now that relies on this (broken) behavior. This does however not mean it should not be fixed! AFAICT 'inside-out' hosting was used long before the introduction of VHM. Using your definition of broken absolute_url(1) was broken since the introduction of CGI scripts, which means longer than Zope has its current name. [...] The idiom '/'+absolute_url(1) to get the path part of an object's URL is *very* common, and as luck will have it *works absolutely fine* as long as inside-out hosting is not present. So this error usually goes undetected and creeps all over people's code. I'd be willing to bet that it is possible to break other packages like, say, Plone simply by changing Vhost configs as well ;-). Note that this is one of my main points: It will be of little use to document usage of BASEPATH1+absolute_url(1) when '/'+absolute_url(1) appears to work (until it is far too late). I can see why you think the API should be changed. But do you really think it is the Right Thing to break existing products of people who read the API documentation and tested their products carefully to fix the products of people who trusted their intuition? Cheers, Yuppie ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Post-mortem [Was: Zope 2.7.0 b3 regressions]
After causing all this noise, let me summarize what I now understand is the intended behavior of Zope's URL methods. Given an object is accessed by /VirtualHostBase/http/example.com:80/VirtualHostRoot/_vh_foo/folder/doc 1) doc.absolute_url() Returns the full URL of doc including protocol and host. e.g. http://example.com/foo/folder/doc 2) doc.absolute_url(relative=1) Returns the path of doc, relative to the virtual root. e.g. folder/doc 3) REQUEST.BASEPATH1 + '/' + doc.absolute_url(1) Results in the absolute path of doc, starting at the server root. e.g. /foo/folder/doc Comments: ad 2) This may or may not be RFC-2396 compliant, I must admit I fail to parse the RFC here. It certainly appears necessary for b/w compatibility at least. ad 3) It may still be a good idea to add an API method for this (e.g. 'absolute_path') like I proposed in February (#809). If only to increase the visibility of this requirement. I understand that it may be too late for 2.7. Whoever is going to unroll the fix, please also adapt the tests in Products/SiteAccess/tests. Finally, please accept my apologies for the tone of some replies; I do certainly need a vacation. Stefan -- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Post-mortem [Was: Zope 2.7.0 b3 regressions]
I'd like to suggest that any new methods created to handle paths or urls do not require parameters for different behaviours (which should be implemented as different methods), so that they can be more easily used from plain ZPT path expressions. Cheers, Leo ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]
Summary: absolute_url(1) didn't include the path to the virtual root, which broke code that assumed that it could just prepend / in all cases. I changed it to include the base path, and broke code that prepends BASEPATH1. Since the old behavior existed for two years (including part of the 2.7 beta), is arguably easier to work with, and works with existing CMF code, I will revert to it. This will leave /-prepending code broken. In line with Stefan's original suggestion, I will add a new method with alternate behavior. It's not hard to grep for broken code and use the new method to make it correct -- Product authors should do so. def absolute_url_path(self): '''Return the entire path of the absolute URL for this object. This includes the leading slash, and can be used as an absolute-path reference as defined in RFC 2396. ''' Lennart proposed additional methods, but I'm going to work on that in the post-2.7 branches, since I really want to clean up this mess properly, and beta 3 isn't the time. Cheers, Evan @ 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]
On Tuesday 09 December 2003 16:24, Evan Simpson wrote: Summary: absolute_url(1) Looks good. -- Toby Dickenson ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]
On Tue, Dec 09, 2003 at 10:24:47AM -0600, Evan Simpson wrote: def absolute_url_path(self): '''Return the entire path of the absolute URL for this object. This includes the leading slash, and can be used as an absolute-path reference as defined in RFC 2396. ''' OK. But maybe the docstrings could be more clear about BASEPATH1? IIUC, absolute_url(1) will leave out BASEPATH1, continuing the behavior from zope 2.7, but absolute_url_path() will include BASEPATH1? I propose this, in OFSP/help/ObjectManagerItem.py: def absolute_url_path(self): ''' Return the entire path portion of the absolute URL for this object. This includes the leading slash and BASEPATH1, and can be used as an absolute-path reference as defined in RFC 2396. Thus, this method is always safe to use with VirtualHostMonster. ''' def absolute_url(relative=None): Return the absolute url to the object. If the relative argument is provided with a true value, then the URL returned is relative to the site object. Does not include a leading slash or BASEPATH1, thus is not always safe to use with VirtualHostMonster. Code that uses '/'+absolute_url(1) should be changed to use absolute_url_path instead. Permission -- Always available I removed the logical rather than physical note from absolute_url because I don't think it was actually true before Evan's change, which IIUC is being reverted. Maybe I misunderstood. Lennart proposed additional methods, but I'm going to work on that in the post-2.7 branches, since I really want to clean up this mess properly, and beta 3 isn't the time. Great. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's HYPO-SUPERCALIFRAGILISTICEXPIALADOCIOUS THIGH MAN! (random hero from isometric.spaceninja.com) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]
Summary: absolute_url(1) didn't include the path to the virtual root, which broke code that assumed that it could just prepend / in all cases. I changed it to include the base path, and broke code that prepends BASEPATH1. Since the old behavior existed for two years (including part of the 2.7 beta), is arguably easier to work with, and works with existing CMF code, I will revert to it. This will leave /-prepending code broken. In line with Stefan's original suggestion, I will add a new method with alternate behavior. It's not hard to grep for broken code and use the new method to make it correct -- Product authors should do so. Good call. I think it would be best to make sure the docstring of the new method is clear on its reason for being. I think somewhere there is an interface file that is used to generate some of the api docs - ideally that can get updated too. Brian Lloyd[EMAIL PROTECTED] V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Post-mortem [Was: Zope 2.7.0 b3 regressions]
Stefan H. Holek wrote at 2003-12-9 15:47 +0100: ... Given an object is accessed by /VirtualHostBase/http/example.com:80/VirtualHostRoot/_vh_foo/folder/doc ... 2) doc.absolute_url(relative=1) Returns the path of doc, relative to the virtual root. e.g. folder/doc ... Comments: ad 2) This may or may not be RFC-2396 compliant, It is not as /folder/doc would not allow to locate the correct object but likely result in an Resource not found. -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope Head (2.8) breaks refresh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/12/2003, at 12:15 AM, Dieter Maurer wrote: Playing with Zope Head (as of 2003-12-04) revealed problems with refresh. This is not just a 2.8 issue - the behavior is in the 2.7 betas (at least up to beta 2 - havn't tested autorefresh with beta 3 yet) as well: http://collector.zope.org/Zope/1010 Manually refreshing works fine, but automatic refreshes cause the ValueErrors. - -- Stuart Bishop [EMAIL PROTECTED] http://www.stuartbishop.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) iD8DBQE/1mfNAfqZj7rGN0oRAj9PAJ4+EUiHT9uI48ne5fRbO7+Tfa2fSQCdETcl ZF0IU3quFDv6QGlnzRdxSz4= =HIIJ -END PGP SIGNATURE- ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )