[Zope] Help: searching a Zope site.

Michel Pelletier michel@digicool.com
Mon, 13 Sep 1999 13:14:15 -0400


> -----Original Message-----
> From: Gilles lavaux [mailto:gilles.lavaux@esrin.esa.it]
> Sent: Monday, September 13, 1999 12:44 PM
> To: Zope@zope.org
> Subject: [Zope] Help: searching a Zope site.
> 
> 
> Hello
> 
> I try to implement a find with Zope 1.10.3. ( I know, it's old.)
> 
> If I use the manage_findResult method  I get the result 
> inside a 'manage'
> like form. I don't want this: I want to be able to format the output.
> 
> I have readed the FAQ about the PrincipiaFind stuff, and I am 
> not able to
> get it to works.
> Can someone send me DTML/external_method example?
> 
> Thanks in advance.

I only tested this with 2.0.0, I don't know about 1.10.3.

<dtml-var standard_html_header>
  This will list all object ids in the current folder<br>
  <dtml-in "ZopeFind(this())">
    <dtml-var "_['sequence-item'][0]">
  </dtml-in>
</dtml-var standard_html_footer>

ZopeFind accepts the following parameters:

    def ZopeFind(self, obj, obj_ids=None, obj_metatypes=None,
                 obj_searchterm=None, obj_expr=None,
                 obj_mtime=None, obj_mspec=None,
                 obj_permission=None, obj_roles=None,
                 search_sub=0,
                 REQUEST=None, result=None, pre=''):

obj is the object to start looking from (in our example, this()) and is
the only required argument

The next 8 arguments are find terms, for example, if an object has an id
you specify with 'obj_ids', it will be returned.

search_sub means recursivly descend into sub folders.

REQUEST is, as allways, the request object.

result and pre are used by the recursion machinery and should not be
diddled with.

ZopeFind returns a list of two item tuples.  The first item is the
object's id, the second is it path *relative to the 'obj' argument*.

Now that I explained all that, _someone_ can volunteer to write a
How-To.

-Michel

> 
> 
> 
> Gilles Lavaux
> SERCO ESA-ESRIN
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
>