mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM: RecordsManagementService refactor
* move candiate methods into FilePlanService * deprecation of RMService methods * remove all deprecation warnings from code * update filePlanService unit tests * remove all other spurious warnings from RM code * a couple of performance enhancements in the bowls of the capability evaluation code * first pass at parametising RecordsManagementAuditService with file plan (so capability evaluation had a tangable reference) * fix up unit test failures and other fall out from refactors git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@52504 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,9 +22,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionDefinition;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.repo.action.evaluator.ActionConditionEvaluator;
|
||||
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
@@ -40,25 +40,32 @@ import org.springframework.context.ApplicationContextAware;
|
||||
*/
|
||||
public class ExtendedActionServiceImpl extends ActionServiceImpl implements ApplicationContextAware
|
||||
{
|
||||
/** Records management service */
|
||||
private RecordsManagementService recordsManagementService;
|
||||
/** File plan service */
|
||||
private FilePlanService filePlanService;
|
||||
|
||||
/** Application context */
|
||||
private ApplicationContext extendedApplicationContext;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ActionServiceImpl#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
super.setApplicationContext(applicationContext);
|
||||
extendedApplicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordsManagementService records management service
|
||||
*/
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ActionServiceImpl#getActionConditionDefinition(java.lang.String)
|
||||
*/
|
||||
public ActionConditionDefinition getActionConditionDefinition(String name)
|
||||
{
|
||||
// get direct access to action condition definition (i.e. ignoring public flag of executer)
|
||||
@@ -91,7 +98,7 @@ public class ExtendedActionServiceImpl extends ActionServiceImpl implements Appl
|
||||
else
|
||||
{
|
||||
// get the file component kind of the node reference
|
||||
FilePlanComponentKind kind = recordsManagementService.getFilePlanComponentKind(nodeRef);
|
||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
|
||||
result = new ArrayList<ActionDefinition>(actionDefinitions.size());
|
||||
|
||||
// check each action definition
|
||||
|
@@ -20,7 +20,7 @@ package org.alfresco.repo.rule;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -39,13 +39,13 @@ import org.alfresco.service.namespace.QName;
|
||||
public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
||||
{
|
||||
private boolean runAsRmAdmin = true;
|
||||
|
||||
private FilePlanService filePlanService;
|
||||
|
||||
private FilePlanAuthenticationService filePlanAuthenticationService;
|
||||
|
||||
protected NodeService nodeService;
|
||||
|
||||
private RecordsManagementService recordsManagementService;
|
||||
|
||||
public void setRunAsRmAdmin(boolean runAsRmAdmin)
|
||||
{
|
||||
this.runAsRmAdmin = runAsRmAdmin;
|
||||
@@ -56,20 +56,20 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
||||
this.filePlanAuthenticationService = filePlanAuthenticationService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
public void setNodeService2(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRule(final NodeRef nodeRef, final Rule rule)
|
||||
{
|
||||
if (recordsManagementService.isFilePlanComponent(nodeRef) == true && runAsRmAdmin == true)
|
||||
if (filePlanService.isFilePlanComponent(nodeRef) == true && runAsRmAdmin == true)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@@ -91,7 +91,7 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
||||
@Override
|
||||
public void removeRule(final NodeRef nodeRef, final Rule rule)
|
||||
{
|
||||
if (recordsManagementService.isFilePlanComponent(nodeRef) == true && runAsRmAdmin == true)
|
||||
if (filePlanService.isFilePlanComponent(nodeRef) == true && runAsRmAdmin == true)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@@ -116,7 +116,7 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
||||
QName typeQName = nodeService.getType(nodeRef);
|
||||
|
||||
// The dispositionSchedule node will not be executed by rules
|
||||
if (recordsManagementService.isFilePlanComponent(nodeRef) == true
|
||||
if (filePlanService.isFilePlanComponent(nodeRef) == true
|
||||
&& typeQName.equals(RecordsManagementModel.TYPE_DISPOSITION_SCHEDULE) == false
|
||||
&& isFilePlanComponentRule(rule) == true && runAsRmAdmin == true)
|
||||
{
|
||||
@@ -141,6 +141,6 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
||||
private boolean isFilePlanComponentRule(Rule rule)
|
||||
{
|
||||
NodeRef nodeRef = getOwningNodeRef(rule);
|
||||
return recordsManagementService.isFilePlanComponent(nodeRef);
|
||||
return filePlanService.isFilePlanComponent(nodeRef);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user