@Name(value="lockActions") @Scope(value=EVENT) @Install(precedence=10) public class LockActionsBean extends Object implements LockActions
Most of the logic of this bean should either be moved into a DocumentModel adapter or directly into the core API.
LOCK_CREATED, LOCK_TIME, LOCKER
Constructor and Description |
---|
LockActionsBean() |
Modifier and Type | Method and Description |
---|---|
Boolean |
getCanLockCurrentDoc()
Tests if the user can get the lock of the current document.
|
Boolean |
getCanLockDoc(DocumentModel document)
Tests if the user can get the lock of a document.
|
Boolean |
getCanUnlockCurrentDoc()
Tests if the user can unlock the current document.
|
Boolean |
getCanUnlockDoc(DocumentModel document)
Tests if the user can unlock a document.
|
Map<String,Serializable> |
getCurrentDocLockDetails()
Gets the details about the lock of the current document, who did the lock and when the lock took place.
|
Map<String,Serializable> |
getLockDetails(DocumentModel document)
Gets the details about the lock of a document,who did the lock and when the lock took place.
|
Action |
getLockOrUnlockAction()
Returns the action of lock or unlock for a document.
|
String |
lockCurrentDocument()
Gets the lock of the current document.
|
String |
lockDocument(DocumentModel document)
Gets the lock of the document.
|
void |
resetEventContext() |
void |
resetLockState() |
String |
unlockCurrentDocument()
Releases the lock of the current document.
|
String |
unlockDocument(DocumentModel document)
Releases the lock of the document.
|
public Boolean getCanLockDoc(DocumentModel document)
LockActions
getCanLockDoc
in interface LockActions
@Factory(value="currentDocumentCanBeLocked", scope=EVENT) public Boolean getCanLockCurrentDoc()
LockActions
getCanLockCurrentDoc
in interface LockActions
@Observer(value="userAllDocumentTypesSelectionChanged", create=false) @BypassInterceptors public void resetEventContext()
public Boolean getCanUnlockDoc(DocumentModel document)
LockActions
getCanUnlockDoc
in interface LockActions
@Factory(value="currentDocumentCanBeUnlocked", scope=EVENT) public Boolean getCanUnlockCurrentDoc()
LockActions
getCanUnlockCurrentDoc
in interface LockActions
public String lockCurrentDocument() throws ClientException
LockActions
lockCurrentDocument
in interface LockActions
ClientException
public String lockDocument(DocumentModel document) throws ClientException
LockActions
lockDocument
in interface LockActions
document
- the document of which lock is to be takenClientException
public String unlockCurrentDocument() throws ClientException
LockActions
unlockCurrentDocument
in interface LockActions
ClientException
public String unlockDocument(DocumentModel document) throws ClientException
LockActions
unlockDocument
in interface LockActions
document
- the document of which lock is to be releasedClientException
public Action getLockOrUnlockAction()
LockActions
getLockOrUnlockAction
in interface LockActions
@Factory(value="currentDocumentLockDetails", scope=EVENT) public Map<String,Serializable> getCurrentDocLockDetails() throws ClientException
LockActions
getCurrentDocLockDetails
in interface LockActions
ClientException
public Map<String,Serializable> getLockDetails(DocumentModel document) throws ClientException
LockActions
getLockDetails
in interface LockActions
document
- the document for which this information is neededClientException
@BypassInterceptors public void resetLockState()
resetLockState
in interface LockActions
Copyright © 2015 Nuxeo SA. All rights reserved.