[Zope] Catalog and CatalogAware questions

Kevin Dangoor kid@kendermedia.com
Wed, 17 May 2000 11:00:31 -0400


----- Original Message -----
From: "ed colmar" <element@immersivearts.com>
To: "Kevin Dangoor" <kid@kendermedia.com>
Cc: <zope@zope.org>
Sent: Tuesday, May 16, 2000 11:49 PM
Subject: Re: [Zope] Catalog and CatalogAware questions


> After inhereiting CatalogAware in all my classes I can now see the main
> catalog when I add a Zsearch interface.  I haved renamed some of my
> variables to match standard naming conventions, namely "title" and
> "summary".  so without adding anything to the meta data table there should
> still be some functionality.

Standard naming conventions are helpful when using ZCatalog.

> Now, within my product, when I add a person, the table does not say 2
> records.  Also, searches for that new person are unsuccessful. I am
curious
> if I need to do any specific calls to inform zope or Catalog of the
> 'person' objects when they are created.  Do the person objects neet to
> inherit some kind of generic zope object?  Currently it only inherits:
> Persistent, Implicit, CatalogAware.

This is where my ZClass-centric upbringing makes it hard for me to answer...
You may want to look at the PTK and see how PTK objects work (Links,
Documents, etc.) These objects all inherit PortalContent, which acts
similarly to CatalogAware (but adds review features). In a ZClass that is
CatalogAware, the CatalogAware class implements a manage_afterAdd that
indexes the object to begin with. However, with ZClasses this happens before
the object's properties are set. So, you need to then set the properties and
call reindex_object.

However, there seems to be some other problem since your objects are not
even getting added to the catalog.

> As it is you don't see the person objects in the "contents" view of the
> management screens, and I want it to stay that way.
>
> I feel like I'm close to the solution.  thx

Glad to help!

Kevin