Skip to content

Instantly share code, notes, and snippets.

@joewiz
Created July 17, 2017 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewiz/421cc249b10c233ed90dee145dd32f93 to your computer and use it in GitHub Desktop.
Save joewiz/421cc249b10c233ed90dee145dd32f93 to your computer and use it in GitHub Desktop.
Check a collection for locked resources, in eXist
xquery version "3.1";
(: You might've forgotten to close a document opened via WebDAV :)
let $col := "/db/apps/frus-dates"
for $resource in xmldb:get-child-resources($col)
let $user := xmldb:document-has-lock($col, $resource)
return
$resource || ": " || (if ($user) then $user else "(not locked)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment