Class RMCaveatConfigServiceImpl
- java.lang.Object
-
- org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigServiceImpl
-
- All Implemented Interfaces:
RMCaveatConfigService
public class RMCaveatConfigServiceImpl extends Object implements RMCaveatConfigService
RM Caveat Config Service impl- Author:
- janv
-
-
Constructor Summary
Constructors Constructor Description RMCaveatConfigServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RMConstraintInfo
addRMConstraint(String listName, String title, String[] values)
add RM constraint listRMConstraintInfo
addRMConstraint(String listName, String title, String[] values, RMListOfValuesConstraint.MatchLogic matchLogic)
void
addRMConstraintListValue(String listName, String authorityName, String value)
Add a single value to an authority in a list.void
deleteRMConstraint(String listName)
delete RM Constraint ListSet<RMConstraintInfo>
getAllRMConstraints()
Get all Constraint ListsMap<String,List<String>>
getListDetails(String listName)
Get the details of the specified listRecordsManagementAdminService
getRecordsManagementAdminService()
List<String>
getRMAllowedValues(String constraintName)
Get allowed values for given caveat list (for current user)RMConstraintInfo
getRMConstraint(String listName)
Get RM Constraint detail.RMConstraintInfo
getRMConstraint(org.alfresco.service.namespace.QName listQName)
Get an RMConstraintInfoboolean
hasAccess(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Check whether access to 'record component' node is vetoed for current user due to caveat(s)void
init()
void
removeRMConstraintListAuthority(String listName, String authorityName)
Remove an authority from a listvoid
removeRMConstraintListValue(String listName, String valueName)
Remove a value from a list and cascade delete.void
setCaveatConfigComponent(RMCaveatConfigComponent rmCaveatConfigComponent)
void
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
void
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
void
setRecordsManagementAdminService(RecordsManagementAdminService recordsManagementAdminService)
org.alfresco.service.cmr.repository.NodeRef
updateOrCreateCaveatConfig(File jsonFile)
org.alfresco.service.cmr.repository.NodeRef
updateOrCreateCaveatConfig(InputStream is)
org.alfresco.service.cmr.repository.NodeRef
updateOrCreateCaveatConfig(String jsonString)
RMConstraintInfo
updateRMConstraintAllowedValues(String listName, String[] allowedValues)
Update The allowed values for an RM Constraint.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 listRMConstraintInfo
updateRMConstraintTitle(String listName, String newTitle)
Update the title of this RM Constraint.
-
-
-
Method Detail
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setCaveatConfigComponent
public void setCaveatConfigComponent(RMCaveatConfigComponent rmCaveatConfigComponent)
-
setRecordsManagementAdminService
public void setRecordsManagementAdminService(RecordsManagementAdminService recordsManagementAdminService)
-
getRecordsManagementAdminService
public RecordsManagementAdminService getRecordsManagementAdminService()
-
init
public void init()
- Specified by:
init
in interfaceRMCaveatConfigService
-
updateOrCreateCaveatConfig
public org.alfresco.service.cmr.repository.NodeRef updateOrCreateCaveatConfig(InputStream is)
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigService
-
updateOrCreateCaveatConfig
public org.alfresco.service.cmr.repository.NodeRef updateOrCreateCaveatConfig(File jsonFile)
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigService
-
updateOrCreateCaveatConfig
public org.alfresco.service.cmr.repository.NodeRef updateOrCreateCaveatConfig(String jsonString)
- Specified by:
updateOrCreateCaveatConfig
in interfaceRMCaveatConfigService
-
getRMAllowedValues
public List<String> getRMAllowedValues(String constraintName)
Description copied from interface:RMCaveatConfigService
Get allowed values for given caveat list (for current user)- Specified by:
getRMAllowedValues
in interfaceRMCaveatConfigService
- Returns:
-
hasAccess
public boolean hasAccess(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Check whether access to 'record component' node is vetoed for current user due to caveat(s)- Specified by:
hasAccess
in interfaceRMCaveatConfigService
- Parameters:
nodeRef
-- Returns:
- false, if caveat(s) veto access otherwise return true
-
addRMConstraint
public RMConstraintInfo addRMConstraint(String listName, String title, String[] values)
add RM constraint list- Specified by:
addRMConstraint
in interfaceRMCaveatConfigService
- Parameters:
listName
- the name of the RMConstraintList
-
addRMConstraint
public RMConstraintInfo addRMConstraint(String listName, String title, String[] values, RMListOfValuesConstraint.MatchLogic matchLogic)
-
deleteRMConstraint
public void deleteRMConstraint(String listName)
delete RM Constraint List- Specified by:
deleteRMConstraint
in interfaceRMCaveatConfigService
- Parameters:
listName
- the name of the RMConstraintList
-
addRMConstraintListValue
public void addRMConstraintListValue(String listName, String authorityName, String value)
Add a single value to an authority in a list. The existing values of the list remain.- Specified by:
addRMConstraintListValue
in interfaceRMCaveatConfigService
- 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
public Map<String,List<String>> getListDetails(String listName)
Get the details of the specified list- Specified by:
getListDetails
in interfaceRMCaveatConfigService
- Parameters:
listName
-- Returns:
- the details of the specified list
-
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 interfaceRMCaveatConfigService
- 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 interfaceRMCaveatConfigService
- Parameters:
listName
-valueName
-authorities
-
-
removeRMConstraintListAuthority
public void removeRMConstraintListAuthority(String listName, String authorityName)
Remove an authority from a list- Specified by:
removeRMConstraintListAuthority
in interfaceRMCaveatConfigService
- Parameters:
listName
- the name of the RMConstraintListauthorityName
-
-
getAllRMConstraints
public Set<RMConstraintInfo> getAllRMConstraints()
Get all Constraint Lists- Specified by:
getAllRMConstraints
in interfaceRMCaveatConfigService
-
getRMConstraint
public RMConstraintInfo getRMConstraint(org.alfresco.service.namespace.QName listQName)
Get an RMConstraintInfo- Parameters:
listQName
-- Returns:
- the constraint or null if it does not exist
-
getRMConstraint
public RMConstraintInfo getRMConstraint(String listName)
Get RM Constraint detail.- Specified by:
getRMConstraint
in interfaceRMCaveatConfigService
- Returns:
- the constraintInfo or null
-
updateRMConstraintAllowedValues
public RMConstraintInfo updateRMConstraintAllowedValues(String listName, String[] allowedValues)
Update The allowed values for an RM Constraint.- Specified by:
updateRMConstraintAllowedValues
in interfaceRMCaveatConfigService
- Parameters:
listName
- The name of the list.allowedValues
- the new alowed values
-
removeRMConstraintListValue
public void removeRMConstraintListValue(String listName, String valueName)
Remove a value from a list and cascade delete.- Specified by:
removeRMConstraintListValue
in interfaceRMCaveatConfigService
- Parameters:
listName
- the name of the RMConstraintList
-
updateRMConstraintTitle
public RMConstraintInfo updateRMConstraintTitle(String listName, String newTitle)
Update the title of this RM Constraint.- Specified by:
updateRMConstraintTitle
in interfaceRMCaveatConfigService
- Parameters:
listName
- the name of the RMConstraintList - can not be changednewTitle
- the new value for the title constraint
-
-