Merge release/V2.4 into master

This commit is contained in:
Ana Bozianu
2016-04-04 09:55:10 +03:00
3 changed files with 35 additions and 24 deletions

View File

@@ -1446,7 +1446,11 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null) if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null)
{ {
NodeRef nodeRef = entry.getNodeRef(); NodeRef nodeRef = entry.getNodeRef();
String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME); String userName = null;
if(nodeService.exists(nodeRef))
{
userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
}
json.put("nodeName", userName == null ? "": userName); json.put("nodeName", userName == null ? "": userName);
json.put("createPerson", true); json.put("createPerson", true);
} }

View File

@@ -269,7 +269,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
* @param form * @param form
* @param nodeRef * @param nodeRef
*/ */
protected void addTransientProperties(Form form, final NodeRef nodeRef) protected void addTransientProperties(final Form form, final NodeRef nodeRef)
{ {
if (recordService.isRecord(nodeRef)) if (recordService.isRecord(nodeRef))
{ {
@@ -277,21 +277,21 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
} }
// Need to get the disposition schedule as the system user. See RM-1727. // Need to get the disposition schedule as the system user. See RM-1727.
DispositionSchedule ds = runAsSystem(new RunAsWork<DispositionSchedule>() //Need to run all block as the system user, needed for disposition instructions, recordCategory and categoryId. See RM-3077.
runAsSystem(new RunAsWork<Void>()
{ {
@Override @Override
public DispositionSchedule doWork() public Void doWork() throws Exception
{ {
return getDispositionService().getDispositionSchedule(nodeRef); DispositionSchedule ds = getDispositionService().getDispositionSchedule(nodeRef);
}
});
if (ds != null) if (ds != null)
{ {
String instructions = ds.getDispositionInstructions(); String instructions = ds.getDispositionInstructions();
if (instructions != null) if (instructions != null)
{ {
addTransientPropertyField(form, TRANSIENT_DISPOSITION_INSTRUCTIONS, DataTypeDefinition.TEXT, instructions); addTransientPropertyField(form, TRANSIENT_DISPOSITION_INSTRUCTIONS, DataTypeDefinition.TEXT,
instructions);
} }
NodeRef recordCategory = getDispositionService().getAssociatedRecordsManagementContainer(ds); NodeRef recordCategory = getDispositionService().getAssociatedRecordsManagementContainer(ds);
@@ -304,6 +304,9 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
} }
} }
} }
return null;
}
});
} }
/** /**

View File

@@ -158,6 +158,10 @@ public class AuditLogGet extends BaseAuditRetrievalWebScript
if( targetNode == null ) if( targetNode == null )
{ {
targetNode = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); targetNode = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
if(targetNode == null)
{
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The default RM site was not found");
}
} }
return AccessStatus.ALLOWED.equals( return AccessStatus.ALLOWED.equals(
capabilityService.getCapabilityAccessState(targetNode, ACCESS_AUDIT_CAPABILITY)); capabilityService.getCapabilityAccessState(targetNode, ACCESS_AUDIT_CAPABILITY));