From: Richard Millet Date: Wed, 11 Aug 2010 18:55:47 +0000 (+0000) Subject: CSPACE-2623: Relation schema needs to include a "display name" for the predicate... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=0d49c3c93127b25872a12f298671ca10223006a0;p=tmp%2Fjakarta-migration.git CSPACE-2623: Relation schema needs to include a "display name" for the predicate type. The new schema element name is "predicateDisplayName" --- diff --git a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java index 5f5f03568..5b9b31bf8 100644 --- a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java +++ b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java @@ -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. diff --git a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java index 2973830ef..d8725f76c 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java +++ b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java @@ -53,7 +53,9 @@ public interface RelationJAXBSchema { /** The Constant RELATIONSHIP_TYPE. */ final static String RELATIONSHIP_TYPE = "relationshipType"; - + + /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */ + final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName"; } diff --git a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java index c90ed4bd3..b044aa5ca 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java +++ b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java @@ -41,6 +41,9 @@ public interface RelationListItemJAXBSchema { final static String RELATIONSHIP_TYPE = "relationshipType"; final static String OBJECT_CSID = "objectCsid"; + /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */ + final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName"; + /** The Constant URI. */ final static String URI = "url"; } diff --git a/services/jaxb/src/main/resources/relations_common.xsd b/services/jaxb/src/main/resources/relations_common.xsd index e5f739d5b..ad46d4bc6 100644 --- a/services/jaxb/src/main/resources/relations_common.xsd +++ b/services/jaxb/src/main/resources/relations_common.xsd @@ -30,6 +30,7 @@ + @@ -72,6 +73,7 @@ + diff --git a/services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd b/services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd index 2ecf22619..3c9a420b0 100644 --- a/services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd +++ b/services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd @@ -41,8 +41,7 @@ - - + diff --git a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java index b06af7614..55dea04c6 100644 --- a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java +++ b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java @@ -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); } } diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java index fad74f7b2..988882954 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java @@ -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 */ diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java index b3d0ced69..07903e350 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java @@ -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 //