-- skin non générique.
[Plinn.git] / Folder.py
index e4959e5..e36dec8 100644 (file)
--- a/Folder.py
+++ b/Folder.py
@@ -48,12 +48,13 @@ from OFS.event import ObjectWillBeMovedEvent
 from zope.component.factory import Factory
 from Acquisition import aq_base, aq_inner, aq_parent
 
 from zope.component.factory import Factory
 from Acquisition import aq_base, aq_inner, aq_parent
 
-from types import StringType
+from types import StringType, NoneType
 from Products.CMFCore.permissions import ListFolderContents, View, ViewManagementScreens,\
                                          ManageProperties, AddPortalFolders, AddPortalContent,\
                                          ManagePortal, ModifyPortalContent
 from permissions import DeletePortalContents, DeleteObjects, DeleteOwnedObjects, SetLocalRoles, CheckMemberPermission
 from Products.CMFCore.utils import _checkPermission, getToolByName
 from Products.CMFCore.permissions import ListFolderContents, View, ViewManagementScreens,\
                                          ManageProperties, AddPortalFolders, AddPortalContent,\
                                          ManagePortal, ModifyPortalContent
 from permissions import DeletePortalContents, DeleteObjects, DeleteOwnedObjects, SetLocalRoles, CheckMemberPermission
 from Products.CMFCore.utils import _checkPermission, getToolByName
+from Products.CMFCore.utils import getUtilityByInterfaceName
 from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
 from Products.CMFCore.PortalFolder import PortalFolder, ContentFilter
 from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
 from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
 from Products.CMFCore.PortalFolder import PortalFolder, ContentFilter
 from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
@@ -63,6 +64,7 @@ from Products.CMFCore.interfaces import IContentish
 
 from utils import _checkMemberPermission
 from utils import Message as _
 
 from utils import _checkMemberPermission
 from utils import Message as _
+from utils import makeValidId
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 
@@ -91,7 +93,8 @@ class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
             method=request.get('REQUEST_METHOD', 'GET')
             if (request.maybe_webdav_client and
                 method not in ('GET', 'POST')):
             method=request.get('REQUEST_METHOD', 'GET')
             if (request.maybe_webdav_client and
                 method not in ('GET', 'POST')):
-                return NullResource(self, key, request).__of__(self)
+                id = makeValidId(self, key)
+                return NullResource(self, id, request).__of__(self)
         raise KeyError, key
     
         
         raise KeyError, key
     
         
@@ -266,10 +269,15 @@ class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
         """ query catalog and returns brains of contents.
             Requires ExtendedPathIndex
         """
         """ query catalog and returns brains of contents.
             Requires ExtendedPathIndex
         """
-        ctool = getToolByName(self, 'portal_catalog')
+        #ctool = getToolByName(self, 'portal_catalog')
+        ctool = getUtilityByInterfaceName('Products.CMFCore.interfaces.ICatalogTool')
+        #print ctool.absolute_url()
         contentFilter['path'] = {'query':'/'.join(self.getPhysicalPath()),
                                 'depth':1}
         contentFilter['path'] = {'query':'/'.join(self.getPhysicalPath()),
                                 'depth':1}
-        return ctool(sort_on='position', **contentFilter)
+        try :
+            return ctool(sort_on='position', **contentFilter)
+        except :
+            return ctool(**contentFilter)
     
 
     security.declarePublic('synContentValues')
     
 
     security.declarePublic('synContentValues')