RM-1345: Edit Disposition Date is not working for moved items

* behaviour now fires as expected so record folder data is updated correctly
 * general improvements to move record folder
 * addition and consolidation of move record folder integration tests
  



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@73870 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-06-16 06:20:05 +00:00
parent 109356ee71
commit 901a8fd8c8
10 changed files with 587 additions and 249 deletions

View File

@@ -666,7 +666,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
{
// For every event create an entry on the action
da.addEventCompletionDetails(event);
// createEvent(event, dispositionActionNodeRef);
}
}

View File

@@ -104,9 +104,11 @@ public class RecordCategoryType extends BaseBehaviourBean
throw new AlfrescoRuntimeException("Operation failed, because you can't place content directly into a record category.");
}
// setup the record folder
// TODO review
recordFolderService.setupRecordFolder(nodeRef);
if (bNew)
{
// setup the record folder
recordFolderService.setupRecordFolder(nodeRef);
}
}
/**

View File

@@ -22,6 +22,7 @@ import java.io.Serializable;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour;
@@ -134,33 +135,22 @@ public class RecordFolderType extends BaseBehaviourBean
{
public Object doWork()
{
behaviourFilter.disableBehaviour();
try
// clean record folder
cleanDisposableItem(nodeService, newNodeRef);
// re-initialise the record folder
recordFolderService.setupRecordFolder(newNodeRef);
// sort out the child records
for (NodeRef record : recordService.getRecords(newNodeRef))
{
// Remove unwanted aspects
removeUnwantedAspects(nodeService, newNodeRef);
// clean record
cleanDisposableItem(nodeService, record);
// reinitialise the record folder
recordFolderService.setupRecordFolder(newNodeRef);
// reinitialise the record folder disposition action details
dispositionService.refreshDispositionAction(newNodeRef);
// Sort out the child records
for (NodeRef record : recordService.getRecords(newNodeRef))
{
// Remove unwanted aspects
removeUnwantedAspects(nodeService, record);
// Re-initiate the records in the new folder.
recordService.file(record);
}
// Re-initiate the records in the new folder.
recordService.file(record);
}
finally
{
behaviourFilter.enableBehaviour();
}
return null;
}
}, AuthenticationUtil.getSystemUserName());
@@ -290,7 +280,7 @@ public class RecordFolderType extends BaseBehaviourBean
* @param nodeService
* @param nodeRef
*/
private void removeUnwantedAspects(NodeService nodeService, NodeRef nodeRef)
private void cleanDisposableItem(NodeService nodeService, NodeRef nodeRef)
{
// Remove unwanted aspects
for (QName aspect : unwantedAspects)
@@ -300,5 +290,12 @@ public class RecordFolderType extends BaseBehaviourBean
nodeService.removeAspect(nodeRef, aspect);
}
}
// remove the current disposition action (if there is one)
DispositionAction dispositionAction = dispositionService.getNextDispositionAction(nodeRef);
if (dispositionAction != null)
{
nodeService.deleteNode(dispositionAction.getNodeRef());
}
}
}