<vars>
<var ID="objectNumber">CSPACE-5518-WhiteRook</var>
<var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
- </vars>
+ </vars>
<expectedCodes>201</expectedCodes>
</test>
<test ID="ReadWhiteRook">
<var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
<var ID="parentCSID">${CreateChessSetBox.CSID}</var>
<var ID="childCSID">${CreateBlackQueen.CSID}</var>
+ <var ID="relationshipMetaType">Item in a set</var>
</vars>
</test>
<test ID="ReadBagOfBlackChessPieces">
<var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
<var ID="child1CSID">${CreateBlackRookFragment1.CSID}</var>
<var ID="child2CSID">${CreateBlackRookFragment2.CSID}</var>
+ <var ID="relationshipMetaType">set</var>
</vars>
<expectedCodes>200</expectedCodes>
</test>
</vars>
<startElement>/document/*[local-name()='relations-common-list']</startElement>
</response>
- </test>
+ </test>
+
+
+ <!-- Verify that the value of the relationshipMetaType field was set -->
+ <!-- correctly and can be successfully retrieved -->
+ <test ID="GetRelationshipMetaType">
+ <method>GET</method>
+ <uri>/cspace-services/relations?sbj=${CreateBlackQueen.CSID}&obj=${CreateBagOfBlackChessPieces.CSID}</uri>
+ <expectedCodes>200</expectedCodes>
+ <response>
+ <expected level="ADDOK" />
+ <filename>collectionobject/hierarchy/res/relationship-metatype.res.xml</filename>
+ <vars>
+ <var ID="relationshipMetaType">${CreateBagOfBlackChessPieces.relationshipMetaType}</var>
+ <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+ <var ID="childCSID">${CreateBlackQueen.CSID}</var>
+ </vars>
+ </response>
+ </test>
<!-- Clean up any remaining records that were NOT automatically deleted by autoDeletePOSTS -->
<csid>${itemCSID}</csid>
<documentType>CollectionObject</documentType>
</object>
+ <relationshipMetaType>${relationshipMetaType}</relationshipMetaType>
</relation-list-item>
</ns3:relations-common-list>
<csid>${parentCSID}</csid>
<documentType>CollectionObject</documentType>
</object>
- </relation-list-item>
+ <relationshipMetaType>${relationshipMetaType}</relationshipMetaType>
+ </relation-list-item>
<!-- Create a relationship between this item and a child -->
<relation-list-item>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <itemsInPage>1</itemsInPage>
+ <totalItems>1</totalItems>
+
+ <relation-list-item>
+ <relationshipMetaType>${relationshipMetaType}</relationshipMetaType>
+ <predicate>hasBroader</predicate>
+ <subject>
+ <csid>${childCSID}</csid>
+ <documentType>CollectionObject</documentType>
+ </subject>
+ <object>
+ <csid>${parentCSID}</csid>
+ <documentType>CollectionObject</documentType>
+ </object>
+ </relation-list-item>
+
+</ns3:relations-common-list>
\r
/** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
+ \r
+ final static String RELATIONSHIP_META_TYPE = "relationshipMetaType";\r
\r
final static String SUBJECT_URI = "subjectUri";\r
final static String SUBJECT_CSID = "subjectCsid";\r
rc.setObjectRefName(itemObject.getRefName());
rc.setRelationshipType(item.getPredicate());
+ rc.setRelationshipMetaType(item.getRelationshipMetaType());
//RelationshipType foo = (RelationshipType.valueOf(item.getPredicate())) ;
//rc.setPredicate(foo); //this must be one of the type found in the enum in services/jaxb/src/main/resources/relations_common.xsd
<xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
<xs:element name="predicate" type="xs:string" minOccurs="1"/>\r
<xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
+ <xs:element name="relationshipMetaType" type="xs:string" minOccurs="1"/>\r
<xs:element name="objectCsid" type="xs:string" minOccurs="1"/>\r
<xs:element name="subject" type="relationsDocListItem" minOccurs="1"/>\r
<xs:element name="object" type="relationsDocListItem" minOccurs="1"/>\r
<xs:enumeration value="hasBroader" />\r
</xs:restriction>\r
</xs:simpleType>\r
+ <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>\r
\r
</xs:schema>\r
\r
@Override
public RelationsCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
RelationsCommonList relList = this.extractPagingInfo(new RelationsCommonList(), wrapDoc);
- relList.setFieldsReturned("subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object");
+ relList.setFieldsReturned("subjectCsid|relationshipType|predicateDisplayName|relationshipMetaType|objectCsid|uri|csid|subject|object");
ServiceContext ctx = getServiceContext();
String serviceContextPath = getServiceContextPath();
relationListItem.setPredicateDisplayName((String) docModel.getProperty(ctx.getCommonPartLabel(),
RelationJAXBSchema.RELATIONSHIP_TYPE_DISPLAYNAME));
+ relationListItem.setRelationshipMetaType((String) docModel.getProperty(ctx.getCommonPartLabel(),
+ RelationJAXBSchema.RELATIONSHIP_META_TYPE));
relationListItem.setObjectCsid((String) docModel.getProperty(ctx.getCommonPartLabel(),
RelationJAXBSchema.OBJECT_CSID));