[Zope] Zcatalog and PrincipiaSearchSource with Zclasses ?

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Fri, 22 Oct 1999 19:52:51 +1000 (EST)


On Fri, 22 Oct 1999, Geir B Hansen wrote:

> > Sure, why not just impliment a DTML Method in your ZClass called
> > PrincipiaSearchSource that returns what you want indexed?
> >
> > <dtml-return "title + author + body">
> 
> Wow.. I have been a bit narrow-minded when thinking about Zclasses and
> Zcatalog.  A lot of things seem a lot clearer to me right now..   Thanks
> !!
> 
> .. but..  i still cannot make the Zcatalog index my new method
> 'PrincipiaSearchSource' that i made inside my Zclass.. The method works
> nicely when called from another dtml-method, but does not get indexed..
> I am at quite a loss here. .
> 
> any hints to what i might do to solve it ??

I don't think the example Michael gave will work.

Try calling your DTML method from another dtml-method using the following
syntax:
    <dtml-var "PrincipiaSearchSource()">

If this doesn't work, ZCatalog cannot index it. This is because ZCatalog
does not (yet) call DTML methods with any arguments. 

It will quite happily index properties at the moment, so a work around
is to store the output of your methods in a property and index that. Of
course in some instances this is not a suitable workaround and you may 
need to look at alternatives to ZClasses.

 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen