RM-1592: "Declare As Record" collaboration rules don't work

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@75705 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-07-07 06:15:49 +00:00
parent fbae56a62c
commit 06e848543a
3 changed files with 41 additions and 18 deletions

View File

@@ -38,7 +38,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.extensions.webscripts.GUID;
/**

View File

@@ -452,24 +452,32 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
*
* @param childAssocRef child association reference
*/
public void dispositionActionCreate(ChildAssociationRef childAssocRef)
public void dispositionActionCreate(final ChildAssociationRef childAssocRef)
{
NodeRef child = childAssocRef.getChildRef();
if (nodeService.exists(child) &&
childAssocRef.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION))
{
// Get the record (or record folder)
NodeRef record = childAssocRef.getParentRef();
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
public Void doWork() throws Exception
{
NodeRef child = childAssocRef.getChildRef();
if (nodeService.exists(child) &&
childAssocRef.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION))
{
// Get the record (or record folder)
NodeRef record = childAssocRef.getParentRef();
// Apply the search aspect
applySearchAspect(record);
// Apply the search aspect
applySearchAspect(record);
// Update disposition properties
updateDispositionActionProperties(record, childAssocRef.getChildRef());
// Update disposition properties
updateDispositionActionProperties(record, childAssocRef.getChildRef());
// Clear the events
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null);
}
// Clear the events
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null);
}
return null;
}
});
}
/**

View File

@@ -780,8 +780,16 @@ public class RecordServiceImpl extends BaseBehaviourBean
// get the documents primary parent assoc
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef);
// move the document into the file plan
nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName());
behaviourFilter.disableBehaviour();
try
{
// move the document into the file plan
nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName());
}
finally
{
behaviourFilter.enableBehaviour();
}
// save the information about the originating details
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(3);
@@ -928,7 +936,15 @@ public class RecordServiceImpl extends BaseBehaviourBean
postfix = name.substring(dotIndex);
}
String recordName = prefix + " (" + recordId + ")" + postfix;
fileFolderService.rename(document, recordName);
behaviourFilter.disableBehaviour();
try
{
fileFolderService.rename(document, recordName);
}
finally
{
behaviourFilter.enableBehaviour();
}
if (logger.isDebugEnabled())
{