]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4041 Cleaned up duplicate fields in relations. Cleaned up the associated test...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Thu, 17 Nov 2011 06:56:32 +0000 (06:56 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Thu, 17 Nov 2011 06:56:32 +0000 (06:56 +0000)
22 files changed:
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_3.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/r-1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/r-2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml
services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/CollectionSpacePerformanceTest.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/CreateAndLinkLoanOutBatchJob.java
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java
services/common/src/main/java/org/collectionspace/services/common/relation/nuxeo/RelationsUtils.java
services/jaxb/src/main/resources/relations_common.xsd
services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/OSGI-INF/layouts-contrib.xml
services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationValidatorHandler.java

index b3fc2ca00b2de5e4792b80bd15609779f61d067d..ecd4b2fa90cbe1ed69518d2b71dd72cdc66da96b 100755 (executable)
@@ -112,19 +112,21 @@ public abstract class CollectionSpaceIntegrationTest {
      * Fill relation.\r
      * \r
      * @param relation the relation\r
-     * @param documentId1 the document id1\r
-     * @param documentType1 the document type1\r
-     * @param documentId2 the document id2\r
-     * @param documentType2 the document type2\r
+     * @param subjectCsid the document id1\r
+     * @param subjectDocumentType the document type1\r
+     * @param objectCsid the document id2\r
+     * @param objectDocumentType the document type2\r
      * @param rt the rt\r
      */\r
-    void fillRelation(RelationsCommon relation, String documentId1, String documentType1,\r
-               String documentId2, String documentType2, String rt)\r
+    void fillRelation(RelationsCommon relation, \r
+            String subjectCsid, String subjectDocumentType,\r
+            String objectCsid, String objectDocumentType,\r
+            String rt)\r
     {\r
-        relation.setDocumentId1(documentId1);\r
-        relation.setDocumentType1(documentType1);\r
-        relation.setDocumentId2(documentId2);\r
-        relation.setDocumentType2(documentType2);\r
+       relation.setSubjectCsid(subjectCsid);\r
+       relation.setSubjectDocumentType(subjectDocumentType);\r
+       relation.setObjectCsid(objectCsid);\r
+       relation.setObjectDocumentType(objectDocumentType);\r
         \r
         relation.setRelationshipType(rt);\r
     }\r
index c4eb6f3830e2b97eda24bbb96f8fff1954788795..8736756a8dbb8d26dce93414af1bc442468605aa 100755 (executable)
@@ -179,9 +179,9 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                        multiPartResponse.releaseConnection();
                }
                
-               Assert.assertEquals(resultRelation.getDocumentId1(), collectionObjectCsid);
+               Assert.assertEquals(resultRelation.getSubjectCsid(), collectionObjectCsid);
                Assert.assertEquals(resultRelation.getRelationshipType(), RelationshipType.COLLECTIONOBJECT_INTAKE.toString());
-               Assert.assertEquals(resultRelation.getDocumentId2(), intakeCsid);
+               Assert.assertEquals(resultRelation.getObjectCsid(), intakeCsid);
             System.out.println();
                i++;            
         }
@@ -308,9 +308,9 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                                multiPartResponse.releaseConnection();
                        }
        
-                       Assert.assertEquals(resultRelation.getDocumentId1(), intakeCsid);
+                       Assert.assertEquals(resultRelation.getSubjectCsid(), intakeCsid);
                        Assert.assertEquals(resultRelation.getRelationshipType(), RelationshipType.COLLECTIONOBJECT_INTAKE.toString());
-                       Assert.assertEquals(resultRelation.getDocumentId2(), collectionObjectCsid);
+                       Assert.assertEquals(resultRelation.getObjectCsid(), collectionObjectCsid);
                        System.out.println();
                        i++;            
                }
index fd72e30e78425f7ea89710e019d1ebb7164f7622..3be5d13b0f02222bf764bfe55f21c6ffe43927e6 100755 (executable)
              <uri>/cspace-services/relations/</uri>\r
              <filename>relation/r-1.xml</filename>\r
              <vars>\r
-                <var ID="documentId1">${Person1.CSID}</var>\r
-                <var ID="documentId2">${Person2.CSID}</var>\r
-                <var ID="documentType1">Persons</var>\r
-                <var ID="documentType2">Persons</var>\r
+                <var ID="subjectCsid">${Person1.CSID}</var>\r
+                <var ID="objectCsid">${Person2.CSID}</var>\r
+                <var ID="subjectDocumentType">Persons</var>\r
+                <var ID="objectDocumentType">Persons</var>\r
                 <var ID="relationshipType">hasBroader</var>\r
              </vars>\r
         </test>\r
              <!-- Person2 and Person1 are switched in this record. \r
                   Ultimately we don't want any hasNarrower actually stored.\r
              -->\r
-                <var ID="documentId1">${Person2.CSID}</var>\r
-                <var ID="documentId2">${Person1.CSID}</var>\r
-                <var ID="documentType1">Persons</var>\r
-                <var ID="documentType2">Persons</var>\r
+                <var ID="subjectCsid">${Person2.CSID}</var>\r
+                <var ID="objectCsid">${Person1.CSID}</var>\r
+                <var ID="subjectDocumentType">Persons</var>\r
+                <var ID="objectDocumentType">Persons</var>\r
                 <var ID="relationshipType">hasNarrower</var>\r
              </vars>\r
          </test>\r
