chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1602436 [2/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
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.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/ObjectService.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/ObjectService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java
Fri Jun 13 14:15:46 2014
@@ -53,6 +53,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.Properties;
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
 import org.apache.chemistry.opencmis.commons.data.RenditionData;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
@@ -95,6 +96,7 @@ public class ObjectService {
             VersioningState versioningState = getEnumParameter(request, PARAM_VERSIONIG_STATE,
VersioningState.class);
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -118,7 +120,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -146,6 +148,7 @@ public class ObjectService {
             VersioningState versioningState = getEnumParameter(request, PARAM_VERSIONIG_STATE,
VersioningState.class);
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -171,7 +174,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -197,6 +200,7 @@ public class ObjectService {
             String folderId = ((BrowserCallContextImpl) context).getObjectId();
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -212,7 +216,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -238,6 +242,7 @@ public class ObjectService {
             String folderId = ((BrowserCallContextImpl) context).getObjectId();
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -253,7 +258,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -279,6 +284,7 @@ public class ObjectService {
             String folderId = ((BrowserCallContextImpl) context).getObjectId();
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -294,7 +300,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -319,6 +325,7 @@ public class ObjectService {
             // get parameters
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -334,7 +341,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             setStatus(request, response, HttpServletResponse.SC_CREATED);
             setCookie(request, response, repositoryId, token,
@@ -362,6 +369,7 @@ public class ObjectService {
             String changeToken = getStringParameter(request, Constants.CONTROL_CHANGE_TOKEN);
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -381,7 +389,7 @@ public class ObjectService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             int status = HttpServletResponse.SC_OK;
             if (!objectId.equals(newObjectId)) {
@@ -471,6 +479,7 @@ public class ObjectService {
             ReturnVersion returnVersion = getEnumParameter(request, PARAM_RETURN_VERSION,
ReturnVersion.class);
             String filter = getStringParameter(request, PARAM_FILTER);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Properties properties;
@@ -489,7 +498,7 @@ public class ObjectService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(properties, objectId, typeCache,
-                    JSONConverter.PropertyMode.OBJECT, succinct);
+                    JSONConverter.PropertyMode.OBJECT, succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonObject, request, response);
@@ -519,6 +528,7 @@ public class ObjectService {
             Boolean includePolicyIds = getBooleanParameter(request, PARAM_POLICY_IDS);
             Boolean includeAcl = getBooleanParameter(request, PARAM_ACL);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ObjectData object;
@@ -539,7 +549,7 @@ public class ObjectService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonObject, request, response);
@@ -755,6 +765,7 @@ public class ObjectService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String changeToken = getStringParameter(request, Constants.PARAM_CHANGE_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -773,7 +784,7 @@ public class ObjectService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }
@@ -796,6 +807,7 @@ public class ObjectService {
             String changeToken = getStringParameter(request, Constants.PARAM_CHANGE_TOKEN);
             Boolean overwriteFlag = getBooleanParameter(request, Constants.PARAM_OVERWRITE_FLAG);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -823,7 +835,7 @@ public class ObjectService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }
@@ -846,6 +858,7 @@ public class ObjectService {
             boolean isLastChunk = getBooleanParameter(request, Constants.CONTROL_IS_LAST_CHUNK,
false);
             String changeToken = getStringParameter(request, Constants.PARAM_CHANGE_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -873,7 +886,7 @@ public class ObjectService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }
@@ -896,6 +909,7 @@ public class ObjectService {
             String targetFolderId = getStringParameter(request, PARAM_TARGET_FOLDER_ID);
             String sourceFolderId = getStringParameter(request, PARAM_SOURCE_FOLDER_ID);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
@@ -915,7 +929,7 @@ public class ObjectService {
             // 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/PolicyService.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/PolicyService.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/PolicyService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java
Fri Jun 13 14:15:46 2014
@@ -27,6 +27,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;
@@ -57,6 +58,7 @@ public class PolicyService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String filter = getStringParameter(request, PARAM_FILTER);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<ObjectData> policies = service.getAppliedPolicies(repositoryId, objectId,
filter, null);
@@ -66,7 +68,7 @@ public class PolicyService {
                 TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
                 for (ObjectData policy : policies) {
                     jsonPolicies.add(JSONConverter.convert(policy, typeCache, JSONConverter.PropertyMode.OBJECT,
-                            succinct));
+                            succinct, dateTimeFormat));
                 }
             }
 
@@ -91,6 +93,7 @@ public class PolicyService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String policyId = getStringParameter(request, PARAM_POLICY_ID);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             service.applyPolicy(repositoryId, policyId, objectId, null);
@@ -105,7 +108,7 @@ public class PolicyService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             writeJSON(jsonObject, request, response);
         }
@@ -127,6 +130,7 @@ public class PolicyService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String policyId = getStringParameter(request, PARAM_POLICY_ID);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             service.removePolicy(repositoryId, policyId, objectId, null);
@@ -141,7 +145,7 @@ public class PolicyService {
 
             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/RelationshipService.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/RelationshipService.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/RelationshipService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java
Fri Jun 13 14:15:46 2014
@@ -32,6 +32,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.RelationshipDirection;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
@@ -66,6 +67,7 @@ public class RelationshipService {
             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 relationships = service.getObjectRelationships(repositoryId, objectId,
@@ -78,7 +80,7 @@ public class RelationshipService {
 
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonChildren = JSONConverter.convert(relationships, typeCache,
-                    JSONConverter.PropertyMode.OBJECT, succinct);
+                    JSONConverter.PropertyMode.OBJECT, succinct, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonChildren, request, response);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.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/RepositoryService.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/RepositoryService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
Fri Jun 13 14:15:46 2014
@@ -39,6 +39,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
@@ -169,11 +170,12 @@ public class RepositoryService {
             boolean includePropertyDefinitions = getBooleanParameter(request, PARAM_PROPERTY_DEFINITIONS,
false);
             BigInteger maxItems = getBigIntegerParameter(request, PARAM_MAX_ITEMS);
             BigInteger skipCount = getBigIntegerParameter(request, PARAM_SKIP_COUNT);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             TypeDefinitionList typeList = service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions,
                     maxItems, skipCount, null);
-            JSONObject jsonTypeList = JSONConverter.convert(typeList);
+            JSONObject jsonTypeList = JSONConverter.convert(typeList, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonTypeList, request, response);
@@ -193,6 +195,7 @@ public class RepositoryService {
             String typeId = getStringParameter(request, PARAM_TYPE_ID);
             BigInteger depth = getBigIntegerParameter(request, PARAM_DEPTH);
             boolean includePropertyDefinitions = getBooleanParameter(request, PARAM_PROPERTY_DEFINITIONS,
false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<TypeDefinitionContainer> typeTree = service.getTypeDescendants(repositoryId,
typeId, depth,
@@ -204,7 +207,7 @@ public class RepositoryService {
 
             JSONArray jsonTypeTree = new JSONArray();
             for (TypeDefinitionContainer container : typeTree) {
-                jsonTypeTree.add(JSONConverter.convert(container));
+                jsonTypeTree.add(JSONConverter.convert(container, dateTimeFormat));
             }
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -226,10 +229,11 @@ public class RepositoryService {
 
             // get parameters
             String typeId = getStringParameter(request, PARAM_TYPE_ID);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             TypeDefinition type = service.getTypeDefinition(repositoryId, typeId, null);
-            JSONObject jsonType = JSONConverter.convert(type);
+            JSONObject jsonType = JSONConverter.convert(type, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonType, request, response);
@@ -250,6 +254,8 @@ public class RepositoryService {
 
             // get parameters
             String typeStr = getStringParameter(request, CONTROL_TYPE);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+
             if (typeStr == null) {
                 throw new CmisInvalidArgumentException("Type definition missing!");
             }
@@ -266,7 +272,7 @@ public class RepositoryService {
 
             // execute
             TypeDefinition typeOut = service.createType(repositoryId, typeIn, null);
-            JSONObject jsonType = JSONConverter.convert(typeOut);
+            JSONObject jsonType = JSONConverter.convert(typeOut, dateTimeFormat);
 
             // set headers
             response.setStatus(HttpServletResponse.SC_CREATED);
@@ -290,6 +296,8 @@ public class RepositoryService {
 
             // get parameters
             String typeStr = getStringParameter(request, CONTROL_TYPE);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+
             if (typeStr == null) {
                 throw new CmisInvalidArgumentException("Type definition missing!");
             }
@@ -306,7 +314,7 @@ public class RepositoryService {
 
             // execute
             TypeDefinition typeOut = service.updateType(repositoryId, typeIn, null);
-            JSONObject jsonType = JSONConverter.convert(typeOut);
+            JSONObject jsonType = JSONConverter.convert(typeOut, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
             writeJSON(jsonType, request, response);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.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/VersioningService.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/VersioningService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
Fri Jun 13 14:15:46 2014
@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 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;
@@ -63,6 +64,7 @@ public class VersioningService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             Holder<String> checkOutId = new Holder<String>(objectId);
@@ -76,7 +78,7 @@ public class VersioningService {
             // return object
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             // set headers
             setStatus(request, response, HttpServletResponse.SC_CREATED);
@@ -131,6 +133,7 @@ public class VersioningService {
             String checkinComment = getStringParameter(request, PARAM_CHECKIN_COMMENT);
             String token = getStringParameter(request, PARAM_TOKEN);
             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             ControlParser cp = new ControlParser(request);
@@ -155,7 +158,7 @@ public class VersioningService {
 
             // return object
             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
-                    succinct);
+                    succinct, dateTimeFormat);
 
             // set headers
             setStatus(request, response, HttpServletResponse.SC_CREATED);
@@ -185,6 +188,7 @@ public class VersioningService {
             String filter = getStringParameter(request, PARAM_FILTER);
             Boolean includeAllowableActions = getBooleanParameter(request, PARAM_ALLOWABLE_ACTIONS);
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+            DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
             List<ObjectData> versions = service.getAllVersions(repositoryId, objectId,
null, filter,
@@ -197,8 +201,8 @@ public class VersioningService {
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONArray jsonVersions = new JSONArray();
             for (ObjectData version : versions) {
-                jsonVersions
-                        .add(JSONConverter.convert(version, typeCache, JSONConverter.PropertyMode.OBJECT,
succinct));
+                jsonVersions.add(JSONConverter.convert(version, typeCache, JSONConverter.PropertyMode.OBJECT,
succinct,
+                        dateTimeFormat));
             }
 
             response.setStatus(HttpServletResponse.SC_OK);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/AbstractServiceCall.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/shared/AbstractServiceCall.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/shared/AbstractServiceCall.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/AbstractServiceCall.java
Fri Jun 13 14:15:46 2014
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.math.BigInteger;
 import java.util.Date;
 import java.util.GregorianCalendar;
+import java.util.Locale;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -31,8 +32,10 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.LastModifiedContentStream;
 import org.apache.chemistry.opencmis.commons.data.RedirectingContentStream;
+import org.apache.chemistry.opencmis.commons.enums.DateTimeFormat;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.CmisEnumHelper;
+import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.DateTimeHelper;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
 
@@ -97,6 +100,21 @@ public abstract class AbstractServiceCal
         }
     }
 
+    public DateTimeFormat getDateTimeFormatParameter(HttpServletRequest request) {
+        String s = getStringParameter(request, Constants.PARAM_DATETIME_FORMAT);
+
+        if (s == null) {
+            return DateTimeFormat.SIMPLE;
+        }
+
+        try {
+            return DateTimeFormat.fromValue(s.trim().toLowerCase(Locale.ENGLISH));
+        } catch (IllegalArgumentException e) {
+            throw new CmisInvalidArgumentException("Invalid value for parameter " + Constants.PARAM_DATETIME_FORMAT
+                    + "!");
+        }
+    }
+
     /**
      * Extracts an enum parameter.
      */



Mime
View raw message