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.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.extensions.webscripts.GUID;
/** /**

View File

@@ -452,7 +452,11 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
* *
* @param childAssocRef child association reference * @param childAssocRef child association reference
*/ */
public void dispositionActionCreate(ChildAssociationRef childAssocRef) public void dispositionActionCreate(final ChildAssociationRef childAssocRef)
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
public Void doWork() throws Exception
{ {
NodeRef child = childAssocRef.getChildRef(); NodeRef child = childAssocRef.getChildRef();
if (nodeService.exists(child) && if (nodeService.exists(child) &&
@@ -470,6 +474,10 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
// Clear the events // Clear the events
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null); 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 // get the documents primary parent assoc
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef); ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef);
behaviourFilter.disableBehaviour();
try
{
// move the document into the file plan // move the document into the file plan
nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName()); nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName());
}
finally
{
behaviourFilter.enableBehaviour();
}
// save the information about the originating details // save the information about the originating details
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(3); Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(3);
@@ -928,7 +936,15 @@ public class RecordServiceImpl extends BaseBehaviourBean
postfix = name.substring(dotIndex); postfix = name.substring(dotIndex);
} }
String recordName = prefix + " (" + recordId + ")" + postfix; String recordName = prefix + " (" + recordId + ")" + postfix;
behaviourFilter.disableBehaviour();
try
{
fileFolderService.rename(document, recordName); fileFolderService.rename(document, recordName);
}
finally
{
behaviourFilter.enableBehaviour();
}
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {