Hi all, Zope seems to behave weird/inconsistently when copy/cut/pasting objects from folder (-objects) to folder (-objects). For one, it doesn't seem possible to move an object more up to the root (or anywhere not *below* the folder the object was cut/copied from). This is partially due to the fact that the __cp (clipboard) cookie has it's path set to it's originating folder. I.e move /foo/bar/a to /foo/a or to /blah/a Clipboards seem to be local to the folder. This may be related to the nature of cookies (with their path set to that the path of that folder), I'm not sure. If you cut 'a' in /foo/bar, then cut 'b' from / and try to paste 'b' in /foo/bar, you'll end up with '/foo/bar/a' again. And as it is not possible to clear your clipboard (esp which opera, which cannot clear cookies), it's very difficult to move objects in these circumstances. Is there any clear reason zope behaves this way? Are there any problems to be expected if the path of the __cp cookie is set to /, so your clipboard is visible everywhere? Could ZCatalog aware objects cause problems? I'd be willing to spend some time on fixing this if there's nothing that it would break. Cheers, Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam -=- Tel: +31-20-4688336 Linux/Unix based corporate Fax: +31-20-4688337 and Web: http://www.amaze.nl/ Internet Solutions Email: ivo@amaze.nl -=-
For one, it doesn't seem possible to move an object more up to the root (or anywhere not *below* the folder the object was cut/copied from). This is partially due to the fact that the __cp (clipboard) cookie has it's path set to it's originating folder. I.e move /foo/bar/a to /foo/a or to /blah/a
Clipboards seem to be local to the folder. This may be related to the nature of cookies (with their path set to that the path of that folder), I'm not sure. If you cut 'a' in /foo/bar, then cut 'b' from / and try to paste 'b' in /foo/bar, you'll end up with '/foo/bar/a' again. And as it is not possible to clear your clipboard (esp which opera, which cannot clear cookies), it's very difficult to move objects in these circumstances.
Is there any clear reason zope behaves this way? Are there any problems to be expected if the path of the __cp cookie is set to /, so your clipboard is visible everywhere? Could ZCatalog aware objects cause problems?
I'd be willing to spend some time on fixing this if there's nothing that it would break.
Hmm - we can't just set it to '/', because some people have multiple Zope instances mapped to a domain (ex: my.com/foo/ and my.com/bar/ are aliased to two different Zope instances). I think what we need to do is figure out the "virtual" root url and set the cookie with that path. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations www.digicool.com
On Sat, Apr 14, 2001 at 09:07:52AM -0400, Brian Lloyd wrote:
For one, it doesn't seem possible to move an object more up to the root (or anywhere not *below* the folder the object was cut/copied from). This is partially due to the fact that the __cp (clipboard) cookie has it's path set to it's originating folder. I.e move /foo/bar/a to /foo/a or to /blah/a
Clipboards seem to be local to the folder. This may be related to the nature of cookies (with their path set to that the path of that folder), I'm not sure. If you cut 'a' in /foo/bar, then cut 'b' from / and try to paste 'b' in /foo/bar, you'll end up with '/foo/bar/a' again. And as it is not possible to clear your clipboard (esp which opera, which cannot clear cookies), it's very difficult to move objects in these circumstances.
Is there any clear reason zope behaves this way? Are there any problems to be expected if the path of the __cp cookie is set to /, so your clipboard is visible everywhere? Could ZCatalog aware objects cause problems?
Hmm - we can't just set it to '/', because some people have multiple Zope instances mapped to a domain (ex: my.com/foo/ and my.com/bar/ are aliased to two different Zope instances).
I think what we need to do is figure out the "virtual" root url and set the cookie with that path.
This sounds difficult. Wouldn't it be easier to use some sort of unique zope instance id (if none exists: something like the hostname + port the zope is running on) and use this in the clipboards cookie name? Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam -=- Tel: +31-20-4688336 Linux/Unix based corporate Fax: +31-20-4688337 and Web: http://www.amaze.nl/ Internet Solutions Email: ivo@amaze.nl -=-
On Sat, Apr 14, 2001 at 04:37:26PM +0200, Ivo van der Wijk wrote:
Hmm - we can't just set it to '/', because some people have multiple Zope instances mapped to a domain (ex: my.com/foo/ and my.com/bar/ are aliased to two different Zope instances).
I think what we need to do is figure out the "virtual" root url and set the cookie with that path.
This sounds difficult. Wouldn't it be easier to use some sort of unique zope instance id (if none exists: something like the hostname + port the zope is running on) and use this in the clipboards cookie name?
No, it's quite easy, the REQUEST object has several variables that take care of this (like REQUEST.BASEPATH1). Note that cookies are already bound to a particular hostname and port number, you can at most make them bind to a domain name instead, but this in not the default behaviour. And it wouldn't solve the problem in this situation. -- Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ ---------------------------------------------
On Mon, Apr 16, 2001 at 08:38:16AM +0200, Martijn Pieters wrote:
On Sat, Apr 14, 2001 at 04:37:26PM +0200, Ivo van der Wijk wrote:
Hmm - we can't just set it to '/', because some people have multiple Zope instances mapped to a domain (ex: my.com/foo/ and my.com/bar/ are aliased to two different Zope instances).
I think what we need to do is figure out the "virtual" root url and set the cookie with that path.
This sounds difficult. Wouldn't it be easier to use some sort of unique zope instance id (if none exists: something like the hostname + port the zope is running on) and use this in the clipboards cookie name?
No, it's quite easy, the REQUEST object has several variables that take care of this (like REQUEST.BASEPATH1).
Note that cookies are already bound to a particular hostname and port number, you can at most make them bind to a domain name instead, but this in not the default behaviour. And it wouldn't solve the problem in this situation.
In the situation Brian suggested, 2 zopeservers are running on 1 domain, probably with apache in front of it. So /foo points to zope server 1 and /bar points to zope server 2. And you don't want these two to share their __cp cookie. And of course each zope server is running on a unique (host,port), but it's not always certain that the server is accessed this way (i.e. I let my customers visit www.somedomain.com/manage instead op zopehosting.amaze.nl/ZopeHosting/site/manage) Anyway, I'll look further into it and see what I can come up with. Vrolijk pasen, Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam -=- Tel: +31-20-4688336 Linux/Unix based corporate Fax: +31-20-4688337 and Web: http://www.amaze.nl/ Internet Solutions Email: ivo@amaze.nl -=-
For one, it doesn't seem possible to move an object more up to the root (or anywhere not *below* the folder the object was cut/copied from). This is partially due to the fact that the __cp (clipboard) cookie has it's path set to it's originating folder. I.e move /foo/bar/a to /foo/a or to /blah/a
Clipboards seem to be local to the folder. This may be related to the nature of cookies (with their path set to that the path of that folder), I'm not sure. If you cut 'a' in /foo/bar, then cut 'b' from / and try to paste 'b' in /foo/bar, you'll end up with '/foo/bar/a' again. And as it is not possible to clear your clipboard (esp which opera, which cannot clear cookies), it's very difficult to move objects in these circumstances.
Actually, as of 2.3.x (and for quite some time before), Zope uses 'SCRIPT_NAME' as the "path" value for the cookie. That should be doing the right thing, except in certain virtual hosting situations. I just checked in a fix that should deal with the odd VH situation, but I don't understand why you are seeing the behavior that you are. What client are you using? Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
participants (3)
-
Brian Lloyd -
Ivo van der Wijk -
Martijn Pieters