index f4be7468dc7070925847a10b5d0810465912f94c..2934776f4d0721858e52be7e9d94c8486f36ee96 100755 (executable)
@@ -30,8 +30,8 @@
     <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
     <relation-list-item>\r
                <subjectCsid>${myCSID}</subjectCsid>\r
-               <documentType1>Person</documentType1>\r
-               <documentType2>Person</documentType2>\r
+               <subjectDocumentType>Person</subjectDocumentType>\r
+               <objectDocumentType>Person</objectDocumentType>\r
                <relationshipType>hasBroader</relationshipType>\r
                <predicate>hasBroader</predicate>\r
                <predicateDisplayName>hasBroader</predicateDisplayName>\r
@@ -49,8 +49,8 @@
        </relation-list-item>\r
        <relation-list-item>\r
                <subjectCsid>${childCSID}</subjectCsid>\r
-               <documentType1>Person</documentType1>\r
-               <documentType2>Person</documentType2>\r
+               <subjectDocumentType>Person</subjectDocumentType>\r
+               <objectDocumentType>Person</objectDocumentType>\r
                <relationshipType>hasBroader</relationshipType>\r
                <predicate>hasBroader</predicate>\r
                <predicateDisplayName>hasBroader</predicateDisplayName>\r
index 85f01c6def16b903203675e29b2e7add5bdad541..c332ccac2ff938d4a142d208cabf11f252442f35 100755 (executable)
@@ -30,8 +30,8 @@
     <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
     <relation-list-item>\r
                <subjectCsid>${myCSID}</subjectCsid>\r
-               <documentType1>Person</documentType1>\r
-               <documentType2>Person</documentType2>\r
+               <subjectDocumentType>Person</subjectDocumentType>\r
+               <objectDocumentType>Person</objectDocumentType>\r
                <relationshipType>hasBroader</relationshipType>\r
                <predicate>hasBroader</predicate>\r
                <predicateDisplayName>hasBroader</predicateDisplayName>\r
index 37916fa9384becf9875620862b140a7b64e63730..a573e0f7dafa0d43d6302d6d8fb868d223451d65 100755 (executable)
@@ -30,8 +30,8 @@
     <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
    <relation-list-item>\r
                <subjectCsid>${childCSID}</subjectCsid>\r
-               <documentType1>Person</documentType1>\r
-               <documentType2>Person</documentType2>\r
+               <subjectDocumentType>Person</subjectDocumentType>\r
+               <objectDocumentType>Person</objectDocumentType>\r
                <relationshipType>hasBroader</relationshipType>\r
                <predicate>hasBroader</predicate>\r
                <predicateDisplayName>hasBroader</predicateDisplayName>\r
@@ -49,8 +49,8 @@
        </relation-list-item>\r
        <relation-list-item>\r
                <subjectCsid>${child2CSID}</subjectCsid>\r
-               <documentType1>Person</documentType1>\r
-               <documentType2>Person</documentType2>\r
+               <subjectDocumentType>Person</subjectDocumentType>\r
+               <objectDocumentType>Person</objectDocumentType>\r
                <relationshipType>hasBroader</relationshipType>\r
                <predicate>hasBroader</predicate>\r
                <predicateDisplayName>hasBroader</predicateDisplayName>\r
index bf61191126aa53ed88ff05ea8daf8db73c89202c..f96366b8a4cda69c9e588c3863763c4d52770648 100644 (file)
@@ -3,10 +3,10 @@
   <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>${documentType1}</documentType2>
+    <subjectCsid>${subjectCsid}</subjectCsid>
+    <subjectDocumentType>${subjectDocumentType}</subjectDocumentType>
+    <objectCsid>${objectCsid}</objectCsid>
+    <objectDocumentType>${objectDocumentType}</objectDocumentType>
     <relationshipType>${relationshipType}</relationshipType>
     <predicateDisplayName>${relationshipType}</predicateDisplayName>
   </ns2:relations_common>
index 6ddcf829a2338904364bda7261f5f091edb1bce8..540692a928eb0fd1042575e6315fe6be15a33649 100644 (file)
@@ -1,16 +1,14 @@
 <?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>
+    <subjectCsid>${subjectCsid}</subjectCsid>
+    <subjectDocumentType>${subjectDocumentType}</subjectDocumentType>
+    <subjectUri>/my/long/uri/${subjectCsid}</subjectUri>
+    <objectCsid>${objectCsid}</objectCsid>
+    <objectDocumentType>${objectDocumentType}</objectDocumentType>
+    <objectUri>/my/long/uri/${objectCsid}</objectUri>
     <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 52f010414308b5b602b7b4847d1239ae0cdac405..b085b325126b6a2a469531d2d2707b9046b335db 100644 (file)
              <uri>/cspace-services/relations/</uri>\r
              <filename>relation/r-1.xml</filename>\r
              <vars>\r
-                <var ID="documentId1">${oe1.CSID}</var>\r
-                <var ID="documentId2">${oe2.CSID}</var>\r
-                <var ID="documentType1">objectexit</var>\r
-                <var ID="documentType2">objectexit</var>\r
+                <var ID="subjectCsid">${oe1.CSID}</var>\r
+                <var ID="objectCsid">${oe2.CSID}</var>\r
+                <var ID="subjectDocumentType">objectexit</var>\r
+                <var ID="objectDocumentType">objectexit</var>\r
                 <var ID="relationshipType">hasBroader</var>\r
              </vars>\r
          </test>\r
              <filename>relation/r-1.xml</filename>\r
              <vars>\r
                 <!-- switched oe2 and oe1 on this -->\r
