From: Patrick Schmitz Date: Fri, 2 Mar 2012 21:59:54 +0000 (-0800) Subject: NOJIRA - some diagnostic logging to determine how Nuxeo handles xs:date vs. xs:datetime. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=668f370f73683032a6bf72696de69a9c26d79c8c;p=tmp%2Fjakarta-migration.git NOJIRA - some diagnostic logging to determine how Nuxeo handles xs:date vs. xs:datetime. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/document/DocumentUtils.java b/services/common/src/main/java/org/collectionspace/services/common/document/DocumentUtils.java index 25ae83614..3037f290b 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/document/DocumentUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/document/DocumentUtils.java @@ -588,7 +588,23 @@ public class DocumentUtils { parent.appendChild(element); // extract the element content if (type.isSimpleType()) { - element.setTextContent(type.encode(value)); + String encodedVal = type.encode(value); + /* + * We need a way to produce just a Date when the specified data + * type is an xs:date vs. xs:datetime. Nuxeo maps both to a Calendar. Sigh. + if(logger.isTraceEnabled() && isDateType(type)) { + String dateValType = "unknown"; + if (value instanceof java.util.Date) { + dateValType = "java.util.Date"; + } else if (value instanceof java.util.Calendar) { + dateValType = "java.util.Calendar"; + } + logger.trace("building XML for date type: "+type.getName() + +" value type: "+dateValType + +" encoded: "+encodedVal); + } + */ + element.setTextContent(encodedVal); } else if (type.isComplexType()) { ComplexType ctype = (ComplexType) type; if (ctype.getName().equals(TypeConstants.CONTENT)) {