diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index de53d974f5..2a2eb95bf7 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -305,10 +305,10 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString()); } } - + /** * Helper method to get the display path. - * + * * @param nodeRef node reference * @return String display path */ @@ -330,43 +330,37 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC */ @SuppressWarnings("unchecked") private JSONObject setRmNodeValues(final NodeRef nodeRef, final boolean useShortQName) - { - return AuthenticationUtil.runAsSystem(new RunAsWork() + { + JSONObject rmNodeValues = new JSONObject(); + + // UI convenience type + rmNodeValues.put("uiType", getUIType(nodeRef)); + + // Get the 'kind' of the file plan component + FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef); + rmNodeValues.put("kind", kind.toString()); + + // File plan node reference + NodeRef filePlan = filePlanService.getFilePlan(nodeRef); + rmNodeValues.put("filePlan", filePlan.toString()); + + // Unfiled container node reference + NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan); + if (unfiledRecordContainer != null) { - public JSONObject doWork() - { - JSONObject rmNodeValues = new JSONObject(); + rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString()); + rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName)); + QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType(); + rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString()); + } - // UI convenience type - rmNodeValues.put("uiType", getUIType(nodeRef)); + // Set the indicators array + setIndicators(rmNodeValues, nodeRef); - // Get the 'kind' of the file plan component - FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef); - rmNodeValues.put("kind", kind.toString()); - - // File plan node reference - NodeRef filePlan = filePlanService.getFilePlan(nodeRef); - rmNodeValues.put("filePlan", filePlan.toString()); - - // Unfiled container node reference - NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan); - if (unfiledRecordContainer != null) - { - rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString()); - rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName)); - QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType(); - rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString()); - } - - // Set the indicators array - setIndicators(rmNodeValues, nodeRef); - - // Set the actions array - setActions(rmNodeValues, nodeRef); - - return rmNodeValues; - } - }); + // Set the actions array + setActions(rmNodeValues, nodeRef); + + return rmNodeValues; } @SuppressWarnings("unchecked")