@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.
Modifier and Type | Class and Description |
---|---|
protected class |
LockActionsBean.UnrestrictedUnlocker |
Modifier and Type | Field and Description |
---|---|
protected CoreSession |
documentManager |
protected org.jboss.seam.faces.FacesMessages |
facesMessages |
protected ResourcesAccessor |
resourcesAccessor |
protected WebActions |
webActions |
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.
|
protected boolean |
isManagerOnDocument(DocumentRef ref) |
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.
|
@In(create=true, required=false) protected transient org.jboss.seam.faces.FacesMessages facesMessages
@In(create=true) protected transient ResourcesAccessor resourcesAccessor
@In(create=true) protected transient WebActions webActions
@In(create=true, required=false) protected transient CoreSession documentManager
public LockActionsBean()
public Boolean getCanLockDoc(DocumentModel document)
LockActions
getCanLockDoc
in interface LockActions
protected boolean isManagerOnDocument(DocumentRef ref)
@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()
LockActions
lockCurrentDocument
in interface LockActions
public String lockDocument(DocumentModel document)
LockActions
lockDocument
in interface LockActions
document
- the document of which lock is to be takenpublic String unlockCurrentDocument()
LockActions
unlockCurrentDocument
in interface LockActions
public String unlockDocument(DocumentModel document)
LockActions
unlockDocument
in interface LockActions
document
- the document of which lock is to be releasedpublic Action getLockOrUnlockAction()
LockActions
getLockOrUnlockAction
in interface LockActions
@Factory(value="currentDocumentLockDetails", scope=EVENT) public Map<String,Serializable> getCurrentDocLockDetails()
LockActions
getCurrentDocLockDetails
in interface LockActions
public Map<String,Serializable> getLockDetails(DocumentModel document)
LockActions
getLockDetails
in interface LockActions
document
- the document for which this information is needed@BypassInterceptors public void resetLockState()
resetLockState
in interface LockActions
Copyright © 2015 Nuxeo SA. All rights reserved.