[Zope] Zclasses derived from ZCatalog

Tres Seaver tseaver@palladion.com
Wed, 03 Nov 1999 07:22:24 -0600


Tom Schwaller wrote:
> 
> Tres Seaver wrote:

<snip>

> >
> > This is essentially what I am doing -- I just tried adding a DTMLMethod named
> > "Catalog" to the ZCatalog-derived class, which just returns this() -- IT WORKS!
> 
> Could you explain that with code? I'm not exactly shure hoh you do that.
> 
> With that you do not need
> 
> <dtml-call "manage_editCataloger( PARENTS[1].id, REQUEST )">
> 
> anymore. Is that right? You should ad this very cool trick
> to your howto (this will be my number 1. Zope magic Trick for this week
> :-))

Add a DTML Method named "Catalog" to the ZClass derived from ObjectManager and
ZCatalog.  its body should be:

  <dtml-return "this()">

The CatalogAware ZClass instances search up the acquisition tree for on object
named Catalog to register with -- they find the method as an attribute of their
container, and use it instead.

CAVEAT:

I haven't yet figured out how to use the Catalog-method inside other DTML, e.g.,

  <dtml-in "Catalog( meta_type='BarBaz' )">
    ...
  </dtml-in>

doesn't work.  I'll think on it some more.


-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com