[Zope] Problem with Automatic Cataloging Example in ZopeBook
Chris McDonough
chrism@digicool.com
Wed, 16 May 2001 10:46:29 -0400
Hi Christian,
Thanks for the report... I'm going to ask you to do one more thing, sorry.
Can you file this as a bugreport in the Collector
(http://classic.zope.org:8080/Collector)? I unfortunately don't have time
to test this right now, but if it goes in the Collector, it'll remind me to
do so when possible.
In the meantime... please hang tight, sorry.
- C
----- Original Message -----
From: "Christian Wittern" <wittern@kanji.zinbun.kyoto-u.ac.jp>
To: "Chris McDonough" <chrism@digicool.com>
Sent: Wednesday, May 16, 2001 2:33 AM
Subject: Re: [Zope] Problem with Automatic Cataloging Example in ZopeBook
> Chris McDonough <chrism@digicool.com> writes:
>
> > Hi Chris,
> >
> > Hmmm... I haven't tried this, but I'm afraid I believe you. :-( Are you
> > saying that anything that is a property of an instance of a ZClass is
> > not indexed in the catalog? Does this happen with any particular type
> > of ZClass properties or only a certain kind? What if you add a
> > PythonScript (with no parameters) to a ZClass as a method and make it
> > return a string? Does that get indexed? Would you be kind enough to
> > try to make that distinction and report back?
>
> I am following the example in the ZopeBook, Chapter 9 to the letter:
>
> Adding Product News,
> Creating ZClass NewsItem, Baseclasses: ZObject, CatalogAwareBase
> Adding a propertysheet News to NewsItem
> Adding properties to this sheet:
> content: text
> author: string
> date: date
>
> I then create an instance of Catalog, with Indexes:
> author FieldIndex
> content TextIndex
> date FieldIndex
> title FieldIndex
>
> and a table of Metadata
> absolute_url
> author
> date
> title
>
> I also create a ZSearch Interface with a FOrm and a Report method
>
> If I now add a NewsItem to my ZOpe somewhere, I can see the item
> appearing in my Catalog, when I click on the Catalog-tab. When I now
> click on the item in the catalog, I see the catalog record for this
> item. This tells me that the fields author and
> title are empty in the section Metadata Contents and author, title and
content
> are empty in the section Index Contents.
>
>
> Now trying the trick with the PythonScript:
>
> Adding a PythonScript "test" as method to NewsItem
> The script just returns a string, without any params.
> Adding a TextIndex "test" to the Catalog
> Adding a field "test" to the Metadata table
>
> With this in place, I now add another NewsItem to my Zope, and add
> some dummy content.
>
> Looking at the index record reveals: Indeed, the string returned from
> the "test" script is in place, both in the Index and in the Metatable
> record.
>
>
> --
>
> Institute for Research in Humanities, Kyoto University
> 47 Higashiogura-cho, Kitashirakawa, Sakyo-ku, Kyoto 606-8265, JAPAN
>
>