]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5518: Create both parent and child relations, in both create and update tests...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 13 Sep 2012 19:37:53 +0000 (12:37 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 13 Sep 2012 19:37:53 +0000 (12:37 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject-create.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject.xml with 100% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml with 84% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml with 86% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml

index b9ed00e37527e6fcc67bda32128812d1e8aadbde..c2683db1bb1cf3a68f3b8f8fadbaa73cda38b667 100644 (file)
@@ -3,14 +3,28 @@
     
     <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="true">
         
-        <!-- Create a set of CollectionObjects -->
+        <!--
+            Create and test a structured set of ten (10) CollectionObjects,
+            with these hierarchical relationsips to one another:
+        
+            ChessSetBox
+            |__ ChessBoard
+            |__ BagOfWhiteChessPieces
+                |__ White Rook
+                |__ White Bishop
+            |__ BagOfBlackChessPieces
+                |__ BlackQueen
+                |__ BlackRook
+                    |__ BlackRookFragment1
+                    |__ BlackRookFragment2
+         -->
         
         <!-- Chess set box -->
-        <!-- (parent of chess board, bags of white and black chess pieces) -->
+        <!-- (parent of chess board, bag of white chess pieces, and bag of black chess pieces) -->
         <test ID="CreateChessSetBox">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
             </vars>
         </test>
         
         <!-- Chess board -->
-        <!-- (child of chess set box, sibling of bags of white and black chess pieces) -->
+        <!-- (child of chess set box, sibling of bag of white chess pieces and bag of black chess pieces) -->
         <test ID="CreateChessBoard">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
                 <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
             <expectedCodes>200</expectedCodes>
         </test>
         
-        <!-- Bags of white and black chess pieces -->
-        <!-- (child of chess set box, sibling of chess board, parents of chess pieces) --> 
+        <!-- Bag of white chess pieces -->
+        <!-- (child of chess set box, sibling of chess board and bag -->
+        <!-- of black chess pieces, parent of white chess pieces) --> 
         
         <test ID="CreateBagOfWhiteChessPieces">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
                 <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
             <expectedCodes>200</expectedCodes>
         </test>
         
-        <test ID="CreateBagOfBlackChessPieces">
-            <method>POST</method>
-            <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
-            <vars>
-                <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
-                <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
-            </vars>
-        </test>
-        <test ID="ReadBagOfBlackChessPieces">
-            <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
-            <expectedCodes>200</expectedCodes>
-        </test>
-        
-        <!-- Individual chess pieces in those bags -->
+        <!-- Individual chess pieces in the bag of white chess pieces, -->
+        <!-- each created along with relations to their parent -->
         
         <test ID="CreateWhiteRook">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
-                 <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
            </vars>
             <expectedCodes>201</expectedCodes>
         </test>
         <test ID="CreateWhiteBishop">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
                 <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
             <expectedCodes>200</expectedCodes>
         </test>
         
+        <!-- Individual chess pieces in the bag of black chess pieces, -->
+        <!-- each created initially without any relations. -->
+                
         <test ID="CreateBlackQueen">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
-                <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
             </vars>
             <expectedCodes>201</expectedCodes>
         </test>
             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
             <expectedCodes>200</expectedCodes>
         </test>
-       
+        
         <test ID="CreateBlackRook">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
-                <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
             </vars>
             <expectedCodes>201</expectedCodes>
         </test>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
             <expectedCodes>200</expectedCodes>
         </test>
+        
+        <test ID="CreateBlackRookFragment1">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackRookFragment1</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackRookFragment">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="CreateBlackRookFragment2">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackRookFragment2</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackRookFragment2">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment2.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Bag of black chess pieces -->
+        <!-- (child of chess set box, sibling of chess board and bag -->
+        <!-- of white chess pieces, parents of black chess pieces) --> 
+        
+        <!--
+            This piece is created along with relations to:
+            * Its parent (the chess set box)
+            * One of its children (the black queen), created previously above
+        -->
+                
+        <test ID="CreateBagOfBlackChessPieces">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
+                <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
+                <var ID="childCSID">${CreateBlackQueen.CSID}</var>
+            </vars>
+        </test>
+        <test ID="ReadBagOfBlackChessPieces">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
 
 
-        <!-- Update one of the existing chess pieces, and add yet one more -->
-        <!-- hierarchical relationship, between that piece and another -->
-        <!-- existing CollectionObject. -->
+        <!-- Update one of the existing chess pieces, and add hierarchical -->
+        <!-- relationships between that piece and both its parent and child. -->
+        
+        <!--
+            This piece is updated along with adding relations to:
+            * Its parent (the bag of black chess pieces)
+            * Its children (black rook fragment1, black rook fragment2)
+        -->
         
         <test ID="UpdateBlackRootWithRelations">
             <method>PUT</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
-            <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
+            <filename>collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml</filename>
             <vars>
-                <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
-                <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
-                <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                <var ID="distinguishingFeatures">This black rook is nearly intact, save for two tiny fragments.</var>
+                <var ID="currentItemCSID">${CreateBlackRook.CSID}</var>
+                <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                <var ID="child1CSID">${CreateBlackRookFragment1.CSID}</var>
+                <var ID="child2CSID">${CreateBlackRookFragment2.CSID}</var>
             </vars>
             <expectedCodes>200</expectedCodes>
         </test>
         
         <test ID="ShowRelationsForBottomLevelItem">
             <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showRelations=true</uri>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
                 <vars>
-                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                    <var ID="blackRookFragment1CSID">${CreateBlackRookFragment1.CSID}</var>
                 </vars>
                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
             </response>
         
         <test ID="ShowSiblingsForBottomLevelItem">
             <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true</uri>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showSiblings=true</uri>
             <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
                 <vars>
-                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
-                    <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
+                    <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                    <var ID="blackRookFragment2CSID">${CreateBlackRookFragment2.CSID}</var>
                 </vars>
                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
             </response>
         
         <!-- Delete the records of relations to ChessSetBox, from its three children -->
                
-        <test ID="GetRelationsAsObjectForChessSetBox">
+        <test ID="GetRelationsToChessSetBoxAsObject">
             <method>GET</method>
             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
             <expectedCodes>200</expectedCodes>
         </test>
         <test ID="DeleteChildRelation1ToChessSetBox">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[1]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[1]/csid")}</uri>
         </test>
         <test ID="DeleteChildRelation2ToChessSetBox">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[2]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[2]/csid")}</uri>
         </test>
         <test ID="DeleteChildRelation3ToChessSetBox">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[3]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[3]/csid")}</uri>
         </test>
         
         <!-- Delete the records of relations to BagOfWhiteChessPieces, from its two children -->
         
-        <test ID="GetRelationsAsObjectForBagOfWhiteChessPieces">
+        <test ID="GetRelationsToBagOfWhiteChessPiecesAsObject">
             <method>GET</method>
             <uri>/cspace-services/relations?obj=${CreateBagOfWhiteChessPieces.CSID}</uri>
             <expectedCodes>200</expectedCodes>
         </test>
         <test ID="DeleteChildRelation1ToBagOfWhiteChessPieces">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[1]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
         </test>
         <test ID="DeleteChildRelation2ToBagOfWhiteChessPieces">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[2]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
         </test>
         
         <!-- Delete the records of relations to BagOfBlackChessPieces, from its two children -->
         
-        <test ID="GetRelationsAsObjectForBagOfBlackChessPieces">
+        <test ID="GetRelationsToBagOfBlackChessPiecesAsObject">
             <method>GET</method>
             <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
             <expectedCodes>200</expectedCodes>
         </test>
         <test ID="DeleteChildRelation1ToBagOfBlackChessPieces">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[1]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
         </test>
         <test ID="DeleteChildRelation2ToBagOfBlackChessPieces">
             <method>DELETE</method>
-            <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[2]/csid")}</uri>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
         </test>
         
+        <!-- Delete the records of a relation to BlackRook, from its teo children -->
+        
+        <test ID="GetRelationsToBlackRookAsObject">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateBlackRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="DeleteChildRelation1ToBlackRook">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[1]/csid")}</uri>
+        </test>
+         <test ID="DeleteChildRelation2ToBlackRook">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[2]/csid")}</uri>
+        </test>
+                       
     </testGroup>
     
 </xmlReplay>
@@ -9,9 +9,8 @@
     <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
                                xmlns:ns2="http://collectionspace.org/services/jaxb">
         
-        <!-- Create hierarchical relationships between the chess set box -->
-        <!-- and its three children: the chess board, and the bags of white -->
-        <!-- and black chess pieces -->
+        <!-- Create a hierarchical relationship between an item -->
+        <!-- and its parent -->
         
         <!-- 
              ${itemCSID} is a convention understood by the Relations service,
              It passes through, and then the service deals with it.
         -->
         <relation-list-item>
-            <predicate>hasBroader</predicate>
+            <!-- The item being created, above ... -->
             <subject>
                 <csid>${itemCSID}</csid>
                 <documentType>CollectionObject</documentType>
             </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
             <object>
                 <csid>${parentCSID}</csid>
                 <documentType>CollectionObject</documentType>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml
new file mode 100644 (file)
index 0000000..26fe850
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+
+    <ns2:collectionobjects_common
+        xmlns:ns2="http://collectionspace.org/services/collectionobject">
+        <objectNumber>${objectNumber}</objectNumber>
+    </ns2:collectionobjects_common>
+
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
+                               xmlns:ns2="http://collectionspace.org/services/jaxb">
+        
+        <!-- Create a hierarchical relationship between an item, -->
+        <!-- its parent, and one child -->
+        
+        <!-- 
+             ${itemCSID} is a convention understood by the Relations service,
+             which is replaced by the CSID of the item being created.  (This
+             applies to all items, including object and procedural records,
+             not just to authority item records).
+             
+             As such, ${itemCSID} does NOT get expanded by XmlReplay. 
+             It passes through, and then the service deals with it.
+        -->
+        
+        <!-- Create a relationship between this item and its parent -->
+        <relation-list-item>
+            <!-- The item being created, above ... -->
+            <subject>
+                <csid>${itemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
+            <object>
+                <csid>${parentCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Create a relationship between this item and a child -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <csid>${childCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: the item being created above -->
+            <object>
+                <csid>${itemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
+
+
@@ -11,8 +11,9 @@
                                xmlns:ns2="http://collectionspace.org/services/jaxb">
         
         <!--
-            Create a hierarchical relationships between the bag of 
-            black chess pieces, and the remaining piece it contains.
+            Create a hierarchical relationship between an item
+            and its parent, via an update that also adds a new field
+            value to the item itself.
         -->
        
         <relation-list-item>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml
new file mode 100644 (file)
index 0000000..b8c2620
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+
+    <ns2:collectionobjects_common
+        xmlns:ns2="http://collectionspace.org/services/collectionobject">
+        <objectNumber>${objectNumber}</objectNumber>
+        <distinguishingFeatures>${distinguishingFeatures}</distinguishingFeatures>
+    </ns2:collectionobjects_common>
+
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
+                               xmlns:ns2="http://collectionspace.org/services/jaxb">
+        
+        <!-- Create a hierarchical relationship between an item, -->
+        <!-- its parent, and its children -->
+
+        <!-- Create a relationship between this item and its parent -->
+        <relation-list-item>
+            <!-- The current item being updated above ... -->
+            <subject>
+                <csid>${currentItemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
+            <object>
+                <csid>${parentCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Create a relationship between this item and a child -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <csid>${child1CSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: i.e. the current item being updated above -->
+            <object>
+                <csid>${currentItemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- And to a second child -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <csid>${child2CSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: i.e. the current item being updated above -->
+            <object>
+                <csid>${currentItemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
+
+
index 82d417c3aa4e49b617356253f3576bd2960d0649..87e8937ee1790316e0b9236a396354dc33330ed9 100644 (file)
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
-                <csid>${blackRookCSID}</csid>
+                <csid>${blackRookFragment1CSID}</csid>
                 <documentType>CollectionObject</documentType>
             </subject>
             <object>
-                <csid>${bagOfBlackChessPiecesCSID}</csid>
+                <csid>${blackRookCSID}</csid>
                 <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
index 1bcc3bdc6d4fda9cbdee89e4a2cde0d9166b7b08..2f677441a35800f55d0447403594cd007f18ba6b 100644 (file)
@@ -4,24 +4,26 @@
     <!-- ignored here; we are interested only in the relations list below. -->
 
     <!--
-        Siblings of the black rook
-        1. black queen
+        Siblings of the black rook fragment 1
+        1. black rook fragment 2
     -->
     <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>
-            <subjectCsid>${blackQueenCSID}</subjectCsid>
-            <objectCsid>${bagOfBlackChessPiecesCSID}</objectCsid>
             <predicate>hasBroader</predicate>
             <subject>
-                <csid>${blackQueenCSID}</csid>
+                <csid>${blackRookFragment2CSID}</csid>
+                <documentType>CollectionObject</documentType>
             </subject>
             <object>
-                <csid>${bagOfBlackChessPiecesCSID}</csid>
+                <csid>${blackRookCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
+        
     </ns3:relations-common-list>
 </document>