]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-11 reconciling changes
authorSanjay Dalal <sanjay.dalal@berkeley.edu>
Thu, 9 Apr 2009 21:56:44 +0000 (21:56 +0000)
committerSanjay Dalal <sanjay.dalal@berkeley.edu>
Thu, 9 Apr 2009 21:56:44 +0000 (21:56 +0000)
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java

index abf31281ca0e1fefeeddf5f62e0b4e8e98d4a9d8..e1008fd15d4b816de40ec97528a07ca26d935d77 100644 (file)
@@ -1,6 +1,10 @@
 package org.collectionspace.hello.services;\r
 \r
 public interface CollectionSpaceResource {\r
-       static String CS_NUXEO_WORKSPACE_UID = "322e1045-8e6f-4984-b42a-f18fb817d091";\r
-       static String CS_NUXEO_DEFAULT_REPOS = "default";       \r
+    //replace WORKSPACE_UID for resource workspace\r
+       static String CS_NUXEO_WORKSPACE_UID = "6c7881fe-54c5-486e-b144-a025dee3a484";\r
+       static String CS_NUXEO_DEFAULT_REPOS = "default";\r
+    //replace host if not running on localhost\r
+    static String CS_NUXEO_HOST = "localhost";\r
+    static String CS_NUXEO_URI = "http://" + CS_NUXEO_HOST + ":8080/nuxeo";\r
 }\r
index 451381af3106fe3eb74c98ca72d5f0693606f604..79cd3cc9a77e8110a26c720c741fd31ab9595d32 100644 (file)
@@ -55,7 +55,7 @@ public class PersonNuxeoResource implements CollectionSpaceResource {
             List<String> pathParams = new ArrayList<String>();
             Map<String, String> queryParams = new HashMap<String, String>();
 
-            pathParams = Arrays.asList("default", CS_NUXEO_WORKSPACE_UID, "browse");
+            pathParams = Arrays.asList(CS_NUXEO_DEFAULT_REPOS, CS_NUXEO_WORKSPACE_UID, "browse");
             Representation res = nxClient.get(pathParams, queryParams);
             SAXReader reader = new SAXReader();
             Document document = reader.read(res.getStream());
@@ -82,7 +82,7 @@ public class PersonNuxeoResource implements CollectionSpaceResource {
 
         List<String> pathParams = new ArrayList<String>();
         Map<String, String> queryParams = new HashMap<String, String>();
-        pathParams.add("default");
+        pathParams.add(CS_NUXEO_DEFAULT_REPOS);
         pathParams.add(CS_NUXEO_WORKSPACE_UID);
         pathParams.add("createDocument");
         queryParams.put("docType", "Hello");
@@ -96,7 +96,7 @@ public class PersonNuxeoResource implements CollectionSpaceResource {
         queryParams.put("hello:zip", p.getZip());
         queryParams.put("hello:country", p.getCountry());
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
-        Representation res = nxClient.post(pathParams, queryParams, bais);
+        Representation res = nxClient.post(pathParams, queryParams,bais);
 
         SAXReader reader = new SAXReader();
         try{
@@ -355,7 +355,7 @@ public class PersonNuxeoResource implements CollectionSpaceResource {
 //
 //    }
     private NuxeoRESTClient getClient() {
-        NuxeoRESTClient nxClient = new NuxeoRESTClient("http://127.0.0.1:8080/nuxeo");
+        NuxeoRESTClient nxClient = new NuxeoRESTClient(CS_NUXEO_URI);
         nxClient.setAuthType(NuxeoRESTClient.AUTH_TYPE_BASIC);
         nxClient.setBasicAuthentication("Administrator", "Administrator");
         return nxClient;
index d438059cf45f35d900ab80c8bace22f747a77ca0..9f76f7b925df6ca3257490646c8661a612189dce 100644 (file)
@@ -143,8 +143,7 @@ public class NuxeoRESTClient {
         }
 
         String completeURL = urlBuffer.toString();
-        // debug statement should be made conditional
-        System.err.println("CollectionSpace: The complete post URL is: " + completeURL);
+        System.out.println("\nNuxeoRESTClient: calling " + completeURL);
         Request request = new Request(Method.POST, completeURL);
 
         setupAuth(request);