matterial

Zurück zur Übersicht » REST - Document - Lock

REST - Document - Lock

REST-Interface

Document locks are used to prevent simultaneous updating of documents by different users. Before a document can be updated, a document lock has to be acquired using a self-generated unique lock id (possibly a GUID). The unique lock id must be used in subsequent requests to update the document, keep the document locked or to unlock it. If the user logs off, all document locks are automatically released.

Acquire or update document-lock

If a client wants to edit a document, it should first acquire a lock with a “unique lock id”.
URL
PUT <application-url>/api/document/lock/<documentId>

Path parameter

Query parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.DocumentLock

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/document/lock/8?uniqueLockId=123


Release my document-lock

Release document lock by “unique lock id”. This is the recommended way to unlock documents.
URL
DELETE <application-url>/api/document/lock

Query parameter

Produces

text/plain

Integer - count of released locks

Permission
Login

Sample
DELETE http://localhost:8080/mtr-backend/api/document/lock?uniqueLockId=123


Release all document-locks by document id

If for some reason you do not know your uniqueLockId anymore this is the only possibility to unlock the document.
URL
DELETE <application-url>/api/document/lock/<documentId>

Path parameter

Produces

text/plain

Integer - count of released

Permission
Login

Sample
DELETE http://localhost:8080/mtr-backend/api/document/lock/8