From: Sanjay Dalal Date: Thu, 9 Apr 2009 21:56:44 +0000 (+0000) Subject: CSPACE-11 reconciling changes X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=dc27fea33d5cc7a1909c4da552996309fa368aa9;p=tmp%2Fjakarta-migration.git CSPACE-11 reconciling changes --- diff --git a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java index abf31281c..e1008fd15 100644 --- a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java +++ b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java @@ -1,6 +1,10 @@ package org.collectionspace.hello.services; public interface CollectionSpaceResource { - static String CS_NUXEO_WORKSPACE_UID = "322e1045-8e6f-4984-b42a-f18fb817d091"; - static String CS_NUXEO_DEFAULT_REPOS = "default"; + //replace WORKSPACE_UID for resource workspace + static String CS_NUXEO_WORKSPACE_UID = "6c7881fe-54c5-486e-b144-a025dee3a484"; + static String CS_NUXEO_DEFAULT_REPOS = "default"; + //replace host if not running on localhost + static String CS_NUXEO_HOST = "localhost"; + static String CS_NUXEO_URI = "http://" + CS_NUXEO_HOST + ":8080/nuxeo"; } diff --git a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java index 451381af3..79cd3cc9a 100644 --- a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java +++ b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java @@ -55,7 +55,7 @@ public class PersonNuxeoResource implements CollectionSpaceResource { List pathParams = new ArrayList(); Map queryParams = new HashMap(); - 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 pathParams = new ArrayList(); Map queryParams = new HashMap(); - 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; diff --git a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java index d438059cf..9f76f7b92 100644 --- a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java +++ b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java @@ -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);