-                <var ID="documentId1">${oe2.CSID}</var>\r
-                <var ID="documentId2">${oe1.CSID}</var>\r
-                <var ID="documentType1">objectexit</var>\r
-                <var ID="documentType2">objectexit</var>\r
+                <var ID="subjectCsid">${oe2.CSID}</var>\r
+                <var ID="objectCsid">${oe1.CSID}</var>\r
+                <var ID="subjectDocumentType">objectexit</var>\r
+                <var ID="objectDocumentType">objectexit</var>\r
                 <var ID="relationshipType">hasBroader</var>\r
              </vars>\r
          </test>\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="subjectCsid">${oe1.CSID}</var>\r
+                <var ID="objectCsid">${itemCSID}</var>\r
+                <var ID="subjectDocumentType">ObjectExit</var>\r
+                <var ID="objectDocumentType">ObjectExit</var>\r
                 <var ID="relationshipType">hasBroader</var>\r
              </vars>\r
          </test>\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="subjectCsid">1234-5678</var>\r
+                <var ID="objectCsid">${itemCSID}</var>\r
+                <var ID="subjectDocumentType">ObjectExit</var>\r
+                <var ID="objectDocumentType">ObjectExit</var>\r
                 <var ID="relationshipType">hasBroader</var>\r
              </vars>\r
          </test>\r
index 74d161446a80ac0eb87b5639d9661dff723d2f33..ae9cf211501ef6b80e9086cdb79416f473b385b6 100644 (file)
@@ -112,19 +112,19 @@ public abstract class CollectionSpacePerformanceTest {
      * Fill relation.\r
      * \r
      * @param relation the relation\r
-     * @param documentId1 the document id1\r
-     * @param documentType1 the document type1\r
-     * @param documentId2 the document id2\r
-     * @param documentType2 the document type2\r
+     * @param subjectCsid the document id1\r
+     * @param subjectDocumentType the document type1\r
+     * @param objectCsid the document id2\r
+     * @param objectDocumentType the document type2\r
      * @param rt the rt\r
      */\r
-    void fillRelation(RelationsCommon relation, String documentId1, String documentType1,\r
-               String documentId2, String documentType2, RelationshipType rt)\r
+    void fillRelation(RelationsCommon relation, String subjectCsid, String subjectDocumentType,\r
+               String objectCsid, String objectDocumentType, RelationshipType rt)\r
     {\r
-        relation.setDocumentId1(documentId1);\r
-        relation.setDocumentType1(documentType1);\r
-        relation.setDocumentId2(documentId2);\r
-        relation.setDocumentType2(documentType2);\r
+        relation.setSubjectCsid(subjectCsid);\r
+        relation.setSubjectDocumentType(subjectDocumentType);\r
+        relation.setSubjectCsid(objectCsid);\r
+        relation.setObjectDocumentType(objectDocumentType);\r
         \r
         relation.setRelationshipType(rt.toString());\r
     }\r
index a41a6451b53cc188c509505361069b683f46e665..40f0b12498f693de09351158ff7952ca532ca682 100644 (file)
@@ -787,11 +787,9 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             // Either value might be null for for each of Subject and Object 
             String subjectCsid = itemSubject.getCsid();
             rc.setSubjectCsid(subjectCsid);
-            rc.setDocumentId1(subjectCsid); // populate legacy field for backward compatibility
 
             String objCsid = itemObject.getCsid();
             rc.setObjectCsid(objCsid);
-            rc.setDocumentId2(objCsid); // populate legacy field for backward compatibility
 
             rc.setSubjectRefName(itemSubject.getRefName());
             rc.setObjectRefName(itemObject.getRefName());
@@ -803,9 +801,6 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             // This is superfluous, since it will be fetched by the Relations Create logic.
             rc.setSubjectDocumentType(itemSubject.getDocumentType());
             rc.setObjectDocumentType(itemObject.getDocumentType());
-            // populate legacy fields for backward compatibility
-            rc.setDocumentType1(itemSubject.getDocumentType());
-            rc.setDocumentType2(itemObject.getDocumentType());
 
             // This is superfluous, since it will be fetched by the Relations Create logic.
             rc.setSubjectUri(itemSubject.getUri());
@@ -817,7 +812,6 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             PoxPayloadOut payloadOut = new PoxPayloadOut(RelationClient.SERVICE_PAYLOAD_NAME);
             PayloadOutputPart outputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMONPART_NAME, rc);
             payloadOut.addPart(outputPart);
-            //System.out.println("\r\n==== TO CREATE: "+rc.getDocumentId1()+"==>"+rc.getPredicate()+"==>"+rc.getDocumentId2());
             RelationResource relationResource = new RelationResource();
             Object res = relationResource.create(ctx.getResourceMap(),
                     ctx.getUriInfo(), payloadOut.toXML());    //NOTE ui recycled from above to pass in unknown query params.
