quick search:
 

unlock WebDAV locked objects

Submitted by: robert
Last Edited: 2004-10-14

Category: Python(Script)

Average rating is: 5.0 out of 5 (2 ratings)

Description:
This script unlocks all object in the folder where it sits an all folders below if they are locked by a abandoned WebDAV client

Source (Text):
print "Start"

def unlockFolder(f):
  print '>', f.getId()
  objectList = f.objectValues()
  print len(objectList)
  for o in objectList:
    if(o.isFolderish())):
      print unlockFolder(o)
    else:
      if o.wl_isLocked():
        print o.getId(), 'locked, will unlock it'
        o.wl_clearLocks()
      else:
        print o.getId(), 'is not locked'
  return printed

print unlockFolder(container)
return printed

ERROR: EOF in multi-line statement


Explanation:
The code tests for all objects residing in the folder where it sits whether it is folderish.
If it is a folder the function calls itself recursively whith that object.
Every non folderish object is then tested whether it is locked. If it is all locks are cleared.



Comments:

It is useful after Dreamweaver misconfiguration. by yadra - 2004-10-14
Thanks Robert, but isFolderish now is depricated.
I'am replaced string
    if(o.isFolderish())):
to
    if hasattr(o, 'isPrincipiaFolderish') and o.isPrincipiaFolderish:
and add string
   unlockFolder(container)
after
   return printed