chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1044007 - in /incubator/chemistry/opencmis-browser-binding/trunk/src/main: java/org/apache/chemistry/opencmis/server/impl/browser/ java/org/apache/chemistry/opencmis/server/impl/browser/json/ webapp/
Date Thu, 09 Dec 2010 15:34:58 GMT
Author: fmui
Date: Thu Dec  9 15:34:57 2010
New Revision: 1044007

URL: http://svn.apache.org/viewvc?rev=1044007&view=rev
Log:
- more browser binding code

Added:
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
  (with props)
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
  (with props)
Modified:
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverterTypeCache.java
    incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
Thu Dec  9 15:34:57 2010
@@ -45,9 +45,20 @@ public class BrowserBindingUtils {
 
     public static final String ROOT_PATH_FRAGMENT = "root";
 
+    public static final String SELECTOR_TYPE_CHILDREN = "typeChildren";
+    public static final String SELECTOR_TYPE_DESCENDANTS = "typeDescendants";
+    public static final String SELECTOR_TYPE_DEFINITION = "typeDefintion";
+
     public static final String SELECTOR_CONTENT = "content";
     public static final String SELECTOR_OBJECT = "object";
     public static final String SELECTOR_CHILDREN = "children";
+    public static final String SELECTOR_DESCENDANTS = "descendants";
+    public static final String SELECTOR_PARENTS = "parents";
+    public static final String SELECTOR_FOLDER_TREE = "folder";
+    public static final String SELECTOR_QUERY = "query";
+    public static final String SELECTOR_VERSIONS = "versions";
+
+    public static final String ACTION_QUERY = "query";
 
     public static final String PARAM_SELECTOR = "selector";
     public static final String PARAM_CLIENTTOKEN = "clientToken";

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
Thu Dec  9 15:34:57 2010
@@ -90,6 +90,16 @@ public class CmisBrowserBindingServlet e
 
         try {
             repositoryDispatcher.addResource("", Dispatcher.METHOD_GET, RepositoryService.class,
"getRepositoryInfo");
+            repositoryDispatcher.addResource(BrowserBindingUtils.SELECTOR_TYPE_CHILDREN,
Dispatcher.METHOD_GET,
+                    RepositoryService.class, "getTypeChildren");
+            repositoryDispatcher.addResource(BrowserBindingUtils.SELECTOR_TYPE_DESCENDANTS,
Dispatcher.METHOD_GET,
+                    RepositoryService.class, "getTypeDescendants");
+            repositoryDispatcher.addResource(BrowserBindingUtils.SELECTOR_TYPE_DEFINITION,
Dispatcher.METHOD_GET,
+                    RepositoryService.class, "getTypeDefintion");
+            repositoryDispatcher.addResource(BrowserBindingUtils.SELECTOR_QUERY, Dispatcher.METHOD_GET,
+                    DiscoveryService.class, "query");
+            repositoryDispatcher.addResource(BrowserBindingUtils.ACTION_QUERY, Dispatcher.METHOD_POST,
+                    DiscoveryService.class, "query");
 
             rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_OBJECT, Dispatcher.METHOD_GET,
ObjectService.class,
                     "getObject");
@@ -97,10 +107,17 @@ public class CmisBrowserBindingServlet e
                     ObjectService.class, "getContentStream");
             rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_CHILDREN, Dispatcher.METHOD_GET,
                     NavigationService.class, "getChildren");
+            rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_DESCENDANTS, Dispatcher.METHOD_GET,
+                    NavigationService.class, "getDescendants");
+            rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_FOLDER_TREE, Dispatcher.METHOD_GET,
+                    NavigationService.class, "getFolderTree");
+            rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_PARENTS, Dispatcher.METHOD_GET,
+                    NavigationService.class, "getObjectParents");
+            rootDispatcher.addResource(BrowserBindingUtils.SELECTOR_VERSIONS, Dispatcher.METHOD_GET,
+                    VersioningService.class, "getAllVersions");
         } catch (NoSuchMethodException e) {
             LOG.error("Cannot initialize dispatcher!", e);
         }
