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.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;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -452,24 +452,32 @@ 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)
|
||||||
{
|
{
|
||||||
NodeRef child = childAssocRef.getChildRef();
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
if (nodeService.exists(child) &&
|
{
|
||||||
childAssocRef.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION))
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
// Get the record (or record folder)
|
NodeRef child = childAssocRef.getChildRef();
|
||||||
NodeRef record = childAssocRef.getParentRef();
|
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
|
// Apply the search aspect
|
||||||
applySearchAspect(record);
|
applySearchAspect(record);
|
||||||
|
|
||||||
// Update disposition properties
|
// Update disposition properties
|
||||||
updateDispositionActionProperties(record, childAssocRef.getChildRef());
|
updateDispositionActionProperties(record, childAssocRef.getChildRef());
|
||||||
|
|
||||||
// Clear the events
|
// Clear the events
|
||||||
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null);
|
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
|
// get the documents primary parent assoc
|
||||||
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef);
|
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef);
|
||||||
|
|
||||||
// move the document into the file plan
|
behaviourFilter.disableBehaviour();
|
||||||
nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName());
|
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
|
// 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;
|
||||||
fileFolderService.rename(document, recordName);
|
behaviourFilter.disableBehaviour();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fileFolderService.rename(document, recordName);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
behaviourFilter.enableBehaviour();
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user