[Zope] zcatalog/zclass problem.. help!

Chris McDonough chris@iqgroup.com
Thu, 23 Sep 1999 13:18:40 -0400


I've searched the mailing list in vain trying to find someone with this same
problem...

Here tis:

I've created a ZClass named "News Item", which is, strangely enough, a news
item.  It has a class, newsClass, that has a property sheet, Properties,
upon which properties have been developed... including "news", "subject",
"owner", "date", "department" and a few others.

I've tweaked the methods within this zclass to give me the sort of actions I
want upon add and edit, etc.

It's based on ZObject and ZClass_for_Catalog_Aware.
ZClass_for_Catalog_Aware was the first base class when it was created.

Instances of this custom Zclass are placed in folders within my site... I
have additionally developed a Zcatalog ("Catalog"), which lives at the root
of the zodb.  Its only contents are news items and it has been indexed on
all the properties of the news item.  Additionally, metadata properties are
the same as the indexed properties.

What I want to happen is this... when someone adds an instance of a news
item, I want it to be immediately added to the zcatalog "Catalog" and become
visible on the "home" page of the site through dtml like this:

<!--#in "Catalog.searchResults()" sort=id reverse--><!--#comment "id" is
zopetime with underscores, eg. 1999_09_23_13_05_17_4633_US_Eastern-->  
<p>
<B><!--#var department--></B> news:<br>
<A HREF="/<!--#var "Catalog.getpath(data_record_id_)"-->"><!--#var
subject--></A><br>
</p>
<!--#/in-->

Now this sort of works... this dtml snippet will display just "news:" when a
new instance of the News Item zclass is added to the site, meaning that it
KNOWS there's a new instance of News Item....  for each news item that gets
added, it will display another instance of the text "news:".  So on my front
page, if I have five news items zclass instances in my site, it'll look
something like this:

news:

news:

news:

news:

news:


However, it wont display any of the dynamic content eg. <!--#var
department-->, <!--#var subject-->, etc. until I go into the Catalog
Zcatalog and manually update the catalog.  Once I manually update the
zcatalog, I get content like:

AppDev news:
This is news.

etc....

Why is this?  Any ideas?