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:
Roy Wetherall
2013-07-12 06:12:46 +00:00
parent ba197612d1
commit 87bd9abe53
85 changed files with 2188 additions and 1000 deletions

View File

@@ -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);
}
}