(1);
dateObj.put("value", value);
dateObj.put("iso8601", ISO8601DateFormat.format((Date)value));
json.put(key, (Serializable)dateObj);
}
else
{
json.put(key, value);
}
}
}
}
catch (NamespaceException ne)
{
// ignore properties that do not have a registered namespace
if (logger.isDebugEnabled())
logger.debug("Ignoring property '" + nextLongQName + "' as its namespace is not registered");
}
}
return json;
}
/**
* @param node the node to construct the download URL for
* @return For a content document, this method returns the URL to the /api/node/content
* API for the default content property
*
* For a container node, this method returns an empty string
*
*/
public String getDownloadAPIUrl(ScriptNode node)
{
if (node.getIsDocument())
{
return MessageFormat.format(CONTENT_DOWNLOAD_API_URL, new Object[]{
node.nodeRef.getStoreRef().getProtocol(),
node.nodeRef.getStoreRef().getIdentifier(),
node.nodeRef.getId(),
URLEncoder.encode(node.getName())});
}
else
{
return "";
}
}
}