[Zope-CMF] portal_catalog fails to update
Kevin Carlson
khcarlso@bellsouth.net
Tue, 18 Jun 2002 10:36:34 -0400
Thanks, Gitte. This works. Any idea why a catalog aware object would just
stop reindexing itself, though?
-----Original Message-----
From: Gitte Wange [mailto:gitte@mmmanager.org]
Sent: Tuesday, June 18, 2002 3:52 AM
To: Kevin Carlson; zope-cmf@zope.org
Subject: Re: [Zope-CMF] portal_catalog fails to update
Kevin Carlson wrote:
> For some reason, the portal_catalog is failing to update indexes and
> metadata that were previously working fine. When I add a new document
> (Portal File) in a script I am calling the following functions:
>
> typesTool.constructContent(docType, homeFolder, ts)
> newDoc = homeFolder[ts]
>
> ##########################
> # process metadata on form
> newDoc.editMetadata( title=docTitle
> , description=desc
> , subject=subject
> , contributors=contributor
> ,
effective_date=effectiveDate.strftime("%Y/%m/%d")
> )
>
> ########################################
> # create plainText property and populate
> newDoc.manage_addProperty('pt', pt, 'text')
> newDoc.manage_addProperty('hpt', hpt, 'boolean')
> newDoc.manage_addProperty('flag', flag, 'boolean')
>
> ####################
> # handle file upload
> newDoc.edit(file=filename)
>
> Previously, the newly created objects were being added correctly and the
> catalog was being updated properly. The properties (pt, hpt, and flag)
are
> not being updated in the catalog (there are indexes for each) even though
> the properties exist in the document. If I use the Update Catalog utility
> on the Advanced Tab of the portal_catalog tool, the indexes and metadata
are
> properly updated.
>
> Does anyone know why this would happen?
>
> Thanks,
>
> Kevin
Hi Kevin,
You nedd to call the reindexObject() method on the object when you have
modified the object (e.g. in the edit function).
Greetings,
Gitte Wange