]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3739 Updated Relations schema to store new fields, including subjectUri and...
authorLaramie Crocker <laramie@berkeley.edu>
Sat, 23 Apr 2011 10:05:17 +0000 (10:05 +0000)
committerLaramie Crocker <laramie@berkeley.edu>
Sat, 23 Apr 2011 10:05:17 +0000 (10:05 +0000)
22 files changed:
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-master.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_POST.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/r-2.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml
services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java
services/jaxb/src/main/resources/relations_common.xsd
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java

index a1508953d9af7b7e7e227675b69a28821a782a5f..eed0cfe656c993a66e0568a0000393ebddca534b 100755 (executable)
@@ -14,7 +14,7 @@ import java.util.List;
  */\r
 public class XmlReplayMasterTest  extends XmlReplayTest {\r
 \r
-//    @Test\r
+    @Test\r
     public void runMaster() throws Exception {\r
         XmlReplay replay = createXmlReplayUsingIntegrationTestsModule("..");\r
         List<List<ServiceResult>> list = replay.runMaster(XmlReplay.DEFAULT_MASTER_CONTROL);\r
index dfd9c1c4b7826a6bad56846d29f4eb2ccbc0db18..417a01dd64a47423d125f960cad1cbc73dc2513b 100644 (file)
     <run controlFile="person/person.xml" testGroup="updatePerson" />\r
     <run controlFile="person/person.xml" testGroup="updatePerson" />\r
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-\r
+   \r
     <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />\r
     <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />\r
-   <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
      \r
-   <run controlFile="person/person.xml" testGroup="postPerson" />\r
+    <run controlFile="person/person.xml" testGroup="postPerson" />\r
+    <run controlFile="relation/relation.xml" testGroup="makeRelationsNested" />\r
+    <run controlFile="relation/relation.xml" testGroup="r2only" />\r
+    <run controlFile="person/person.xml" testGroup="postPerson" />\r
     -->\r
-    <!-- TODO: make this an override: autoDeletePOSTS="true"-->\r
    \r
-    \r
+\r
+   \r
+    <!-- TODO: make this an override: autoDeletePOSTS="true"-->\r
 </xmlReplayMaster>\r
 \r
index e26e11267e8d857b69bac0216bfea152c1430b3c..c48d38088127e4f225ef2c310dd3eaf2f7b93970 100755 (executable)
                <var ID="shortIdentifier">johnWayneActor</var>\r
                <var ID="CSID">${itemCSID}</var>\r
                <var ID="parentCSID">${PersonParent.CSID}</var>\r
+               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>\r
                <var ID="childCSID">${PersonChild.CSID}</var>\r
+               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>\r
                <var ID="child2CSID">${PersonChild2.CSID}</var>\r
+               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>\r
             </vars>\r
         </test>\r
         \r
index 7d75d8be416fcad843d66aa3daeba0422759e7cf..b37fc2b5803c226dd590eea139745c0176c7a293 100755 (executable)
@@ -37,6 +37,7 @@
                </subject>\r
                <object>\r
                  <csid>${parentCSID}</csid>\r
+                 <uri>${parentUri}</uri>\r
                  <documentType>Person</documentType>\r
                  <name>John Wayne 2, the evil twin, Parent</name>\r
                </object>\r
@@ -45,6 +46,7 @@
                <predicate>hasBroader</predicate>\r
                <subject>\r
                  <csid>${childCSID}</csid>\r
+                 <uri>${childUri}</uri>\r
                  <documentType>Person</documentType>\r
                  <name>John Wayne 2, the evil twin, child</name>\r
                </subject>\r
@@ -57,6 +59,7 @@
        <relation-list-item>\r
                <predicate>hasBroader</predicate>\r
                <subject>\r
+                 <uri>${child2Uri}</uri>\r
                  <csid>${child2CSID}</csid>\r
                  <documentType>Person</documentType>\r
                  <name>John Wayne 2, the evil twin, child</name>\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/r-2.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/r-2.xml
new file mode 100644 (file)
index 0000000..6ddcf82
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="relations">
+  <ns2:relations_common xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <documentId1>${documentId1}</documentId1>
+    <documentType1>${documentType1}</documentType1>
+    <documentId2>${documentId2}</documentId2>
+    <documentType2>${documentType2}</documentType2>
+    <relationshipType>${relationshipType}</relationshipType>
+    <predicateDisplayName>${relationshipType}</predicateDisplayName>
+    <subjectCsid>${documentId1}</subjectCsid>
+    <objectCsid>${documentId2}</objectCsid>
+    <subjectUri>/my/long/uri/${documentId1}</subjectUri>
+    <objectUri>/my/long/uri/${documentId2}</objectUri>
+  </ns2:relations_common>
+</document>
+
index 70d3d1535da75c03a98728d3b3176d009418eec8..0ce0f6decf2eda1c4fd80608ad1b075cac9bbf21 100644 (file)
         </test>\r
         -->\r
     </testGroup>\r
+    \r
+    <testGroup ID="makeRelationsNested" autoDeletePOSTS="true">\r
+         <test ID="oe1"  auth="test">\r
+             <method>POST</method>\r
+             <uri>/cspace-services/objectexit/</uri>\r
+             <filename>relation/oe1.xml</filename>\r
+         </test>\r
+         <test ID="oe2"  auth="test">\r
+             <method>POST</method>\r
+             <uri>/cspace-services/objectexit/</uri>\r
+             <filename>relation/oe1.xml</filename>\r
+         </test>\r
+         <test ID="relate1"  auth="test">\r
+             <method>POST</method>\r
+             <uri>/cspace-services/relations/</uri>\r
+             <filename>relation/r-2.xml</filename>\r
+             <vars>\r
+                <var ID="documentId1">${oe1.CSID}</var>\r
+                <var ID="documentId2">${itemCSID}</var>\r
+                <var ID="documentType1">ObjectExit</var>\r
+                <var ID="documentType2">ObjectExit</var>\r
+                <var ID="relationshipType">hasBroader</var>\r
+             </vars>\r
+         </test>\r
+         <test ID="relationsGET"  auth="test">\r
+             <method>GET</method>\r
+             <uri>/cspace-services/relations/</uri>\r
+         </test>\r
+    </testGroup>\r
+         \r
+    <testGroup ID="r2only" autoDeletePOSTS="true">\r
+         <test ID="relate"  auth="test">\r
+             <method>POST</method>\r
+             <uri>/cspace-services/relations/</uri>\r
+             <filename>relation/r-2.xml</filename>\r
+             <vars>\r
+                <var ID="documentId1">1234-5678</var>\r
+                <var ID="documentId2">${itemCSID}</var>\r
+                <var ID="documentType1">ObjectExit</var>\r
+                <var ID="documentType2">ObjectExit</var>\r
+                <var ID="relationshipType">hasBroader</var>\r
+             </vars>\r
+         </test>\r
+         <test ID="relationsGET"  auth="test">\r
+             <method>GET</method>\r
+             <uri>/cspace-services/relations/</uri>\r
+         </test>\r
+    </testGroup>\r
          \r
 </xmlReplay>\r
         \r
index 19568b721aad87eda083c56617ff0a8f880deca5..4eb55062539def2a63e519150fb31599b3db8ea4 100755 (executable)
          File below this line have been ported. -->\r
     <!-- ============================================= -->\r
     \r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
+    <!--\r
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
+    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
+    -->\r
+    <run controlFile="relation/relation.xml" testGroup="r2only" />\r
+    <run controlFile="person/person.xml" testGroup="postPerson" />\r
+   \r
     \r
 </xmlReplayMaster>\r
 \r
index 6ca1012de64a49cac4d602d40f5411b2ef685bfa..50231e04de2e95abaeb2fb3ef93644a159477502 100644 (file)
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
 
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -101,6 +102,12 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
                this.inAuthority = inAuthority;
        }
 
+    @Override
+    public String getUri(DocumentModel docModel) {
+        return getServiceContextPath()+inAuthority+"/"+ AuthorityClient.ITEMS+"/"+getCsid(docModel);
+    }
+
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
      */
@@ -236,8 +243,9 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
         DocumentModel documentModel = (wrapDoc.getWrappedObject());
         String itemCsid = documentModel.getName();
 
-        //TODO: create all relations....  UPDATE and CREATE will call.   Updates AuthorityItem part
-        RelationsCommonList relationsCommonList = updateRelations(itemCsid, input);
+        //UPDATE and CREATE will call.   Updates relations part
+        RelationsCommonList relationsCommonList = updateRelations(itemCsid, input, wrapDoc);
+
         PayloadOutputPart payloadOutputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMON_LIST_NAME, relationsCommonList);
         ctx.setProperty(RelationClient.SERVICE_COMMON_LIST_NAME, payloadOutputPart);
     }