index fcaa5e616cf2a5dbda96b92eeb61847333ee0764..808976073d1572d63d2eba73e44f0c735e2a1204 100644 (file)
@@ -153,10 +153,10 @@ public class CreateAndLinkLoanOutBatchJob implements BatchInvocable {
                String relationPayload = "<document name=\"relations\">"
                        + "<ns2:relations_common xmlns:ns2=\"http://collectionspace.org/services/relation\"" 
                        +               " xmlns:ns3=\"http://collectionspace.org/services/jaxb\">"
-                       +   "<documentId1>"+loanCSID+"</documentId1>"
-                       +   "<documentType1>"+LOAN_DOCTYPE+"</documentType1>"
-                       +   "<documentId2>"+toCSID+"</documentId2>"
-                       +   "<documentType2>"+context.getDocType()+"</documentType2>"
+                       +   "<subjectCsid>"+loanCSID+"</subjectCsid>"
+                       +   "<subjectDocumentType>"+LOAN_DOCTYPE+"</subjectDocumentType>"
+                       +   "<objectCsid>"+toCSID+"</objectCsid>"
+                       +   "<objectDocumentType>"+context.getDocType()+"</objectDocumentType>"
                        +   "<relationshipType>"+RELATION_TYPE+"</relationshipType>"
                        +   "<predicateDisplayName>"+RELATION_PREDICATE_DISP+"</predicateDisplayName>"
                        + "</ns2:relations_common></document>";
index 4bdeb869c102ff395c0021017b69d38b96985164..75603635909d5a72d590ebed8f7e6bf07a2df24f 100644 (file)
       <service:properties xmlns:service="http://collectionspace.org/services/common/service">
         <types:item xmlns:types="http://collectionspace.org/services/common/types">
           <types:key>objectNameProperty</types:key>
-          <types:value>documentId1</types:value>
+          <types:value>subjectCsid</types:value>
         </types:item>
         <types:item xmlns:types="http://collectionspace.org/services/common/types">
           <types:key>objectNumberProperty</types:key>
           </service:field>
           <service:field>
             <service:table>relations_common</service:table>
-            <service:param>documentid1,documentid2</service:param>
+            <service:param>subjectcsid,objectcsid</service:param>
           </service:field>
         </service:params>
       </service:initHandler>
index e7a8282c8fa0c17b66c57d51a719615a98e4774c..a2b50118a4246987ac6fb477bf32d7301c796295 100644 (file)
@@ -98,7 +98,7 @@ public class QueryManagerNuxeoImpl implements IQueryManager {
                        RepositoryInstance repoSession = client.openRepository();\r
 \r
                        DocumentModelList docModelList = repoSession\r
-                                       .query("SELECT * FROM Relation WHERE relation:relationtype.documentId1='updated-Subject-1'");\r
+                                       .query("SELECT * FROM Relation WHERE relations_common:subjectCsid='updated-Subject-1'");\r
                        // DocumentModelList docModelList =\r
                        // repoSession.query("SELECT * FROM Relation");\r
                        // DocumentModelList docModelList =\r
@@ -109,9 +109,9 @@ public class QueryManagerNuxeoImpl implements IQueryManager {
                                System.out.println(docModel.getPathAsString());\r
                                System.out.println(docModel.getName());\r
                                System.out.println(docModel.getPropertyValue("dc:title"));\r
-                               // System.out.println("documentId1=" +\r
-                               // docModel.getProperty("relation",\r
-                               // "relationtype/documentId1").toString());\r
+                               // System.out.println("subjectCsid=" +\r
+                               // docModel.getProperty("relations_common",\r
+                               // "subjectCsid").toString());\r
                        }\r
 \r
                } catch (Exception e) {\r
index f5c8e2f34d20a7df8af974776b9b87ebef88981c..c28d367c5544dc5bf196d9fc2938fdb9dbee8628 100644 (file)
@@ -39,33 +39,21 @@ public interface RelationJAXBSchema {
        /** The Constant CSID. */\r
        final static String CSID = "csid";\r
        \r
-       /** The Constant DOCUMENT_ID_1. */\r
-       final static String DOCUMENT_ID_1 = "documentId1";\r
-       \r
-       /** The Constant DOCUMENT_TYPE_1. */\r
-       final static String DOCUMENT_TYPE_1 = "documentType1";\r
-       \r
-       /** The Constant DOCUMENT_ID_2. */\r
-       final static String DOCUMENT_ID_2 = "documentId2";\r
-       \r
-       /** The Constant DOCUMENT_TYPE_2. */\r
-       final static String DOCUMENT_TYPE_2 = "documentType2";\r
-       \r
        /** The Constant RELATIONSHIP_TYPE. */\r
        final static String RELATIONSHIP_TYPE = "relationshipType";\r
        \r
        /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
        final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
 \r
-    final static String SUBJECT_URI = "subjectUri";\r
-    final static String SUBJECT_CSID = "subjectCsid";\r
-    final static String SUBJECT_REFNAME = "subjectRefName";\r
-    final static String SUBJECT_DOCTYPE = "subjectDocumentType";\r
+    final static String SUBJECT_URI =          "subjectUri";\r
+    final static String SUBJECT_CSID =         "subjectCsid";\r
+    final static String SUBJECT_REFNAME =      "subjectRefName";\r
+    final static String SUBJECT_DOCTYPE =      "subjectDocumentType";\r
 \r
-    final static String OBJECT_URI = "objectUri";\r
-    final static String OBJECT_CSID = "objectCsid";\r
-    final static String OBJECT_REFNAME = "objectRefName";\r
-    final static String OBJECT_DOCTYPE = "objectDocumentType";\r
+    final static String OBJECT_URI =           "objectUri";\r
+    final static String OBJECT_CSID =          "objectCsid";\r
+    final static String OBJECT_REFNAME =       "objectRefName";\r
+    final static String OBJECT_DOCTYPE =       "objectDocumentType";\r
 \r
 }\r
 \r
index 2d4240b0d8047cd6e30410d2c088a0e4778ddc53..3c1b664243fa78af007ae6bf638e42e240a1ab1e 100644 (file)
@@ -58,15 +58,16 @@ public class RelationsUtils {
        StringBuilder stringBuilder = new StringBuilder();
        if (subject != null) {
                stringBuilder.append(RelationConstants.NUXEO_SCHEMA_NAME + ":" +
-                               RelationJAXBSchema.DOCUMENT_ID_1 + " = " + "'" + subject + "'");
+                               RelationJAXBSchema.SUBJECT_CSID + " = " + "'" + subject + "'");
        }
        
        if (subjectType != null) {
                if (stringBuilder.length() > 0) {
                        stringBuilder.append(IQueryManager.SEARCH_QUALIFIER_AND);
                }
+               // BUG - this should use the new field RelationJAXBSchema.SUBJECT_DOCTYPE
                stringBuilder.append(RelationConstants.NUXEO_SCHEMA_NAME + ":" +
-                               RelationJAXBSchema.DOCUMENT_TYPE_1 + " = " + "'" + subjectType + "'");
+                               RelationJAXBSchema.SUBJECT_DOCTYPE + " = " + "'" + subjectType + "'");
        }
        
        if (predicate != null) {
@@ -82,15 +83,16 @@ public class RelationsUtils {
                        stringBuilder.append(IQueryManager.SEARCH_QUALIFIER_AND);
                }
                stringBuilder.append(RelationConstants.NUXEO_SCHEMA_NAME + ":" +
-                               RelationJAXBSchema.DOCUMENT_ID_2 + " = " + "'" + object + "'");
+                               RelationJAXBSchema.OBJECT_CSID + " = " + "'" + object + "'");
        }
        
        if (objectType != null) {
                if (stringBuilder.length() > 0) {
                        stringBuilder.append(IQueryManager.SEARCH_QUALIFIER_AND);
                }
+               // BUG - this should use the new field RelationJAXBSchema.OBJECT_DOCTYPE
                stringBuilder.append(RelationConstants.NUXEO_SCHEMA_NAME + ":" +
-                               RelationJAXBSchema.DOCUMENT_TYPE_2 + " = " + "'" + objectType + "'");
+                               RelationJAXBSchema.OBJECT_DOCTYPE + " = " + "'" + objectType + "'");
        }
        
        if (stringBuilder.length() > 0) {
index bccb241b72ba74be50f02f6f8593e3d45894ec17..48e5fe1f36347479e933bdc2c75926f1c094a236 100644 (file)
         <xs:complexType>\r
             <xs:sequence>\r
                <xs:element name="csid" type="xs:string" />            \r
-                <xs:element name="documentId1" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="documentType1" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="documentId2" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="documentType2" type="xs:string" minOccurs="1"/>\r
                 <!-- type of relationship between two entities -->\r
                 <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
                 <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
index ff58c8e364771b78e92a77ceb5f8efe662a43a50..57e5f09a830115659e61935ea27d0e5a45f10ac0 100644 (file)
             </templates>            
             <rows>
                 <row><widget>relationshipType</widget></row>
-                <row><widget>documentId1</widget></row>
-                <row><widget>documentType1</widget></row>
-                <row><widget>documentId2</widget></row>
-                <row><widget>documentType2</widget></row>
+                <row><widget>subjectCsid</widget></row>
+                <row><widget>subjectDocumentType</widget></row>
+                <row><widget>objectCsid</widget></row>
+                <row><widget>objectDocumentType</widget></row>
             </rows>
             
             <widget name="relationshipType" type="text">
                 </properties>
             </widget>
             
-            <widget name="documentId1" type="text">
+            <widget name="subjectCsid" type="text">
                 <labels>
-                    <label mode="any">Document ID 1</label>
+                    <label mode="any">Subject CSID</label>
                 </labels>
                 <translated>true</translated>
                 <fields>
-                    <field schema="relations_common">documentId1</field>
+                    <field schema="relations_common">subjectCsid</field>
                 </fields>
                 <properties widgetMode="edit">
                     <property name="styleClass">dataInputText</property>
                 </properties>
             </widget>
             
-            <widget name="documentType1" type="text">
+            <widget name="subjectDocumentType" type="text">
                 <labels>
-                    <label mode="any">Document Type 1</label>
+                    <label mode="any">Subject Document Type</label>
                 </labels>
                 <translated>true</translated>
                 <fields>
-                    <field schema="relations_common">documentType1</field>
+                    <field schema="relations_common">subjectDocumentType</field>
                 </fields>
                 <properties widgetMode="edit">
                     <property name="styleClass">dataInputText</property>
                 </properties>
             </widget>
             
-            <widget name="documentId2" type="text">
+            <widget name="objectCsid" type="text">
                 <labels>
-                    <label mode="any">Document ID 2</label>
+                    <label mode="any">Object CSID</label>
                 </labels>
                 <translated>true</translated>
                 <fields>
-                    <field schema="relations_common">documentId2</field>
+                    <field schema="relations_common">objectCsid</field>
                 </fields>
                 <properties widgetMode="edit">
                     <property name="styleClass">dataInputText</property>
                 </properties>
             </widget>
             
-            <widget name="documentType2" type="text">
+            <widget name="objectDocumentType" type="text">
                 <labels>
-                    <label mode="any">Document Type 2</label>
+                    <label mode="any">Object Document Type</label>
                 </labels>
                 <translated>true</translated>
                 <fields>
-                    <field schema="relations_common">documentType2</field>
+                    <field schema="relations_common">objectDocumentType</field>
                 </fields>
                 <properties widgetMode="edit">
                     <property name="styleClass">dataInputText</property>
index 6c28e5ceaa937dfe02446c64c486580e1a10a897..7654170098794d215ee3a14e69b4c7c149f3f516 100644 (file)
             <!-- document-type-1 would be the doc-type of the container collectionobject -->\r
             <!-- document-id-2 would be the id of the contained (or child) collectionobject -->\r
             <!-- document-type-2 would be the doc-type of the collectionobejct -->\r
-    <xs:element name="documentId1" type="xs:string"  minOccurs="1" maxOccurs="1"/>\r
     <xs:element name="subjectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentId1 -->\r
-    <xs:element name="documentType1" type="xs:string"  minOccurs="1" maxOccurs="1"/>\r
     <xs:element name="subjectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentType1 -->\r
 \r
-    <xs:element name="documentId2" type="xs:string"  minOccurs="1" maxOccurs="1"/>\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
     <xs:element name="objectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentType2 -->\r
 \r
             <!-- type of relationship between two entities -->\r
index 76f0254c0f9ca42a1ac55b9401923704d5e64ad0..37309dded9022b420e296921459e7ff6012d240b 100644 (file)
@@ -229,7 +229,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         String identifier = createIdentifier();
         RelationsCommon relationsCommon = createRelationsCommon(identifier);
         // Make the subject ID equal to the object ID
-        relationsCommon.setDocumentId1(relationsCommon.getDocumentId2());
+        relationsCommon.setSubjectCsid(relationsCommon.getObjectCsid());
         PoxPayloadOut multipart = createRelationInstance(relationsCommon);
         ClientResponse<Response> res = client.create(multipart);
         int statusCode = res.getStatus();
@@ -618,13 +618,13 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         final String msg2 =
                 "Data in updated object was not correctly computed.";
         Assert.assertEquals(
-                updatedRelationCommon.getDocumentId1(), newSubjectId, msg);
+                updatedRelationCommon.getSubjectCsid(), newSubjectId, msg);
         Assert.assertEquals(
-                updatedRelationCommon.getDocumentType1(), newSubjectDocType, msg2);
+                updatedRelationCommon.getSubjectDocumentType(), newSubjectDocType, msg2);
         Assert.assertEquals(
-                updatedRelationCommon.getDocumentId2(), newObjectId, msg);
+                updatedRelationCommon.getObjectCsid(), newObjectId, msg);
         Assert.assertEquals(
-                updatedRelationCommon.getDocumentType2(), newObjectDocType, msg2);
+                updatedRelationCommon.getObjectDocumentType(), newObjectDocType, msg2);
         Assert.assertEquals(
                 updatedRelationCommon.getPredicateDisplayName(), relationCommon.getPredicateDisplayName(), msg);
 