-
     }
 
     @Override

Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java?rev=1044007&view=auto
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
(added)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
Thu Dec  9 15:34:57 2010
@@ -0,0 +1,66 @@
+/*
+ * 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.server.impl.browser;
+
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBigIntegerParameter;
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBooleanParameter;
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getEnumParameter;
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter;
+
+import java.math.BigInteger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.impl.Constants;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.CmisService;
+import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter;
+
+public class DiscoveryService {
+
+    /**
+     * Query.
+     */
+    public static void query(CallContext context, CmisService service, String repositoryId,
HttpServletRequest request,
+            HttpServletResponse response) throws Exception {
+        // get parameters
+        String statement = getStringParameter(request, Constants.PARAM_Q);
+        Boolean searchAllVersions = getBooleanParameter(request, Constants.PARAM_SEARCH_ALL_VERSIONS);
+        Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+        IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+                IncludeRelationships.class);
+        String renditionFilter = null;
+        BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
+        BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT);
+
+        // execute
+        ObjectList results = service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+                includeRelationships, renditionFilter, maxItems, skipCount, null);
+
+        if (results == null) {
+            throw new CmisRuntimeException("Results are null!");
+        }
+
+        BrowserBindingUtils.writeJSON(JSONConverter.convert(results), request, response);
+    }
+}

Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
Thu Dec  9 15:34:57 2010
@@ -24,11 +24,14 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter;
 
 import java.math.BigInteger;
+import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
+import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
@@ -36,12 +39,13 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter;
 import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverterTypeCache;
