From: Benoît Pin Date: Mon, 22 Jul 2013 15:00:12 +0000 (+0200) Subject: On appelle (et on retourne) l'action « jsupload_snippet » après un PUT webdav. X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/commitdiff_plain/351e9460c5a2215ba574374c37cde06f1ceb55a9?hp=c921c5b8f9fdd20ea1b69079dce59d7b1afd18f1 On appelle (et on retourne) l'action « jsupload_snippet » après un PUT webdav. --- diff --git a/Folder.py b/Folder.py index c3ca6f7..db87868 100644 --- a/Folder.py +++ b/Folder.py @@ -325,7 +325,9 @@ class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) : 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 @@ -340,10 +342,13 @@ class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) : ob.PUT(REQUEST, RESPONSE) ob.orig_name = fileName - - RESPONSE.setStatus(201) - RESPONSE.setBody('') - return RESPONSE + + + 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 '' % meth() # ## overload to maintain ownership if authenticated user has 'Manage portal' permission