Fix for document list not returning data (e.g. when tag property is null)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29215 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2011-07-20 10:45:27 +00:00
parent dba83496a9
commit feb32d5a4c

View File

@@ -232,24 +232,27 @@ public final class ApplicationScriptUtils extends BaseScopableProcessorExtension
String key = useShortQNames ? shortQName : nextLongQName.toString(); String key = useShortQNames ? shortQName : nextLongQName.toString();
Serializable value = properties.get(nextLongQName); Serializable value = properties.get(nextLongQName);
// Has a decorator has been registered for this property? if (value != null)
if (this.decoratedProperties.containsKey(shortQName))
{ {
json.put(key, ((JSONPropertyDecorator) this.decoratedProperties.get(shortQName)).decorate(nodeRef, shortQName, value)); // Has a decorator has been registered for this property?
} if (this.decoratedProperties.containsKey(shortQName))
else
{
// Built-in data type processing
if (value instanceof Date)
{ {
Map<String, Serializable> dateObj = new LinkedHashMap<String, Serializable>(1); json.put(key, ((JSONPropertyDecorator) this.decoratedProperties.get(shortQName)).decorate(nodeRef, shortQName, value));
dateObj.put("value", value);
dateObj.put("iso8601", ISO8601DateFormat.format((Date)value));
json.put(key, (Serializable)dateObj);
} }
else else
{ {
json.put(key, value); // Built-in data type processing
if (value instanceof Date)
{
Map<String, Serializable> dateObj = new LinkedHashMap<String, Serializable>(1);
dateObj.put("value", value);
dateObj.put("iso8601", ISO8601DateFormat.format((Date)value));
json.put(key, (Serializable)dateObj);
}
else
{
json.put(key, value);
}
} }
} }
} }