+import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 
 public final class NavigationService {
 
     /**
-     * Children Collection GET.
+     * getChildren.
      */
     public static void getChildren(CallContext context, CmisService service, String repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
@@ -71,4 +75,102 @@ public final class NavigationService {
 
         BrowserBindingUtils.writeJSON(jsonChildren, request, response);
     }
+
+    /**
+     * getDescendants.
+     */
+    @SuppressWarnings("unchecked")
+    public static void getDescendants(CallContext context, CmisService service, String repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+        // get parameters
+        String folderId = (String) context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID);
+        BigInteger depth = getBigIntegerParameter(request, Constants.PARAM_DEPTH);
+        String filter = getStringParameter(request, Constants.PARAM_FILTER);
+        Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+        IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+                IncludeRelationships.class);
+        String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER);
+        Boolean includePathSegment = getBooleanParameter(request, Constants.PARAM_PATH_SEGMENT);
+
+        // execute
+        List<ObjectInFolderContainer> descendants = service.getDescendants(repositoryId,
folderId, depth, filter,
+                includeAllowableActions, includeRelationships, renditionFilter, includePathSegment,
null);
+
+        if (descendants == null) {
+            throw new CmisRuntimeException("Descendants are null!");
+        }
+
+        JSONConverterTypeCache typeCache = new JSONConverterTypeCache(repositoryId, service);
+        JSONArray jsonDescendants = new JSONArray();
+        for (ObjectInFolderContainer descendant : descendants) {
+            jsonDescendants.add(JSONConverter.convert(descendant, typeCache));
+        }
+
+        BrowserBindingUtils.writeJSON(jsonDescendants, request, response);
+    }
+
+    /**
+     * getFolderTree.
+     */
+    @SuppressWarnings("unchecked")
+    public static void getFolderTree(CallContext context, CmisService service, String repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+        // get parameters
+        String folderId = (String) context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID);
+        BigInteger depth = getBigIntegerParameter(request, Constants.PARAM_DEPTH);
+        String filter = getStringParameter(request, Constants.PARAM_FILTER);
+        Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+        IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+                IncludeRelationships.class);
+        String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER);
+        Boolean includePathSegment = getBooleanParameter(request, Constants.PARAM_PATH_SEGMENT);
+
+        // execute
+        List<ObjectInFolderContainer> folderTree = service.getFolderTree(repositoryId,
folderId, depth, filter,
+                includeAllowableActions, includeRelationships, renditionFilter, includePathSegment,
null);
+
+        if (folderTree == null) {
+            throw new CmisRuntimeException("Folder Tree are null!");
+        }
+
+        JSONConverterTypeCache typeCache = new JSONConverterTypeCache(repositoryId, service);
+        JSONArray jsonDescendants = new JSONArray();
+        for (ObjectInFolderContainer descendant : folderTree) {
+            jsonDescendants.add(JSONConverter.convert(descendant, typeCache));
+        }
+
+        BrowserBindingUtils.writeJSON(jsonDescendants, request, response);
+    }
+
+    /**
+     * getObjectParents.
+     */
+    @SuppressWarnings("unchecked")
+    public static void getObjectParents(CallContext context, CmisService service, String
repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+        // get parameters
+        String objectId = (String) context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID);
+        String filter = getStringParameter(request, Constants.PARAM_FILTER);
+        Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+        IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+                IncludeRelationships.class);
+        String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER);
+        Boolean includeRelativePathSegment = getBooleanParameter(request, Constants.PARAM_RELATIVE_PATH_SEGMENT);
+
+        // execute
+        List<ObjectParentData> parents = service.getObjectParents(repositoryId, objectId,
filter,
+                includeAllowableActions, includeRelationships, renditionFilter, includeRelativePathSegment,
null);
+
+        if (parents == null) {
+            throw new CmisRuntimeException("Parents are null!");
+        }
+
+        JSONConverterTypeCache typeCache = new JSONConverterTypeCache(repositoryId, service);
+        JSONArray jsonParents = new JSONArray();
+        for (ObjectParentData parent : parents) {
+            jsonParents.add(JSONConverter.convert(parent, typeCache));
+        }
+
+        BrowserBindingUtils.writeJSON(jsonParents, request, response);
+    }
 }

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
Thu Dec  9 15:34:57 2010
@@ -32,6 +32,9 @@ import org.json.simple.JSONObject;
 
 public final class RepositoryService {
 
+    /**
+     * getRepositories.
+     */
     @SuppressWarnings("unchecked")
     public static void getRepositories(CallContext context, CmisService service, HttpServletRequest
request,
             HttpServletResponse response) throws Exception {
@@ -48,6 +51,9 @@ public final class RepositoryService {
         BrowserBindingUtils.writeJSON(result, request, response);
     }
 
+    /**
+     * getRepositoryInfo.
+     */
     public static void getRepositoryInfo(CallContext context, CmisService service, String
repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // execute
@@ -57,4 +63,25 @@ public final class RepositoryService {
 
         BrowserBindingUtils.writeJSON(JSONConverter.convert(ri, baseUrl), request, response);
     }
+
+    /**
+     * getTypeChildren.
+     */
+    public static void getTypeChildren(CallContext context, CmisService service, String repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+    }
+
+    /**
+     * getTypeDescendants.
+     */
+    public static void getTypeDescendants(CallContext context, CmisService service, String
repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+    }
+
+    /**
+     * getTypeDefintion.
+     */
+    public static void getTypeDefintion(CallContext context, CmisService service, String
repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+    }
 }

Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java?rev=1044007&view=auto
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
(added)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
Thu Dec  9 15:34:57 2010
@@ -0,0 +1,67 @@
+/*
+ * 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.server.impl.browser;
+
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBooleanParameter;
+import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.impl.Constants;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.CmisService;
+import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter;
+import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverterTypeCache;
+import org.json.simple.JSONArray;
+
+public class VersioningService {
+
+    /**
+     * getAllVersions.
+     */
+    @SuppressWarnings("unchecked")
+    public static void getAllVersions(CallContext context, CmisService service, String repositoryId,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+        // get parameters
+        String objectId = (String) context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID);
+        String filter = getStringParameter(request, Constants.PARAM_FILTER);
+        Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+
+        // execute
+        List<ObjectData> versions = service.getAllVersions(repositoryId, objectId,
null, filter,
+                includeAllowableActions, null);
+
+        if (versions == null) {
+            throw new CmisRuntimeException("Versions are null!");
+        }
+
+        JSONConverterTypeCache typeCache = new JSONConverterTypeCache(repositoryId, service);
+        JSONArray jsonVersions = new JSONArray();
+        for (ObjectData version : versions) {
+            jsonVersions.add(JSONConverter.convert(version, typeCache));
+        }
+
+        BrowserBindingUtils.writeJSON(jsonVersions, request, response);
+    }
+}

Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java
Thu Dec  9 15:34:57 2010
@@ -43,31 +43,31 @@ public class JSONConstants {
     public final static String REPINFO_PRINCIPAL_ID_ANONYMOUS = "principalIdAnonymous";
     public final static String REPINFO_PRINCIPAL_ID_ANYONE = "principalIdAnyone";
 
-    public final static String JSON_CAP_CONTENT_STREAM_UPDATES = "contentStreamUpdates";
-    public final static String JSON_CAP_CHANGES = "changes";
-    public final static String JSON_CAP_RENDITIONS = "renditions";
-    public final static String JSON_CAP_GET_DESCENDANTS = "getDescendants";
-    public final static String JSON_CAP_GET_FOLDER_TREE = "getFolderTree";
-    public final static String JSON_CAP_MULTIFILING = "multifiling";
-    public final static String JSON_CAP_UNFILING = "unfiling";
-    public final static String JSON_CAP_VERSION_SPECIFIC_FILING = "versionSpecificFiling";
-    public final static String JSON_CAP_PWC_SEARCHABLE = "pwcSearchable";
-    public final static String JSON_CAP_PWC_UPDATABLE = "pwcUpdatable";
-    public final static String JSON_CAP_ALL_VERSIONS_SEARCHABLE = "allVersionsSearchable";
-    public final static String JSON_CAP_QUERY = "query";
-    public final static String JSON_CAP_JOIN = "join";
-    public final static String JSON_CAP_ACL = "acl";
+    public final static String JSON_CAP_CONTENT_STREAM_UPDATES = "capabilityContentStreamUpdatability";
+    public final static String JSON_CAP_CHANGES = "capabilityChanges";
+    public final static String JSON_CAP_RENDITIONS = "capabilityRenditions";
+    public final static String JSON_CAP_GET_DESCENDANTS = "capabilityGetDescendants";
+    public final static String JSON_CAP_GET_FOLDER_TREE = "capabilityGetFolderTree";
+    public final static String JSON_CAP_MULTIFILING = "capabilityMultifiling";
+    public final static String JSON_CAP_UNFILING = "capabilityUnfiling";
+    public final static String JSON_CAP_VERSION_SPECIFIC_FILING = "capabilityVersionSpecificFiling";
+    public final static String JSON_CAP_PWC_SEARCHABLE = "capabilityPWCSearchable";
+    public final static String JSON_CAP_PWC_UPDATABLE = "capabilityPWCUpdatable";
+    public final static String JSON_CAP_ALL_VERSIONS_SEARCHABLE = "capabilityAllVersionsSearchable";
+    public final static String JSON_CAP_QUERY = "capabilityQuery";
+    public final static String JSON_CAP_JOIN = "capabilityJoin";
+    public final static String JSON_CAP_ACL = "capabilityACL";
 
     public final static String JSON_ACLCAP_SUPPORTED_PERMISSIONS = "supportedPermissions";
-    public final static String JSON_ACLCAP_ACL_PROPAGATION = "aclPropagation";
+    public final static String JSON_ACLCAP_ACL_PROPAGATION = "propagation";
     public final static String JSON_ACLCAP_PERMISSIONS = "permissions";
     public final static String JSON_ACLCAP_PERMISSION_MAPPING = "permissionMapping";
 
-    public final static String JSON_ACLCAP_PERMISSION_ID = "id";
+    public final static String JSON_ACLCAP_PERMISSION_PERMISSION = "permission";
     public final static String JSON_ACLCAP_PERMISSION_DESCRIPTION = "description";
 
     public final static String JSON_ACLCAP_MAPPING_KEY = "key";
-    public final static String JSON_ACLCAP_MAPPING_PERMISSIONS = "permissions";
+    public final static String JSON_ACLCAP_MAPPING_PERMISSION = "permission";
 
     public final static String JSON_OBJECT_PROPERTIES = "properties";
     public final static String JSON_OBJECT_ALLOWABLE_ACTIONS = "allowableActions";
@@ -77,7 +77,11 @@ public class JSONConstants {
     public final static String JSON_OBJECT_EXACT_ACL = "exactACL";
     public final static String JSON_OBJECT_POLICY_IDS = "policyIds";
     public final static String JSON_OBJECT_RENDITION = "rendition";
-    public final static String JSON_OBJECT_PATH_SEGMENT = "pathSegment";
+
+    public final static String JSON_OBJECTINFOLDER_OBJECT = "object";
+    public final static String JSON_OBJECTINFOLDER_PATH_SEGMENT = "pathSegment";
+    public final static String JSON_OBJECTPARENTS_OBJECT = "object";
+    public final static String JSON_OBJECTPARENTS_RELATIVE_PATH_SEGMENT = "relativePathSegment";
 
     public final static String JSON_PROPERTY_ID = "id";
     public final static String JSON_PROPERTY_LOCAL_NAME = "localName";
@@ -86,18 +90,20 @@ public class JSONConstants {
     public final static String JSON_PROPERTY_VALUE = "value";
     public final static String JSON_PROPERTY_DATATYPE = "type";
     public final static String JSON_PROPERTY_CARDINALITY = "cardinality";
-    
+
     public final static String JSON_CHANGE_EVENT_TYPE = "changeType";
     public final static String JSON_CHANGE_EVENT_TIME = "changeTime";
 
     public final static String JSON_ACL_ACES = "aces";
     public final static String JSON_ACL_IS_EXACT = "isExact";
 
-    public final static String JSON_ACE_PRINCIPAL = "princialId";
+    public final static String JSON_ACE_PRINCIPAL = "princial";
+    public final static String JSON_ACE_PRINCIPAL_ID = "princialId";
     public final static String JSON_ACE_PERMISSIONS = "permissions";
+    public final static String JSON_ACE_IS_DIRECT = "isDirect";
 
     public final static String JSON_RENDITION_STREAM_ID = "streamId";
-    public final static String JSON_RENDITION_MIMETYPE = "mimetype";
+    public final static String JSON_RENDITION_MIMETYPE = "mimeType";
     public final static String JSON_RENDITION_LENGTH = "length";
     public final static String JSON_RENDITION_KIND = "kind";
     public final static String JSON_RENDITION_TITLE = "title";
@@ -105,7 +111,62 @@ public class JSONConstants {
     public final static String JSON_RENDITION_WIDTH = "width";
     public final static String JSON_RENDITION_DOCUMENT_ID = "renditionDocumentId";
 
+    public final static String JSON_OBJECTLIST_OBJECTS = "objects";
+    public final static String JSON_OBJECTLIST_HAS_MORE_ITEMS = "hasMoreItems";
+    public final static String JSON_OBJECTLIST_NUM_ITEMS = "numItems";
+
     public final static String JSON_OBJECTINFOLDERLIST_OBJECTS = "objects";
     public final static String JSON_OBJECTINFOLDERLIST_HAS_MORE_ITEMS = "hasMoreItems";
     public final static String JSON_OBJECTINFOLDERLIST_NUM_ITEMS = "numItems";
+
+    public final static String JSON_OBJECTINFOLDERCONTAINER_OBJECT = "object";
+    public final static String JSON_OBJECTINFOLDERCONTAINER_CHILDREN = "children";
+
+    public final static String JSON_TYPE_ID = "id";
+    public final static String JSON_TYPE_LOCALNAME = "localName";
+    public final static String JSON_TYPE_LOCALNAMESPACE = "localNamespace";
+    public final static String JSON_TYPE_DISPLAYNAME = "displayName";
+    public final static String JSON_TYPE_QUERYNAME = "queryName";
+    public final static String JSON_TYPE_DESCRIPTION = "description";
+    public final static String JSON_TYPE_BASE_ID = "baseId";
+    public final static String JSON_TYPE_PARENT_ID = "parentId";
+    public final static String JSON_TYPE_CREATABLE = "creatable";
+    public final static String JSON_TYPE_FILEABLE = "fileable";
+    public final static String JSON_TYPE_QUERYABLE = "queryable";
+    public final static String JSON_TYPE_FULLTEXT_INDEXED = "fulltextIndexed";
+    public final static String JSON_TYPE_INCLUDE_IN_SUPERTYPE_QUERY = "includedInSupertypeQuery";
+    public final static String JSON_TYPE_INCLUDE_CONTROLABLE_POLICY = "controllablePolicy";
+    public final static String JSON_TYPE_INCLUDE_CONTROLABLE_ACL = "controllableACL";
+    public final static String JSON_TYPE_PROPERTY_DEFINITIONS = "propertyDefinitions";
+
+    public final static String JSON_TYPE_VERSIONABLE = "versionable"; // document
+    public final static String JSON_TYPE_CONTENTSTREAM_ALLOWED = "contentStreamAllowed";
// document
+
+    public final static String JSON_TYPE_ALLOWED_SOURCE_TYPES = "allowedSourceTypes"; //
relationship
+    public final static String JSON_TYPE_ALLOWED_TARGET_TYPES = "allowedTargetTypes"; //
relationship
+
+    public final static String JSON_PROPERTYTYPE_ID = "id";
+    public final static String JSON_PROPERTYTYPE_LOCALNAME = "localName";
+    public final static String JSON_PROPERTYTYPE_LOCALNAMESPACE = "localNamespace";
+    public final static String JSON_PROPERTYTYPE_DISPLAYNAME = "displayName";
+    public final static String JSON_PROPERTYTYPE_QUERYNAME = "queryName";
+    public final static String JSON_PROPERTYTYPE_DESCRIPTION = "description";
+    public final static String JSON_PROPERTYTYPE_PROPERTY_TYPE = "propertyType";
+    public final static String JSON_PROPERTYTYPE_CARDINALITY = "cardinality";
+    public final static String JSON_PROPERTYTYPE_UPDATABILITY = "updatability";
+    public final static String JSON_PROPERTYTYPE_INHERITED = "inherited";
+    public final static String JSON_PROPERTYTYPE_QUERYABLE = "queryable";
+    public final static String JSON_PROPERTYTYPE_OPENCHOICE = "openChoice";
+
+    public final static String JSON_PROPERTYTYPE_DEAULT_VALUE = "defaultValue";
+
+    public final static String JSON_PROPERTYTYPE_MAX_LENGTH = "maxLength";
+    public final static String JSON_PROPERTYTYPE_MIN_VALUE = "minValue";
+    public final static String JSON_PROPERTYTYPE_MAX_VALUE = "maxValue";
+    public final static String JSON_PROPERTYTYPE_MAX_PRECISION = "precision";
+    public final static String JSON_PROPERTYTYPE_MAX_RESOLUTION = "resolution";
+
+    public final static String JSON_PROPERTYTYPE_CHOICE_DISPLAYNAME = "displayName";
+    public final static String JSON_PROPERTYTYPE_CHOICE_VALUE = "value";
+    public final static String JSON_PROPERTYTYPE_CHOICE_CHOICE = "choice";
 }

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java
Thu Dec  9 15:34:57 2010
@@ -27,8 +27,11 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
 import org.apache.chemistry.opencmis.commons.data.ChangeEventInfo;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderData;
 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.data.PermissionMapping;
 import org.apache.chemistry.opencmis.commons.data.PropertyBoolean;
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
@@ -161,7 +164,7 @@ public class JSONConverter extends JSONC
 
             for (PermissionDefinition permDef : capabilities.getPermissions()) {
                 JSONObject permission = new JSONObject();
-                permission.put(JSON_ACLCAP_PERMISSION_ID, permDef.getId());
+                permission.put(JSON_ACLCAP_PERMISSION_PERMISSION, permDef.getId());
                 permission.put(JSON_ACLCAP_PERMISSION_DESCRIPTION, permDef.getDescription());
 
                 permissions.add(permission);
@@ -185,7 +188,7 @@ public class JSONConverter extends JSONC
 
                 JSONObject mapping = new JSONObject();
                 mapping.put(JSON_ACLCAP_MAPPING_KEY, permMap.getKey());
-                mapping.put(JSON_ACLCAP_MAPPING_PERMISSIONS, mappingPermissions);
+                mapping.put(JSON_ACLCAP_MAPPING_PERMISSION, mappingPermissions);
 
                 permissionMapping.add(mapping);
             }
@@ -212,9 +215,17 @@ public class JSONConverter extends JSONC
             JSONObject properties = new JSONObject();
 
             for (PropertyData<?> property : object.getProperties().getPropertyList())
{
-                TypeDefinition type = typeCache.getTypeDefinitionForObject(object.getId());
-                properties
-                        .put(property.getId(), convert(property, type.getPropertyDefinitions().get(property.getId())));
+                TypeDefinition type = null;
+                if (typeCache != null) {
+                    type = typeCache.getTypeDefinitionForObject(object.getId());
+                }
+
+                PropertyDefinition<?> propDef = null;
+                if (type != null) {
+                    propDef = type.getPropertyDefinitions().get(property.getId());
+                }
+
+                properties.put(property.getId(), convert(property, propDef));
             }
 
             result.put(JSON_OBJECT_PROPERTIES, properties);
@@ -293,18 +304,32 @@ public class JSONConverter extends JSONC
         result.put(JSON_PROPERTY_LOCAL_NAME, property.getLocalName());
         result.put(JSON_PROPERTY_DISPLAY_NAME, property.getDisplayName());
         result.put(JSON_PROPERTY_QUERY_NAME, property.getQueryName());
-        result.put(JSON_PROPERTY_DATATYPE, propDef.getPropertyType().value());
-        result.put(JSON_PROPERTY_CARDINALITY, propDef.getCardinality().value());
 
-        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)));
+        if (propDef != null) {
+            result.put(JSON_PROPERTY_DATATYPE, propDef.getPropertyType().value());
+            result.put(JSON_PROPERTY_CARDINALITY, propDef.getCardinality().value());
+
+            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)));
+            } else {
+                JSONArray values = new JSONArray();
+
+                for (Object value : property.getValues()) {
+                    values.add(getJSONValue(value));
+                }
+
+                result.put(JSON_PROPERTY_VALUE, values);
+            }
         } else {
-            JSONArray values = new JSONArray();
+            JSONArray values = null;
 
-            for (Object value : property.getValues()) {
-                values.add(getJSONValue(value));
+            if (property.getValues() != null) {
+                values = new JSONArray();
+                for (Object value : property.getValues()) {
+                    values.add(getJSONValue(value));
+                }
             }
 
             result.put(JSON_PROPERTY_VALUE, values);
@@ -352,8 +377,11 @@ public class JSONConverter extends JSONC
             }
 
             JSONObject aceObject = new JSONObject();
-            aceObject.put(JSON_ACE_PRINCIPAL, ace.getPrincipalId());
+            JSONObject principalObjecy = new JSONObject();
+            principalObjecy.put(JSON_ACE_PRINCIPAL_ID, ace.getPrincipalId());
+            aceObject.put(JSON_ACE_PRINCIPAL, principalObjecy);
             aceObject.put(JSON_ACE_PERMISSIONS, permissions);
+            aceObject.put(JSON_ACE_IS_DIRECT, ace.isDirect());
 
             aceObjects.add(aceObject);
         }
