chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1365998 - in /chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/ chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apa...
Date Thu, 26 Jul 2012 13:54:44 GMT
Author: fmui
Date: Thu Jul 26 13:54:44 2012
New Revision: 1365998

URL: http://svn.apache.org/viewvc?rev=1365998&view=rev
Log:
Follow up latest CMIS 1.1 draft changes

Modified:
    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/JSONConstants.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-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.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/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/webapp/web/createdocument.html
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createfolder.html

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=1365998&r1=1365997&r2=1365998&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
Thu Jul 26 13:54:44 2012
@@ -142,7 +142,7 @@ public final class Constants {
 
     // browser binding control
     public static final String CONTROL_CMISACTION = "cmisaction";
-    public static final String CONTROL_TRANSACTION = "transaction";
+    public static final String CONTROL_TOKEN = "token";
     public static final String CONTROL_OBJECT_ID = "objectId";
     public static final String CONTROL_PROP_ID = "propertyId";
     public static final String CONTROL_PROP_VALUE = "propertyValue";
@@ -204,9 +204,9 @@ public final class Constants {
     public static final String PARAM_SOURCE_ID = "sourceId";
 
     public static final String PARAM_SELECTOR = "cmisselector";
-    public static final String PARAM_TRANSACTION = "cmistransaction";
     public static final String PARAM_CALLBACK = "callback";
     public static final String PARAM_SUPPRESS_RESPONSE_CODES = "suppressResponseCodes";
+    public static final String PARAM_TOKEN = "token";
 
     // rendition filter
     public static final String RENDITION_NONE = "cmis:none";

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConstants.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/JSONConstants.java?rev=1365998&r1=1365997&r2=1365998&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConstants.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConstants.java
Thu Jul 26 13:54:44 2012
@@ -144,6 +144,7 @@ public class JSONConstants {
     public static final String JSON_OBJECT_ACL = "acl";
     public static final String JSON_OBJECT_EXACT_ACL = "exactACL";
     public static final String JSON_OBJECT_POLICY_IDS = "policyIds";
+    public static final String JSON_OBJECT_POLICY_IDS_IDS = "ids";
     public static final String JSON_OBJECT_RENDITIONS = "renditions";
 
     public static final Set<String> OBJECT_KEYS = new HashSet<String>();
@@ -165,6 +166,11 @@ public class JSONConstants {
         }
     }
 
+    public static final Set<String> POLICY_IDS_KEYS = new HashSet<String>();
+    static {
+        POLICY_IDS_KEYS.add(JSON_OBJECT_POLICY_IDS_IDS);
+    }
+
     public static final String JSON_OBJECTINFOLDER_OBJECT = "object";
     public static final String JSON_OBJECTINFOLDER_PATH_SEGMENT = "pathSegment";
 

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=1365998&r1=1365997&r2=1365998&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
Thu Jul 26 13:54:44 2012
@@ -860,6 +860,8 @@ public class JSONConverter {
             changeEventInfo.put(JSON_CHANGE_EVENT_TYPE, getJSONStringValue(cei.getChangeType().value()));
             changeEventInfo.put(JSON_CHANGE_EVENT_TIME, getJSONValue(cei.getChangeTime()));
 
+            convertExtension(object.getChangeEventInfo(), changeEventInfo);
+
             result.put(JSON_OBJECT_CHANGE_EVENT_INFO, changeEventInfo);
         }
 
@@ -870,14 +872,17 @@ public class JSONConverter {
         }
 
         // policy ids
-        if ((object.getPolicyIds() != null) && (object.getPolicyIds().getPolicyIds()
!= null)
-                && (!object.getPolicyIds().getPolicyIds().isEmpty())) {
-            JSONArray policyIds = new JSONArray();
+        if ((object.getPolicyIds() != null) && (object.getPolicyIds().getPolicyIds()
!= null)) {
+            JSONObject policyIds = new JSONObject();
+            JSONArray ids = new JSONArray();
+            policyIds.put(JSON_OBJECT_POLICY_IDS_IDS, ids);
 
             for (String pi : object.getPolicyIds().getPolicyIds()) {
-                policyIds.add(pi);
+                ids.add(pi);
             }
 
+            convertExtension(object.getPolicyIds(), policyIds);
+
             result.put(JSON_OBJECT_POLICY_IDS, policyIds);
         }
 
@@ -1512,7 +1517,7 @@ public class JSONConverter {
             result.setChangeEventInfo(changeEventInfo);
         }
         result.setIsExactAcl(getBoolean(json, JSON_OBJECT_EXACT_ACL));
-        result.setPolicyIds(convertPolicyIds(getList(json.get(JSON_OBJECT_POLICY_IDS))));
+        result.setPolicyIds(convertPolicyIds(getMap(json.get(JSON_OBJECT_POLICY_IDS))));
         result.setProperties(convertProperties(getMap(json.get(JSON_OBJECT_PROPERTIES))));
         List<Object> jsonRelationships = getList(json.get(JSON_OBJECT_RELATIONSHIPS));
         if (jsonRelationships != null) {
@@ -1635,7 +1640,7 @@ public class JSONConverter {
     /**
      * Converts a list of policy ids.
      */
-    public static PolicyIdList convertPolicyIds(List<Object> json) {
+    public static PolicyIdList convertPolicyIds(Map<String, Object> json) {
         if (json == null) {
             return null;
         }
@@ -1643,12 +1648,18 @@ public class JSONConverter {
         PolicyIdListImpl result = new PolicyIdListImpl();
         List<String> policyIds = new ArrayList<String>();
 
-        for (Object obj : json) {
-            if (obj instanceof String) {
-                policyIds.add((String) obj);
+        List<Object> ids = getList(json.get(JSON_OBJECT_POLICY_IDS_IDS));
+
+        if (ids != null) {
+            for (Object obj : ids) {
+                if (obj instanceof String) {
+                    policyIds.add((String) obj);
+                }
             }
         }
 
+        convertExtension(json, result, POLICY_IDS_KEYS);
+
         result.setPolicyIds(policyIds);
 
         return result;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.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/BrowserBindingUtils.java?rev=1365998&r1=1365997&r2=1365998&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
Thu Jul 26 13:54:44 2012
@@ -80,7 +80,7 @@ public class BrowserBindingUtils {
     public static final String CONTEXT_OBJECT_ID = "org.apache.chemistry.opencmis.browserbinding.objectId";
     public static final String CONTEXT_OBJECT_TYPE_ID = "org.apache.chemistry.opencmis.browserbinding.objectTypeId";
     public static final String CONTEXT_BASETYPE_ID = "org.apache.chemistry.opencmis.browserbinding.basetypeId";
-    public static final String CONTEXT_TRANSACTION = "org.apache.chemistry.opencmis.browserbinding.transaction";
+    public static final String CONTEXT_TOKEN = "org.apache.chemistry.opencmis.browserbinding.token";
 
     public enum CallUrl {
         SERVICE, REPOSITORY, ROOT
@@ -144,11 +144,11 @@ public class BrowserBindingUtils {
      * Returns the object id of the current request.
      */
     public static void prepareContext(CallContext context, CallUrl callUrl, CmisService service,
String repositoryId,
-            String objectId, String transaction, HttpServletRequest request) {
+            String objectId, String token, HttpServletRequest request) {
         CallContextImpl contextImpl = null;
         if (context instanceof CallContextImpl) {
             contextImpl = (CallContextImpl) context;
-            contextImpl.put(CONTEXT_TRANSACTION, transaction);
+            contextImpl.put(CONTEXT_TOKEN, token);
         }
 
         if (callUrl != CallUrl.ROOT) {
@@ -416,37 +416,37 @@ public class BrowserBindingUtils {
     /**
      * Transforms the transaction into a cookie name.
      */
-    public static String getCookieName(String transaction) {
-        if (transaction == null || transaction.length() == 0) {
+    public static String getCookieName(String token) {
+        if (token == null || token.length() == 0) {
             return "cmis%";
         }
 
-        return "cmis_" + Base64.encodeBytes(transaction.getBytes()).replace('=', '%');
+        return "cmis_" + Base64.encodeBytes(token.getBytes()).replace('=', '%');
     }
 
     /**
      * Sets a transaction cookie.
      */
     public static void setCookie(HttpServletRequest request, HttpServletResponse response,
String repositoryId,
-            String transaction, String value) {
-        setCookie(request, response, repositoryId, transaction, value, 3600);
+            String token, String value) {
+        setCookie(request, response, repositoryId, token, value, 3600);
     }
 
     /**
      * Deletes a transaction cookie.
      */
     public static void deleteCookie(HttpServletRequest request, HttpServletResponse response,
String repositoryId,
-            String transaction) {
-        setCookie(request, response, repositoryId, transaction, "", 0);
+            String token) {
+        setCookie(request, response, repositoryId, token, "", 0);
     }
 
     /**
      * Sets a transaction cookie.
      */
     public static void setCookie(HttpServletRequest request, HttpServletResponse response,
String repositoryId,
-            String transaction, String value, int expiry) {
-        if (transaction != null && transaction.length() > 0) {
-            Cookie transactionCookie = new Cookie(getCookieName(transaction), value);
+            String token, String value, int expiry) {
+        if (token != null && token.length() > 0) {
+            Cookie transactionCookie = new Cookie(getCookieName(token), value);
             transactionCookie.setMaxAge(expiry);
             transactionCookie.setPath(request.getContextPath() + request.getServletPath()
+ "/" + repositoryId);
             response.addCookie(transactionCookie);
@@ -470,9 +470,9 @@ public class BrowserBindingUtils {
      */
     public static void writeJSON(JSONStreamAware json, HttpServletRequest request, HttpServletResponse
response)
             throws IOException {
-        String transaction = getStringParameter(request, Constants.PARAM_TRANSACTION);
+        String token = getStringParameter(request, Constants.PARAM_TOKEN);
 
-        if (transaction == null) {
+        if (token == null) {
             response.setContentType(JSON_MIME_TYPE);
             response.setCharacterEncoding("UTF-8");
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.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/CmisBrowserBindingServlet.java?rev=1365998&r1=1365997&r2=1365998&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
Thu Jul 26 13:54:44 2012
@@ -65,7 +65,7 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.ERROR_MESSAGE;
 import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.ERROR_STACKTRACE;
 import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.CONTEXT_BASETYPE_ID;
-import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.CONTEXT_TRANSACTION;
+import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.CONTEXT_TOKEN;
 import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.HTML_MIME_TYPE;
 import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.JSON_MIME_TYPE;
 import static org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils.createCookieValue;
@@ -356,14 +356,14 @@ public class CmisBrowserBindingServlet e
 
                 String cmisaction = getStringParameter(postRequest, Constants.CONTROL_CMISACTION);
                 String objectId = getStringParameter(postRequest, Constants.CONTROL_OBJECT_ID);
-                String transaction = getStringParameter(postRequest, Constants.CONTROL_TRANSACTION);
+                String token = getStringParameter(postRequest, Constants.CONTROL_TOKEN);
 
                 if (cmisaction == null || cmisaction.length() == 0) {
                     throw new CmisNotSupportedException("Unknown action");
                 }
 
                 // add object id and object base type id to context
-                prepareContext(context, callUrl, service, repositoryId, objectId, transaction,
postRequest);
+                prepareContext(context, callUrl, service, repositoryId, objectId, token,
postRequest);
 
                 // dispatch
                 if (callUrl == CallUrl.REPOSITORY) {
@@ -437,9 +437,9 @@ public class CmisBrowserBindingServlet e
             LOG.error(ex.getMessage(), ex);
         }
 
-        String transaction = (context == null ? null : (String) context.get(CONTEXT_TRANSACTION));
+        String token = (context == null ? null : (String) context.get(CONTEXT_TOKEN));
 
-        if (transaction == null) {
+        if (token == null) {
             setStatus(request, response, statusCode);
             response.setContentType(JSON_MIME_TYPE);
 
@@ -463,7 +463,7 @@ public class CmisBrowserBindingServlet e
             response.setContentLength(0);
 
             if (context != null) {
-                setCookie(request, response, context.getRepositoryId(), transaction,
+                setCookie(request, response, context.getRepositoryId(), token,
                         createCookieValue(statusCode, null, exceptionName, ex.getMessage()));
             }
         }

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=1365998&r1=1365997&r2=1365998&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
Thu Jul 26 13:54:44 2012
@@ -30,7 +30,7 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_SOURCE_ID;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_STREAM_ID;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TARGET_FOLDER_ID;
-import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TRANSACTION;
+import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TOKEN;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_VERSIONIG_STATE;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.RESOURCE_CONTENT;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileBaseUrl;
@@ -105,7 +105,7 @@ public final class ObjectService {
         // get parameters
         String folderId = (String) context.get(CONTEXT_OBJECT_ID);
         VersioningState versioningState = getEnumParameter(request, PARAM_VERSIONIG_STATE,
VersioningState.class);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -124,7 +124,7 @@ public final class ObjectService {
         JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
 
         setStatus(request, response, HttpServletResponse.SC_CREATED);
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -139,7 +139,7 @@ public final class ObjectService {
         String folderId = (String) context.get(CONTEXT_OBJECT_ID);
         String sourceId = getStringParameter(request, PARAM_SOURCE_ID);
         VersioningState versioningState = getEnumParameter(request, PARAM_VERSIONIG_STATE,
VersioningState.class);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -164,7 +164,7 @@ public final class ObjectService {
         JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
 
         setStatus(request, response, HttpServletResponse.SC_CREATED);
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -177,7 +177,7 @@ public final class ObjectService {
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
         String folderId = (String) context.get(CONTEXT_OBJECT_ID);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -195,7 +195,7 @@ public final class ObjectService {
         JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
 
         setStatus(request, response, HttpServletResponse.SC_CREATED);
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -208,7 +208,7 @@ public final class ObjectService {
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
         String folderId = (String) context.get(CONTEXT_OBJECT_ID);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -226,7 +226,7 @@ public final class ObjectService {
         JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
 
         setStatus(request, response, HttpServletResponse.SC_CREATED);
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -238,7 +238,7 @@ public final class ObjectService {
     public static void createRelationship(CallContext context, CmisService service, String
repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -256,7 +256,7 @@ public final class ObjectService {
         JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
 
         setStatus(request, response, HttpServletResponse.SC_CREATED);
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -271,7 +271,7 @@ public final class ObjectService {
         String objectId = (String) context.get(CONTEXT_OBJECT_ID);
         String typeId = (String) context.get(CONTEXT_OBJECT_TYPE_ID);
         String changeToken = getStringParameter(request, Constants.PARAM_CHANGE_TOKEN);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -298,7 +298,7 @@ public final class ObjectService {
         }
 
         setStatus(request, response, status);
-        setCookie(request, response, repositoryId, transaction, createCookieValue(status,
object.getId(), null, null));
+        setCookie(request, response, repositoryId, token, createCookieValue(status, object.getId(),
null, null));
 
         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/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=1365998&r1=1365997&r2=1365998&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
Thu Jul 26 13:54:44 2012
@@ -22,7 +22,7 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_MAX_ITEMS;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_PROPERTY_DEFINITIONS;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_SKIP_COUNT;
-import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TRANSACTION;
+import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TOKEN;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TYPE_ID;
 import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBigIntegerParameter;
 import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBooleanParameter;
@@ -100,8 +100,8 @@ public final class RepositoryService {
     public static void getLastResult(CallContext context, CmisService service, String repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
 
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
-        String cookieName = BrowserBindingUtils.getCookieName(transaction);
+        String token = getStringParameter(request, PARAM_TOKEN);
+        String cookieName = BrowserBindingUtils.getCookieName(token);
         String cookieValue = null;
 
         if (request.getCookies() != null) {
@@ -125,7 +125,7 @@ public final class RepositoryService {
                     "Cookie pasring error!");
         }
 
-        BrowserBindingUtils.deleteCookie(request, response, repositoryId, transaction);
+        BrowserBindingUtils.deleteCookie(request, response, repositoryId, token);
 
         response.setStatus(HttpServletResponse.SC_OK);
         BrowserBindingUtils.writeJSON((JSONObject) JSONValue.parse(cookieValue), 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=1365998&r1=1365997&r2=1365998&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
Thu Jul 26 13:54:44 2012
@@ -22,7 +22,7 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_CHECKIN_COMMENT;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_FILTER;
 import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_MAJOR;
-import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TRANSACTION;
+import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_TOKEN;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.RESOURCE_CONTENT;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileBaseUrl;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrl;
@@ -73,7 +73,7 @@ public class VersioningService {
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
         String objectId = (String) context.get(CONTEXT_OBJECT_ID);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         Holder<String> checkOutId = new Holder<String>(objectId);
@@ -94,7 +94,7 @@ public class VersioningService {
         setStatus(request, response, HttpServletResponse.SC_CREATED);
         response.setHeader("Location", location);
 
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);
@@ -125,7 +125,7 @@ public class VersioningService {
         String typeId = (String) context.get(CONTEXT_OBJECT_TYPE_ID);
         Boolean major = getBooleanParameter(request, PARAM_MAJOR);
         String checkinComment = getStringParameter(request, PARAM_CHECKIN_COMMENT);
-        String transaction = getStringParameter(request, PARAM_TRANSACTION);
+        String token = getStringParameter(request, PARAM_TOKEN);
 
         // execute
         ControlParser cp = new ControlParser(request);
@@ -151,7 +151,7 @@ public class VersioningService {
         setStatus(request, response, HttpServletResponse.SC_CREATED);
         response.setHeader("Location", location);
 
-        setCookie(request, response, repositoryId, transaction,
+        setCookie(request, response, repositoryId, token,
                 createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
 
         writeJSON(jsonObject, request, response);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createdocument.html
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createdocument.html?rev=1365998&r1=1365997&r2=1365998&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createdocument.html
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createdocument.html
Thu Jul 26 13:54:44 2012
@@ -40,7 +40,7 @@ td {
 <script type="text/javascript">
 var repositoryUrl;
 var rootFolderUrl;
-var lastTransaction;
+var lastToken;
 
 function loadRepositoryInfos(infos) {
     for(repId in infos) {
@@ -58,18 +58,18 @@ function createDocument() {
     document.getElementById('info').innerHTML = "Creating " + docname + " ...";
 
     createForm.action = rootFolderUrl + createForm.folder.value;
-    lastTransaction = createGUID();
-    createForm.cmistransaction.value = lastTransaction;
+    lastToken = createGUID();
+    createForm.token.value = lastToken;
  
     return true;
 }
 
 function createDocumentCallback() {
-    if(lastTransaction) {
-        document.getElementById('info').innerHTML = 'Transaction: ' + lastTransaction
+    if(lastToken) {
+        document.getElementById('info').innerHTML = 'Token: ' + lastToken
 
         var script1 = document.createElement("script");
-        script1.setAttribute("src", repositoryUrl + "?cmisselector=lastResult&callback=showNewDocumentId&transaction="+lastTransaction);
+        script1.setAttribute("src", repositoryUrl + "?cmisselector=lastResult&callback=showNewDocumentId&token="+lastToken);
         script1.setAttribute("type","text/javascript");                
         document.body.appendChild(script1);
     }
@@ -92,7 +92,7 @@ function showNewDocumentId(result) {
 
 <form id="createForm" action="" method="POST" target="result" enctype="multipart/form-data"
onsubmit="return createDocument()">
 <input name="cmisaction" type="hidden" value="createDocument" />
-<input name="cmistransaction" type="hidden" value="" />
+<input name="token" type="hidden" value="" />
 <table>
 <tr>
     <td>Folder:</td>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createfolder.html
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createfolder.html?rev=1365998&r1=1365997&r2=1365998&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createfolder.html
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/webapp/web/createfolder.html
Thu Jul 26 13:54:44 2012
@@ -39,7 +39,7 @@ td {
 <script type="text/javascript">
 var repositoryUrl;
 var rootFolderUrl;
-var lastTransaction;
+var lastToken;
 
 function loadRepositoryInfos(infos) {
     for(repId in infos) {
@@ -57,18 +57,18 @@ function createFolder() {
     document.getElementById('info').innerHTML = "Creating " + foldername + " ...";
 
     createForm.action = rootFolderUrl + createForm.folder.value;
-    lastTransaction = createGUID();
-    createForm.cmistransaction.value = lastTransaction;
+    lastToken = createGUID();
+    createForm.token.value = lastToken;
  
     return true;
 }
 
 function createFolderCallback() {
-    if(lastTransaction) {
-        document.getElementById('info').innerHTML = 'Transaction: ' + lastTransaction
+    if(lastToken) {
+        document.getElementById('info').innerHTML = 'Token: ' + lastToken
 
         var script1 = document.createElement("script");
-        script1.setAttribute("src", repositoryUrl + "?cmisselector=lastResult&callback=showNewFolderId&transaction="+lastTransaction);
+        script1.setAttribute("src", repositoryUrl + "?cmisselector=lastResult&callback=showNewFolderId&token="+lastToken);
         script1.setAttribute("type","text/javascript");                
         document.body.appendChild(script1);
     }
@@ -91,7 +91,7 @@ function showNewFolderId(result) {
 
 <form id="createForm" action="" method="POST" target="result" onsubmit="return createFolder()">
 <input name="cmisaction" type="hidden" value="createFolder" />
-<input name="cmistransaction" type="hidden" value="" />
+<input name="token" type="hidden" value="" />
 <table>
 <tr>
     <td>Folder:</td>



Mime
View raw message