RM-3181, RM-3195: ensure JSON conversion component works when no file plan is found

This commit is contained in:
Roy Wetherall
2016-04-06 10:24:27 +10:00
parent dc526e4a48
commit c59d9d00c9

View File

@@ -414,16 +414,16 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
if (filePlan != null) if (filePlan != null)
{ {
result.put("filePlan", filePlan.toString()); result.put("filePlan", filePlan.toString());
}
// Unfiled container node reference // Unfiled container node reference
NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan); NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);
if (unfiledRecordContainer != null) if (unfiledRecordContainer != null)
{ {
result.put("unfiledRecordContainer", unfiledRecordContainer.toString()); result.put("unfiledRecordContainer", unfiledRecordContainer.toString());
result.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName)); result.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName));
QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType(); QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType();
result.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString()); result.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
}
} }
return result; return result;