[Zope-CMF] listFolderContents

Florent Guillaume fg@nuxeo.com
Fri, 28 Jun 2002 22:38:54 +0000 (UTC)


I now believe that the bug described in
http://www.zope.org/Products/PTK/Tracker/483
isn't a bug, but a case of poor understanding (maybe due to poor
documentation) of the use of the contentValues, contentIds, contentItems
and listFolderContents methods, and of the Type Information.

The methods have this interface:
  def contentIds(self, spec=None, filter=None)
  def contentValues(self, spec=None, filter=None)
  def contentItems(self, spec=None, filter=None)
  def listFolderContents(self, spec=None, contentFilter=None)

The spec optional argument is a list of meta_types to filter on.

Note that this filtering relies on the "Meta Type" (content_meta_type)
parameter of a Type Information in the Types Tool to be correctly set,
namely to be equal to the meta_type of the underlying object.

In the PortalType code, _morphSpec only deals with meta_types.


The filter or contentFilter optional argument is a dictionnary with a
key 'Type' (among others) and for value a string or a list representing
the Types upon which filtering is desired.

One could call for instance:
  listFolderContents(contentFilter={'Type': ['MyDocumentType', 'MyOtherType']})


I suggest that #483 be closed (I didn't find how to do it myself --
should I be added as a supporter to the whole Tracker ?)

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com