[Zope-dev] update Zcatalog

Johan Beauce jbeauce@odyssey-group.com
Thu, 27 Sep 2001 09:55:24 +0200


Hello,

I use Zcatalog to index my file. This file change often. They are deleted,
added or modified.
I have two choices to update my ZCatalog :
first 
when I add a file, I add the file to the catalog (but it doesn't work)

<dtml-let docAdding="_.getattr(PARENTS[0], idName)">
  <dtml-call
"companyDoc.catalog.catalog_object(docAdding,_.string.join(docAdding.getPhys
icalPath(),'/'))">
</dtml-let>

when I delete a file, I delete the file from the catalog (but it doesn't
work)

<dtml-let docAdding="_.getattr(PARENTS[0], idName)">
  <dtml-call
"companyDoc.catalog.uncatalog_object(_.string.join(docAdding.getPhysicalPath
(),'/'))">
</dtml-let>

second 
clear the catalog, and create all indexes in catalog again.

<dtml-tree>
<dtml-if "objectValues(['File'])">
    <dtml-call
"companyDoc.catalog.catalog_object(id,_.string.join(docAdding.getPhysicalPat
h(),'/'))"
</dtml-if>
</dtml-tree>

Can you help me to this two solutions work please ?