@@ -936,21 +936,21 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
      * Fills the relation.
      *
      * @param relationCommon the relation
-     * @param documentId1 the document id1
-     * @param documentType1 the document type1
-     * @param documentId2 the document id2
-     * @param documentType2 the document type2
+     * @param subjectCsid the subject document id
+     * @param subjectDocumentType the subject document type
+     * @param objectCsid the object document id
+     * @param objectDocumentType the object document type
      * @param rt the rt
      */
     private void fillRelation(RelationsCommon relationCommon,
-            String documentId1, String documentType1,
-            String documentId2, String documentType2,
+            String subjectCsid, String subjectDocumentType,
+            String objectCsid, String objectDocumentType,
             String rt,
             String rtDisplayName) {
-        relationCommon.setDocumentId1(documentId1);
-        relationCommon.setDocumentType1(documentType1);
-        relationCommon.setDocumentId2(documentId2);
-        relationCommon.setDocumentType2(documentType2);
+        relationCommon.setSubjectCsid(subjectCsid);
+        relationCommon.setSubjectDocumentType(subjectDocumentType);
+        relationCommon.setObjectCsid(objectCsid);
+        relationCommon.setObjectDocumentType(objectDocumentType);
 
         relationCommon.setRelationshipType(rt);
         relationCommon.setPredicateDisplayName(rtDisplayName);
index dc38d6e6de17c4cfb4fef2b56676ecabb7e28262..9c9827691be2eca5a5ffe4de494d06ce24b77db4 100644 (file)
@@ -197,38 +197,45 @@ public class RelationDocumentModelHandler
         String id = getCsid(docModel);
         relationListItem.setCsid(id);
 
-        relationListItem.setSubjectCsid((String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_ID_1));
+        relationListItem.setSubjectCsid((String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.SUBJECT_CSID));
 
-        String predicate = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.RELATIONSHIP_TYPE);
+        String predicate = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.RELATIONSHIP_TYPE);
         relationListItem.setRelationshipType(predicate);
         relationListItem.setPredicate(predicate); //predicate is new name for relationshipType.
