Hi all,

I've started implementation of a simple ZPatterns based
application, and so far things have been going well.

The problem is, I'm not sure if I'm doing this right.

Here is my setup:

Zope 2.2.0 hosted at Codeit.com on a Linux box
ZPatterns 0.4.3b2

'BookProduct' product
 *'BookClass' ZClass (inherits from
  _ZClass_for_CatalogAware, _ZClass_for_DataSkin)
   * Methods: editInstanceForm, editInstance, index_html,

'Books' Specialist
 * defaultRack which stores 'Book' ZClasses
 * Methods: addBookForm, addBook, index_html, BookSearch,
   BookResults (the last two methods are a Z Search
 *'Catalog' ZCatalog

The 'BookClass' editInstance method contains:

<dtml-call reindex_object>

The 'Books' Specialist's addBook method contains:

<dtml-let ni="newItem(isbn)">
Title=Title, Price=Price)">
 <dtml-call "ni.index_object()">

I've snipped out only the most relevant parts of these

As I said, so far this has worked ok. But it seems to me
that either the reindex_object or the index_object is in the
wrong place, but I'm not sure which. I'm also not sure it's
a good or bad idea to place the ZCatalog directly into the

Also, I would like to replace the three indexes I'm
maintaining on the books with a single text index on a
computed attribute. I understand that this involves adding a
SkinScript to the Rack containing something like 'WITH SELF
COMPUTE AllText=AllTextMethod', but I'm unsure of the
details. I have a method (AllTextMethod) on the ZClass that
returns several fields concatenated as a single string,
which I would like to use as a text index.

So, I decided to ask for a critique of the application
design (such as it is). I also seem to recall mention of
'indexing agents' that might make this a bit more elegant,
but haven't found a how-to on the subject.


Michael Bernstein.

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to