Commit 52b3c3b2 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Patch to support webdav on folderish files.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11812 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ff0f081c
......@@ -42,6 +42,7 @@ from Products.ERP5Type.patches import CookieCrumbler
from Products.ERP5Type.patches import Localizer
from Products.ERP5Type.patches import CMFMailIn
from Products.ERP5Type.patches import CMFCoreUtils
from Products.ERP5Type.patches import PropertySheets
# These symbols are required for backward compatibility
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
......
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2002,2005 Nexedi SARL and Contributors. All Rights Reserved.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from OFS.PropertySheets import DAVProperties, isDavCollection
from Acquisition import aq_base
# This is required to make an ERP5 Document (folderish) look like a file (non folderish)
def DAVProperties_dav__resourcetype(self):
vself = self.v_self()
if getattr(vself, 'isDocument', None): return '' # This is the patch
if (isDavCollection(vself) or
getattr(aq_base(vself), 'isAnObjectManager', None)):
return '<n:collection/>'
return ''
DAVProperties.dav__resourcetype = DAVProperties_dav__resourcetype
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment