+ in url /zope object name
I am running into the problem mentioned in: http://mail.zope.org/pipermail/zope/2003-October/141868.html I have "+" used in a directory name of some content generated outside zope that I want to upload. Preserving the directory name is necessary for the integrity of the data. Why is "+" a prohibited name for a zope object? As a solution Andy Mackay suggests modifying zope to allow "+" in a zope object name. Is there a downside to this?
On 4/4/06, Brian Sullivan <briansullivan@gmail.com> wrote:
Why is "+" a prohibited name for a zope object? As a solution Andy Mackay suggests modifying zope to allow "+" in a zope object name. Is there a downside to this?
I think it is a reserved name in Zope3. + are there used for the views that help create new objects. That could be a downside. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On 4/4/06, Lennart Regebro <regebro@gmail.com> wrote:
On 4/4/06, Brian Sullivan <briansullivan@gmail.com> wrote:
Why is "+" a prohibited name for a zope object? As a solution Andy Mackay suggests modifying zope to allow "+" in a zope object name. Is there a downside to this?
I think it is a reserved name in Zope3. + are there used for the views that help create new objects.
Seems like a strategic design mistake though doesn't it?
On 4/4/06, Brian Sullivan <briansullivan@gmail.com> wrote:
Seems like a strategic design mistake though doesn't it?
Which one? Calling adders "+" or creating objects called "+"? ;-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
Brian Sullivan wrote at 2006-4-4 12:38 -0400:
On 4/4/06, Lennart Regebro <regebro@gmail.com> wrote:
I think it is a reserved name in Zope3. + are there used for the views that help create new objects.
Seems like a strategic design mistake though doesn't it?
I agree with you... However, Zope3 allows you to configure the rules. Thus, you can allow names starting with '+'. -- Dieter
On 4/5/06, Dieter Maurer <dieter@handshake.de> wrote:
Brian Sullivan wrote at 2006-4-4 12:38 -0400:
On 4/4/06, Lennart Regebro <regebro@gmail.com> wrote:
I think it is a reserved name in Zope3. + are there used for the views that help create new objects.
Seems like a strategic design mistake though doesn't it?
I agree with you...
However, Zope3 allows you to configure the rules. Thus, you can allow names starting with '+'.
Starting with a "+"? What about containing a "+"? What about Zope 2? The reason this is an issue for me is that I have a whole bunch of content that has directories using "+" in the name that I would like to upload.
--On 5. April 2006 14:12:15 -0400 Brian Sullivan <briansullivan@gmail.com> wrote:
Starting with a "+"? What about containing a "+"?
What about Zope 2?
The reason this is an issue for me is that I have a whole bunch of content that has directories using "+" in the name that I would like to upload.
Basically: things are as they are. If you want something different try to patch the code as you mentioned in your first mail...patch it and try it out. -aj ----------------------------------------------------------------------- - Andreas Jung ZOPYX Ltd. & Co KG - - E-mail: info@zopyx.com Web: www.zopyx.com, www.zopyx.de - -----------------------------------------------------------------------
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Jung wrote:
--On 5. April 2006 14:12:15 -0400 Brian Sullivan <briansullivan@gmail.com> wrote:
Starting with a "+"? What about containing a "+"?
What about Zope 2?
The reason this is an issue for me is that I have a whole bunch of content that has directories using "+" in the name that I would like to upload.
Basically: things are as they are. If you want something different try to patch the code as you mentioned in your first mail...patch it and try it out.
Zope maps URL traversal onto at least three separate kinds of things: - object attributes - container items - software lookup (typically views) On the filesystem, you only have to deal with *one* of these, which is why there are no (or fewer) restrictions. For non-containers, the clash between attribute and software lookup is usually resolvable in an unambiguous way. However, for containers whos items can be named arbitrarily by the users (your case), there is no clear way to resolve whether a particular path element should refer to an item or a view. Reserving some portion of the namespace for view / software lookup (leading '@@' for views, leading '++<namespacename>++' for other fancy traversal) is a compromise for coping with the problem. Zope2 *doesn't* cope well with it, which led to *lots* of grief: the classic example is that you add an object named 'target' and suddenly your ZMI tabs all break. Zope2 applications have therefore often imposed harsher restrictions on naming container items, trying to reduce such conflicts. Zope2 also had a policy (going back to Bobo) that "private" methods (whose names traditionally start with '_' in Python) would not be publishable, which is the origin of the restriction on leading underscores. The case the OP referred to *is* pluggable in Zope3: the "adding" name doesn't have to be '+', and you can register a different name-checker component for your containers than the default one. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFENFDO+gerLs4ltQ4RApIkAJ4kuldPkavrLolxdoVxbQfm0ue9sQCfW7s3 LnwicjBdOUFQyYXEctVhsas= =re4Q -----END PGP SIGNATURE-----
Brian Sullivan wrote at 2006-4-5 14:12 -0400:
...
However, Zope3 allows you to configure the rules. Thus, you can allow names starting with '+'.
Starting with a "+"? What about containing a "+"?
In Zope3, you decide about the naming rules.
What about Zope 2?
In Zope2, only a few special characters are allowed.
The reason this is an issue for me is that I have a whole bunch of content that has directories using "+" in the name that I would like to upload.
You can easily extend the regular expression checking for bad ids. I even removed almost all restrictions in our local Zope version (only "/" and ";" is still forbidden). That was a bit more work, as proper escaping is necessary. -- Dieter
Brian Sullivan wrote at 2006-4-4 12:04 -0400:
... Why is "+" a prohibited name for a zope object?
Almost surely, due to a stupidity: Why would you want to use anything beside letters, numbers, and characters from "-_~,.$()# " in ids? You probably see a reason (as I do) but the Zope authors did not... -- Dieter
participants (5)
-
Andreas Jung -
Brian Sullivan -
Dieter Maurer -
Lennart Regebro -
Tres Seaver