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
QNAME
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRMConstraint
(String listName) Add RM constraintvoid
addRMConstraintListValue
(String listName, String authorityName, String value) Add a single value to an authority in a list.void
beforeDeleteNode
(NodeRef nodeRef) void
deleteRMConstraint
(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 RMConstraintInfoboolean
Check whether access to 'record component' node is vetoed for current user due to caveat(s)void
init()
Initialise behaviours and caveat config cachevoid
onContentUpdate
(NodeRef nodeRef, boolean newContent) void
onCreateNode
(ChildAssociationRef childAssocRef) void
removeRMConstraintListAuthority
(String listName, String authorityName) Remove an authority from a listvoid
removeRMConstraintListValue
(String listName, String valueName) Remove RM constraint value (all authorities)void
setAuthorityService
(AuthorityService authorityService) void
setCaveatAspects
(List<String> caveatAspectNames) void
setCaveatConfig
(SimpleCache<String, Map<String, List<String>>> caveatConfig) void
setCaveatModels
(List<String> caveatModelNames) void
setContentService
(ContentService contentService) void
setDictionaryService
(DictionaryService dictionaryService) void
setNamespaceService
(NamespaceService namespaceService) void
setNodeService
(NodeService nodeService) void
setPersonService
(PersonService personService) void
setStoreRef
(String storeRef) updateOrCreateCaveatConfig
(File jsonFile) updateOrCreateCaveatConfig
(String jsonString) void
updateRMConstraintListAuthority
(String listName, String authorityName, List<String> values) Replace the values for an authority in a list.void
updateRMConstraintListValue
(String listName, String valueName, List<String> authorities) Replace the authorities for a value in a listprotected void
validateAndReset
(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:
init
in interfaceRMCaveatConfigComponent
-
onContentUpdate
-
beforeDeleteNode
-
onCreateNode
-
validateAndReset
Validate the caveat config and optionally update the cache.- Parameters:
nodeRef
- The nodeRef of the config
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigComponent
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigComponent
-
updateOrCreateCaveatConfig
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigComponent
-
getRMConstraintNames
-
getRMAllowedValues
Description copied from interface:RMCaveatConfigComponent
Get allowed values for given caveat list (for current user)- Specified by:
getRMAllowedValues
in interfaceRMCaveatConfigComponent
- Returns:
-
hasAccess
Check whether access to 'record component' node is vetoed for current user due to caveat(s)- Specified by:
hasAccess
in 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:
addRMConstraintListValue
in 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:
getListDetails
in interfaceRMCaveatConfigComponent
- Parameters:
listName
-- Returns:
- the details of the specified list
-
getRMCaveatModels
Description copied from interface:RMCaveatConfigComponent
Get custom caveat models- Specified by:
getRMCaveatModels
in 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:
updateRMConstraintListAuthority
in 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:
updateRMConstraintListValue
in interfaceRMCaveatConfigComponent
- Parameters:
listName
-valueName
-authorities
-
-
removeRMConstraintListValue
Description copied from interface:RMCaveatConfigComponent
Remove RM constraint value (all authorities)- Specified by:
removeRMConstraintListValue
in interfaceRMCaveatConfigComponent
-
removeRMConstraintListAuthority
Remove an authority from a list- Specified by:
removeRMConstraintListAuthority
in 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:
getRMConstraint
in interfaceRMCaveatConfigComponent
- Parameters:
listName
- the name of the RMConstraintList- Returns:
- the constraintInfo or null
-
deleteRMConstraint
Description copied from interface:RMCaveatConfigComponent
Delete RM Constraint- Specified by:
deleteRMConstraint
in interfaceRMCaveatConfigComponent
- Parameters:
listName
- the name of the RMConstraintList
-
addRMConstraint
Description copied from interface:RMCaveatConfigComponent
Add RM constraint- Specified by:
addRMConstraint
in interfaceRMCaveatConfigComponent
-