<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for your help. With your help I have added a ZCatalog to my
product and some indexes to it. Next question is how to add new items
to the indexes as they are created and edited. CatalogAware alone does
not seem to be sufficient.<br>
<br>
Here is what I have so far:<br>
<br>
<hr size="2" width="100%"><br>
from Products.ZCatalog import ZCatalog<br>
...<br>
class MusicLibrary(Folder):<br>
&nbsp;&nbsp;&nbsp; "A Zope Folder for the objects of the Music Library"<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; meta_type = "Music Library"<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; def __init__(self, id, title, description = ""):<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ... &nbsp;&nbsp; &nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._catalog = ZCatalog.<b>ZCatalog</b>('Catalog')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._catalog.<b>addIndex</b>('path_index', 'PathIndex')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._catalog.<b>addIndex</b>('text_index', 'TextIndex')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._catalog.<b>addIndex</b>('field_index', 'FieldIndex')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._<b>setObject</b>('Catalog', self._catalog)<br>
&nbsp;&nbsp;&nbsp; ...<br>
&nbsp;&nbsp;&nbsp; def addItem(self, id, item):<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._<b>setObject</b>(id, item)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.category = None<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._catalog.<b>catalog_object</b>(item) # does not work yet
!!!<br>
<br>
<hr size="2" width="100%"><br>
from Products.ZCatalog.CatalogPathAwareness import CatalogAware<br>
...<br>
class Composer(SimpleItem, <b>CatalogAware</b>):<br>
&nbsp;&nbsp;&nbsp; ...<br>
<br>
<hr size="2" width="100%"><br>
Any ideas or examples? Your help is appreciated.<br>
<br>
thanks<br>
Andre<br>
<br>
<br>
<br>
Dieter Maurer wrote:
<blockquote cite="mid16456.62530.95964.541273@gargle.gargle.HOWL"
 type="cite">
  <pre wrap="">Andre Meyer wrote at 2004-3-4 15:03 +0100:
  </pre>
  <blockquote type="cite">
    <pre wrap="">The Zope Book explains the use of ZCatalog for indexing and searching 
(<a class="moz-txt-link-freetext" href="http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx">http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx</a>).

However, I want to use Catalog (and not ZCatalog) in my 
file-system-based product. I use a Folder object to which I add custom 
objects using self._setObject(id, item).
    </pre>
  </blockquote>
  <pre wrap=""><!---->
"ZCatalog" is essentially a configuration device for the "Catalog".
Searching, indexing, adding columns and indexes essentially
work for "Catalog" as they do for "ZCatalog".

You are using "Catalog" in an "unsupported" way.
Therefore, you must expect to look at its (and that of ZCatalog)
code from time to time to find out some relevant details.

  </pre>
</blockquote>
<br>
</body>
</html>