@@ -250,28 +258,11 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
         ((PoxPayloadOut)ctx.getOutput()).addPart(foo);
     }
 
-    //===================================================================
-    /*
-        for (RelationsCommonList.RelationListItem parentListItem : parentList.getRelationListItem()) {
-            System.out.println("    parentListItems " + parentListItem);
-            //todo: if num-parents > 1 then complain.
-            //todo: if not found in update list, remove from system
-            //todo: if update list item not found in parent list, add to system.
-        }
-        for (RelationsCommonList.RelationListItem childListItem : childList.getRelationListItem()) {
-           System.out.println("    childListItem: " + childListItem);
-            //todo: if not found in update list, remove from system
-            //todo: if update list item not found in child list, add to system.
-        }
-
-
-
-     */
-    public RelationsCommonList updateRelations(String itemCSID, PoxPayloadIn input) throws Exception {
+    public RelationsCommonList updateRelations(String itemCSID, PoxPayloadIn input, DocumentWrapper<DocumentModel> wrapDoc)
+     throws Exception {
         PayloadInputPart part = input.getPart(RelationClient.SERVICE_COMMON_LIST_NAME);        //input.getPart("relations_common");
         if (part == null) {
-            //System.out.println("Nothing to do in updateRelations: " + input);
-            return null;
+            return null;  //nothing to do--they didn't send a list of relations.
         }
         RelationsCommonList relationsCommonListBody = (RelationsCommonList) part.getBody();
 
@@ -316,14 +307,18 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
         List<RelationsCommonList.RelationListItem> childList = childListOuter.getRelationListItem();
         List<RelationsCommonList.RelationListItem> parentList = parentListOuter.getRelationListItem();
 
+        DocumentModel docModel = wrapDoc.getWrappedObject();
+
         for (RelationsCommonList.RelationListItem inboundItem : inboundList) {
             if (inboundItem.getObject().getCsid().equalsIgnoreCase(CommonAPI.AuthorityItemCSID_REPLACE)){
                 inboundItem.setObjectCsid(itemCSID);
                 inboundItem.getObject().setCsid(itemCSID);
+                inboundItem.getObject().setUri(getUri(docModel));
             }
             if (inboundItem.getSubject().getCsid().equalsIgnoreCase(CommonAPI.AuthorityItemCSID_REPLACE)){
                 inboundItem.setSubjectCsid(itemCSID);
                 inboundItem.getSubject().setCsid(itemCSID);
+                 inboundItem.getSubject().setUri(getUri(docModel));
             }
             if (inboundItem.getObject().getCsid().equals(itemCSID) && inboundItem.getPredicate().equals(HAS_BROADER)) {
                 //then this is an item that says we have a child.
@@ -350,17 +345,23 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
         deleteRelations(parentList, ctx);               //todo: there are items appearing on both lists....april 20.
         deleteRelations(childList, ctx);
         createRelations(actionList, ctx);
-
+        //We return all elements on the inbound list, since we have just worked to make them exist in the system
+        // and be non-redundant, etc.  That list came from relationsCommonListBody, so it is still attached to it, just pass that back.
         return relationsCommonListBody;
     }
 
+    // this method calls the RelationResource to have it create the relations and persist them.
     private void createRelations(List<RelationsCommonList.RelationListItem> inboundList, ServiceContext ctx){
          for (RelationsCommonList.RelationListItem item : inboundList) {
              RelationsCommon rc = new RelationsCommon();
              //rc.setCsid(item.getCsid());
-             String itemCsid =  item.getSubject().getCsid();
-             rc.setDocumentId1(itemCsid);
-             rc.setSubjectCsid(itemCsid);
+             //todo: assignTo(item, rc);
+             RelationsDocListItem itemSubject = item.getSubject();
+             RelationsDocListItem itemObject = item.getObject();
+
+             String subjectCsid =  itemSubject.getCsid();
+             rc.setDocumentId1(subjectCsid);
+             rc.setSubjectCsid(subjectCsid);
 
              String objCsid = item.getObject().getCsid();
              rc.setDocumentId2(objCsid);
@@ -368,10 +369,14 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
 
              rc.setRelationshipType(item.getPredicate());
              //RelationshipType  foo = (RelationshipType.valueOf(item.getPredicate())) ;
-             //rc.setPredicate(foo);
+             //rc.setPredicate(foo);     //this must be one of the type found in the enum in  services/jaxb/src/main/resources/relations_common.xsd
+
+             rc.setDocumentType1(itemSubject.getDocumentType());
+             rc.setDocumentType2(itemObject.getDocumentType());
+
+             rc.setSubjectUri(itemSubject.getUri());
+             rc.setObjectUri(itemObject.getUri());
 
-             rc.setDocumentType1(item.getSubject().getDocumentType());
-             rc.setDocumentType2(item.getObject().getDocumentType());
 
             PoxPayloadOut payloadOut = new PoxPayloadOut(RelationClient.SERVICE_PAYLOAD_NAME);
             PayloadOutputPart outputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMONPART_NAME, rc);
index b2df0df55333e488c9588046929d9ec78f12ec10..4fe239ced6b0affaf6e294a2be812d9c7defca61 100644 (file)
@@ -14,6 +14,10 @@ import org.jboss.resteasy.client.ClientResponse;
  */\r
 public interface AuthorityClient<LT extends AbstractCommonList, ILT extends AbstractCommonList, P extends AuthorityProxy<LT, ILT>> \r
        extends CollectionSpacePoxClient<LT, P> {\r
+\r
+    /** The uri path element for items in an authority */\r
+    public static String ITEMS = "items";    //used to construct uri's in service paths for authorities.\r
+\r
        /*\r
         * Basic CRUD operations\r
         */\r
index d8725f76c05757b26ec39bae89a4aa86de479a48..73e2fe88ed7444a2cb55682db4fba9bd57aebab2 100644 (file)
@@ -56,6 +56,11 @@ public interface RelationJAXBSchema {
        \r
        /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
        final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
+\r
+    final static String subjectUri = "subjectUri";\r
+\r
+    final static String objectUri = "objectUri";\r
+\r
 }\r
 \r
 \r
index 977605cdc8d80cfc7cfe0af103150f99426077e9..2fd29648a6175484e1b6191a0f7fc456179422a0 100644 (file)
@@ -68,6 +68,10 @@ public abstract class DocumentModelHandler<T, TL>
     public String getCsid(DocumentModel docModel) {
        return NuxeoUtils.getCsid(docModel);
     }
+
+    public String getUri(DocumentModel docModel) {
+        return getServiceContextPath()+getCsid(docModel);
+    }
     /**
      * getRepositorySession returns Nuxeo Repository Session
      * @return
index 32e60ad90f6f3d38000ed47cc8df099ab9f128fa..e3e3cff634655da4f38e75c18d4d458f974bf5fb 100644 (file)
@@ -35,6 +35,8 @@
                 <xs:element name="subjectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentId1 -->\r
                 <xs:element name="objectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentId2 -->\r
                 <xs:element name="predicate" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>   <!-- new name for relationshipType -->\r
+                <xs:element name="subjectUri" type="xs:string" minOccurs="1"/>\r
+                <xs:element name="objectUri" type="xs:string" minOccurs="1"/>\r
             </xs:sequence>\r
         </xs:complexType>\r
     </xs:element>\r
index 21714f5f353d962cd9d89e0bbda355c02925c46d..ba26368707447682bfb994f0ffc1024d5396e5fa 100644 (file)
@@ -54,7 +54,6 @@ public class LocationAuthorityClient extends AuthorityClientImpl<Locationauthori
        // Subitem constants
        //
        public static final String SERVICE_ITEM_NAME = "locations";
-       public static final String SERVICE_PATH_ITEMS_COMPONENT = "items";      //FIXME: REM - This should be defined in an AuthorityClient base class
        public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
        //
        // Payload Part/Schema part names
index a35fe76169c3cd67e5469b4a07c2e96718050aa8..76d3cf95d9ab5f178ff50c3fc1411e598fac1b36 100644 (file)
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.collectionspace.services.LocationJAXBSchema;
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ContactClient;
 import org.collectionspace.services.client.ContactClientUtils;
@@ -79,7 +80,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI
        }
     
     public String getItemServicePathComponent() {
-        return LocationAuthorityClient.SERVICE_PATH_ITEMS_COMPONENT;
+        return AuthorityClient.ITEMS;
     }  
     
     // Instance variables specific to this test.
index 1856a9c31e1401410dff8295040f490d34785286..8c086c694367bd215ef2ec65051b586e8125d08b 100644 (file)
@@ -42,7 +42,6 @@ public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<Orgautho
        // Subitem constants
        //
        public static final String SERVICE_ITEM_NAME = "organizations";
-       public static final String SERVICE_PATH_ITEMS_COMPONENT = "items";      //FIXME: REM - This should be defined in an AuthorityClient base class
        public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
        //
        // Payload Part/Schema part names
index 597af32cd9f56a7b240ef13865c9f63b0c1261a4..346bb6425ad0d1c296cc1209d9c3857cebc4147e 100644 (file)
@@ -31,6 +31,7 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ContactClient;
 import org.collectionspace.services.client.ContactClientUtils;
@@ -2129,7 +2130,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl { //FIXME:
      * @return the item service path component
      */
     public String getItemServicePathComponent() {
-        return OrgAuthorityClient.SERVICE_PATH_ITEMS_COMPONENT;
+        return AuthorityClient.ITEMS;
     }
 
     /**
index 99fe7449496b9cff4f23a28f77152c511a9452b5..6fab0561284cd921f6443e05cf7956658ca97ea5 100644 (file)
@@ -45,7 +45,6 @@ public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<Perso
        // Subitem constants
        //
        public static final String SERVICE_ITEM_NAME = "persons";
-       public static final String SERVICE_PATH_ITEMS_COMPONENT = "items";      //FIXME: REM - This should be defined in an AuthorityClient base class
        public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
        //
        // Payload Part/Schema part names
index 921ace6198ae295eba1fa2c51b567fb9239a0f21..9e02ccb70777bf18c3dd80ef7b4e11ecfa216ccc 100644 (file)
@@ -29,6 +29,7 @@ import java.util.Map;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -81,7 +82,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
        }
     
     public String getItemServicePathComponent() {
-        return PersonAuthorityClient.SERVICE_PATH_ITEMS_COMPONENT;
+        return AuthorityClient.ITEMS;
     }  
     
     /** The test forename. */
index ac4e1eb495f92dc8af45f98ec0358a8235f2bf21..a3b41bb0737369018c323da2cf30e16478a11c54 100644 (file)
@@ -27,7 +27,7 @@
             <!-- document-id-1 would be the id of the collectionobject -->\r
             <!-- document-type-1 would be the doc-type of the collectionobject -->\r
             <!-- document-id-2 would be the id of the intake -->\r
-            <!-- document-type-2 would be the doc-type of the intake -->\r
+`            <!-- document-type-2 would be the doc-type of the intake -->\r
             <!-- 2. left to right container and containee or children -->\r
             <!-- e.g. for collectionobject containing other collectionobjects -->\r
             <!-- document-id-1 would be the id of the container collectionobject -->\r
     <xs:element name="objectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentId2 -->\r
     <xs:element name="documentType2" type="xs:string"  minOccurs="1" maxOccurs="1"/>\r
 \r
-            <!-- type of relatinoship between two entities -->\r
+            <!-- type of relationship between two entities -->\r
     <xs:element name="relationshipType" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>\r
     <xs:element name="predicate" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>   <!-- new name for relationshipType -->\r
     <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
 \r
+\r
+    <xs:element name="subjectUri" type="xs:string"/>\r
+    <xs:element name="objectUri" type="xs:string"/>\r
+\r
     <!-- enumeration defining the type of relationship between two entities -->\r
     <xs:simpleType name="RelationshipType">\r
         <xs:restriction base="xs:string">\r
@@ -58,6 +62,7 @@
         </xs:restriction>\r
     </xs:simpleType>\r
 \r
+\r
 </xs:schema>\r
 \r
 \r
index c17d4379da473ac6b302b47783581a7fecd9902a..e6d08e973aa107396185e21c67189583c4e8d49e 100644 (file)
@@ -159,11 +159,20 @@ public class RelationDocumentModelHandler
         String subjectCsid = relationListItem.getSubjectCsid();
         String documentType = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_TYPE_1);
         RelationsDocListItem subject = createRelationsDocListItem(ctx, sbt, subjectCsid, tReader, documentType);
+
+        //Object o1 =  docModel.getProperty(ctx.getCommonPartLabel(), "subject");
+        //Object o2 =  docModel.getProperty(ctx.getCommonPartLabel(), "object");
+
+        String subjectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.subjectUri);
+        subject.setUri(subjectUri);
         relationListItem.setSubject(subject);
 
         String objectCsid = relationListItem.getObjectCsid();
         documentType = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_TYPE_2);
         RelationsDocListItem object = createRelationsDocListItem(ctx, sbt, objectCsid, tReader, documentType);
+
+        String objectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.objectUri);
+        object.setUri(objectUri);
         relationListItem.setObject(object);
 
         return relationListItem;
index e3f04d088ccb8bd326f87b076e5988f87ceef6a0..d8646d5b9b0b37747f33ad461eba2744b945fe81 100644 (file)
@@ -44,7 +44,6 @@ public class VocabularyClient extends AuthorityClientImpl<VocabulariesCommonList
        // Subitem constants
        //
        public static final String SERVICE_ITEM_NAME = "vocabularyitems";
-       public static final String SERVICE_PATH_ITEMS_COMPONENT = "items";      //FIXME: REM - This should be defined in an AuthorityClient base class
        public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
        
        @Override
index de103d1fb621c37cc4d05547d8da48fed1073c14..a2615ab6b0ba3f7422fdf13aa3b8c5842365d710 100644 (file)
@@ -29,6 +29,7 @@ import java.util.Map;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadOutputPart;
@@ -62,7 +63,6 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
     private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = VocabularyClient.SERVICE_PATH_COMPONENT;//"vocabularies";
-    final String SERVICE_PATH_ITEMS_COMPONENT = VocabularyClient.SERVICE_PATH_ITEMS_COMPONENT;//"items";
     final String SERVICE_PAYLOAD_NAME = VocabularyClient.SERVICE_PAYLOAD_NAME;
     final String SERVICE_ITEM_PAYLOAD_NAME = VocabularyClient.SERVICE_ITEM_PAYLOAD_NAME;
     private String knownResourceId = null;
@@ -1339,7 +1339,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
     }
 
     public String getServicePathItemsComponent() {
-        return this.SERVICE_PATH_ITEMS_COMPONENT;
+        return AuthorityClient.ITEMS;
     }
 
     /**