
When two users work simultaneously with the same document, you can lock and unlock the document by implementing code in the application service of your composite application.
More information: Creating Composite Application Development Components
More information: Creating Application Services
More information: Defining Application Service Dependencies
/* You should provide an integer value that indicates the type of the
locking and the scope of the locking
lockType can be one of the following:
1 - Read Lock
2 - Write Lock
lockScope can be one of the following:
1 - Shared Lock
2 - Exclusive Lock
timeout should be an integer value, that indicates the timeout
in milliseconds
*/
int lockType = 1;
int lockScope = 2;
int timeout = 100000;
String token = docContentLocal.lockDocument( rid,lockType,lockScope,timeout);
docContentLocal.unlockDocumentWithToken(rid, token); docContentLocal.unLockDocument(rid);
docContentLocal.isDocumentLocked(rid));