Loading src/main/java/com/inteligr8/alfresco/acs/model/NodeBodyCreateMultipartCxf.java +12 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.inteligr8.alfresco.acs.model; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; Loading Loading @@ -90,9 +91,18 @@ public class NodeBodyCreateMultipartCxf extends MultipartBody { if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty()) logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content"); if (nodeBody.getProperties() != null) { @SuppressWarnings("unchecked") Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties(); for (Entry<String, ?> prop : props.entrySet()) { if (prop.getValue() != null) { if (prop.getValue() instanceof Collection<?>) { for (Object value : (Collection<?>)prop.getValue()) if (value != null) atts.add(toAttachment(prop.getKey(), value.toString())); } else if (prop.getValue() instanceof Object[]) { for (Object value : (Object[])prop.getValue()) if (value != null) atts.add(toAttachment(prop.getKey(), value.toString())); } else if (prop.getValue() != null) { // FIXME convert dates as ACS would expect them to be formatted atts.add(toAttachment(prop.getKey(), prop.getValue().toString())); } Loading src/main/java/com/inteligr8/alfresco/acs/model/NodeBodyCreateMultipartJersey.java +15 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.inteligr8.alfresco.acs.model; import java.io.IOException; import java.io.InputStream; import java.text.ParseException; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; Loading Loading @@ -86,9 +87,18 @@ public class NodeBodyCreateMultipartJersey extends FormDataMultiPart { if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty()) logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content"); if (nodeBody.getProperties() != null) { @SuppressWarnings("unchecked") Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties(); for (Entry<String, ?> prop : props.entrySet()) { if (prop.getValue() != null) { if (prop.getValue() instanceof Collection<?>) { for (Object value : (Collection<?>)prop.getValue()) if (value != null) fields.add(new FormDataBodyPart(prop.getKey(), value.toString())); } else if (prop.getValue() instanceof Object[]) { for (Object value : (Object[])prop.getValue()) if (value != null) fields.add(new FormDataBodyPart(prop.getKey(), value.toString())); } else if (prop.getValue() != null) { // FIXME convert dates as ACS would expect them to be formatted fields.add(new FormDataBodyPart(prop.getKey(), prop.getValue().toString())); } Loading Loading
src/main/java/com/inteligr8/alfresco/acs/model/NodeBodyCreateMultipartCxf.java +12 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.inteligr8.alfresco.acs.model; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; Loading Loading @@ -90,9 +91,18 @@ public class NodeBodyCreateMultipartCxf extends MultipartBody { if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty()) logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content"); if (nodeBody.getProperties() != null) { @SuppressWarnings("unchecked") Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties(); for (Entry<String, ?> prop : props.entrySet()) { if (prop.getValue() != null) { if (prop.getValue() instanceof Collection<?>) { for (Object value : (Collection<?>)prop.getValue()) if (value != null) atts.add(toAttachment(prop.getKey(), value.toString())); } else if (prop.getValue() instanceof Object[]) { for (Object value : (Object[])prop.getValue()) if (value != null) atts.add(toAttachment(prop.getKey(), value.toString())); } else if (prop.getValue() != null) { // FIXME convert dates as ACS would expect them to be formatted atts.add(toAttachment(prop.getKey(), prop.getValue().toString())); } Loading
src/main/java/com/inteligr8/alfresco/acs/model/NodeBodyCreateMultipartJersey.java +15 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.inteligr8.alfresco.acs.model; import java.io.IOException; import java.io.InputStream; import java.text.ParseException; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; Loading Loading @@ -86,9 +87,18 @@ public class NodeBodyCreateMultipartJersey extends FormDataMultiPart { if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty()) logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content"); if (nodeBody.getProperties() != null) { @SuppressWarnings("unchecked") Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties(); for (Entry<String, ?> prop : props.entrySet()) { if (prop.getValue() != null) { if (prop.getValue() instanceof Collection<?>) { for (Object value : (Collection<?>)prop.getValue()) if (value != null) fields.add(new FormDataBodyPart(prop.getKey(), value.toString())); } else if (prop.getValue() instanceof Object[]) { for (Object value : (Object[])prop.getValue()) if (value != null) fields.add(new FormDataBodyPart(prop.getKey(), value.toString())); } else if (prop.getValue() != null) { // FIXME convert dates as ACS would expect them to be formatted fields.add(new FormDataBodyPart(prop.getKey(), prop.getValue().toString())); } Loading