You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/10/17 20:57:16 UTC

svn commit: r1023557 - in /incubator/chemistry/opencmis-browser-binding/trunk: pom.xml src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java src/main/webapp/demo.html

Author: fmui
Date: Sun Oct 17 18:57:15 2010
New Revision: 1023557

URL: http://svn.apache.org/viewvc?rev=1023557&view=rev
Log:
- renamed "callback" to "clientToken"

Modified:
    incubator/chemistry/opencmis-browser-binding/trunk/pom.xml
    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/webapp/demo.html

Modified: incubator/chemistry/opencmis-browser-binding/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/pom.xml?rev=1023557&r1=1023556&r2=1023557&view=diff
==============================================================================
--- incubator/chemistry/opencmis-browser-binding/trunk/pom.xml (original)
+++ incubator/chemistry/opencmis-browser-binding/trunk/pom.xml Sun Oct 17 18:57:15 2010
@@ -46,6 +46,8 @@
                             <artifactId>chemistry-opencmis-server-inmemory</artifactId>
                         </overlay>
                     </overlays>
+                    <archiveClasses>true</archiveClasses>
+                    <attachClasses>true</attachClasses>
                 </configuration>
             </plugin>
             <plugin>
@@ -92,6 +94,11 @@
             <version>0.2.0-incubating-SNAPSHOT</version>
         </dependency>
         <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.2.1</version>
+        </dependency>
+        <dependency>
              <groupId>com.googlecode.json-simple</groupId>
              <artifactId>json-simple</artifactId>
              <version>1.1</version>

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=1023557&r1=1023556&r2=1023557&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 Sun Oct 17 18:57:15 2010
@@ -49,7 +49,7 @@ public class BrowserBindingUtils {
     public static final String METHOD_GET_CHILDREN = "getChildren";
 
     public static final String PARAM_METHOD = "method";
-    public static final String PARAM_CALLBACK = "callback";
+    public static final String PARAM_CLIENTTOKEN = "clientToken";
     public static final String PARAM_INCLUDE_TYPE = "includeTypeInformation";
 
     public static final String CONTEXT_OBJECT_ID = "org.apache.chemistry.openmis.browserbinding.objectId";
@@ -160,17 +160,17 @@ public class BrowserBindingUtils {
         response.setContentType(JSON_MIME_TYPE);
         response.setCharacterEncoding("UTF-8");
 
-        String callback = getStringParameter(request, PARAM_CALLBACK);
-        if (callback != null) {
-            if (!callback.matches("[A-Za-z0-9._\\[\\]]*")) {
-                throw new CmisInvalidArgumentException("Invalid callback name!");
+        String clientToken = getStringParameter(request, PARAM_CLIENTTOKEN);
+        if (clientToken != null) {
+            if (!clientToken.matches("[A-Za-z0-9._\\[\\]]*")) {
+                throw new CmisInvalidArgumentException("Invalid clientToken name!");
             }
-            response.getWriter().print(callback + "(");
+            response.getWriter().print(clientToken + "(");
         }
 
         json.writeJSONString(response.getWriter());
 
-        if (callback != null) {
+        if (clientToken != null) {
             response.getWriter().print(");");
         }
     }

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=1023557&r1=1023556&r2=1023557&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 Sun Oct 17 18:57:15 2010
@@ -31,7 +31,7 @@ function printRepositoryInfos(infos) {
             '<tr><td>Description:</td><td>' + ri.repositoryDescription + '</td></tr>' +
             '<tr><td>Product:</td><td>' + ri.vendorName + ' ' + ri.productName + ' ' + ri.productVersion + '</td></tr>' +
             '<tr><td>Root folder id:</td><td>' + ri.rootFolderId + '</td></tr>' +
-            '<tr><td>Root folder id:</td><td>' + ri.rootFolderUrl + '</td></tr>' +
+            '<tr><td>Root folder URL:</td><td>' + ri.rootFolderUrl + '</td></tr>' +
             '</table>';
             
         repositoryUrl = ri.rootFolderUrl; // the InMemory repository has only one repository
@@ -40,12 +40,12 @@ function printRepositoryInfos(infos) {
     var rootFolder = "/";
 	
     var script1 = document.createElement("script");        
-    script1.setAttribute("src", repositoryUrl + rootFolder + "?method=getObject&callback=printObject");
+    script1.setAttribute("src", repositoryUrl + rootFolder + "?method=getObject&clientToken=printObject");
     script1.setAttribute("type","text/javascript");                
     document.body.appendChild(script1);
 
     var script2 = document.createElement("script");        
-    script2.setAttribute("src", repositoryUrl + rootFolder + "?method=getChildren&callback=printChildren");
+    script2.setAttribute("src", repositoryUrl + rootFolder + "?method=getChildren&clientToken=printChildren");
     script2.setAttribute("type","text/javascript");                
     document.body.appendChild(script2);
 }
@@ -129,6 +129,6 @@ objectInfo
 folderInfo
 </div>
 
-<script type="text/javascript" src="browser?callback=printRepositoryInfos"></script>
+<script type="text/javascript" src="browser?clientToken=printRepositoryInfos"></script>
 </body>
 </html>
\ No newline at end of file