Class RMCaveatConfigComponentImpl
java.lang.Object
org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigComponentImpl
- All Implemented Interfaces:
RMCaveatConfigComponent,ContentServicePolicies.OnContentUpdatePolicy,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnCreateNodePolicy,ClassPolicy,Policy
public class RMCaveatConfigComponentImpl
extends Object
implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnCreateNodePolicy, RMCaveatConfigComponent
RM Caveat Config component impl
- Author:
- janv
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRMConstraint(String listName) Add RM constraintvoidaddRMConstraintListValue(String listName, String authorityName, String value) Add a single value to an authority in a list.voidbeforeDeleteNode(NodeRef nodeRef) voiddeleteRMConstraint(String listName) Delete RM ConstraintgetListDetails(String listName) Get the member details of the specified listgetRMAllowedValues(String constraintName) Get allowed values for given caveat list (for current user)Get custom caveat modelsgetRMConstraint(String listName) Get RM Constraint detail.getRMConstraint(QName listQName) Get an RMConstraintInfobooleanCheck whether access to 'record component' node is vetoed for current user due to caveat(s)voidinit()Initialise behaviours and caveat config cachevoidonContentUpdate(NodeRef nodeRef, boolean newContent) voidonCreateNode(ChildAssociationRef childAssocRef) voidremoveRMConstraintListAuthority(String listName, String authorityName) Remove an authority from a listvoidremoveRMConstraintListValue(String listName, String valueName) Remove RM constraint value (all authorities)voidsetAuthorityService(AuthorityService authorityService) voidsetCaveatAspects(List<String> caveatAspectNames) voidsetCaveatConfig(SimpleCache<String, Map<String, List<String>>> caveatConfig) voidsetCaveatModels(List<String> caveatModelNames) voidsetContentService(ContentService contentService) voidsetDictionaryService(DictionaryService dictionaryService) voidsetNamespaceService(NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) voidsetPersonService(PersonService personService) voidsetStoreRef(String storeRef) updateOrCreateCaveatConfig(File jsonFile) updateOrCreateCaveatConfig(String jsonString) voidupdateRMConstraintListAuthority(String listName, String authorityName, List<String> values) Replace the values for an authority in a list.voidupdateRMConstraintListValue(String listName, String valueName, List<String> authorities) Replace the authorities for a value in a listprotected voidvalidateAndReset(NodeRef nodeRef) Validate the caveat config and optionally update the cache.
-
Constructor Details
-
RMCaveatConfigComponentImpl
public RMCaveatConfigComponentImpl()
-
-
Method Details
-
setCaveatConfig
-
setNodeService
-
setContentService
-
setDictionaryService
-
setNamespaceService
-
setAuthorityService
-
setPersonService
-
setStoreRef
-
setCaveatAspects
-
setCaveatModels
-
init
public void init()Initialise behaviours and caveat config cache- Specified by:
initin interfaceRMCaveatConfigComponent
-
onContentUpdate
-
beforeDeleteNode
-
onCreateNode
-
validateAndReset
Validate the caveat config and optionally update the cache.- Parameters:
nodeRef- The nodeRef of the config
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfigin interfaceRMCaveatConfigComponent
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfigin interfaceRMCaveatConfigComponent
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfigin interfaceRMCaveatConfigComponent
-
getRMConstraintNames
-
getRMAllowedValues
Description copied from interface:RMCaveatConfigComponentGet allowed values for given caveat list (for current user)- Specified by:
getRMAllowedValuesin interfaceRMCaveatConfigComponent- Returns:
-
hasAccess
Check whether access to 'record component' node is vetoed for current user due to caveat(s)- Specified by:
hasAccessin interfaceRMCaveatConfigComponent- Parameters:
nodeRef-- Returns:
- false, if caveat(s) veto access otherwise return true
-
addRMConstraintListValue
Add a single value to an authority in a list. The existing values of the list remain.- Specified by:
addRMConstraintListValuein interfaceRMCaveatConfigComponent- Parameters:
listName- the name of the RMConstraintListauthorityName-value-- Throws:
org.alfresco.error.AlfrescoRuntimeException- if either the list or the authority do not already exist.
-
getListDetails
Get the member details of the specified list- Specified by:
getListDetailsin interfaceRMCaveatConfigComponent- Parameters:
listName-- Returns:
- the details of the specified list
-
getRMCaveatModels
Description copied from interface:RMCaveatConfigComponentGet custom caveat models- Specified by:
getRMCaveatModelsin interfaceRMCaveatConfigComponent- Returns:
-
updateRMConstraintListAuthority
public void updateRMConstraintListAuthority(String listName, String authorityName, List<String> values) Replace the values for an authority in a list. The existing values are removed. If the authority does not already exist in the list, it will be added- Specified by:
updateRMConstraintListAuthorityin interfaceRMCaveatConfigComponent- Parameters:
listName- the name of the RMConstraintListauthorityName-values-
-
updateRMConstraintListValue
public void updateRMConstraintListValue(String listName, String valueName, List<String> authorities) Replace the authorities for a value in a list- Specified by:
updateRMConstraintListValuein interfaceRMCaveatConfigComponent- Parameters:
listName-valueName-authorities-
-
removeRMConstraintListValue
Description copied from interface:RMCaveatConfigComponentRemove RM constraint value (all authorities)- Specified by:
removeRMConstraintListValuein interfaceRMCaveatConfigComponent
-
removeRMConstraintListAuthority
Remove an authority from a list- Specified by:
removeRMConstraintListAuthorityin interfaceRMCaveatConfigComponent- Parameters:
listName- the name of the RMConstraintListauthorityName-
-
getRMConstraint
Get an RMConstraintInfo- Parameters:
listQName-- Returns:
- the constraint or null if it does not exist
-
getRMConstraint
Get RM Constraint detail.- Specified by:
getRMConstraintin interfaceRMCaveatConfigComponent- Parameters:
listName- the name of the RMConstraintList- Returns:
- the constraintInfo or null
-
deleteRMConstraint
Description copied from interface:RMCaveatConfigComponentDelete RM Constraint- Specified by:
deleteRMConstraintin interfaceRMCaveatConfigComponent- Parameters:
listName- the name of the RMConstraintList
-
addRMConstraint
Description copied from interface:RMCaveatConfigComponentAdd RM constraint- Specified by:
addRMConstraintin interfaceRMCaveatConfigComponent
-