@@ -389,6 +417,29 @@ public class JSONConverter extends JSONC
     }
 
     /**
+     * Converts a query object list.
+     */
+    @SuppressWarnings("unchecked")
+    public static JSONObject convert(ObjectList list) {
+        JSONObject result = new JSONObject();
+
+        if (list != null) {
+            JSONArray objects = new JSONArray();
+            if (list.getObjects() != null) {
+                for (ObjectData object : list.getObjects()) {
+                    objects.add(convert(object, null));
+                }
+            }
+
+            result.put(JSON_OBJECTLIST_OBJECTS, objects);
+            result.put(JSON_OBJECTLIST_HAS_MORE_ITEMS, list.hasMoreItems());
+            result.put(JSON_OBJECTLIST_NUM_ITEMS, list.getNumItems());
+        }
+
+        return result;
+    }
+
+    /**
      * Converts an object in a folder list.
      */
     @SuppressWarnings("unchecked")
@@ -397,8 +448,11 @@ public class JSONConverter extends JSONC
             return null;
         }
 
-        JSONObject result = convert(objectInFolder.getObject(), typeCache);
-        result.put(JSON_OBJECT_PATH_SEGMENT, objectInFolder.getPathSegment());
+        JSONObject result = new JSONObject();
+        result.put(JSON_OBJECTINFOLDER_OBJECT, convert(objectInFolder.getObject(), typeCache));
+        if (objectInFolder.getPathSegment() != null) {
+            result.put(JSON_OBJECTINFOLDER_PATH_SEGMENT, objectInFolder.getPathSegment());
+        }
 
         return result;
     }
