Get Public Locks
Before the client attempts to lock the resource it can optionally
check to see whether or not a conflicting lock is already set. This is
done by sending a GET
request to the lock
collection URI. For example:
curl -u user:password http://host-ip-address/webservice/escenic/lock/article/4
The following example shows a response indicating that the resource is already locked:
<feed xmlns="http://www.w3.org/2005/Atom"> <author> <name>Escenic Content Engine</name> </author> <id>http://host-ip-address/webservice/escenic/lock/article/4</id> <link rel="self" href="http://host-ip-address/webservice/escenic/lock/article/4" type="application/atom+xml"/> <updated>2010-12-04T08:05:08.474Z</updated> <entry xmlns:age="http://purl.org/atompub/age/1.0" xmlns:metadata="http://xmlns.escenic.com/2010/atom-metadata"> <id>http://host-ip-address/webservice/escenic/lock/article/4/public/72</id> <title type="text">Lock of the fragment SUMMARY</title> <link href="http://host-ip-address/webservice/escenic/lock/article/4/public/72" rel="self"/> <metadata:fragment>SUMMARY</metadata:fragment> <author> <uri>http://host-ip-address/webservice/escenic/person/1</uri> <name>testpub Administrator</name> </author> <updated>2010-12-04T04:49:18.000Z</updated> <age:expires>2010-12-05T04:49:18.000Z</age:expires> <summary type="text">Lock created by: lpt-sai/10.211.10.176</summary> <content type="text">The fragment 'SUMMARY' of the resource is locked by testpub Administrator</content> </entry> </feed>
The returned feed contains an entry with the public lock URI
http://host-ip-address/webservice/escenic/lock/article/4/public/72
.
The metadata:fragment
element, however, indicates
that this is a fragment lock that only locks the content item's
SUMMARY
field. If the client does not intend to
lock the same fragment or the whole resource, then it can still
acquire a lock.
This step is optional: a client can POST a lock request without
first checking the existing locks, and in many cases it may be most
efficient to do so. An interactive clients will, however, often need
to GET
this list of public locks in order to
present the information in its user interface.