[Zope] Need ZCatalog help

Martijn Pieters mj@antraciet.nl
Fri, 10 Sep 1999 10:34:53 +0200


At 05:22 10/09/99 , John Goerzen wrote:
>Here I am talking to myself again :-)
>
>I have two more questions to go along with the below.
>
>I have made a ZCatalog up near the top of my tree named
>EventsCatalog.  I have a method named getEventsByDate that now usses
>this.  This method works fine if invoked directly, but if not, it
>claims it can't find EventsCatalog -- even if both the method and the
>caller are clearly below EventsCatalog in the tree, thus acquisition
>should step in.
>
>Here's the code:
>
><dtml-with "_(myEventList=[])">
>   <dtml-in "EventsCatalog.searchResults({'when' :
>    [startDate, endDate], 'when_usage' : 'range:min:max'})">
>     <dtml-call "myEventList.append(EventsCatalog.resolve_url('/' +
>EventsCatalog.getpath(data_record_id_),
>REQUEST=REQUEST))"></dtml-comment>
></dtml-in>
><dtml-return myEventList>
></dtml-with>
>
>Now, it is aborting at searchResults.

Hmmm.. don't directly know about this one. If I ever run into such a 
problem, and solve it, I'll let you know.


>Secondly, the search string *may* be working, but I don't understand
>the syntax.  What do the colons and the curly braces signify?  Why is
>"_usage" significant?  What exactly does 'range:min:max' indicate?

See below.


>Thanks!
>
>John Goerzen <jgoerzen@complete.org> writes:
>
> > Hi!
> >
> > OK, it looks like I've been doing things a stupid way by not using
> > ZCatalog.  I managed to find a ZCatalog.txt buried deep within the
> > source, but I'm a bit stuck now.
> >
> > First.  I created a ZClass in my own Application with my Events
> > class.  Do I need to delete it and recreate it so that it lists
> > ClassAware as one of its meta types?
> >
> > When a class is ClassAware, how does it know into which catalog new
> > items should go?  I haven't been able to make the thing update
> > catalogs automatically.
> >
> > What is the purpose of using the Contents tab of a ZCatalog to
> > actually add items inside it?  What are the pros/cons of doing this?
> > Why are these objects not automatically cataloged?
> >
> > Where can I find a reference on the syntax of searching a catalog?

For now, all documentation is contained in ZCatalog.txt in the ZCatalog 
folder and in the source itself. It is based on ZTables, which in itself 
was never well documented. I believe Michel is in the process of UMLifying 
the code, so we should have some more documentation then.

As for the search terms, I believe not even Michel fully understands what 
options there are yet... =)

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------