chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1602436 [1/2] - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ chemistry-opencmis-client/chemistry-opencmis-client-impl/sr...
Date Fri, 13 Jun 2014 14:15:47 GMT
Author: fmui
Date: Fri Jun 13 14:15:46 2014
New Revision: 1602436

URL: http://svn.apache.org/r1602436
Log:
CMIS-815: basic implementation of the extended date time format

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java   (with props)
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/FormDataWriter.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/TypeUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Constants.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/TypeDefinitionConverterTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AbstractBrowserServiceCall.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/AbstractServiceCall.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java Fri Jun 13 14:15:46 2014
@@ -23,6 +23,7 @@ import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
@@ -34,6 +35,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
@@ -79,6 +81,7 @@ public abstract class AbstractBrowserBin
 
     private BindingSession session;
     private boolean succint;
+    private DateTimeFormat dateTimeFormat;
 
     /**
      * Sets the current session.
@@ -88,6 +91,10 @@ public abstract class AbstractBrowserBin
 
         Object succintObj = session.get(SessionParameter.BROWSER_SUCCINCT);
         this.succint = (succintObj == null ? true : Boolean.parseBoolean(succintObj.toString()));
+
+        Object dateTimeFormatObj = session.get(SessionParameter.BROWSER_DATETIME_FORMAT);
+        this.dateTimeFormat = (dateTimeFormatObj == null ? DateTimeFormat.SIMPLE : DateTimeFormat
+                .fromValue(dateTimeFormatObj.toString().toLowerCase(Locale.ENGLISH)));
     }
 
     /**
@@ -199,6 +206,14 @@ public abstract class AbstractBrowserBin
         return succint ? "true" : null;
     }
 
+    protected DateTimeFormat getDateTimeFormat() {
+        return dateTimeFormat;
+    }
+
+    protected String getDateTimeFormatParameter() {
+        return dateTimeFormat == null || dateTimeFormat == DateTimeFormat.SIMPLE ? null : dateTimeFormat.value();
+    }
+
     // ---- exceptions ----
 
     /**

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -64,6 +64,7 @@ public class DiscoveryServiceImpl extend
         formData.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
         formData.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
         formData.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
+        formData.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
         // Important: No succinct flag here!!!
 
         // send and parse

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/FormDataWriter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/FormDataWriter.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/FormDataWriter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/FormDataWriter.java Fri Jun 13 14:15:46 2014
@@ -32,7 +32,9 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.Properties;
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
+import org.apache.chemistry.opencmis.commons.impl.DateTimeHelper;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
 import org.apache.chemistry.opencmis.commons.impl.MimeHelper;
 import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
@@ -67,7 +69,7 @@ public final class FormDataWriter {
         parameters.put(name, UrlBuilder.normalizeParameter(value));
     }
 
-    public void addPropertiesParameters(Properties properties) {
+    public void addPropertiesParameters(Properties properties, DateTimeFormat dateTimeFormat) {
         if (properties == null) {
             return;
         }
@@ -83,12 +85,14 @@ public final class FormDataWriter {
 
             if (prop.getValues() != null && prop.getValues().size() > 0) {
                 if (prop.getValues().size() == 1) {
-                    addParameter(Constants.CONTROL_PROP_VALUE + idxStr, convertPropertyValue(prop.getFirstValue()));
+                    addParameter(Constants.CONTROL_PROP_VALUE + idxStr,
+                            convertPropertyValue(prop.getFirstValue(), dateTimeFormat));
                 } else {
                     int vidx = 0;
                     for (Object obj : prop.getValues()) {
                         String vidxStr = "[" + vidx + "]";
-                        addParameter(Constants.CONTROL_PROP_VALUE + idxStr + vidxStr, convertPropertyValue(obj));
+                        addParameter(Constants.CONTROL_PROP_VALUE + idxStr + vidxStr,
+                                convertPropertyValue(obj, dateTimeFormat));
                         vidx++;
                     }
                 }
@@ -197,13 +201,17 @@ public final class FormDataWriter {
         }
     }
 
-    private String convertPropertyValue(Object value) {
+    private String convertPropertyValue(Object value, DateTimeFormat dateTimeFormat) {
         if (value == null) {
             return null;
         }
 
         if (value instanceof GregorianCalendar) {
-            return "" + ((GregorianCalendar) value).getTimeInMillis();
+            if (dateTimeFormat == DateTimeFormat.EXTENDED) {
+                return DateTimeHelper.formatXmlDateTime((GregorianCalendar) value);
+            } else {
+                return String.valueOf(((GregorianCalendar) value).getTimeInMillis());
+            }
         }
 
         return value.toString();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -63,6 +63,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -85,6 +86,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -107,6 +109,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -128,6 +131,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
         url.addParameter(Constants.PARAM_RELATIVE_PATH_SEGMENT, includeRelativePathSegment);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -143,6 +147,7 @@ public class NavigationServiceImpl exten
         UrlBuilder url = getObjectUrl(repositoryId, folderId, Constants.SELECTOR_PARENT);
         url.addParameter(Constants.PARAM_FILTER, filter);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -167,6 +172,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -75,7 +75,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_DOCUMENT, contentStream);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addParameter(Constants.PARAM_VERSIONIG_STATE, versioningState);
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
@@ -107,7 +107,7 @@ public class ObjectServiceImpl extends A
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_DOCUMENT_FROM_SOURCE);
         formData.addParameter(Constants.PARAM_SOURCE_ID, sourceId);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addParameter(Constants.PARAM_VERSIONIG_STATE, versioningState);
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
@@ -137,7 +137,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_FOLDER);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
         formData.addRemoveAcesParameters(removeAces);
@@ -166,7 +166,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_RELATIONSHIP);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
         formData.addRemoveAcesParameters(removeAces);
@@ -195,7 +195,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_POLICY);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
         formData.addRemoveAcesParameters(removeAces);
@@ -224,7 +224,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_ITEM);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
         formData.addRemoveAcesParameters(removeAces);
@@ -269,6 +269,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
         url.addParameter(Constants.PARAM_ACL, includeAcl);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -291,6 +292,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
         url.addParameter(Constants.PARAM_ACL, includeAcl);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -306,6 +308,7 @@ public class ObjectServiceImpl extends A
         UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_PROPERTIES);
         url.addParameter(Constants.PARAM_FILTER, filter);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -384,7 +387,7 @@ public class ObjectServiceImpl extends A
 
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_UPDATE_PROPERTIES);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken == null ? null : changeToken.getValue()));
         formData.addSuccinctFlag(getSuccinct());
 
@@ -423,7 +426,7 @@ public class ObjectServiceImpl extends A
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_BULK_UPDATE);
         formData.addObjectIdsAndChangeTokens(objectIdAndChangeToken);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addSecondaryTypeIds(addSecondaryTypeIds);
         formData.removeSecondaryTypeIds(removeSecondaryTypeIds);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -84,6 +84,7 @@ public class PolicyServiceImpl extends A
         UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_POLICIES);
         url.addParameter(Constants.PARAM_FILTER, filter);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -57,6 +57,7 @@ public class RelationshipServiceImpl ext
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -91,6 +91,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -106,6 +107,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_TYPE_ID, typeId);
         url.addParameter(Constants.PARAM_DEPTH, depth);
         url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -121,7 +123,8 @@ public class RepositoryServiceImpl exten
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CREATE_TYPE);
         if (type != null) {
-            formData.addParameter(Constants.CONTROL_TYPE, JSONConverter.convert(type).toJSONString());
+            formData.addParameter(Constants.CONTROL_TYPE, JSONConverter.convert(type, getDateTimeFormat())
+                    .toJSONString());
         }
 
         // send
@@ -143,7 +146,8 @@ public class RepositoryServiceImpl exten
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_UPDATE_TYPE);
         if (type != null) {
-            formData.addParameter(Constants.CONTROL_TYPE, JSONConverter.convert(type).toJSONString());
+            formData.addParameter(Constants.CONTROL_TYPE, JSONConverter.convert(type, getDateTimeFormat())
+                    .toJSONString());
         }
 
         // send

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java Fri Jun 13 14:15:46 2014
@@ -112,7 +112,7 @@ public class VersioningServiceImpl exten
         // prepare form data
         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CHECK_IN, contentStream);
         formData.addParameter(Constants.PARAM_MAJOR, major);
-        formData.addPropertiesParameters(properties);
+        formData.addPropertiesParameters(properties, getDateTimeFormat());
         formData.addParameter(Constants.PARAM_CHECKIN_COMMENT, checkinComment);
         formData.addPoliciesParameters(policies);
         formData.addAddAcesParameters(addAces);
@@ -149,6 +149,7 @@ public class VersioningServiceImpl exten
         url.addParameter(Constants.PARAM_RETURN_VERSION,
                 (major == null || Boolean.FALSE.equals(major) ? ReturnVersion.LATEST : ReturnVersion.LASTESTMAJOR));
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -167,6 +168,7 @@ public class VersioningServiceImpl exten
         url.addParameter(Constants.PARAM_RETURN_VERSION,
                 (major == null || Boolean.FALSE.equals(major) ? ReturnVersion.LATEST : ReturnVersion.LASTESTMAJOR));
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);
@@ -187,6 +189,7 @@ public class VersioningServiceImpl exten
         url.addParameter(Constants.PARAM_FILTER, filter);
         url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+        url.addParameter(Constants.PARAM_DATETIME_FORMAT, getDateTimeFormatParameter());
 
         // read and parse
         Response resp = read(url);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/TypeUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/TypeUtils.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/TypeUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/TypeUtils.java Fri Jun 13 14:15:46 2014
@@ -52,6 +52,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.Cardinality;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
@@ -103,7 +104,7 @@ public final class TypeUtils {
         }
 
         Writer writer = new BufferedWriter(new OutputStreamWriter(stream, IOUtils.UTF8));
-        JSONConverter.convert(type).writeJSONString(writer);
+        JSONConverter.convert(type, DateTimeFormat.SIMPLE).writeJSONString(writer);
         writer.flush();
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java Fri Jun 13 14:15:46 2014
@@ -565,6 +565,7 @@ public final class SessionParameter {
     /** URL of the Browser Binding entry point. */
     public static final String BROWSER_URL = "org.apache.chemistry.opencmis.binding.browser.url";
     public static final String BROWSER_SUCCINCT = "org.apache.chemistry.opencmis.binding.browser.succinct";
