You are here: Home Members Resources WebDAV Folder Contents for Plone
Document Actions

WebDAV Folder Contents for Plone

A monkeypatch for the standard webdav.Collection.listDAVObjects that ignores objects not registered with the types tool. In other words, it ignores user folders, skin tools, etc.

 listDAVObjects(self):
objectValues = getattr(self, 'objectValues', None)
if objectValues is not None:
if hasattr(self, 'portal_types'):
types = [obj.content_meta_type for obj in self.portal_types.listTypeInfo()]
return [obj for obj in objectValues() if getattr(obj, 'meta_type') in types]
else:
return ObjectValues()
return []

At first I tried to use getFolderContents(), but this method does not play well with the Plone Site root (it appears to require manager or owner rights to get the contents), most likely because it does not inherit from PloneFolder. If PloneSites inherited from PloneFolder, getFolderContents() would seem to be preferable. A new catalog-based version would be nice when 2.1 comes out w/ PathIndex.

This method was tested on Zope 2.7.5 running Plone 2.0.5 and Python 2.3.5.