ALF-4194 - minor fixes

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21883 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2010-08-19 19:02:18 +00:00
parent aed6bca1f3
commit f17f156887

View File

@@ -13,7 +13,6 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.namespace.QName;
import org.json.JSONArray;
import org.json.JSONException;
@@ -86,6 +85,7 @@ public class BulkMetadataGet extends AbstractWebScript {
for(int i = 0; i < nodeRefsArray.length(); i++)
{
NodeRef nodeRef = new NodeRef(nodeRefsArray.getString(i));
if(nodeService.exists(nodeRef))
{
NodeRef parentNodeRef = null;
@@ -107,12 +107,10 @@ public class BulkMetadataGet extends AbstractWebScript {
jsonOut.writeValue("shortType", shortType);
TypeDefinition typeDef = dictionaryService.getType(type);
jsonOut.writeValue("typeTitle", typeDef.getTitle());
// TODO is this always cm:title? what if custom type?
jsonOut.writeValue("name", properties.get(ContentModel.PROP_NAME).toString());
jsonOut.writeValue("title", properties.get(ContentModel.PROP_TITLE).toString());
jsonOut.writeValue("name", (String)properties.get(ContentModel.PROP_NAME));
jsonOut.writeValue("title", (String)properties.get(ContentModel.PROP_TITLE));
jsonOut.writeValue("mimeType", getMimeType((ContentData)properties.get(ContentModel.PROP_CONTENT)));
Path path = nodeService.getPath(nodeRef);
jsonOut.writeValue("path", path.toString());
}
jsonOut.endObject();
}