-        relationListItem.setPredicateDisplayName((String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.RELATIONSHIP_TYPE_DISPLAYNAME));
+        relationListItem.setPredicateDisplayName((String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.RELATIONSHIP_TYPE_DISPLAYNAME));
 
-        relationListItem.setObjectCsid((String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_ID_2));
+        relationListItem.setObjectCsid((String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.OBJECT_CSID));
 
         relationListItem.setUri(serviceContextPath + id);
 
         //Now fill in summary info for the related docs: subject and object.
         String subjectCsid = relationListItem.getSubjectCsid();
-        String documentType = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_TYPE_1);
-        RelationsDocListItem subject = createRelationsDocListItem(ctx, sbt, subjectCsid, tReader, documentType);
+        String subjectDocumentType = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.SUBJECT_DOCTYPE);
+        RelationsDocListItem subject = createRelationsDocListItem(ctx, sbt, subjectCsid, tReader, subjectDocumentType);
 
-        //Object o1 =  docModel.getProperty(ctx.getCommonPartLabel(), "subject");
-        //Object o2 =  docModel.getProperty(ctx.getCommonPartLabel(), "object");
-
-        String subjectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_URI);
+        String subjectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.SUBJECT_URI);
         subject.setUri(subjectUri);
-        String subjectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_REFNAME);
+        String subjectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.SUBJECT_REFNAME);
         subject.setRefName(subjectRefName);
         relationListItem.setSubject(subject);
 
         String objectCsid = relationListItem.getObjectCsid();
