[Zope-Checkins] CVS: Zope/lib/python/OFS - ObjectManager.py:1.143.2.3
Andreas Jung
andreas@zope.com
Tue, 6 Nov 2001 15:59:49 -0500
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv16610
Modified Files:
Tag: ajung-webdav-debug
ObjectManager.py
Log Message:
added lock support
=== Zope/lib/python/OFS/ObjectManager.py 1.143.2.2 => 1.143.2.3 ===
import sys,string,fnmatch,copy
import types
+from webdav.LockItem import LockItem
import XMLExportImport
customImporters={
@@ -692,8 +693,13 @@
return marshal.dumps((mode,0,0,1,owner,group,0,mtime,mtime,mtime))
+
+
def manage_lockObjects(self, ids=None, REQUEST=None, RESPONSE=None):
""" Lock selected objects """
+
+
+ user=getSecurityManager().getUser()
if ids is None and REQUEST is not None:
return eNoItemsSpecified
@@ -704,30 +710,16 @@
ids=[ids]
for id in ids:
- print id
v=self._getOb(id, self)
if v is self:
raise 'BadRequest', '%s does not exist' % ids[-1]
- cmd = davcmds.Lock(REQUEST)
- token, result = cmd.apply(self, creator, depth=depth)
- try:
- cmd = davcmds.Lock(REQUEST)
- token, result = cmd.apply(v)
- print token,result
+ LI = LockItem(user)
+ try: v.wl_setLock(LI.getLockToken(),LI)
+ except: pass
- print 'locked'
- except:
- print sys.exc_type,sys.exc_value
- return self.manage_main(self, REQUEST)
-
-
- def manage_lockObjects(self, ids=None, REQUEST=None, RESPONSE=None):
- """ Lock selected objects """
-
- raise "NotImplementedYet"
return self.manage_main(self, REQUEST)