Hi, I have a problem with an object that has a Space in it's ID Name. The object causes several problems because it sometimes cannot be found. The object is contained in a catalog_aware class and cannot be renamed or deleted because an error occurs: Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201' Anyone has a clue how I can get rid of such an object? Jochen
At 15:03 Uhr +0100 27.02.2000, Jochen Haeberle wrote:
Hi,
I have a problem with an object that has a Space in it's ID Name. The object causes several problems because it sometimes cannot be found. The object is contained in a catalog_aware class and cannot be renamed or deleted because an error occurs:
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201'
Anyone has a clue how I can get rid of such an object?
I managed to get rid of the problem part way... I created a new container instance, copied all correct items over to this one. That works fine, but the next step would mean to delete or rename the old instance, but this does not work either, I get Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000' How can I get rid of such objects? Jochen
Jochen, I had success bypassing the "Uncatalog of absent id" catch by first deleting the catalog, then deleting the catalog-aware objects. You may not want to delete the catalog, however. But you might find a way to make Zope think it's not there. Back up data.fs before doing anything you might regret. -- HTH -- Loren ----- Original Message ----- From: Jochen Haeberle <listen@MIDRAS.de> To: Zope-Talk <zope@zope.org> Sent: February 27, 2000 01:05 PM Subject: Re: [Zope] ID with Space in Name
At 15:03 Uhr +0100 27.02.2000, Jochen Haeberle wrote:
Hi,
I have a problem with an object that has a Space in it's ID Name. The object causes several problems because it sometimes cannot be found. The object is contained in a catalog_aware class and cannot be renamed or deleted because an error occurs:
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201'
Anyone has a clue how I can get rid of such an object?
I managed to get rid of the problem part way... I created a new container instance, copied all correct items over to this one. That works fine, but the next step would mean to delete or rename the old instance, but this does not work either, I get
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000'
How can I get rid of such objects?
Jochen
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 14:51 Uhr -0800 27.02.2000, Loren Stafford wrote:
Jochen,
I had success bypassing the "Uncatalog of absent id" catch by first deleting the catalog, then deleting the catalog-aware objects. You may not want to delete the catalog, however. But you might find a way to make Zope think it's not there. Back up data.fs before doing anything you might regret.
Loren, thanks for the tip, but the catalog is part of the container class and seems not to be deleteable either... Jochen
Hi, I think I asked about this on the list before, but what exactly is the rationale behind allowing spaces in object IDs? Even if it's for something like providing for file imports or WebDAV on Win32 so that the object id is the same as the original file, why not just convert all the spaces to underscores, then? Anyone who knows? --Brian Hooper On Sun, 27 Feb 2000 15:03:47 +0100 Jochen Haeberle <listen@MIDRAS.de> wrote:
Hi,
I have a problem with an object that has a Space in it's ID Name. The object causes several problems because it sometimes cannot be found. The object is contained in a catalog_aware class and cannot be renamed or deleted because an error occurs:
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201'
Anyone has a clue how I can get rid of such an object?
Jochen
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 10:12 Uhr +0900 28.02.2000, Brian Takashi Hooper wrote:
Hi,
I think I asked about this on the list before, but what exactly is the rationale behind allowing spaces in object IDs? Even if it's for something like providing for file imports or WebDAV on Win32 so that the object id is the same as the original file, why not just convert all the spaces to underscores, then?
I guess you're right, as users and content managers are to create most of the objects and give the appropriate IDs, name guidelines should somehow be enforceable... And there are more cases than IDs with spaces.... Ever had Quotes in Names or properties...??? (Like when a monitor manufacturer classifies their monitors by sizes... 15", 17"... ugly!) IDs are problematic for the average user, because s/he does not know what this is or how to keep them "uinque", I guess there should be some way to autonaming objects, so we can just leave the ID away. I know you can do this on your own (saw this on KMNN), but I guess this should go directly into Zope: Leave ID empty and a suitable name (based on date uniqueID or Title) is created. I hate it when I upload a big Image just to be told the ID I used already exists. The upload is then discarded, why not name it accordingly (ID-1 or else) and ask the user for another ID? Jochen
Jochen Haeberle wrote:
Hi,
I have a problem with an object that has a Space in it's ID Name. The object causes several problems because it sometimes cannot be found. The object is contained in a catalog_aware class and cannot be renamed or deleted because an error occurs:
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201'
Anyone has a clue how I can get rid of such an object?
It's like this - the ZCatalog used to have two ways of cataloging objects - 1. as 'Album/Narrentreffen2000/Fete%201' 2. as '/Album/Narrentreffen2000/Fete 1' the second way is now the standard (http://lists.zope.org/pipermail/zope-dev/2000-January/003021.html). However, the latest CatalogAwareness is still broken and doesn't support it yet. If you replace the url() function in the CatalogAware class with this version it should work, but it may break your applications and I'm not sure if this is the correct way to fix the problem. def url(self, ftype=urllib.splittype, fhost=urllib.splithost): """Return a SCRIPT_NAME-based url for an object.""" from urllib import unquote if hasattr(self, 'DestinationURL') and \ callable(self.DestinationURL): url='%s/%s' % (self.DestinationURL(), self.id) else: url=self.absolute_url(relative=1) type, uri=ftype(url) host, uri=fhost(uri) script_name=self.REQUEST['SCRIPT_NAME'] __traceback_info__=(`uri`, `script_name`) if script_name: uri=filter(None, string.split(uri, script_name))[0] if uri[0] != '/': uri = '/' + uri uri=uri or '/' return unquote(uri) I call absolute_url with relative=1, add a slash to the beginning of the URL and unqoute the result. In my local version I also set script_name to "" cause if I use self.REQUEST I get errors that REQUEST doesn't exist. In the Portal Toolkit, instead of defining a url() function, index_object and friends just use "'/' + self.absolute_url(1)", which is also wrong, it should be urllib.unquote('/' + self.absolute_url(1)). Or maybe have absolute_url return unurl-quoted URLs. And CatalogAware would probably work fine this way as well. So, fix CatalogAwareness, update your catalog and you're done. -- -= This is NOT a pyramid scheme =- The SNAFU Principle: True communication is possible only between equals Itamar S.T. itamars@ibm.net
Hi, thanks for your detailed reply! At 10:51 Uhr +0200 28.02.2000, Itamar Shtull-Trauring wrote:
Error Type: ValueError Error Value: Uncatalog of absent id 'Album/Narrentreffen2000/Fete%201'
Anyone has a clue how I can get rid of such an object?
It's like this - the ZCatalog used to have two ways of cataloging objects -
1. as 'Album/Narrentreffen2000/Fete%201' 2. as '/Album/Narrentreffen2000/Fete 1'
the second way is now the standard (http://lists.zope.org/pipermail/zope-dev/2000-January/003021.html). However, the latest CatalogAwareness is still broken and doesn't support it yet.
But I find exactly V1 in my Cataloged Objects... Nevertheless, I will gladly try this on a copy of my data.fs :-) Jochen
Itamar Shtull-Trauring wrote:
If you replace the url() function in the CatalogAware class with this version it should work, but it may break your applications and I'm not sure if this is the correct way to fix the problem.
def url(self, ftype=urllib.splittype, fhost=urllib.splithost): """Return a SCRIPT_NAME-based url for an object.""" from urllib import unquote if hasattr(self, 'DestinationURL') and \ callable(self.DestinationURL): url='%s/%s' % (self.DestinationURL(), self.id) else: url=self.absolute_url(relative=1) type, uri=ftype(url) host, uri=fhost(uri) script_name=self.REQUEST['SCRIPT_NAME'] __traceback_info__=(`uri`, `script_name`) if script_name: uri=filter(None, string.split(uri, script_name))[0] if uri[0] != '/': uri = '/' + uri uri=uri or '/' return unquote(uri)
I just checked in this fix, thanks. -Michel
participants (5)
-
Brian Takashi Hooper -
Itamar Shtull-Trauring -
Jochen Haeberle -
Loren Stafford -
Michel Pelletier