[Zope-CMF] Get list of published items that user has access to

Tres Seaver tseaver@palladion.com
Mon, 22 Oct 2001 04:52:55 -0400 (EDT)


On Mon, 22 Oct 2001 davelehman@loewen.com wrote:

>
> Crap-- that sounds a heck of a lot easier than what I was trying to do, now
> doesn't it?
>
> <dtml-in "portal_catalog.searchResults( meta_type='Document'
>   , sort_on='Date'
>   , sort_order='reverse'
>   , review_state='published'
> )" size="10">
>
> Um, is there any way to restrict the catalog search to a specific folder?
> That is, for this particular news summary, I would like to grab only the
> qualifying documents (ie published) from a certain folder.

In Zope 2.4, the catalog comes standard with an instance of a new
kind of index, called PathIndex, motivated exactly by the use
case you outline.  Taking advantage of it, your query would look
something like this::

  <dtml-in "portal_catalog.searchResults( meta_type='Document'
                                        , sort_on='Date'
                                        , sort_order='reverse'
                                        , review_state='published'
                                        , path=absolute_url
                                        )" size="10">

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com