projects
/
Plinn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
On appelle (et on retourne) l'action « jsupload_snippet » après un PUT webdav.
[Plinn.git]
/
Folder.py
diff --git
a/Folder.py
b/Folder.py
index
ce440f1
..
db87868
100644
(file)
--- a/
Folder.py
+++ b/
Folder.py
@@
-321,7
+321,14
@@
class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
if typ is None:
typ, enc=guess_content_type(validId, body)
if typ is None:
typ, enc=guess_content_type(validId, body)
- ob = self.PUT_factory(validId, typ, body)
+ if self.checkIdAvailable(validId) :
+ ob = self.PUT_factory(validId, typ, body)
+ self._setObject(validId, ob)
+ ob = self._getOb(validId)
+ httpRespCode = 201
+ else :
+ httpRespCode = 200
+ ob = self._getOb(validId)
# We call _verifyObjectPaste with verify_src=0, to see if the
# user can create this type of object (and we don't need to
# We call _verifyObjectPaste with verify_src=0, to see if the
# user can create this type of object (and we don't need to
@@
-333,15
+340,15
@@
class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
(ob.__class__, repr(self), sys.exc_info()[1],)
raise Unauthorized, sMsg
(ob.__class__, repr(self), sys.exc_info()[1],)
raise Unauthorized, sMsg
- # Delegate actual PUT handling to the new object,
- # SDS: But just *after* it has been stored.
- self._setObject(validId, ob)
- ob = self._getOb(validId)
ob.PUT(REQUEST, RESPONSE)
ob.PUT(REQUEST, RESPONSE)
-
- RESPONSE.setStatus(201)
- RESPONSE.setBody('')
- return RESPONSE
+ ob.orig_name = fileName
+
+
+ ti = ob.getTypeInfo()
+ method_id = ti.queryMethodID('jsupload_snippet')
+ meth = method_id and getattr(ob, method_id) or (lambda : 'Not implemented')
+ RESPONSE.setStatus(httpRespCode)
+ return '<![CDATA[%s]]>' % meth()
# ## overload to maintain ownership if authenticated user has 'Manage portal' permission
# ## overload to maintain ownership if authenticated user has 'Manage portal' permission