+    public static final String BROWSER_DATETIME_FORMAT ="org.apache.chemistry.opencmis.binding.browser.datetimeformat";
 
     /** Factory class name for the local binding. */
     public static final String LOCAL_FACTORY = "org.apache.chemistry.opencmis.binding.local.classname";

Added: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java?rev=1602436&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java Fri Jun 13 14:15:46 2014
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.commons.enums;
+
+/**
+ * DateTime Format Enum for the browser binding.
+ */
+public enum DateTimeFormat {
+
+    SIMPLE("simple"), EXTENDED("extended");
+    private final String value;
+
+    DateTimeFormat(String v) {
+        value = v;
+    }
+
+    public String value() {
+        return value;
+    }
+
+    public static DateTimeFormat fromValue(String v) {
+        for (DateTimeFormat c : DateTimeFormat.values()) {
+            if (c.value.equals(v)) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException(v);
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/enums/DateTimeFormat.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Constants.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Constants.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Constants.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Constants.java Fri Jun 13 14:15:46 2014
@@ -176,6 +176,7 @@ public final class Constants {
     public static final String PARAM_DOWNLOAD = "download";
     public static final String PARAM_FILTER = "filter";
     public static final String PARAM_SUCCINCT = "succinct";
+    public static final String PARAM_DATETIME_FORMAT = "dateTimeFormat";
     public static final String PARAM_FOLDER_ID = "folderId";
     public static final String PARAM_ID = "id";
     public static final String PARAM_IS_LAST_CHUNK = "isLastChunk";

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java Fri Jun 13 14:15:46 2014
@@ -98,6 +98,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.Cardinality;
 import org.apache.chemistry.opencmis.commons.enums.ChangeType;
 import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.DateTimeResolution;
 import org.apache.chemistry.opencmis.commons.enums.DecimalPrecision;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
@@ -1051,7 +1052,7 @@ public final class JSONConverter {
      * Converts an object.
      */
     public static JSONObject convert(final ObjectData object, final TypeCache typeCache,
-            final PropertyMode propertyMode, final boolean succinct) {
+            final PropertyMode propertyMode, final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if (object == null) {
             return null;
         }
@@ -1061,12 +1062,14 @@ public final class JSONConverter {
         // properties
         if (object.getProperties() != null) {
             if (succinct) {
-                JSONObject properties = convert(object.getProperties(), object.getId(), typeCache, propertyMode, true);
+                JSONObject properties = convert(object.getProperties(), object.getId(), typeCache, propertyMode, true,
+                        dateTimeFormat);
                 if (properties != null) {
                     result.put(JSON_OBJECT_SUCCINCT_PROPERTIES, properties);
                 }
             } else {
-                JSONObject properties = convert(object.getProperties(), object.getId(), typeCache, propertyMode, false);
+                JSONObject properties = convert(object.getProperties(), object.getId(), typeCache, propertyMode, false,
+                        dateTimeFormat);
                 if (properties != null) {
                     result.put(JSON_OBJECT_PROPERTIES, properties);
                 }
@@ -1089,7 +1092,7 @@ public final class JSONConverter {
             JSONArray relationships = new JSONArray();
 
             for (ObjectData relationship : object.getRelationships()) {
-                relationships.add(convert(relationship, typeCache, propertyMode, succinct));
+                relationships.add(convert(relationship, typeCache, propertyMode, succinct, dateTimeFormat));
             }
 
             result.put(JSON_OBJECT_RELATIONSHIPS, relationships);
@@ -1101,7 +1104,7 @@ public final class JSONConverter {
 
             ChangeEventInfo cei = object.getChangeEventInfo();
             changeEventInfo.put(JSON_CHANGE_EVENT_TYPE, getJSONEnumValue(cei.getChangeType()));
-            changeEventInfo.put(JSON_CHANGE_EVENT_TIME, getJSONValue(cei.getChangeTime()));
+            changeEventInfo.put(JSON_CHANGE_EVENT_TIME, getJSONValue(cei.getChangeTime(), dateTimeFormat));
 
             convertExtension(object.getChangeEventInfo(), changeEventInfo);
 
@@ -1150,7 +1153,7 @@ public final class JSONConverter {
      * Converts a bag of properties.
      */
     public static JSONObject convert(final Properties properties, final String objectId, final TypeCache typeCache,
-            final PropertyMode propertyMode, final boolean succinct) {
+            final PropertyMode propertyMode, final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if (properties == null) {
             return null;
         }
@@ -1193,7 +1196,7 @@ public final class JSONConverter {
             if (propId == null) {
                 throw new CmisRuntimeException("No query name or alias for property '" + property.getId() + "'!");
             }
-            result.put(propId, convert(property, propDef, succinct));
+            result.put(propId, convert(property, propDef, succinct, dateTimeFormat));
         }
 
         return result;
@@ -1202,7 +1205,8 @@ public final class JSONConverter {
     /**
      * Converts a property.
      */
-    public static Object convert(final PropertyData<?> property, final PropertyDefinition<?> propDef, boolean succinct) {
+    public static Object convert(final PropertyData<?> property, final PropertyDefinition<?> propDef, boolean succinct,
+            final DateTimeFormat dateTimeFormat) {
         if (property == null) {
             return null;
         }
@@ -1214,12 +1218,12 @@ public final class JSONConverter {
                 if ((property.getValues() == null) || (property.getValues().size() == 0)) {
                     result = null;
                 } else if (propDef.getCardinality() == Cardinality.SINGLE) {
-                    result = getJSONValue(property.getValues().get(0));
+                    result = getJSONValue(property.getValues().get(0), dateTimeFormat);
                 } else {
                     JSONArray values = new JSONArray();
 
                     for (Object value : property.getValues()) {
-                        values.add(getJSONValue(value));
+                        values.add(getJSONValue(value, dateTimeFormat));
                     }
 
                     result = values;
@@ -1231,7 +1235,7 @@ public final class JSONConverter {
                     JSONArray values = new JSONArray();
 
                     for (Object value : property.getValues()) {
-                        values.add(getJSONValue(value));
+                        values.add(getJSONValue(value, dateTimeFormat));
                     }
 
                     result = values;
@@ -1254,12 +1258,12 @@ public final class JSONConverter {
                 if ((property.getValues() == null) || (property.getValues().size() == 0)) {
                     result.put(JSON_PROPERTY_VALUE, null);
                 } else if (propDef.getCardinality() == Cardinality.SINGLE) {
-                    result.put(JSON_PROPERTY_VALUE, getJSONValue(property.getValues().get(0)));
+                    result.put(JSON_PROPERTY_VALUE, getJSONValue(property.getValues().get(0), dateTimeFormat));
                 } else {
                     JSONArray values = new JSONArray();
 
                     for (Object value : property.getValues()) {
-                        values.add(getJSONValue(value));
+                        values.add(getJSONValue(value, dateTimeFormat));
                     }
 
                     result.put(JSON_PROPERTY_VALUE, values);
@@ -1273,7 +1277,7 @@ public final class JSONConverter {
                     JSONArray values = new JSONArray();
 
                     for (Object value : property.getValues()) {
-                        values.add(getJSONValue(value));
+                        values.add(getJSONValue(value, dateTimeFormat));
                     }
 
                     result.put(JSON_PROPERTY_VALUE, values);
@@ -1376,7 +1380,7 @@ public final class JSONConverter {
      * Converts a query object list.
      */
     public static JSONObject convert(final ObjectList list, final TypeCache typeCache, final PropertyMode propertyMode,
-            final boolean succinct) {
+            final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if (list == null) {
             return null;
         }
@@ -1386,7 +1390,7 @@ public final class JSONConverter {
         JSONArray objects = new JSONArray();
         if (list.getObjects() != null) {
             for (ObjectData object : list.getObjects()) {
-                objects.add(convert(object, typeCache, propertyMode, succinct));
+                objects.add(convert(object, typeCache, propertyMode, succinct, dateTimeFormat));
             }
         }
 
@@ -1411,14 +1415,14 @@ public final class JSONConverter {
      * Converts an object in a folder list.
      */
     public static JSONObject convert(final ObjectInFolderData objectInFolder, final TypeCache typeCache,
-            final boolean succinct) {
+            final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if ((objectInFolder == null) || (objectInFolder.getObject() == null)) {
             return null;
         }
 
         JSONObject result = new JSONObject();
         result.put(JSON_OBJECTINFOLDER_OBJECT,
-                convert(objectInFolder.getObject(), typeCache, PropertyMode.OBJECT, succinct));
+                convert(objectInFolder.getObject(), typeCache, PropertyMode.OBJECT, succinct, dateTimeFormat));
         setIfNotNull(JSON_OBJECTINFOLDER_PATH_SEGMENT, objectInFolder.getPathSegment(), result);
 
         convertExtension(objectInFolder, result);
@@ -1430,7 +1434,7 @@ public final class JSONConverter {
      * Converts a folder list.
      */
     public static JSONObject convert(final ObjectInFolderList objectInFolderList, final TypeCache typeCache,
-            final boolean succinct) {
+            final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if (objectInFolderList == null) {
             return null;
         }
@@ -1441,7 +1445,7 @@ public final class JSONConverter {
             JSONArray objects = new JSONArray();
 
             for (ObjectInFolderData object : objectInFolderList.getObjects()) {
-                objects.add(convert(object, typeCache, succinct));
+                objects.add(convert(object, typeCache, succinct, dateTimeFormat));
             }
 
             result.put(JSON_OBJECTINFOLDERLIST_OBJECTS, objects);
@@ -1459,18 +1463,19 @@ public final class JSONConverter {
      * Converts a folder container.
      */
     public static JSONObject convert(final ObjectInFolderContainer container, final TypeCache typeCache,
-            final boolean succinct) {
+            final boolean succinct, final DateTimeFormat dateTimeFormat) {
         if (container == null) {
             return null;
         }
 
         JSONObject result = new JSONObject();
-        result.put(JSON_OBJECTINFOLDERCONTAINER_OBJECT, convert(container.getObject(), typeCache, succinct));
+        result.put(JSON_OBJECTINFOLDERCONTAINER_OBJECT,
+                convert(container.getObject(), typeCache, succinct, dateTimeFormat));
 
         if ((container.getChildren() != null) && (container.getChildren().size() > 0)) {
             JSONArray children = new JSONArray();
             for (ObjectInFolderContainer descendant : container.getChildren()) {
-                children.add(JSONConverter.convert(descendant, typeCache, succinct));
+                children.add(JSONConverter.convert(descendant, typeCache, succinct, dateTimeFormat));
             }
 
             result.put(JSON_OBJECTINFOLDERCONTAINER_CHILDREN, children);
@@ -1484,13 +1489,15 @@ public final class JSONConverter {
     /**
      * Converts an object parent.
      */
-    public static JSONObject convert(final ObjectParentData parent, final TypeCache typeCache, final boolean succinct) {
+    public static JSONObject convert(final ObjectParentData parent, final TypeCache typeCache, final boolean succinct,
+            final DateTimeFormat dateTimeFormat) {
         if ((parent == null) || (parent.getObject() == null)) {
             return null;
         }
 
         JSONObject result = new JSONObject();
-        result.put(JSON_OBJECTPARENTS_OBJECT, convert(parent.getObject(), typeCache, PropertyMode.OBJECT, succinct));
+        result.put(JSON_OBJECTPARENTS_OBJECT,
+                convert(parent.getObject(), typeCache, PropertyMode.OBJECT, succinct, dateTimeFormat));
         if (parent.getRelativePathSegment() != null) {
             result.put(JSON_OBJECTPARENTS_RELATIVE_PATH_SEGMENT, parent.getRelativePathSegment());
         }
@@ -1503,7 +1510,7 @@ public final class JSONConverter {
     /**
      * Converts a type definition.
      */
-    public static JSONObject convert(final TypeDefinition type) {
+    public static JSONObject convert(final TypeDefinition type, final DateTimeFormat dateTimeFormat) {
         if (type == null) {
             return null;
         }
@@ -1555,7 +1562,7 @@ public final class JSONConverter {
             JSONObject propertyDefs = new JSONObject();
 
             for (PropertyDefinition<?> pd : type.getPropertyDefinitions().values()) {
-                propertyDefs.put(pd.getId(), convert(pd));
+                propertyDefs.put(pd.getId(), convert(pd, dateTimeFormat));
             }
 
             result.put(JSON_TYPE_PROPERTY_DEFINITIONS, propertyDefs);
@@ -1569,7 +1576,7 @@ public final class JSONConverter {
     /**
      * Converts a property type definition.
      */
-    public static JSONObject convert(final PropertyDefinition<?> propertyDefinition) {
+    public static JSONObject convert(final PropertyDefinition<?> propertyDefinition, final DateTimeFormat dateTimeFormat) {
         if (propertyDefinition == null) {
             return null;
         }
@@ -1615,13 +1622,13 @@ public final class JSONConverter {
         if (propertyDefinition.getDefaultValue() != null) {
             if (propertyDefinition.getCardinality() == Cardinality.SINGLE) {
                 if (!propertyDefinition.getDefaultValue().isEmpty()) {
-                    result.put(JSON_PROPERTY_TYPE_DEAULT_VALUE, getJSONValue(propertyDefinition.getDefaultValue()
-                            .get(0)));
+                    result.put(JSON_PROPERTY_TYPE_DEAULT_VALUE,
+                            getJSONValue(propertyDefinition.getDefaultValue().get(0), dateTimeFormat));
                 }
             } else {
                 JSONArray values = new JSONArray();
                 for (Object value : propertyDefinition.getDefaultValue()) {
-                    values.add(getJSONValue(value));
+                    values.add(getJSONValue(value, dateTimeFormat));
                 }
                 result.put(JSON_PROPERTY_TYPE_DEAULT_VALUE, values);
             }
@@ -1629,8 +1636,9 @@ public final class JSONConverter {
 
         // choices
         if (propertyDefinition.getChoices() != null && !propertyDefinition.getChoices().isEmpty()) {
-            result.put(JSON_PROPERTY_TYPE_CHOICE,
-                    convertChoices(propertyDefinition.getChoices(), propertyDefinition.getCardinality()));
+            result.put(
+                    JSON_PROPERTY_TYPE_CHOICE,
+                    convertChoices(propertyDefinition.getChoices(), propertyDefinition.getCardinality(), dateTimeFormat));
         }
 
         // generic
@@ -1657,7 +1665,8 @@ public final class JSONConverter {
     /**
      * Converts choices.
      */
-    private static <T> JSONArray convertChoices(final List<Choice<T>> choices, final Cardinality cardinality) {
+    private static <T> JSONArray convertChoices(final List<Choice<T>> choices, final Cardinality cardinality,
+            final DateTimeFormat dateTimeFormat) {
         assert cardinality != null;
 
         if (choices == null) {
@@ -1673,18 +1682,20 @@ public final class JSONConverter {
 
             if (cardinality == Cardinality.SINGLE) {
                 if (!choice.getValue().isEmpty()) {
-                    jsonChoice.put(JSON_PROPERTY_TYPE_CHOICE_VALUE, getJSONValue(choice.getValue().get(0)));
+                    jsonChoice.put(JSON_PROPERTY_TYPE_CHOICE_VALUE,
+                            getJSONValue(choice.getValue().get(0), dateTimeFormat));
                 }
             } else {
                 JSONArray values = new JSONArray();
                 for (Object value : choice.getValue()) {
-                    values.add(getJSONValue(value));
+                    values.add(getJSONValue(value, dateTimeFormat));
                 }
                 jsonChoice.put(JSON_PROPERTY_TYPE_CHOICE_VALUE, values);
             }
 
             if (choice.getChoice() != null && !choice.getChoice().isEmpty()) {
-                jsonChoice.put(JSON_PROPERTY_TYPE_CHOICE_CHOICE, convertChoices(choice.getChoice(), cardinality));
+                jsonChoice.put(JSON_PROPERTY_TYPE_CHOICE_CHOICE,
+                        convertChoices(choice.getChoice(), cardinality, dateTimeFormat));
             }
 
             result.add(jsonChoice);
@@ -1696,7 +1707,7 @@ public final class JSONConverter {
     /**
      * Converts a type definition list.
      */
-    public static JSONObject convert(final TypeDefinitionList list) {
+    public static JSONObject convert(final TypeDefinitionList list, final DateTimeFormat dateTimeFormat) {
         if (list == null) {
             return null;
         }
@@ -1707,7 +1718,7 @@ public final class JSONConverter {
             JSONArray objects = new JSONArray();
 
             for (TypeDefinition type : list.getList()) {
-                objects.add(convert(type));
+                objects.add(convert(type, dateTimeFormat));
             }
 
             result.put(JSON_TYPESLIST_TYPES, objects);
@@ -1755,18 +1766,18 @@ public final class JSONConverter {
     /**
      * Converts a type definition container.
      */
-    public static JSONObject convert(final TypeDefinitionContainer container) {
+    public static JSONObject convert(final TypeDefinitionContainer container, final DateTimeFormat dateTimeFormat) {
         if (container == null) {
             return null;
         }
 
         JSONObject result = new JSONObject();
-        result.put(JSON_TYPESCONTAINER_TYPE, convert(container.getTypeDefinition()));
+        result.put(JSON_TYPESCONTAINER_TYPE, convert(container.getTypeDefinition(), dateTimeFormat));
 
         if ((container.getChildren() != null) && (container.getChildren().size() > 0)) {
             JSONArray children = new JSONArray();
             for (TypeDefinitionContainer child : container.getChildren()) {
-                children.add(JSONConverter.convert(child));
+                children.add(convert(child, dateTimeFormat));
             }
 
             result.put(JSON_TYPESCONTAINER_CHILDREN, children);
@@ -2329,6 +2340,12 @@ public final class JSONConverter {
                     GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
                     cal.setTimeInMillis(((Number) obj).longValue());
                     result.add(cal);
+                } else if (obj instanceof String) {
+                    GregorianCalendar cal = DateTimeHelper.parseXmlDateTime((String) obj);
+                    if (cal == null) {
+                        throw new CmisRuntimeException("Invalid property value: " + obj);
+                    }
+                    result.add(cal);
                 } else {
                     throw new CmisRuntimeException("Invalid property value: " + obj);
                 }
@@ -2807,9 +2824,13 @@ public final class JSONConverter {
         return obj.toString();
     }
 
-    public static Object getJSONValue(final Object value) {
+    public static Object getJSONValue(final Object value, final DateTimeFormat dateTimeFormat) {
         if (value instanceof GregorianCalendar) {
-            return ((GregorianCalendar) value).getTimeInMillis();
+            if (dateTimeFormat == DateTimeFormat.EXTENDED) {
+                return DateTimeHelper.formatXmlDateTime((GregorianCalendar) value);
+            } else {
+                return ((GregorianCalendar) value).getTimeInMillis();
+            }
         }
 
         return value;
@@ -2866,6 +2887,12 @@ public final class JSONConverter {
                 GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
                 cal.setTimeInMillis(((Number) value).longValue());
                 return cal;
+            } else if (value instanceof String) {
+                GregorianCalendar cal = DateTimeHelper.parseXmlDateTime((String) value);
+                if (cal == null) {
+                    new CmisRuntimeException("Invalid DateTime value!");
+                }
+                return cal;
             }
             throw new CmisRuntimeException("Invalid DateTime value!");
         default:
@@ -2987,6 +3014,8 @@ public final class JSONConverter {
             GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
             cal.setTimeInMillis(((Number) obj).longValue());
             return cal;
+        } else if (obj instanceof String) {
+            return DateTimeHelper.parseXmlDateTime((String) obj);
         }
 
         return null;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java Fri Jun 13 14:15:46 2014
@@ -46,6 +46,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.ChangeType;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
 import org.apache.chemistry.opencmis.commons.impl.TypeCache;
@@ -358,7 +359,8 @@ public class ObjectConvertTest extends A
 
         StringWriter sw = new StringWriter();
 
-        JSONObject jsonObject = JSONConverter.convert(data, typeCache, JSONConverter.PropertyMode.CHANGE, false);
+        JSONObject jsonObject = JSONConverter.convert(data, typeCache, JSONConverter.PropertyMode.CHANGE, false,
+                DateTimeFormat.SIMPLE);
         jsonObject.writeJSONString(sw);
 
         // test toJSONString()
@@ -394,7 +396,8 @@ public class ObjectConvertTest extends A
 
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(children, typeCache, JSONConverter.PropertyMode.CHANGE, false).writeJSONString(sw);
+        JSONConverter.convert(children, typeCache, JSONConverter.PropertyMode.CHANGE, false, DateTimeFormat.SIMPLE)
+                .writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);
@@ -419,7 +422,7 @@ public class ObjectConvertTest extends A
 
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(children, typeCache, false).writeJSONString(sw);
+        JSONConverter.convert(children, typeCache, false, DateTimeFormat.SIMPLE).writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);
@@ -449,7 +452,7 @@ public class ObjectConvertTest extends A
 
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(container, typeCache, false).writeJSONString(sw);
+        JSONConverter.convert(container, typeCache, false, DateTimeFormat.EXTENDED).writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/TypeDefinitionConverterTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/TypeDefinitionConverterTest.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/TypeDefinitionConverterTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/TypeDefinitionConverterTest.java Fri Jun 13 14:15:46 2014
@@ -47,6 +47,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.Cardinality;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.DateTimeResolution;
 import org.apache.chemistry.opencmis.commons.enums.DecimalPrecision;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
@@ -505,7 +506,7 @@ public class TypeDefinitionConverterTest
     protected void assertJsonTypeDefinition11(TypeDefinition typeDef) throws Exception {
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(typeDef).writeJSONString(sw);
+        JSONConverter.convert(typeDef, DateTimeFormat.SIMPLE).writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);
@@ -535,7 +536,7 @@ public class TypeDefinitionConverterTest
     protected void assertJsonTypeDefinitionList(TypeDefinitionList typeDefList) throws Exception {
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(typeDefList).writeJSONString(sw);
+        JSONConverter.convert(typeDefList, DateTimeFormat.SIMPLE).writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);
@@ -568,7 +569,7 @@ public class TypeDefinitionConverterTest
     protected void assertJsonTypeDefinitionContainer(TypeDefinitionContainer typeDefContainer) throws Exception {
         StringWriter sw = new StringWriter();
 
-        JSONConverter.convert(typeDefContainer).writeJSONString(sw);
+        JSONConverter.convert(typeDefContainer, DateTimeFormat.SIMPLE).writeJSONString(sw);
 
         Object json = (new JSONParser()).parse(sw.toString());
         assertTrue(json instanceof Map<?, ?>);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AbstractBrowserServiceCall.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AbstractBrowserServiceCall.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AbstractBrowserServiceCall.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AbstractBrowserServiceCall.java Fri Jun 13 14:15:46 2014
@@ -45,6 +45,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.Base64;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
+import org.apache.chemistry.opencmis.commons.impl.DateTimeHelper;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
 import org.apache.chemistry.opencmis.commons.impl.TypeCache;
 import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
@@ -376,15 +377,23 @@ public abstract class AbstractBrowserSer
             break;
         case DATETIME:
             List<GregorianCalendar> calValues = new ArrayList<GregorianCalendar>(strValues.size());
-            try {
-                for (String s : strValues) {
-                    GregorianCalendar cal = new GregorianCalendar();
-                    cal.setTimeInMillis(Long.parseLong(s));
-                    calValues.add(cal);
+            for (String s : strValues) {
+                GregorianCalendar cal;
+                try {
+                    long timestamp = Long.parseLong(s);
+                    cal = new GregorianCalendar();
+                    cal.setTimeInMillis(timestamp);
+                } catch (NumberFormatException e) {
+                    cal = DateTimeHelper.parseXmlDateTime(s);
                 }
-            } catch (NumberFormatException e) {
-                throw new CmisInvalidArgumentException(propDef.getId() + " value is not an datetime value!", e);
+
+                if (cal == null) {
+                    throw new CmisInvalidArgumentException(propDef.getId() + " value is not an datetime value!");
+                }
+
+                calValues.add(cal);
             }
+
             propertyData = new PropertyDateTimeImpl(propDef.getId(), calValues);
             break;
         case HTML:

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java Fri Jun 13 14:15:46 2014
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
@@ -71,6 +72,7 @@ public class DiscoveryService {
             BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
             BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ObjectList results = service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
@@ -82,7 +84,7 @@ public class DiscoveryService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonResults = JSONConverter.convert(results, typeCache, JSONConverter.PropertyMode.QUERY,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonResults, request, response);
@@ -109,6 +111,7 @@ public class DiscoveryService {
             Boolean includeAcl = getBooleanParameter(request, PARAM_ACL);
             BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
             ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
@@ -116,7 +119,7 @@ public class DiscoveryService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, JSONConverter.PropertyMode.CHANGE,
-                    succinct);
+                    succinct, dateTimeFormat);
             jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());
 
             response.setStatus(HttpServletResponse.SC_OK);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java Fri Jun 13 14:15:46 2014
@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
@@ -55,6 +56,7 @@ public class MultiFilingService {
             String folderId = getStringParameter(request, PARAM_FOLDER_ID);
             Boolean allVersions = getBooleanParameter(request, Constants.PARAM_ALL_VERSIONS);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -74,7 +76,7 @@ public class MultiFilingService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }
@@ -96,6 +98,7 @@ public class MultiFilingService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String folderId = getStringParameter(request, PARAM_FOLDER_ID);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -115,7 +118,7 @@ public class MultiFilingService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java?rev=1602436&r1=1602435&r2=1602436&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java Fri Jun 13 14:15:46 2014
@@ -40,6 +40,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
@@ -79,6 +80,7 @@ public class NavigationService {
             BigInteger maxItems = getBigIntegerParameter(request, PARAM_MAX_ITEMS);
             BigInteger skipCount = getBigIntegerParameter(request, PARAM_SKIP_COUNT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ObjectInFolderList children = service.getChildren(repositoryId, folderId, filter, orderBy,
@@ -90,7 +92,7 @@ public class NavigationService {
             }
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
-            JSONObject jsonChildren = JSONConverter.convert(children, typeCache, succinct);
+            JSONObject jsonChildren = JSONConverter.convert(children, typeCache, succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonChildren, request, response);
@@ -119,6 +121,7 @@ public class NavigationService {
             String renditionFilter = getStringParameter(request, PARAM_RENDITION_FILTER);
             Boolean includePathSegment = getBooleanParameter(request, PARAM_PATH_SEGMENT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<ObjectInFolderContainer> descendants = service.getDescendants(repositoryId, folderId, depth, filter,
@@ -131,7 +134,7 @@ public class NavigationService {
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONArray jsonDescendants = new JSONArray();
             for (ObjectInFolderContainer descendant : descendants) {
-                jsonDescendants.add(JSONConverter.convert(descendant, typeCache, succinct));
+                jsonDescendants.add(JSONConverter.convert(descendant, typeCache, succinct, dateTimeFormat));
             }
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -161,6 +164,7 @@ public class NavigationService {
             String renditionFilter = getStringParameter(request, PARAM_RENDITION_FILTER);
             Boolean includePathSegment = getBooleanParameter(request, PARAM_PATH_SEGMENT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<ObjectInFolderContainer> folderTree = service.getFolderTree(repositoryId, folderId, depth, filter,
@@ -173,7 +177,7 @@ public class NavigationService {
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONArray jsonDescendants = new JSONArray();
             for (ObjectInFolderContainer descendant : folderTree) {
-                jsonDescendants.add(JSONConverter.convert(descendant, typeCache, succinct));
+                jsonDescendants.add(JSONConverter.convert(descendant, typeCache, succinct, dateTimeFormat));
             }
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -197,6 +201,7 @@ public class NavigationService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String filter = getStringParameter(request, PARAM_FILTER);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ObjectData parent = service.getFolderParent(repositoryId, objectId, filter, null);
@@ -207,7 +212,7 @@ public class NavigationService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(parent, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonObject, request, response);
@@ -235,6 +240,7 @@ public class NavigationService {
             String renditionFilter = getStringParameter(request, PARAM_RENDITION_FILTER);
             Boolean includeRelativePathSegment = getBooleanParameter(request, PARAM_RELATIVE_PATH_SEGMENT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<ObjectParentData> parents = service.getObjectParents(repositoryId, objectId, filter,
@@ -247,7 +253,7 @@ public class NavigationService {
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONArray jsonParents = new JSONArray();
             for (ObjectParentData parent : parents) {
-                jsonParents.add(JSONConverter.convert(parent, typeCache, succinct));
+                jsonParents.add(JSONConverter.convert(parent, typeCache, succinct, dateTimeFormat));
             }
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -278,6 +284,7 @@ public class NavigationService {
             BigInteger maxItems = getBigIntegerParameter(request, PARAM_MAX_ITEMS);
             BigInteger skipCount = getBigIntegerParameter(request, PARAM_SKIP_COUNT);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ObjectList checkedout = service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
@@ -289,7 +296,7 @@ public class NavigationService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonCheckedOut = JSONConverter.convert(checkedout, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonCheckedOut, request, response);



Mime
View raw message