[Zope] automate Find and Catalog

Igor Leturia IGOR@emun.com
Tue, 15 Apr 2003 17:06:36 +0200


>does anybody know how i can make a link that will automatically find
>objects and catalog them? so instead of the users doing it manually all
>they have to do is click the link.

I have a XRONDTMLMethod that makes it automatically every X hours. You
could copy the code there in a DTMLMethod and call it when you like (or
in a python script, too). This is the piece of code:

<dtml-call "catalog.manage_catalogClear()">
<dtml-call
"catalog.manage_catalogFoundItems(REQUEST,RESPONSE,URL1,URL1+'/catalog',
obj_metatypes=3D['Folder'])">

'catalog' is the name of the ZCatalog object, which is located in the
same folder as the XRONDTMLMethod. If you want to catalog objects of
type 'File', change the 'Folder' for 'File'.

    Igor Leturia