diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml index 2b10615154..c0fb9ec36d 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml @@ -145,7 +145,8 @@ - + + diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 6de002f343..ad4a1a7ac9 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -501,7 +501,8 @@ - + + diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java index 2ef8b753d8..1000908aca 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java @@ -53,6 +53,9 @@ import org.apache.commons.lang.StringUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.extensions.surf.util.I18NUtil; /** @@ -62,7 +65,8 @@ import org.springframework.extensions.surf.util.I18NUtil; * @since 2.1 */ public class FilePlanRoleServiceImpl implements FilePlanRoleService, - RecordsManagementModel + RecordsManagementModel, + ApplicationContextAware { /** I18N */ private static final String MSG_ALL_ROLES = "rm.role.all"; @@ -93,6 +97,8 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, private BootstrapImporterModuleComponent bootstrapImporterModule; + private ApplicationContext applicationContext; + /** Records management role zone */ public static final String RM_ROLE_ZONE_PREFIX = "rmRoleZone"; @@ -147,6 +153,16 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, { this.bootstrapImporterModule = bootstrapImporterModuleComponent; } + + protected FilePlanService getFilePlanService() + { + if (filePlanService == null) + { + filePlanService = (FilePlanService) applicationContext.getBean("FilePlanService"); + } + + return filePlanService; + } /** * @see org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService#initialiseFilePlan(org.alfresco.service.cmr.repository.NodeRef) @@ -190,11 +206,11 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, permissionService.setPermission(filePlan, ExtendedWriterDynamicAuthority.EXTENDED_WRITER, RMPermissionModel.FILING, true); // Create the transfer and hold containers - systemContainers.add(filePlanService.createHoldContainer(filePlan)); - systemContainers.add(filePlanService.createTransferContainer(filePlan)); + systemContainers.add(getFilePlanService().createHoldContainer(filePlan)); + systemContainers.add(getFilePlanService().createTransferContainer(filePlan)); // Create the unfiled record container - systemContainers.add(filePlanService.createUnfiledContainer(filePlan)); + systemContainers.add(getFilePlanService().createUnfiledContainer(filePlan)); return systemContainers; } @@ -877,4 +893,10 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, { return authorityService.getName(AuthorityType.GROUP, getAllRolesGroupShortName(filePlan)); } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + this.applicationContext = applicationContext; + } } diff --git a/rm-server/source/java/org/alfresco/repo/action/ExtendedActionServiceImpl.java b/rm-server/source/java/org/alfresco/repo/action/ExtendedActionServiceImpl.java index 4d6d313465..35225914d9 100644 --- a/rm-server/source/java/org/alfresco/repo/action/ExtendedActionServiceImpl.java +++ b/rm-server/source/java/org/alfresco/repo/action/ExtendedActionServiceImpl.java @@ -46,6 +46,16 @@ public class ExtendedActionServiceImpl extends ActionServiceImpl implements Appl /** Application context */ private ApplicationContext extendedApplicationContext; + protected FilePlanService getFilePlanService() + { + if (filePlanService == null) + { + filePlanService = (FilePlanService) extendedApplicationContext.getBean("FilePlanService"); + } + + return filePlanService; + } + /** * @see org.alfresco.repo.action.ActionServiceImpl#setApplicationContext(org.springframework.context.ApplicationContext) */ @@ -98,7 +108,7 @@ public class ExtendedActionServiceImpl extends ActionServiceImpl implements Appl else { // get the file component kind of the node reference - FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef); + FilePlanComponentKind kind = getFilePlanService().getFilePlanComponentKind(nodeRef); result = new ArrayList(actionDefinitions.size()); // check each action definition