RM-975: Unable to change the name of a vital folder that contains a frozen record

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55513 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-09-19 05:56:32 +00:00
parent ce269f12b7
commit c677956ccb
3 changed files with 24 additions and 14 deletions

View File

@@ -18,4 +18,4 @@ log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=info
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.record.RecordServiceImpl=debug
#log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=on
log4j.logger.org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService=debug
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService=debug

View File

@@ -28,6 +28,7 @@ import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstrac
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -67,7 +68,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
@Override
protected void executeImpl(Action action, final NodeRef actionedUponNodeRef)
{
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
AuthenticationUtil.runAs(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
@@ -75,7 +76,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
propagateChangeToChildrenOf(actionedUponNodeRef);
return null;
}
});
}, AuthenticationUtil.getAdminUserName());
}
/**
@@ -102,10 +103,11 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
{
NodeRef nextChild = nextAssoc.getChildRef();
if (filePlanService.isFilePlanComponent(nextChild) == true)
if (filePlanService.isFilePlanComponent(nextChild) == true &&
freezeService.isFrozen(nextChild) == false)
{
// If the child is a record, then the VitalRecord aspect needs to be applied or updated
if (recordService.isRecord(nextChild))
if (recordService.isRecord(nextChild) == true)
{
if (parentVri)
{

View File

@@ -31,9 +31,9 @@ import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -42,6 +42,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.Period;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
import org.alfresco.util.PropertyMap;
/**
* Vital record service interface implementation.
@@ -141,17 +142,24 @@ public class VitalRecordServiceImpl implements VitalRecordService,
@Override
public void onUpdateProperties(final NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{
if (nodeService.exists(nodeRef) == true && nodeService.hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT) == true)
if (nodeService.exists(nodeRef) == true &&
nodeService.hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT) == true)
{
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
// check that vital record definition has been changed in the first place
Map<QName, Serializable> changedProps = PropertyMap.getChangedProperties(before, after);
if (changedProps.containsKey(PROP_VITAL_RECORD_INDICATOR) == true ||
changedProps.containsKey(PROP_REVIEW_PERIOD) == true)
{
@Override
public Void doWork() throws Exception
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
{
rmActionService.executeRecordsManagementAction(nodeRef, "broadcastVitalRecordDefinition");
return null;
}}
);
@Override
public Void doWork() throws Exception
{
rmActionService.executeRecordsManagementAction(nodeRef, "broadcastVitalRecordDefinition");
return null;
}}
);
}
}
}