[Zope] Catalog and CatalogAware questions

ed colmar element@immersivearts.com
Tue, 16 May 2000 21:49:50 -0600


Thanks again for your time kevin.  I appreciate your help a great deal.

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.

So, the catalog gets updated with this new record (the fresh install of my
product), and reads successfully that 1 record is in each of the meta data
tables.  All good so far.

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.  

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

-ed-

At 09:52 AM 5/16/00 -0400, you wrote:
>----- Original Message -----
>From: "ed colmar" <element@immersivearts.com>
>To: "Kevin Dangoor" <kid@kendermedia.com>
>Sent: Monday, May 15, 2000 10:03 PM
>Subject: Re: [Zope] Catalog and CatalogAware questions
>
>
>>
>> Thanks for your reply Kevin.
>>
>> You have made the picture a bit clearer in my mind.  I don't quite follow
>> your points about the metadata table.  This is the table within the
>catalog
>> that contains the searchable items correct?  So, when someone first
>> installs my product, it or they will need to check to see if the meta data
>> attributes are set, and if not, set them?
>
>When you search the Catalog, the fields that are compared for the search are
>compared against the indexed fields. The return value is a list of search
>result objects that include the values from the meta data table. The
>advantage to this setup is that the actual objects (which could be quite
>large) are not activated when you do a search.
>
>I'll give the caveat that my experience has been in building ZClass
>products, but many of the same lessons are applicable to Python products.
>
>When I first created KM|net News, I specified in the documentation that the
>user needed to add a few properties to the metadata table, and other
>properties to the indexes. This *can* be automated though. The latest
>version of KMNN creates its own Catalog and sets up the proper indexes and
>all. There's no reason why it couldn't configure another Catalog similarly.
>
>> Was I mistaken in setting the _searchable_result_columns()
>> and _searchable_arguments()?
>
>I don't remember the exact bit of code... I just know that when you're doing
>"application-level" stuff with ZCatalog, you don't really need to do a whole
>lot to make it work. In DTML,
><dtml-in "Catalog({'metatype' : 'Foo', 'title' : 'something'})">
><dtml-var title>
></dtml-in>
>
>In python:
>for obj in self.Catalog({'metatype' : 'Foo', 'title' : 'something'}):
>  if obj.title == "Something Something Something":
>    return "something else"
>
>> With this method, can a search be performed on just this product?  Can it
>> also be performed on the entire zope install
>
>Yep. Just set the metatype in your search... I think you'll find that for
>application-level sorts of things, DTML examples may help you, because they
>can be converted to Python pretty readily (as you see above).
>
>Kevin
>
>
>