diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/atomentry.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/atomentry.lib.atom.ftl index a7d26770a1..f6f6341969 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/atomentry.lib.atom.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/atomentry.lib.atom.ftl @@ -386,7 +386,7 @@ [#macro booleanvalue value]${value?string}[/#macro] [#macro datetimevalue value]${xmldate(value)}[/#macro] [#macro urivalue value]${value?xml}[/#macro] -[#macro idvalue value]${value?xml}[/#macro] +[#macro idvalue value][#if value?is_hash && value.nodeRef??]${value.nodeRef?xml}[#else]${value?xml}[/#if][/#macro] [#-- --] [#-- CMIS Relationships --] diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/modify.lib.js b/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/modify.lib.js index b60e459c39..ae06d3abfe 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/modify.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/lib/modify.lib.js @@ -29,10 +29,6 @@ function createNode(parent, entry, slug, versioningState) if (baseType == DOCUMENT_TYPE_ID) { node = parent.createFile(name); - if (versioningState != null) - { - node = cmis.applyVersioningState(node, versioningState); - } } else if (baseType == FOLDER_TYPE_ID) { @@ -66,6 +62,12 @@ function createNode(parent, entry, slug, versioningState) var exclude = [ PROP_OBJECT_TYPE_ID, PROP_NAME ]; var updated = updateNode(node, entry, exclude, function(propDef) {return patchValidator(propDef, true);}); + // apply versioning state + if (baseType == DOCUMENT_TYPE_ID && versioningState != null) + { + node = cmis.applyVersioningState(node, versioningState); + } + // only return node if updated successfully return (updated == null) ? null : node; } diff --git a/source/java/org/alfresco/repo/cmis/ws/utils/PropertyUtil.java b/source/java/org/alfresco/repo/cmis/ws/utils/PropertyUtil.java index 6681fb45a6..2a3268281b 100644 --- a/source/java/org/alfresco/repo/cmis/ws/utils/PropertyUtil.java +++ b/source/java/org/alfresco/repo/cmis/ws/utils/PropertyUtil.java @@ -612,9 +612,13 @@ public class PropertyUtil if (value instanceof Collection) { - for (String propertyValue : (Collection) value) + for (Serializable propertyValue : (Collection) value) { - property.getValue().add(propertyValue); + // NOTE: CMIS multi-valued values cannot contain null + if (propertyValue != null) + { + property.getValue().add(propertyValue.toString()); + } } } else