I have a ZCatalog which contains about 850k entries. Each entry is a zclass instance which is NOT 'catalog aware' (ie. catalog_object was used to explicitly add the record to the zcatalog).
The records exist in the zcatalog and I can access a single record's data_record_id_ by:
<dtml-call "REQUEST.set('recid', '1049298593')"> <dtml-in "Catalog({'master_recid' : recid})"> <dtml-call "REQUEST.set('drid', data_record_id_)"> </dtml-in> drid= <dtml-var drid>
Displays:
drid= 17223047659
All is well, so far... I now want to remove the record from the ZCatalog:
<dtml-call "Catalog.uncatalog_object(recid)">
generates the following error in my log file:
2004-07-02T11:13:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1049298593.
and
<dtml-call "Catalog.uncatalog_object(drid)">
generates the following error in my log file:
2004-07-02T11:21:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1722304759.
So, how do you remove a 'non-catalog aware' object from a zcatalog? (this is the first time I have used non-catalog aware instances, in previous projects I used catalog-aware objects and just deleted the object in the folder and the object was automatically removed from the zcatalog).
Thanks for any ideas!
Jonathan
* Jonathan Hobbs toolkit@magma.ca [2004-07-02 17:36]:
<dtml-call "Catalog.uncatalog_object(recid)">
generates the following error in my log file:
2004-07-02T11:13:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1049298593.
and
<dtml-call "Catalog.uncatalog_object(drid)">
generates the following error in my log file:
2004-07-02T11:21:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1722304759.
So, how do you remove a 'non-catalog aware' object from a zcatalog? (this is the first time I have used non-catalog aware instances, in previous projects I used catalog-aware objects and just deleted the object in the folder and the object was automatically removed from the zcatalog).
Thanks for any ideas!
Jonathan
It doesn't have to be catalog aware. You should call uncatalog_object with the path of the object not the rid. If you don't know it call Catalog.getpath(rid).
Thanks Roche'
The solution was two-fold:
(1) your suggestion for use of getpath (2) apparently uncatalog_object can't indirectly access a variable stored within REQUEST eg. uncatalog_object(uid) does not work, but uncatalog_object(REQUEST['uid']) does work
Thanks again!
Jonathan
----- Original Message ----- From: "Roché Compaan" roche@upfrontsystems.co.za To: "Jonathan Hobbs" toolkit@magma.ca Cc: zope@zope.org Sent: July 2, 2004 1:11 PM Subject: Re: [Zope] uncatalog_object question
- Jonathan Hobbs toolkit@magma.ca [2004-07-02 17:36]:
<dtml-call "Catalog.uncatalog_object(recid)">
generates the following error in my log file:
2004-07-02T11:13:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1049298593.
and
<dtml-call "Catalog.uncatalog_object(drid)">
generates the following error in my log file:
2004-07-02T11:21:07 ERROR(200) Catalog uncatalogObject unsuccessfully attempted to uncatalog an object with a uid of 1722304759.
So, how do you remove a 'non-catalog aware' object from a zcatalog?
(this is
the first time I have used non-catalog aware instances, in previous
projects
I used catalog-aware objects and just deleted the object in the folder
and
the object was automatically removed from the zcatalog).
Thanks for any ideas!
Jonathan
It doesn't have to be catalog aware. You should call uncatalog_object with the path of the object not the rid. If you don't know it call Catalog.getpath(rid).
-- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za