Hi, I have build a external product with its own classes for storing information. How can I get Zcatalog to index the data within these classes and how do I get Zcatalog to index certain parts of these classes (certain dictionaries).
From the ZMI, Zcatalog finds my product but it won't index for instance the tekst field wich is contained in the class. Classes are build on folder or objectmanager.
regards, Henny
Henny van der Linde wrote at 2004-5-11 01:30 +0200:
I have build a external product with its own classes for storing information. How can I get Zcatalog to index the data within these classes and how do I get Zcatalog to index certain parts of these classes (certain dictionaries).
Please read the "ZCatalog" section in the Zope Book (2.6 edition, online on Zope.org). It explains how indexes and metadata fields of the catalog correspond with attributes and methods (maybe acquired) of indexed objects. -- Dieter
Hi,
Henny van der Linde wrote at 2004-5-11 01:30 +0200:
I have build a external product with its own classes for storing information. How can I get Zcatalog to index the data within these classes and how do I get Zcatalog to index certain parts of these classes (certain dictionaries).
Please read the "ZCatalog" section in the Zope Book (2.6 edition, online on Zope.org).
It explains how indexes and metadata fields of the catalog correspond with attributes and methods (maybe acquired) of indexed objects.
Thanks, but I'm aware of the Zcatalog section in the Zope book. I got the ZCatalog perfectly working with my ZClasses. However I'm building the next generation of our Zope based cms entirely with external products, leaving ZClasses behind. Documention including the developpers guide isn't any helpfull regarding the Zcatalog in this respect. I have a product wich has a dictionary of dictionaries (items) for storing data, including text data. One of the items fields is tekst (text). Of course I can instruct the Zcatalog to catalog this product. But it won't find the 'tekst' object (or any other) in the object in while creating indexes. I'm clearly missing something here. Henny
On Tuesday 11 May 2004 01:03 pm, Henny van der Linde (zettai) wrote:
Thanks, but I'm aware of the Zcatalog section in the Zope book. I got the ZCatalog perfectly working with my ZClasses. However I'm building the next generation of our Zope based cms entirely with external products, leaving ZClasses behind. Documention including the developpers guide isn't any helpfull regarding the Zcatalog in this respect.
I have a product wich has a dictionary of dictionaries (items) for storing data, including text data. One of the items fields is tekst (text). Of course I can instruct the Zcatalog to catalog this product. But it won't find the 'tekst' object (or any other) in the object in while creating indexes.
Define an accessor method 'getTekst(self)' which returns the value you want, then create an index/metadata-column for that function 'getTekst'. Alec Mitchell
Henny van der Linde (zettai) wrote at 2004-5-11 22:03 +0200:
... Thanks, but I'm aware of the Zcatalog section in the Zope book. I got the ZCatalog perfectly working with my ZClasses. However I'm building the next generation of our Zope based cms entirely with external products, leaving ZClasses behind. Documention including the developpers guide isn't any helpfull regarding the Zcatalog in this respect.
That is because there is nothing special for external products with respect to the ZCatalog: attributes and parameterless methods are indexed/put in the catalog's metadata row when the name agrees. This general principle applies to everthing: Zope objects, ZClasses, external products ... -- Dieter
Thanks, but I'm aware of the Zcatalog section in the Zope book. I got the ZCatalog perfectly working with my ZClasses. However I'm building the next generation of our Zope based cms entirely with external products, leaving ZClasses behind. Documention including the developpers guide isn't any helpfull regarding the Zcatalog in this respect.
That is because there is nothing special for external products with respect to the ZCatalog: attributes and parameterless methods are indexed/put in the catalog's metadata row when the name agrees.
This general principle applies to everthing: Zope objects, ZClasses, external products ...
-- Dieter
What I overlooked was the fact that you have to define an acces method (as Alec Mitchell pointed out) for the fields in the dictionaries and use that as fieldnames in the indexes. Stupid of me, basic OOP, but I didn't know I could use methods as fields for the indexes. I have it now perfectly working. Henny
participants (4)
-
Alec Mitchell -
Dieter Maurer -
Henny van der Linde -
Henny van der Linde (zettai)