[Zope] VHM - ZCatalog - Find Objects

Milos Prudek milos.prudek@tiscali.cz
Fri, 04 Oct 2002 13:34:30 +0200


Milos Prudek wrote:
>> But when ZMI is used to mass-catalog (Find Objects tab), the folder is 
>> always added. Objects in the catalog have ABSOLUTE paths, i.e. paths 
>> which include the container folder which should be hidden by VHM. This 
>> is incorrect.

Clarification:

AFAIK the ZMI Find Object will put absolute paths in "Object Identifier" 
column. A Python script could iterate over newly created ZCatalog, and 
reindex every object. The same script could then uncatalog the original 
"absolute path" items.

This is my attempt at the first task: reindexing.

i=0
Meta_set=context.Catalog_Art()

for Meta in Meta_set:
   P = context.Catalog_Art.getpath(Meta.data_record_id_)
   if P.startswith('/www.orl.cz'):
     print Meta.absolute_url, P
     Obj=context.Catalog_Art.getobject(Meta.data_record_id_)
     Obj.reindex_object()
   i=i+1

return printed


This script reindexes only a few of the instances. When run a second 
time, it will reindex a few more. But never all of them.

STUPID_LOG_FILE reveals the reason: "Catalog uncatalogObject 
unsuccessfully attempted to uncatalog an object with a uid of 
/choroby/ucho/bubinek/obecne/1."

I have read http://www.zope.org/Members/lucasm/ZCatalogPatch and 
http://www.zope.org/Members/rmore/unsuccessfulUncatalog, but I do not 
feel that I should use the patch provided there.

It's a dead end. To search ZClass instances I need ZCatalog. To use 
cookie-based authentication (exUserFolder) from a root folder, I need 
Virtual Host Monster. And I do not know how to use ZCatalog and VHM 
together without generating double entries in ZCatalog as a result of 
ZMI Find Object/Update Catalog and API reindex_object.

Can anyone help me, please?

-- 
Milos Prudek