Commit fb49fda8 authored by Nicolas Delaby's avatar Nicolas Delaby

Resurect support of WebDAV on ContributionTool

If _setObject receive an object in ob parameter,
fill in the volatile cache and return the object.
Otherwise create new Document (like it is currently done)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41663 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 488d4a0c
...@@ -342,15 +342,17 @@ class ContributionTool(BaseTool): ...@@ -342,15 +342,17 @@ class ContributionTool(BaseTool):
# document inside us at this stage. Else we # document inside us at this stage. Else we
# must find out where to store it. # must find out where to store it.
if ob is not None: if ob is not None:
# Call from webdav API # Called from webdav API
# redefine parameters # Object is already created by PUT_factory
portal_type = ob.getPortalType() # fill the volatile cache _v_document_cache
container = ob.getParentValue() # then return the document
document = ob
else:
if not portal_type: if not portal_type:
document = BaseTool.newContent(self, id=id, document = BaseTool.newContent(self, id=id,
portal_type=portal_type, portal_type=portal_type,
is_indexable=0) is_indexable=0)
else: elif ob is None:
# We give the system a last chance to analyse the # We give the system a last chance to analyse the
# portal_type based on the document content # portal_type based on the document content
# (ex. a Memo is a kind of Text which can be identified # (ex. a Memo is a kind of Text which can be identified
...@@ -387,7 +389,6 @@ class ContributionTool(BaseTool): ...@@ -387,7 +389,6 @@ class ContributionTool(BaseTool):
self._v_document_cache = {} self._v_document_cache = {}
volatile_cache = self._v_document_cache volatile_cache = self._v_document_cache
volatile_cache[document.getId()] = document.getRelativeUrl() volatile_cache[document.getId()] = document.getRelativeUrl()
# Return document to newContent method # Return document to newContent method
return document return document
......
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