-        String documentType2 = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_TYPE_2);
-        RelationsDocListItem object = createRelationsDocListItem(ctx, sbt, objectCsid, tReader, documentType2);
+        String objectDocumentType = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.OBJECT_DOCTYPE);
+        RelationsDocListItem object = createRelationsDocListItem(ctx, sbt, objectCsid, tReader, objectDocumentType);
 
-        String objectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_URI);
+        String objectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.OBJECT_URI);
         object.setUri(objectUri);
-        String objectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_REFNAME);
+        String objectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), 
+                                                                                                       RelationJAXBSchema.OBJECT_REFNAME);
         object.setRefName(objectRefName);
         relationListItem.setObject(object);
 
@@ -242,33 +249,16 @@ public class RelationDocumentModelHandler
             TenantBindingConfigReaderImpl tReader,
             String documentType) throws Exception {
         RelationsDocListItem item = new RelationsDocListItem();
-        item.setDocumentType(documentType);//this one comes from the record, as documentType1, documentType2.
-        // CSPACE-4037 REMOVING: item.setService(documentType);//this one comes from the record, as documentType1, documentType2.   Current app seems to use servicename for this.
+        item.setDocumentType(documentType);//this one comes from the record, as subjectDocumentType, objectDocumentType.
         item.setCsid(itemCsid);
 
         DocumentModel itemDocModel = NuxeoUtils.getDocFromCsid(getRepositorySession(), ctx, itemCsid);    //null if not found.
         if (itemDocModel != null) {
             String itemDocType = itemDocModel.getDocumentType().getName();
-            // CSPACE-4037 REMOVING: item.setDocumentTypeFromModel(itemDocType);           //this one comes from the nuxeo documentType
-
-            //DEBUG: System.out.println("\r\n******** AuthorityItemDocumentModelHandlder documentType **************\r\n\tdocModel: "+itemDocType+"\r\n\tpayload: "+documentType);
-            //boolean usedDocumentTypeFromPayload = true;
-            /*if ( ! Tools.isBlank(documentType)){
-            if (documentType.equals(itemDocType)){
-            //usedDocumentTypeFromPayload = true;
-            }  else {
-            // Laramie20110510 CSPACE-3739  throw the exception for 3739, otherwise, don't throw it.
-            //throw new Exception("documentType supplied was wrong.  supplied: "+documentType+" required: "+itemDocType+ " itemCsid: "+itemCsid );
-            }
-            } else {
-            //usedDocumentTypeFromPayload = false;
-            item.setDocumentType(itemDocType);
-            }   */
             if (Tools.isBlank(documentType)) {
                 item.setDocumentType(itemDocType);
             }
 
-            // TODO: clean all the output statements out of here when CSPACE-4037 is done.
             //TODO: ensure that itemDocType is really the entry point, i.e. servicename==doctype
             //ServiceBindingType itemSbt2 = tReader.getServiceBinding(ctx.getTenantId(), itemDocType);
             String propName = "ERROR-FINDING-PROP-VALUE";
@@ -277,13 +267,11 @@ public class RelationDocumentModelHandler
                 propName = ServiceBindingUtils.getPropertyValue(itemSbt, ServiceBindingUtils.OBJ_NAME_PROP);
                 String itemDocname = ServiceBindingUtils.getMappedFieldInDoc(itemSbt, ServiceBindingUtils.OBJ_NAME_PROP, itemDocModel);
                 if (propName == null || itemDocname == null) {
-                    //System.out.println("=== prop NOT found: "+ServiceBindingUtils.OBJ_NAME_PROP+"::"+propName+"="+itemDocname+" documentType: "+documentType);
                 } else {
                     item.setName(itemDocname);
-                    //System.out.println("=== found prop : "+ServiceBindingUtils.OBJ_NAME_PROP+"::"+propName+"="+itemDocname+" documentType: "+documentType);
                 }
             } catch (Throwable t) {
-                System.out.println("====Error finding objectNameProperty: " + itemDocModel + " field " + ServiceBindingUtils.OBJ_NAME_PROP + "=" + propName
+               logger.error("====Error finding objectNameProperty: " + itemDocModel + " field " + ServiceBindingUtils.OBJ_NAME_PROP + "=" + propName
                         + " not found in itemDocType: " + itemDocType + " inner: " + t.getMessage());
             }
             propName = "ERROR-FINDING-PROP-VALUE";
@@ -292,12 +280,8 @@ public class RelationDocumentModelHandler
                 String itemDocnumber = ServiceBindingUtils.getMappedFieldInDoc(itemSbt, ServiceBindingUtils.OBJ_NUMBER_PROP, itemDocModel);
 
                 if (propName == null || itemDocnumber == null) {
-                    //System.out.println("=== prop NOT found: "+ServiceBindingUtils.OBJ_NUMBER_PROP+"::"+propName+"="+itemDocnumber
-                    //                          +" documentType: "+documentType);
                 } else {
                     item.setNumber(itemDocnumber);
-                    //System.out.println("============ found prop : "+ServiceBindingUtils.OBJ_NUMBER_PROP+"::"+propName+"="+itemDocnumber
-                    //                          +" documentType: "+documentType);
                 }
             } catch (Throwable t) {
                 logger.error("====Error finding objectNumberProperty: " + ServiceBindingUtils.OBJ_NUMBER_PROP + "=" + propName
@@ -331,11 +315,6 @@ public class RelationDocumentModelHandler
         try {
             csid = (String) relationDocModel.getProperty(commonPartLabel, 
                        (fSubject?RelationJAXBSchema.SUBJECT_CSID:RelationJAXBSchema.OBJECT_CSID));
-            // FIXME: Remove this entire 'if' statement when legacy fields are removed from the Relation record:
-            if (Tools.isBlank(csid)) {
-                csid = (String) relationDocModel.getProperty(commonPartLabel, 
-                                       (fSubject?RelationJAXBSchema.DOCUMENT_ID_1:RelationJAXBSchema.DOCUMENT_ID_2));
-            }
         } catch (PropertyException pe) {
             // Per CSPACE-4468, ignore any property exception here.
             // The objectCsid and/or subjectCsid field in a relation record
@@ -373,16 +352,10 @@ public class RelationDocumentModelHandler
                String doctype = (String) subjectOrObjectDocModel.getType();
                properties.put((fSubject?RelationJAXBSchema.SUBJECT_DOCTYPE:RelationJAXBSchema.OBJECT_DOCTYPE),
                                                        doctype);
-               // FIXME: Remove the line below when legacy fields are removed from the Relation record:
-               properties.put((fSubject?RelationJAXBSchema.DOCUMENT_TYPE_1:RelationJAXBSchema.DOCUMENT_TYPE_2), 
-                                                       doctype);
        
                String csid = (String) subjectOrObjectDocModel.getName();
                properties.put((fSubject?RelationJAXBSchema.SUBJECT_CSID:RelationJAXBSchema.OBJECT_CSID),
                                                        csid);
-               // FIXME: Remove the two lines immediately below when legacy fields are removed from the Relation record:
-               properties.put((fSubject?RelationJAXBSchema.DOCUMENT_ID_1:RelationJAXBSchema.DOCUMENT_ID_2),
-                                                       csid);
        
                String uri = (String) subjectOrObjectDocModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,
                                                                                                                                        COLLECTIONSPACE_CORE_URI);
index af72ae538620564f6ef248338638a0276562ecac..532fdc031e78e47ec0e0606012323a9c3786cf00 100644 (file)
@@ -41,8 +41,8 @@ public class RelationValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn,
                 logger.trace(relationsCommon.toString());\r
             }\r
 \r
-            String subjectCsid = getSubjectCsid(relationsCommon);\r
-            String objectCsid = getObjectCsid(relationsCommon);\r
+            String subjectCsid = relationsCommon.getSubjectCsid();\r
+            String objectCsid = relationsCommon.getObjectCsid();\r
 \r
             // If no CSID for a subject or object is included in the create payload,\r
             // a refName must be provided for that subject or object as an alternate identifier.\r
@@ -87,24 +87,6 @@ public class RelationValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn,
         // TODO Auto-generated method stub\r
     }\r
 \r
-    private String getSubjectCsid(RelationsCommon relationsCommon) {\r
-        String subjectCsid = relationsCommon.getSubjectCsid();\r
-        // FIXME: Remove this entire 'if' statement when legacy fields are removed from the Relation record:\r
-        if (Tools.isBlank(subjectCsid)) {\r
-            subjectCsid = relationsCommon.getDocumentId1();\r
-        }\r
-        return subjectCsid;\r
-    }\r
-\r
-    private String getObjectCsid(RelationsCommon relationsCommon) {\r
-        String objectCsid = relationsCommon.getObjectCsid();\r
-        // FIXME: Remove this entire 'if' statement when legacy fields are removed from the Relation record:\r
-        if (Tools.isBlank(objectCsid)) {\r
-            objectCsid = relationsCommon.getDocumentId2();\r
-        }\r
-        return objectCsid;\r
-    }\r
-\r
     private boolean hasCsid(String csid) {\r
         boolean hasCsid = false;\r
         if (Tools.notBlank(csid)) {\r