@@ -415,10 +469,10 @@ public class JSONConverter extends JSONC
         JSONObject result = new JSONObject();
 
         if (objectInFolderList.getObjects() != null) {
-            JSONObject objects = new JSONObject();
+            JSONArray objects = new JSONArray();
 
             for (ObjectInFolderData object : objectInFolderList.getObjects()) {
-                objects.put(object.getObject().getId(), convert(object, typeCache));
+                objects.add(convert(object, typeCache));
             }
 
             result.put(JSON_OBJECTINFOLDERLIST_OBJECTS, objects);
@@ -430,6 +484,48 @@ public class JSONConverter extends JSONC
         return result;
     }
 
+    /**
+     * Converts a folder container.
+     */
+    @SuppressWarnings("unchecked")
+    public static JSONObject convert(ObjectInFolderContainer container, JSONConverterTypeCache
typeCache) {
+        if (container == null) {
+            return null;
+        }
+
+        JSONObject result = new JSONObject();
+        result.put(JSON_OBJECTINFOLDERCONTAINER_OBJECT, convert(container.getObject(), typeCache));
+
+        if ((container.getChildren() != null) && (container.getChildren().size()
> 0)) {
+            JSONArray children = new JSONArray();
+            for (ObjectInFolderContainer descendant : container.getChildren()) {
+                children.add(JSONConverter.convert(descendant, typeCache));
+            }
+
+            result.put(JSON_OBJECTINFOLDERCONTAINER_CHILDREN, children);
+        }
+
+        return result;
+    }
+
+    /**
+     * Converts an object parent.
+     */
+    @SuppressWarnings("unchecked")
+    public static JSONObject convert(ObjectParentData parent, JSONConverterTypeCache typeCache)
{
+        if ((parent == null) || (parent.getObject() == null)) {
+            return null;
+        }
+
+        JSONObject result = new JSONObject();
+        result.put(JSON_OBJECTPARENTS_OBJECT, convert(parent.getObject(), typeCache));
+        if (parent.getRelativePathSegment() != null) {
+            result.put(JSON_OBJECTPARENTS_RELATIVE_PATH_SEGMENT, parent.getRelativePathSegment());
+        }
+
+        return result;
+    }
+
     // -----------------------------------------------------------------
 
     public static String getJSONStringValue(Object obj) {

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverterTypeCache.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverterTypeCache.java?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverterTypeCache.java
(original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverterTypeCache.java
Thu Dec  9 15:34:57 2010
@@ -47,7 +47,7 @@ public class JSONConverterTypeCache {
     }
 
     public TypeDefinition getTypeDefinitionForObject(String objectId) {
-        ObjectInfo info = service.getObjectInfo(objectId, objectId);
+        ObjectInfo info = service.getObjectInfo(repositoryId, objectId);
         return getTypeDefinition(info.getTypeId());
     }
 }

Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html?rev=1044007&r1=1044006&r2=1044007&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html (original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html Thu Dec 
9 15:34:57 2010
@@ -20,6 +20,7 @@ td {
 }
 </style>
 <script type="text/javascript">
+var repositoryUrl;
 var rootFolderUrl;
 
 function printRepositoryInfos(infos) {
@@ -36,11 +37,15 @@ function printRepositoryInfos(infos) {
             '<tr><td>Repository URL:</td><td>' + ri.repositoryUrl
+ '</td></tr>' +
             '<tr><td>Root folder URL:</td><td>' + ri.rootFolderUrl
+ '</td></tr>' +
             '</table>';
-            
-        rootFolderUrl = ri.rootFolderUrl; // the InMemory repository has only one repository
+
+        // the InMemory repository has only one repository
+        repositoryUrl = ri.repositoryUrl;
+        rootFolderUrl = ri.rootFolderUrl; 
 	}
 
     var rootFolder = "/";
+
+    document.getElementById('queryForm').action = repositoryUrl;
 	
     var script1 = document.createElement("script");        
     script1.setAttribute("src", rootFolderUrl + rootFolder + "?selector=object&clientToken=printObject");
@@ -89,8 +94,8 @@ function printChildren(children) {
     s = s + '<table><tr><th>Name</th><th>Type</th><th>MIME
Type</th><th>Size</th>' +
     '<th>Created By</th><th>Created At</th><th>Id</th></tr>';
 
-    for(var id in children.objects) {
-        var object = children.objects[id];
+    for(var index in children.objects) {
+        var object = children.objects[index].object;
 
         var name = object.properties["cmis:name"].value;
         var type = object.properties["cmis:objectTypeId"].value;
@@ -134,6 +139,19 @@ function printChildren(children) {
 <div id="objectInfo" class="box">objectInfo</div>
 <br />
 <div id="folderInfo" class="box">folderInfo</div>
+<br />
+<div id="query" class="box">
+<h2>Query</h2>
+<form id="queryForm" action="" method="POST">
+<input name="action" type="hidden" value="query" />
+<table>
+<tr><td>Query:</td><td><input name="q" type="text" size="100"
maxlength="1000" value="SELECT * FROM cmis:document"></td></tr>
+<tr><td>Max Items:</td><td><input name="maxItems" type="text"
size="4" maxlength="8" value="100"></td></tr>
+<tr><td>Skip Count:</td><td><input name="skipCount" type="text"
size="4" maxlength="8" value="0"></td></tr>
+<tr><td></td><td><input type="submit" value="Go" /></td></tr>
+</table>
+</form>
+</div>
 
 <script type="text/javascript"
 	src="browser?clientToken=printRepositoryInfos"></script>



Mime
View raw message