mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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())
|
||||
{
|
||||
|
Reference in New Issue
Block a user