]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2623: Relation schema needs to include a "display name" for the predicate...
authorRichard Millet <richard.millet@berkeley.edu>
Wed, 11 Aug 2010 18:55:47 +0000 (18:55 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Wed, 11 Aug 2010 18:55:47 +0000 (18:55 +0000)
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java
services/jaxb/src/main/resources/relations_common.xsd
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/NewRelationResource.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java

index 5f5f03568bc2294ac722a01f9c0482845d9f1559..5b9b31bf823950e0551c9661e44d1e5dc57fc89c 100644 (file)
@@ -380,7 +380,6 @@ public class CollectionObjectResource
      * 
      * @return the intakes common list
      */
-    /*
     @GET
     @Path("{csid}/intakes")
     @Produces("application/xml")
@@ -398,7 +397,11 @@ public class CollectionObjectResource
                String objectCsid = null;
                NewRelationResource relationResource = new NewRelationResource();
                RelationsCommonList relationsCommonList = relationResource.getRelationList(queryParams,
-                               subjectCsid, predicate, objectCsid);
+                               subjectCsid,
+                               null, /*subjectType*/
+                               predicate,
+                               objectCsid,
+                               null /*objectType*/);
                
                //
                // Create an array of Intake csid's
@@ -425,8 +428,6 @@ public class CollectionObjectResource
         
         return result;
     }
-     *
-     */
 
     /**
      * Gets the authority refs.
index 2973830ef6d92ed97e22f877fb5cfdbc3a2721e3..d8725f76c05757b26ec39bae89a4aa86de479a48 100644 (file)
@@ -53,7 +53,9 @@ public interface RelationJAXBSchema {
        \r
        /** The Constant RELATIONSHIP_TYPE. */\r
        final static String RELATIONSHIP_TYPE = "relationshipType";\r
-               \r
+       \r
+       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
+       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
 }\r
 \r
 \r
index c90ed4bd3051154f0a83a4434ed19a74b548b513..b044aa5cafe9d62b7b0108cc435b8bc7fab66009 100644 (file)
@@ -41,6 +41,9 @@ public interface RelationListItemJAXBSchema {
        final static String RELATIONSHIP_TYPE = "relationshipType";\r
        final static String OBJECT_CSID = "objectCsid";\r
        \r
+       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
+       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
+\r
        /** The Constant URI. */\r
        final static String URI = "url";\r
 }\r
index e5f739d5bc3a58d729e189c091706cb968374bea..ad46d4bc6c1bd5a9bf6f0b506a3dbee2479c15cd 100644 (file)
@@ -30,6 +30,7 @@
                 <xs:element name="documentType2" type="xs:string" minOccurs="1"/>\r
                 <!-- type of relationship between two entities -->\r
                 <xs:element name="relationshipType" type="rel:RelationshipType" minOccurs="1"/>\r
+                <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
             </xs:sequence>\r
         </xs:complexType>\r
     </xs:element>\r
@@ -72,6 +73,7 @@
                                     <xs:element name="csid" type="xs:string" minOccurs="1"/>\r
                                     <xs:element name="subjectCsid" type="xs:string" minOccurs="1"/>\r
                                     <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
+                                    <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
                                     <xs:element name="objectCsid" type="xs:string" minOccurs="1"/>\r
                                 </xs:sequence>\r
                             </xs:complexType>\r
index 2ecf22619f69d5127ff044b30716d65079aae697..3c9a420b0ab91ed3d72b12d7b0b850c4106b89d2 100644 (file)
@@ -41,8 +41,7 @@
 \r
             <!-- type of relatinoship between two entities -->\r
     <xs:element name="relationshipType" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>\r
-\r
-\r
+    <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
 \r
     <!-- enumeration defining the type of relationship between two entities -->\r
     <xs:simpleType name="RelationshipType">\r
index b06af76145a3c01ec48a28d4433f07d1c8168925..55dea04c66b3bbf09199d7316876f8a1d1e9839b 100644 (file)
@@ -423,6 +423,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         relation.setDocumentType1("updated-" + relation.getDocumentType1());
         relation.setDocumentId2("updated-" + relation.getDocumentId2());
         relation.setDocumentType2("updated-" + relation.getDocumentType2());
+        relation.setPredicateDisplayName("updated-" + relation.getPredicateDisplayName());
         if(logger.isDebugEnabled()){
             logger.debug("updated object");
             logger.debug(objectAsXmlString(relation, RelationsCommon.class));
@@ -459,6 +460,8 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
                 updatedObject.getDocumentId2(), relation.getDocumentId2(), msg);
         Assert.assertEquals(
                 updatedObject.getDocumentType2(), relation.getDocumentType2(), msg);
+        Assert.assertEquals(
+                updatedObject.getPredicateDisplayName(), relation.getPredicateDisplayName(), msg);
 
     }
 
@@ -754,7 +757,8 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
                 "SubjectType-" + identifier + "-type",
                 "Object-" + identifier,
                 "ObjectType-" + identifier + "-type",
-                RelationshipType.COLLECTIONOBJECT_INTAKE);
+                RelationshipType.COLLECTIONOBJECT_INTAKE,
+                RelationshipType.COLLECTIONOBJECT_INTAKE + ".displayName");
     }
 
     /**
@@ -770,12 +774,14 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
     private void fillRelation(RelationsCommon relation,
             String documentId1, String documentType1,
             String documentId2, String documentType2,
-            RelationshipType rt) {
+            RelationshipType rt,
+            String rtDisplayName) {
         relation.setDocumentId1(documentId1);
         relation.setDocumentType1(documentType1);
         relation.setDocumentId2(documentId2);
         relation.setDocumentType2(documentType2);
 
         relation.setRelationshipType(rt);
+        relation.setPredicateDisplayName(rtDisplayName);
     }
 }
index fad74f7b2c671147b7ccf6cb4a009ae9f403e9c7..9888829541c178f77908d86841f6c9c33588a5ba 100644 (file)
@@ -321,8 +321,10 @@ public class NewRelationResource extends
         *
         * @param queryParams the query params
         * @param subjectCsid the subject csid
+        * @param subjectType 
         * @param predicate the predicate
         * @param objectCsid the object csid
+        * @param objectType 
         * @return the relation list
         * @throws WebApplicationException the web application exception
         */
index b3d0ced6970109167fbbcc9a5c7acf442ad1ae76..07903e3502bf008a8ff9e302d71bae64316b4d91 100644 (file)
@@ -170,6 +170,8 @@ public class RelationDocumentModelHandler
         //
         relationListItem.setRelationshipType((String) docModel.getProperty(ctx.getCommonPartLabel(),
                        RelationJAXBSchema.RELATIONSHIP_TYPE));
+        relationListItem.setPredicateDisplayName((String) docModel.getProperty(ctx.getCommonPartLabel(),
+                       RelationJAXBSchema.RELATIONSHIP_TYPE_DISPLAYNAME));
         //
         // Object
         //