mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
RM-1095: Fixed failing tests after refactoring RecordsManagementService.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@57919 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
<property name="freezeService" ref="FreezeService" />
|
||||
<property name="recordService" ref="RecordService" />
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
<!-- FIXME -->
|
||||
<property name="dispositionService" ref="dispositionService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService" />
|
||||
</bean>
|
||||
|
||||
|
@@ -137,7 +137,8 @@
|
||||
<property name="recordService" ref="recordService"/>
|
||||
<property name="parameterProcessorComponent" ref="parameterProcessorComponent"/>
|
||||
<property name="modelSecurityService" ref="modelSecurityService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService" />
|
||||
<!-- FIXME -->
|
||||
<property name="recordFolderService" ref="recordFolderService" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmProxyAction"
|
||||
|
@@ -91,7 +91,8 @@
|
||||
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry"/>
|
||||
<property name="vitalRecordService" ref="VitalRecordService"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<property name="recordService" ref="RecordService"/>
|
||||
<!-- FIXME -->
|
||||
<property name="recordService" ref="recordService"/>
|
||||
<property name="recordFolderService" ref="RecordFolderService"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -186,7 +186,7 @@
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<!-- FIXME -->
|
||||
<!-- <property name="recordFolderService" ref="RecordFolderService"/> -->
|
||||
<property name="recordService" ref="RecordService"/>
|
||||
<property name="recordService" ref="recordService"/>
|
||||
<property name="dispositionSelectionStrategy">
|
||||
<ref local="org_alfresco_module_rm_dispositionSelectionStrategy" />
|
||||
</property>
|
||||
@@ -975,7 +975,8 @@
|
||||
<property name="policyComponent" ref="policyComponent" />
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="dictionaryService" ref="dictionaryService" />
|
||||
<property name="recordService" ref="RecordService" />
|
||||
<!-- FIXME -->
|
||||
<property name="recordService" ref="recordService" />
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="permissionService" ref="PermissionService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
@@ -1129,6 +1130,7 @@
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<!-- FIXME -->
|
||||
<!-- <property name="filePlanService" ref="FilePlanService" /> -->
|
||||
<!-- <property name="recordService" ref="RecordService" /> -->
|
||||
</bean>
|
||||
|
||||
@@ -1541,7 +1543,8 @@
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
||||
<property name="recordsManagementSearchBehaviour" ref="recordsManagementSearchBehaviour"/>
|
||||
<property name="dispositionService" ref="DispositionService"/>
|
||||
<property name="recordFolderService" ref="RecordFolderService"/>
|
||||
<!-- FIXME -->
|
||||
<property name="recordFolderService" ref="recordFolderService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="DataSetService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
|
@@ -14,14 +14,16 @@
|
||||
<bean id="jsonConversionComponent.baseEvaluator"
|
||||
abstract="true">
|
||||
<property name="jsonConversionComponent" ref="jsonConversionComponent"/>
|
||||
<property name="recordService" ref="RecordService"/>
|
||||
<!-- FIXME -->
|
||||
<property name="recordService" ref="recordService"/>
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="namespaceService" ref="NamespaceService"/>
|
||||
<property name="capabilityService" ref="CapabilityService"/>
|
||||
<property name="freezeService" ref="FreezeService"/>
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService" />
|
||||
<!-- FIXME -->
|
||||
<property name="recordFolderService" ref="recordFolderService" />
|
||||
</bean>
|
||||
|
||||
<bean id="jsonConversionComponent.baseIndicator"
|
||||
|
@@ -89,7 +89,7 @@ public class DispositionServiceImpl implements
|
||||
|
||||
/** Application context */
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
|
||||
/** Record Folder Service */
|
||||
// FIXME
|
||||
//private RecordFolderService recordFolderService;
|
||||
@@ -296,7 +296,7 @@ public class DispositionServiceImpl implements
|
||||
{
|
||||
// Get the record folders for the record
|
||||
// FIXME
|
||||
RecordFolderService recordFolderService = (RecordFolderService)applicationContext.getBean("RecordFolderService");
|
||||
RecordFolderService recordFolderService = (RecordFolderService)applicationContext.getBean("recordFolderService");
|
||||
List<NodeRef> recordFolders = recordFolderService.getRecordFolders(nodeRef);
|
||||
// At this point, we may have disposition instruction objects from 1..n folders.
|
||||
diNodeRef = dispositionSelectionStrategy.selectDispositionScheduleFrom(recordFolders);
|
||||
@@ -470,7 +470,7 @@ public class DispositionServiceImpl implements
|
||||
List<NodeRef> items = filePlanService.getAllContained(rmContainer);
|
||||
List<NodeRef> result = new ArrayList<NodeRef>(items.size());
|
||||
// FIXME
|
||||
RecordFolderService recordFolderService = (RecordFolderService)applicationContext.getBean("RecordFolderService");
|
||||
RecordFolderService recordFolderService = (RecordFolderService)applicationContext.getBean("recordFolderService");
|
||||
for (NodeRef item : items)
|
||||
{
|
||||
if (recordFolderService.isRecordFolder(item) == true)
|
||||
|
@@ -42,6 +42,9 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
@@ -53,6 +56,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
implements RecordFolderService,
|
||||
RecordsManagementModel,
|
||||
ApplicationContextAware,
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||
{
|
||||
/** I18N */
|
||||
@@ -61,6 +65,9 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
private final static String MSG_PARENT_RECORD_FOLDER_TYPE = "rm.service.parent-record-folder-type";
|
||||
private final static String MSG_RECORD_FOLDER_TYPE = "rm.service.record-folder-type";
|
||||
|
||||
/** Application context */
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
@@ -68,10 +75,10 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
private DispositionService dispositionService;
|
||||
|
||||
/** Record Service */
|
||||
private RecordService recordService;
|
||||
// private RecordService recordService;
|
||||
|
||||
/** File Plan Service */
|
||||
private FilePlanService filePlanService;
|
||||
// private FilePlanService filePlanService;
|
||||
|
||||
/** Behaviours */
|
||||
private JavaBehaviour onCreateChildAssociation
|
||||
@@ -102,17 +109,26 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
/**
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
// public void setRecordService(RecordService recordService)
|
||||
// {
|
||||
// this.recordService = recordService;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
// public void setFilePlanService(FilePlanService filePlanService)
|
||||
// {
|
||||
// this.filePlanService = filePlanService;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
{
|
||||
this.filePlanService = filePlanService;
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,6 +231,8 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
|
||||
// Check that each record in the record folder in declared
|
||||
|
||||
// FIXME
|
||||
RecordService recordService = (RecordService) applicationContext.getBean("recordService");
|
||||
List<NodeRef> records = recordService.getRecords(nodeRef);
|
||||
for (NodeRef record : records)
|
||||
{
|
||||
@@ -266,9 +284,11 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
ParameterCheck.mandatory("rmContainer", rmContainer);
|
||||
ParameterCheck.mandatoryString("name", name);
|
||||
ParameterCheck.mandatory("type", type);
|
||||
ParameterCheck.mandatory("properties", properties);
|
||||
// "properties" is not mandatory
|
||||
|
||||
// Check that we are not trying to create a record folder in a root container
|
||||
// FIXME
|
||||
FilePlanService filePlanService = (FilePlanService) applicationContext.getBean("FilePlanService");
|
||||
if (filePlanService.isFilePlan(rmContainer) == true)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_PARENT_RECORD_FOLDER_ROOT));
|
||||
@@ -337,6 +357,8 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
ParameterCheck.mandatory("record", record);
|
||||
|
||||
List<NodeRef> result = new ArrayList<NodeRef>(1);
|
||||
// FIXME
|
||||
RecordService recordService = (RecordService) applicationContext.getBean("RecordService");
|
||||
if (recordService.isRecord(record) == true)
|
||||
{
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getParentAssocs(record, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
@@ -351,5 +373,4 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user