]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
Final changes for v0.1 release candidate for CollectionObject and Identifier services.
authorRichard Millet <richard.millet@berkeley.edu>
Thu, 9 Apr 2009 02:57:00 +0000 (02:57 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Thu, 9 Apr 2009 02:57:00 +0000 (02:57 +0000)
HelloWorld/HelloWorldClient/.classpath
HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java
HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierClient.java [new file with mode: 0644]
HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierProxy.java [new file with mode: 0644]
HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java
HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java
HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectServiceTest.java
HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/DomainIdentifierServiceTest.java [new file with mode: 0644]
HelloWorld/HelloWorldJaxb/src/main/resources/hello.xsd
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java

index 96f09f11f76884d703f4e7ff928248ebf899b491..5fc0d16391df16d8b6d83e690c5c4c5b6b2c87f5 100644 (file)
@@ -6,5 +6,6 @@
        <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>\r
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+       <classpathentry kind="lib" path="/helloworld-jaxb/target/helloworld-jaxb-0.1.jar"/>\r
        <classpathentry kind="output" path="target/classes"/>\r
 </classpath>\r
index 8e5a7cf9f650c606dd082b0412585aa0d5445d1e..ffda95ba718e1171c6a71127f78afbe38e22e280 100644 (file)
@@ -15,10 +15,8 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
  * @version $Revision:$
  */
-public class CollectionObjectClient {
+public class CollectionObjectClient implements CollectionSpaceClient {
 
-       private static final String HOST = "http://localhost:8080";
-       private static final String URI = "/helloworld/cspace-nuxeo";
 
     /**
      *
diff --git a/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierClient.java b/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierClient.java
new file mode 100644 (file)
index 0000000..98c6a71
--- /dev/null
@@ -0,0 +1,65 @@
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.hello.DomainIdentifier;
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+/**
+ * A IdentifierClient.
+
+ * @version $Revision:$
+ */
+public class DomainIdentifierClient implements CollectionSpaceClient {
+
+
+    /**
+     *
+     */
+    private static final DomainIdentifierClient instance = new DomainIdentifierClient();
+    /**
+     *
+     */
+    private DomainIdentifierProxy identifierProxy;
+
+    /**
+     *
+     * Create a new IdentifierClient.
+     *
+     */
+    private DomainIdentifierClient() {
+        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+        RegisterBuiltin.register(factory);
+        identifierProxy = ProxyFactory.create(DomainIdentifierProxy.class, HOST + URI);
+    }
+
+    /**
+     * FIXME Comment this
+     *
+     * @return
+     */
+    public static DomainIdentifierClient getInstance() {
+        return instance;
+    }
+
+    /**
+     * @param id
+     * @return
+     * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long)
+     */
+    public ClientResponse<DomainIdentifier> getIdentifier(String id) {
+        return identifierProxy.getIdentifier(id);
+    }
+
+    /**
+     * @param identifier
+     * @return
+     * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier)
+     */
+    public ClientResponse<Response> createIdentifier(DomainIdentifier identifier) {
+        return identifierProxy.createIdentifier(identifier);
+    }
+}
diff --git a/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierProxy.java b/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/DomainIdentifierProxy.java
new file mode 100644 (file)
index 0000000..ca42255
--- /dev/null
@@ -0,0 +1,32 @@
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.hello.DomainIdentifier;
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * @version $Revision:$
+ */
+@Path("/domainidentifiers/")
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface DomainIdentifierProxy {
+
+    /**
+     * @param id
+     * @return
+     */
+    @GET
+    @Path("/{id}")
+    ClientResponse<DomainIdentifier> getIdentifier(@PathParam("id") String id);
+
+    @POST
+    ClientResponse<Response> createIdentifier(DomainIdentifier so);
+}
\ No newline at end of file
index a7b12f9673b514109b711f5c7e46002ae1de091c..62c03f356e845b239d8e12bdf7a3b7541e470790 100644 (file)
@@ -13,7 +13,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
  * @version $Revision:$
  */
-public class IdentifierClient {
+public class IdentifierClient implements CollectionSpaceClient {
 
     /**
      *
@@ -32,7 +32,7 @@ public class IdentifierClient {
     private IdentifierClient() {
         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
         RegisterBuiltin.register(factory);
-        identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace");
+        identifierProxy = ProxyFactory.create(IdentifierProxy.class, HOST + URI);
     }
 
     /**
index cc99f11eea18add4b0f1d267d2a51635585e832e..d60bb07d4009bbf8b018488f835ca367b931b36c 100644 (file)
@@ -14,7 +14,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
  * @version $Revision:$
  */
-public class PersonNuxeoClient {
+public class PersonNuxeoClient implements CollectionSpaceClient {
 
     /**
      *
@@ -33,7 +33,7 @@ public class PersonNuxeoClient {
     private PersonNuxeoClient() {
         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
         RegisterBuiltin.register(factory);
-        personProxy = ProxyFactory.create(PersonNuxeoProxy.class, "http://localhost:8080/helloworld/cspace-nuxeo");
+        personProxy = ProxyFactory.create(PersonNuxeoProxy.class, HOST + URI);
     }
 
     /**
index aa76d13c3d3433717696f772367b4a907690b911..7887d0077a602e6c2d9c5bbade5ef2469837dd33 100644 (file)
@@ -44,18 +44,20 @@ public class CollectionObjectServiceTest {
     public void updateCollectionObject() {
        ClientResponse<CollectionObject> res = collectionObjectClient.getCollectionObject(updateId);
         CollectionObject collectionObject = res.getEntity();
-        verbose("got collectionobject to update: " + updateId,
+        verbose("Got CollectionObject to update with ID: " + updateId,
                        collectionObject, CollectionObject.class);
         
         //collectionObject.setCsid("updated-" + updateId);
-        collectionObject.setIdentifier("updated-" + collectionObject.getIdentifier());
-        collectionObject.setDescription("updated-" + collectionObject.getDescription());
+        collectionObject.setObjectNumber("updated-" + collectionObject.getObjectNumber());
+        collectionObject.setObjectName("updated-" + collectionObject.getObjectName());
         
+        // make call to update service
         res = collectionObjectClient.updateCollectionObject(updateId, collectionObject);
-        CollectionObject updatedCollectionObject = res.getEntity();
-        Assert.assertEquals(updatedCollectionObject.getDescription(), collectionObject.getDescription());
-
-        verbose("updated collectionObject", updatedCollectionObject, CollectionObject.class);
+        
+        // check the response
+        CollectionObject updatedCollectionObject = res.getEntity();        
+        Assert.assertEquals(updatedCollectionObject.getObjectName(), collectionObject.getObjectName());
+        verbose("updateCollectionObject: ", updatedCollectionObject, CollectionObject.class);
         
         return;
     }
@@ -75,7 +77,7 @@ public class CollectionObjectServiceTest {
         int i = 0;
         for(CollectionObjectList.CollectionObjectListItem pli : coItemList) {
             verbose("getCollectionObjectList: list-item[" + i + "] csid=" + pli.getCsid());
-            verbose("getCollectionObjectList: list-item[" + i + "] identifier=" + pli.getIdentifier());
+            verbose("getCollectionObjectList: list-item[" + i + "] objectNumber=" + pli.getObjectNumber());
             verbose("getCollectionObjectList: list-item[" + i + "] URI=" + pli.getUri());
             i++;
         }
@@ -89,19 +91,18 @@ public class CollectionObjectServiceTest {
         Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode());
     }
 
-    private CollectionObject createCollectionObject(String csid, String identifier, String description) {
-       CollectionObject collectionObject = new CollectionObject();
-       
-       collectionObject.setCsid(csid);
-       collectionObject.setIdentifier(identifier);
-       collectionObject.setDescription(description);
+    private CollectionObject createCollectionObject(long identifier) {
+       CollectionObject collectionObject = createCollectionObject("objectNumber-" + identifier,
+                       "objectName-" + identifier);            
 
         return collectionObject;
     }
 
-    private CollectionObject createCollectionObject(long identifier) {
-       CollectionObject collectionObject = createCollectionObject("csid-" + identifier,
-                       "did-" + identifier, "description-" + identifier);      
+    private CollectionObject createCollectionObject(String objectNumber, String objectName) {
+       CollectionObject collectionObject = new CollectionObject();
+       
+       collectionObject.setObjectNumber(objectNumber);
+       collectionObject.setObjectName(objectName);
 
         return collectionObject;
     }
@@ -116,7 +117,7 @@ public class CollectionObjectServiceTest {
     }
 
     private void verbose(String msg) {
-        System.out.println("CollectionObjectServiceTest : " + msg);
+        System.out.println("CollectionObject Test: " + msg);
     }
 
     private void verbose(String msg, Object o, Class clazz) {
diff --git a/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/DomainIdentifierServiceTest.java b/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/DomainIdentifierServiceTest.java
new file mode 100644 (file)
index 0000000..65999b7
--- /dev/null
@@ -0,0 +1,64 @@
+package org.collectionspace.hello.client.test;
+
+import org.collectionspace.hello.client.DomainIdentifierClient;
+import java.util.ArrayList;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import org.collectionspace.hello.DomainIdentifier;
+import org.jboss.resteasy.client.ClientResponse;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * A IdentifierServiceTest.
+ * 
+ * @version $Revision:$
+ */
+public class DomainIdentifierServiceTest {
+
+    private DomainIdentifierClient identifierClient = DomainIdentifierClient.getInstance();
+    private String id = null;
+
+    @Test
+    public void createIdentifier() {
+        DomainIdentifier identifier = new DomainIdentifier();
+        identifier.setDsid("org.bnhm");
+        ClientResponse<Response> res = identifierClient.createIdentifier(identifier);
+        Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode());
+        id = extractId(res);
+    }
+
+    @Test(dependsOnMethods = {"createIdentifier"})
+    public void getIdentifier() {
+        DomainIdentifier i = identifierClient.getIdentifier(id).getEntity();
+        verbose("got Identifier", i);
+    }
+
+    private String extractId(ClientResponse<Response> res) {
+        MultivaluedMap mvm = res.getMetadata();
+        String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
+        String[] segments = uri.split("/");
+        verbose("id=" + segments[segments.length - 1]);
+        return segments[segments.length - 1];
+    }
+
+    private void verbose(String msg) {
+        System.out.println("IdentifierServiceTest : " + msg);
+    }
+
+    private void verbose(String msg, DomainIdentifier p) {
+        try {
+            verbose(msg);
+            JAXBContext jc = JAXBContext.newInstance(DomainIdentifier.class);
+            Marshaller m = jc.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+                    Boolean.TRUE);
+            m.marshal(p, System.out);
+        //m.marshal(new JAXBElement(new QName("uri", "local"), Identifier.class, p), System.out);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
index 51e8e3028dcb76fd1d296a6d03cc52833b39be45..bf3dcfc21142e71af227fdacc5724ce8a2242cb6 100644 (file)
         </xs:complexType>
     </xs:element>
     
+    <!-- domain-identifier  -->
+    <xs:element name="domain-identifier">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="dsid" type="xs:string"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    
+    
     <!-- collection-object  -->
     <xs:element name="collection-object">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="csid" type="xs:string" minOccurs="1" />
-                <xs:element name="identifier" type="xs:string" minOccurs="1" />
-                <xs:element name="description" type="xs:string" minOccurs="1" />
+                           <xs:element name="objectNumber" type="xs:string"/>
+                           <xs:element name="otherNumber" type="xs:string"/>
+                           <xs:element name="briefDescription" type="xs:string"/>
+                           <xs:element name="comments" type="xs:string"/>
+                           <xs:element name="distFeatures" type="xs:string"/>
+                           <xs:element name="objectName" type="xs:string"/>
+                           <xs:element name="responsibleDept" type="xs:string"/>
+                           <xs:element name="title" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
                 <xs:element name="collection-object-list-item" maxOccurs="unbounded">
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="identifier" type="xs:string"
+                            <xs:element name="objectNumber" type="xs:string"
                                 minOccurs="1" />
-                            <!-- uri to retrive person details -->
+                            <!-- uri to retrive collection object details -->
                             <xs:element name="uri" type="xs:anyURI"
                                 minOccurs="1" />
                             <xs:element name="csid" type="xs:string"
index d861fc89c56d290dc9a821871d4da395ede14c8f..af28915c770994dfc66f39085c0931a90cf9afa2 100644 (file)
@@ -1,7 +1,6 @@
 package org.collectionspace.hello.services;
 
 import java.io.ByteArrayInputStream;
-import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -26,7 +25,11 @@ import javax.xml.bind.Marshaller;
 import org.collectionspace.hello.*;
 
 
+import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient;
 import org.collectionspace.hello.CollectionObjectList.CollectionObjectListItem;
+import org.collectionspace.hello.services.CollectionObjectJAXBSchema;
+import org.collectionspace.hello.services.CollectionObjectListItemJAXBSchema;
+
 import org.dom4j.Document;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
@@ -38,10 +41,11 @@ import org.slf4j.LoggerFactory;
 @Path("/collectionobjects")
 @Consumes("application/xml")
 @Produces("application/xml")
-public class CollectionObjectResource {
+public class CollectionObjectResource implements CollectionSpaceResource {
 
-       final static String NUXEO_WORKSPACE_UID = "776a8787-9d81-41b0-a02c-1ba674638c0a";
-       final static String NUXEO_DOCTYPE = "CollectionObject";
+       final static String CO_NUXEO_DOCTYPE = "CollectionObject";
+       final static String CO_NUXEO_SCHEMA_NAME = "collectionobject";
+       final static String CO_NUXEO_DC_TITLE = "CollectionSpace-CollectionObject";
        
     final Logger logger = LoggerFactory.getLogger(CollectionObjectResource.class);
 
@@ -53,29 +57,32 @@ public class CollectionObjectResource {
     public CollectionObjectList getCollectionObjectList(@Context UriInfo ui) {
        CollectionObjectList p = new CollectionObjectList();
         try{
-            List<CollectionObjectList.CollectionObjectListItem> list = p.getCollectionObjectListItem();
             NuxeoRESTClient nxClient = getClient();
 
             List<String> pathParams = new ArrayList<String>();
             Map<String, String> queryParams = new HashMap<String, String>();
-            pathParams = Arrays.asList("default", NUXEO_WORKSPACE_UID, "browse");
+            pathParams = Arrays.asList("default", CS_NUXEO_WORKSPACE_UID, "browse");
             Representation res = nxClient.get(pathParams, queryParams);
             SAXReader reader = new SAXReader();
             Document document = reader.read(res.getStream());
             Element root = document.getRootElement();
+
+            List<CollectionObjectList.CollectionObjectListItem> list = p.getCollectionObjectListItem();
             for(Iterator i = root.elementIterator(); i.hasNext();){
                 Element element = (Element) i.next();
+
+                // set the CollectionObject list item entity elements                
                 CollectionObjectListItem pli = new CollectionObjectListItem();
-                //
-                pli.setCsid(element.attributeValue("csid"));
-                pli.setUri(element.attributeValue("url"));
-                pli.setIdentifier(element.attributeValue("identifier"));
+                pli.setObjectNumber(element.attributeValue(CollectionObjectListItemJAXBSchema.OBJECT_NUMBER));
+                pli.setUri(element.attributeValue(CollectionObjectListItemJAXBSchema.URI));
+                pli.setCsid(element.attributeValue(CollectionObjectListItemJAXBSchema.CSID));
                 list.add(pli);
             }
 
         }catch(Exception e){
             e.printStackTrace();
         }
+        
         return p;
     }
 
@@ -87,19 +94,35 @@ public class CollectionObjectResource {
         List<String> pathParams = new ArrayList<String>();
         Map<String, String> queryParams = new HashMap<String, String>();
         pathParams.add("default");
-        pathParams.add(NUXEO_WORKSPACE_UID);
+        pathParams.add(CS_NUXEO_WORKSPACE_UID);
         pathParams.add("createDocument");
-        queryParams.put("docType", NUXEO_DOCTYPE);
+        queryParams.put("docType", CO_NUXEO_DOCTYPE);
+        
+        // a default title for the Dublin Core schema
+        queryParams.put("dublincore:title", CO_NUXEO_DC_TITLE);
         
-        queryParams.put("dublincore:title", co.getIdentifier());
         // CollectionObject core values
-        queryParams.put("collectionobject:csid", Integer.valueOf(1).toString());
-        queryParams.put("collectionobject:identifier", co.getIdentifier());
-        queryParams.put("collectionobject:description", co.getDescription());
-
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OBJECT_NUMBER, 
+                       co.getObjectNumber());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OTHER_NUMBER, 
+                       co.getOtherNumber());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.BRIEF_DESCRIPTION,
+                       co.getBriefDescription());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.COMMENTS,
+                       co.getComments());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.DIST_FEATURES,
+                       co.getDistFeatures());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OBJECT_NAME,
+                       co.getObjectName());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.RESPONSIBLE_DEPT,
+                       co.getResponsibleDept());
+        queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.TITLE,
+                       co.getTitle());
+        
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
         Representation res = nxClient.post(pathParams, queryParams, bais);
 
+        String csid = null;
         SAXReader reader = new SAXReader();
         try {
             Document document = reader.read(res.getStream());
@@ -107,8 +130,7 @@ public class CollectionObjectResource {
             for (Iterator i = root.elementIterator(); i.hasNext();){
                 Element element = (Element) i.next();
                 if ("docRef".equals(element.getName())){
-                    String id = (String) element.getData();
-                    co.setCsid(id);
+                    csid = (String) element.getData();
                 }
             }
         } catch(Exception e){
@@ -117,9 +139,9 @@ public class CollectionObjectResource {
             throw new WebApplicationException(response);
         }
 
-        verbose("created collectionobject", co);
+        verbose("createCollectionObject: ", co);
         UriBuilder path = UriBuilder.fromResource(PersonNuxeoResource.class);
-        path.path("" + co.getCsid());
+        path.path("" + csid);
         Response response = Response.created(path.build()).build();
         
         return response;
@@ -157,19 +179,41 @@ public class CollectionObjectResource {
                 System.err.println("CollectionObject.getCollectionObject() called.");
 
                 //TODO: recognize schema thru namespace uri
-                if ("collectionobject".equals(schemaElement.attribute("name").getValue())){
-                    co.setCsid(csid);
-                    Element ele = schemaElement.element("identifier");
+                if (CO_NUXEO_SCHEMA_NAME.equals(schemaElement.attribute("name").getValue())){
+                    Element ele = schemaElement.element(CollectionObjectJAXBSchema.OBJECT_NUMBER);
+                    if(ele != null){
+                        co.setObjectNumber((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.OTHER_NUMBER);
+                    if(ele != null){
+                        co.setOtherNumber((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.BRIEF_DESCRIPTION);
+                    if(ele != null){
+                        co.setBriefDescription((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.COMMENTS);
+                    if(ele != null){
+                        co.setComments((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.DIST_FEATURES);
+                    if(ele != null){
+                        co.setDistFeatures((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.OBJECT_NAME);
                     if(ele != null){
-                        co.setIdentifier((String) ele.getData());
+                        co.setObjectName((String) ele.getData());
                     }
-                    ele = schemaElement.element("description");
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.RESPONSIBLE_DEPT);
                     if(ele != null){
-                        co.setDescription((String) ele.getData());
+                        co.setResponsibleDept((String) ele.getData());
+                    }
+                    ele = schemaElement.element(CollectionObjectJAXBSchema.TITLE);
+                    if(ele != null){
+                        co.setTitle((String) ele.getData());
                     }
                 }
             }
-
         } catch(Exception e){
             e.printStackTrace();
             Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
@@ -181,7 +225,7 @@ public class CollectionObjectResource {
                     "Get failed, the requested CollectionObject CSID:" + csid + ": was not found.").type("text/plain").build();
             throw new WebApplicationException(response);
         }
-        verbose("get collectionobject", co);
+        verbose("getCollectionObject: ", co);
         
         return co;
     }
@@ -190,29 +234,61 @@ public class CollectionObjectResource {
     @Path("{csid}")
     public CollectionObject updateCollectionObject(
             @PathParam("csid") String csid,
-            CollectionObject update) {
+            CollectionObject theUpdate) {
 
-        verbose("updating collectionobject input", update);
+        verbose("updateCollectionObject with input: ", theUpdate);
 
         List<String> pathParams = new ArrayList<String>();
         Map<String, String> queryParams = new HashMap<String, String>();
         pathParams.add("default");
-        pathParams.add(update.getCsid());
+        pathParams.add(csid);
         pathParams.add("updateDocumentRestlet");
         
         //todo: intelligent merge needed
-        if(update.getIdentifier() != null){
-            queryParams.put("collectionobject:identifier", update.getIdentifier());
+        if(theUpdate.getObjectNumber() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OBJECT_NUMBER, 
+                       theUpdate.getObjectNumber());
+        }
+
+        if(theUpdate.getOtherNumber() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OTHER_NUMBER, 
+                       theUpdate.getOtherNumber());
+        }
+
+        if(theUpdate.getBriefDescription()!= null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.BRIEF_DESCRIPTION, 
+                       theUpdate.getBriefDescription());
+        }
+
+        if(theUpdate.getComments() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.COMMENTS, 
+                       theUpdate.getComments());
         }
 
-        if(update.getDescription() != null){
-            queryParams.put("collectionobject:description", update.getDescription());
+        if(theUpdate.getDistFeatures() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.DIST_FEATURES, 
+                       theUpdate.getDistFeatures());
+        }
+
+        if(theUpdate.getObjectName() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.OBJECT_NAME, 
+                       theUpdate.getObjectName());
+        }
+
+        if(theUpdate.getResponsibleDept() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.RESPONSIBLE_DEPT, 
+                       theUpdate.getResponsibleDept());
+        }
+
+        if(theUpdate.getTitle() != null){
+            queryParams.put(CO_NUXEO_SCHEMA_NAME + ":" + CollectionObjectJAXBSchema.TITLE, 
+                       theUpdate.getTitle());
         }
 
         NuxeoRESTClient nxClient = getClient();
         Representation res = nxClient.get(pathParams, queryParams);
         SAXReader reader = new SAXReader();
-        String status = "";
+        String status = null;
         try {
             Document document = reader.read(res.getStream());
             Element root = document.getRootElement();
@@ -220,9 +296,8 @@ public class CollectionObjectResource {
                 Element element = (Element) i.next();
                 if("docRef".equals(element.getName())){
                     status = (String) element.getData();
-                    verbose("update collectionobject: response=" + status);
+                    verbose("updateCollectionObject response: " + status);
                 }
-
             }
         } catch(Exception e) {
             //FIXME: NOT_FOUND?
@@ -231,14 +306,14 @@ public class CollectionObjectResource {
             throw new WebApplicationException(response);
         }
         
-        return update;
+        return theUpdate;
     }
 
     @DELETE
     @Path("{csid}")
     public void deleteCollectionObject(@PathParam("csid") String csid) {
 
-       verbose("deleting collectionobject with csid=" + csid);
+       verbose("deleteCollectionObject with csid=" + csid);
         
        NuxeoRESTClient nxClient = getClient();
         List<String> pathParams = new ArrayList<String>();
@@ -258,9 +333,8 @@ public class CollectionObjectResource {
                 Element element = (Element) i.next();
                 if("docRef".equals(element.getName())){
                     status = (String) element.getData();
-                    verbose("delete collectionobject: response=" + status);
+                    verbose("deleteCollectionObjectt response: " + status);
                 }
-
             }
         }catch(Exception e){
             //FIXME: NOT_FOUND?
@@ -284,7 +358,6 @@ public class CollectionObjectResource {
         } catch(Exception e){
             e.printStackTrace();
         }
-
     }
 
     private NuxeoRESTClient getClient() {
@@ -295,6 +368,6 @@ public class CollectionObjectResource {
     }
 
     private void verbose(String msg) {
-        System.out.println("CollectionObjectResource: " + msg);
+        System.out.println("CollectionObjectResource. " + msg);
     }
 }