serviceResult.error = msg;
serviceResult.failureReason = " : SYSTEM ERROR; ";
results.add(serviceResult);
+ //
+ // Fail fast
+ //
+ throw t;
}
}
if (Tools.isTrue(autoDeletePOSTS) && param_autoDeletePOSTS){
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
</auths>
-
- <testGroup ID="makeone" autoDeletePOSTS="true">
- <test ID="ac1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/acquisitions/</uri>
- <filename>acquisitions/ac1.xml</filename>
- </test>
+
+ <testGroup ID="makeone" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="ac1" auth="admin@core.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/acquisitions/</uri>
+ <filename>acquisitions/ac1.xml</filename>
+ </test>
<test ID="ac1get">
<method>GET</method>
<uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<label>acquisitions_common</label>
<filename>acquisitions/res/ac1.res.xml</filename>
- </response>
- </test>
- </testGroup>
+ </response>
+ </test>
+ </testGroup>
- <testGroup ID="testList" autoDeletePOSTS="true">
- <test ID="ac1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/acquisitions/</uri>
- <filename>acquisitions/ac1.xml</filename>
- </test>
-
- <test ID="ac1get">
+ <testGroup ID="testList" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="ac1">
+ <method>POST</method>
+ <uri>/cspace-services/acquisitions/</uri>
+ <filename>acquisitions/ac1.xml</filename>
+ </test>
+
+ <test ID="ac1get">
<method>GET</method>
<uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<label>acquisitions_common</label>
- <filename>acquisitions/res/ac1.res.xml</filename>
- </response>
- </test>
+ <filename>acquisitions/res/ac1.res.xml</filename>
+ </response>
+ </test>
+
+ <test ID="ac2">
+ <method>POST</method>
+ <uri>/cspace-services/acquisitions/</uri>
+ <filename>acquisitions/ac2.xml</filename>
+ </test>
- <test ID="ac2" auth="test">
- <method>POST</method>
- <uri>/cspace-services/acquisitions/</uri>
- <filename>acquisitions/ac2.xml</filename>
- </test>
-
<test ID="ac2get">
<method>GET</method>
<uri>/cspace-services/acquisitions/${ac2.CSID}</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<label>acquisitions_common</label>
- <filename>acquisitions/res/ac2.res.xml</filename>
- </response>
+ <filename>acquisitions/res/ac2.res.xml</filename>
+ </response>
</test>
<test ID="ac3list">
<method>GET</method>
<uri>/cspace-services/acquisitions/?sortBy=&pgNum=0&pgSz=10</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<label>acquisitions_common</label>
<filename>acquisitions/res/ac3list.res.xml</filename>
- </response>
+ </response>
</test>
-
+
</testGroup>
-
+
</xmlReplay>
-
-
testGroup ID="person" is not live. It works, but may not clean up correctly.
For now, use ID="updatePerson"
-->
- <testGroup ID="AuthRefs" autoDeletePOSTS="true">
+ <testGroup ID="AuthRefs" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<test ID="PersonAuth1" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/personauthorities/</uri>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
</test>
- <test ID="loanout1" auth="test">
+ <test ID="loanout1">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout2" auth="test">
+ <test ID="loanout2">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout3" auth="test">
+ <test ID="loanout3">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout4" auth="test">
+ <test ID="loanout4">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout5" auth="test">
+ <test ID="loanout5">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout6" auth="test">
+ <test ID="loanout6">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout7" auth="test">
+ <test ID="loanout7">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout8" auth="test">
+ <test ID="loanout8">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout9" auth="test">
+ <test ID="loanout9">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
</vars>
</test>
- <test ID="loanout10" auth="test">
+ <test ID="loanout10">
<method>POST</method>
<uri>/cspace-services/loansout/</uri>
<filename>authrefs/loanout.xml</filename>
For now, use ID="updatePerson"
-->
<testGroup ID="AuthRefsComplex" autoDeletePOSTS="true">
- <test ID="intake1" auth="test">
+ <test ID="intake1">
<method>POST</method>
<uri>/cspace-services/intakes/</uri>
<filename>authrefs/intake1.xml</filename>
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
- <!--
+ <!--
testGroup ID="person" is not live. It works, but may not clean up correctly.
For now, use ID="updatePerson"
-->
- <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/</uri>
- <filename>authrefs/newPersonAuthority.xml</filename>
- </test>
- <test ID="Person1">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- <filename>authrefs/newPerson1.xml</filename>
- </test>
- <test ID="Person2">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- <filename>authrefs/newPerson2.xml</filename>
- </test>
+ <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ <filename>authrefs/newPersonAuthority.xml</filename>
+ </test>
+ <test ID="Person1">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ <filename>authrefs/newPerson1.xml</filename>
+ </test>
+ <test ID="Person2">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ <filename>authrefs/newPerson2.xml</filename>
+ </test>
- <test ID="GetPerson1">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
- </test>
+ <test ID="GetPerson1">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+ </test>
- <test ID="GetPerson2">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
- </test>
+ <test ID="GetPerson2">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+ </test>
- <test ID="loanout1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansout/</uri>
- <filename>authrefs/loanout.xml</filename>
- <vars>
- <var ID="loannum">42</var>
- <var ID="person">${GetPerson1.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="loanout1">
+ <method>POST</method>
+ <uri>/cspace-services/loansout/</uri>
+ <filename>authrefs/loanout.xml</filename>
+ <vars>
+ <var ID="loannum">42</var>
+ <var ID="person">${GetPerson1.got("//refName")}</var>
+ </vars>
+ </test>
- <test ID="loanout2" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansout/</uri>
- <filename>authrefs/loanout.xml</filename>
- <vars>
- <var ID="loannum">102</var>
- <var ID="person">${GetPerson2.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="loanout2">
+ <method>POST</method>
+ <uri>/cspace-services/loansout/</uri>
+ <filename>authrefs/loanout.xml</filename>
+ <vars>
+ <var ID="loannum">102</var>
+ <var ID="person">${GetPerson2.got("//refName")}</var>
+ </vars>
+ </test>
- <test ID="getLoan1AuthRefs">
- <method>GET</method>
- <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/foo.res.xml</filename>
- </response>
- </test>
+ <test ID="getLoan1AuthRefs">
+ <method>GET</method>
+ <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/foo.res.xml</filename>
+ </response>
+ </test>
- <test ID="getPerson1RefObjs">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/refObjs.res.xml</filename>
- </response>
- </test>
+ <test ID="getPerson1RefObjs">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/refObjs.res.xml</filename>
+ </response>
+ </test>
- <test ID="OrganizationAuth1">
- <method>POST</method>
- <uri>/cspace-services/orgauthorities/</uri>
- <filename>authrefs/orgauthorities_common.xml</filename>
- </test>
-
- <test ID="Org1">
- <method>POST</method>
- <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>
- <filename>authrefs/organizations_common.xml</filename>
- <vars>
- <var ID="person1">${GetPerson1.got("//refName")}</var>
- <var ID="person2">${GetPerson2.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="OrganizationAuth1">
+ <method>POST</method>
+ <uri>/cspace-services/orgauthorities/</uri>
+ <filename>authrefs/orgauthorities_common.xml</filename>
+ </test>
- <test ID="getOrg1AuthRefs">
- <method>GET</method>
- <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/foo.res.xml</filename>
- </response>
- </test>
- </testGroup>
+ <test ID="Org1">
+ <method>POST</method>
+ <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>
+ <filename>authrefs/organizations_common.xml</filename>
+ <vars>
+ <var ID="person1">${GetPerson1.got("//refName")}</var>
+ <var ID="person2">${GetPerson2.got("//refName")}</var>
+ </vars>
+ </test>
+
+ <test ID="getOrg1AuthRefs">
+ <method>GET</method>
+ <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/foo.res.xml</filename>
+ </response>
+ </test>
+ </testGroup>
</xmlReplay>
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
- <!--
+ <!--
testGroup ID="person" is not live. It works, but may not clean up correctly.
For now, use ID="updatePerson"
-->
- <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/</uri>
- <filename>authrefs/newPersonAuthority.xml</filename>
- </test>
- <test ID="Person1">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- <filename>authrefs/newPerson1.xml</filename>
- </test>
+ <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ <filename>authrefs/newPersonAuthority.xml</filename>
+ </test>
+ <test ID="Person1">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ <filename>authrefs/newPerson1.xml</filename>
+ </test>
- <test ID="GetPerson1">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
- </test>
+ <test ID="GetPerson1">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+ </test>
- <test ID="loanin1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansin/</uri>
- <filename>authrefs/loanin.xml</filename>
- <vars>
- <var ID="loannum">42</var>
- <var ID="person">${GetPerson1.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="loanin1">
+ <method>POST</method>
+ <uri>/cspace-services/loansin/</uri>
+ <filename>authrefs/loanin.xml</filename>
+ <vars>
+ <var ID="loannum">42</var>
+ <var ID="person">${GetPerson1.got("//refName")}</var>
+ </vars>
+ </test>
- <test ID="getloanin1" auth="test">
- <method>GET</method>
- <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/foo.res.xml</filename>
- </response>
- </test>
+ <test ID="getloanin1">
+ <method>GET</method>
+ <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/foo.res.xml</filename>
+ </response>
+ </test>
- <test ID="getLoan1AuthRefs">
- <method>GET</method>
- <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/foo.res.xml</filename>
- </response>
- </test>
+ <test ID="getLoan1AuthRefs">
+ <method>GET</method>
+ <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/foo.res.xml</filename>
+ </response>
+ </test>
- <test ID="getPerson1RefObjs">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
- <response>
- <expected level="ADDOK" />
- <filename>authrefs/res/refObjs.res.xml</filename>
- </response>
- </test>
+ <test ID="getPerson1RefObjs">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>authrefs/res/refObjs.res.xml</filename>
+ </response>
+ </test>
- </testGroup>
+ </testGroup>
</xmlReplay>
<!-- This tests the UpdateObjectLocationBatchJob -->
<!-- in various invocation modes -->
- <testGroup ID="invocationModeSingle" autoDeletePOSTS="true">
+ <testGroup ID="invocationModeSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<!-- Tests with CollectionObject->Movement relations -->
<!-- This post of a batch job invocation request doesn't create a new record, -->
<!-- so we need to exclude it from the post-run auto-deletion of records. -->
- <test ID="invokeBatch" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatch" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
<expectedCodes>201</expectedCodes>
</test>
- <test ID="invokeBatchAfterAddingReverseRelation" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterAddingReverseRelation" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
</vars>
</test>
- <test ID="invokeBatchAfterSoftDeletingMovement" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterSoftDeletingMovement" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
</vars>
</test>
- <test ID="invokeBatchAfterSoftDeletingCollectionObject" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterSoftDeletingCollectionObject" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
</testGroup>
- <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true">
+ <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<test ID="createBatchRecordWithTiebreaker">
<method>POST</method>
<expectedCodes>200</expectedCodes>
</test>
- <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
<expectedCodes>200</expectedCodes>
</test>
- <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
<expectedCodes>200</expectedCodes>
</test>
- <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-single.xml</filename>
</testGroup>
- <testGroup ID="invocationModeList" autoDeletePOSTS="true">
+ <testGroup ID="invocationModeList" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<test ID="createBatchRecord">
<method>POST</method>
<expectedCodes>201</expectedCodes>
</test>
- <test ID="invokeBatchWithList" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchWithList" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-list.xml</filename>
</testGroup>
- <testGroup ID="invocationModeGroup" autoDeletePOSTS="true">
+ <testGroup ID="invocationModeGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<test ID="createBatchRecord">
<method>POST</method>
<expectedCodes>201</expectedCodes>
</test>
- <test ID="invokeBatchWithGroup" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchWithGroup" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-group.xml</filename>
<!-- These tests verify that updates to the computed current location values -->
<!-- in CollectionObject records succeed, even in tenants where Movement -->
<!-- records are configured to be versioned. See CSPACE-6188 for more details. -->
- <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true">
+ <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
<test ID="createBatchRecordInVersioningTenant" auth="admin@testsci.collectionspace.org">
<method>POST</method>
<expectedCodes>201</expectedCodes>
</test>
- <test ID="invokeBatchWithNoContext" auth="test" autoDeletePOSTS="false">
+ <test ID="invokeBatchWithNoContext" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
<filename>batch/batch-invoke-updateobjloc-nocontext.xml</filename>
<auth ID="bigbird@cspace.org">YmlnYmlyZEBjc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
</auths>
- <testGroup ID="testPermissionsAndRoles" autoDeletePOSTS="true">
+ <testGroup ID="testPermissionsAndRoles" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<!--
Setup accounts, roles, and permissions for tests.
-->
</test>
</testGroup>
- <testGroup ID="testSingle" autoDeletePOSTS="true">
- <test ID="TestCreateAndLinkLoanOutBatchJob" auth="test">
+ <testGroup ID="testSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="TestCreateAndLinkLoanOutBatchJob">
<method>POST</method>
<uri>/cspace-services/batch/</uri>
<filename>batch/TestCreateAndLinkLoanOutBatchJob.xml</filename>
</test>
- <test ID="createCollObj1" auth="test">
+ <test ID="createCollObj1">
<method>POST</method>
<uri>/cspace-services/collectionobjects/</uri>
<filename>batch/collObj1.xml</filename>
</test>
- <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+ <test ID="testInvokeSingle" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
<filename>batch/batch-invoke-single.xml</filename>
<var ID="CollObj1">${createCollObj1.CSID}</var>
</vars>
</test>
- <test ID="testInvokeList" auth="test" autoDeletePOSTS="false">
+ <test ID="testInvokeList" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
<filename>batch/batch-invoke-list.xml</filename>
<var ID="CollObj1">${createCollObj1.CSID}</var>
</vars>
</test>
- <test ID="testBadInvoke" auth="test" autoDeletePOSTS="false">
+ <test ID="testBadInvoke" autoDeletePOSTS="false">
<method>POST</method>
<expectedCodes>400</expectedCodes>
<uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
<var ID="CollObj1">${createCollObj1.CSID}</var>
</vars>
</test>
- <test ID="testInvokeEmptyList" auth="test" autoDeletePOSTS="false">
+ <test ID="testInvokeEmptyList" autoDeletePOSTS="false">
<method>POST</method>
<expectedCodes>400</expectedCodes>
<uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
<var ID="CollObj1">${createCollObj1.CSID}</var>
</vars>
</test>
- <test ID="testFilteredList1" auth="test">
+ <test ID="testFilteredList1">
<method>GET</method>
<uri>/cspace-services/batch?doctype=CollectionObject&inv=single</uri>
</test>
- <test ID="testFilteredList2" auth="test">
+ <test ID="testFilteredList2">
<method>GET</method>
<uri>/cspace-services/batch?doctype=Intake&inv=group</uri>
</test>
<auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
</auths>
- <testGroup ID="advSearchCommonSchema" autoDeletePOSTS="true">
+ <testGroup ID="advSearchCommonSchema" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
<!-- Create a new CollectionObject record with a common part. -->
<test ID="co1" auth="admin@testsci.collectionspace.org">
<method>POST</method>
</test>
</testGroup>
- <testGroup ID="advSearchExtensionSchema" autoDeletePOSTS="true">
+ <testGroup ID="advSearchExtensionSchema" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
<!-- Create a new CollectionObject record with an extension schema part -->
<test ID="co2" auth="admin@testsci.collectionspace.org">
<method>POST</method>
<xmlReplay>
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
- <auth ID="admin@core.collectionspace.org">59PnafP1k9rcuGNMxbCfyQ3TphxKBqecsJI2Yv5vrms=</auth>
+ <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
<auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>
+ <!-- A bogus set of credentials -->
</auths>
-
- <!-- ================================================================================ -->
-
- <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">
- <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->
- <test ID="dimension1" auth="bigbird2010">
+
+ <!-- ================================================================================ -->
+
+ <testGroup ID="dimensionTestGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="dimension1" auth="bigbird2010">
<expectedCodes>401,403</expectedCodes>
<method>POST</method>
<uri>/cspace-services/dimensions/</uri>
- <part>
- <label>dimensions_common</label>
- <filename>dimension/1.xml</filename>
- </part>
+ <filename>dimension/1.xml</filename>
</test>
- <!-- should succeed on auth="test" since test is admin user. -->
- <test ID="dimension2" auth="admin@core.collectionspace.org">
- <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
- <expectedCodes>201,403</expectedCodes>
+ <test ID="dimension2" auth="admin@core.collectionspace.org">
+ <expectedCodes>201</expectedCodes>
<method>POST</method>
<uri>/cspace-services/dimensions/</uri>
- <part>
- <label>dimensions_common</label>
- <filename>dimension/1.xml</filename>
- </part>
+ <filename>dimension/1.xml</filename>
</test>
-
-
</testGroup>
- <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true">
- <!-- should succeed on auth="test" since test is admin user. -->
- <test ID="dimPOST" auth="admin@core.collectionspace.org">
- <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
- <expectedCodes>201</expectedCodes>
- <method>POST</method>
- <uri>/cspace-services/dimensions/</uri>
- <part>
- <label>dimensions_common</label>
- <filename>dimension/1.xml</filename>
- </part>
- </test>
+ <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="dimPOST" auth="admin@core.collectionspace.org">
+ <expectedCodes>201</expectedCodes>
+ <method>POST</method>
+ <uri>/cspace-services/dimensions/</uri>
+ <filename>dimension/1.xml</filename>
+ </test>
- <test ID="dimGET" auth="admin@core.collectionspace.org">
- <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
+ <test ID="dimGET" auth="admin@core.collectionspace.org">
<method>GET</method>
<uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
</test>
- <test ID="dimPUT" auth="admin@core.collectionspace.org">
+ <test ID="dimPUT" auth="admin@core.collectionspace.org">
<method>PUT</method>
<uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
- <part>
- <label>dimensions_common</label>
- <filename>dimension/2-put.xml</filename>
- </part>
+ <filename>dimension/2-put.xml</filename>
</test>
- <test ID="dimGET2" auth="admin@core.collectionspace.org">
+ <test ID="dimGET2" auth="admin@core.collectionspace.org">
<method>GET</method>
<uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
</test>
-
-
- </testGroup>
+ </testGroup>
</xmlReplay>
-
-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document name="dimensions">
- <ns2:dimensions_common
- xmlns:ns2="http://collectionspace.org/services/dimension"
- xmlns:ns3="http://collectionspace.org/services/jaxb">
- <dimension>dimensionType-1288727556164</dimension>
- <value>entryNumber-1288727556164</value>
- <valueDate>entryDate-1288727556164</valueDate>
- </ns2:dimensions_common>
+ <ns2:dimensions_common xmlns:ns2="http://collectionspace.org/services/dimension" xmlns:ns3="http://collectionspace.org/services/jaxb">
+ <dimension>dimensionType-1288727556164</dimension>
+ <value>entryNumber-1288727556164</value>
+ <valueDate>entryDate-1288727556164</valueDate>
+ </ns2:dimensions_common>
</document>
-
<!-- These tests verify that updates to the computed current location values -->
<!-- in CollectionObject records succeed, even in tenants where Movement -->
<!-- records are configured to be versioned. See CSPACE-6171 for more details. -->
- <testGroup ID="updateObjectLocationOnMoveInVersioningEnabledTenant" autoDeletePOSTS="true">
+ <testGroup ID="updateObjectLocationOnMoveInVersioningEnabledTenant" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
<test ID="createCollectionObjectInVersioningTenant" auth="admin@testsci.collectionspace.org">
<method>POST</method>
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
</auths>
-
- <testGroup ID="makeone" autoDeletePOSTS="false">
- <test ID="ac1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansin/</uri>
- <part>
- <label>loansin_common</label>
- <filename>loanin/li1.xml</filename>
- </part>
- </test>
- </testGroup>
-
- <testGroup ID="cleanup" autoDeletePOSTS="true">
- <test ID="ac1" auth="test">
- <method>DELETE</method>
- <uri>/cspace-services/loansin/8080b6b8-393a-4e8a-b823</uri>
- </test>
- </testGroup>
-
+ <testGroup ID="makeone" autoDeletePOSTS="true">
+ <test ID="ac1">
+ <method>POST</method>
+ <uri>/cspace-services/loansin/</uri>
+ <part>
+ <label>loansin_common</label>
+ <filename>loanin/li1.xml</filename>
+ </part>
+ </test>
+ </testGroup>
</xmlReplay>
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
</auths>
-
- <testGroup ID="makeone" autoDeletePOSTS="false">
- <test ID="loanout1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansout/</uri>
- <filename>loanout/1.xml</filename>
- </test>
+
+ <testGroup ID="makeone" autoDeletePOSTS="true">
+ <test ID="loanout1">
+ <method>POST</method>
+ <uri>/cspace-services/loansout/</uri>
+ <filename>loanout/1.xml</filename>
+ </test>
</testGroup>
</xmlReplay>
-
-
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
</auths>
-
+
<!-- ============= authrefs ============================================== -->
<!-- run this group with autoDeletePOSTS="false" and then you can hit
http://nightly.collectionspace.org:8180/cspace-services/objectexit/
then grab a CSID, and paste it in here:
http://nightly.collectionspace.org:8180/cspace-services/objectexit/d781aed4-2e2c-45e2-ad8d/authorityrefs
-->
- <testGroup ID="authrefs" autoDeletePOSTS="false">
+ <testGroup ID="authrefs" autoDeletePOSTS="true">
<test ID="oe9">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/</uri>
- <part>
- <label>personauthorities_common</label>
- <filename>objectexit/oe9.xml</filename>
- </part>
- </test>
- <test ID="oe11">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
- <part>
- <label>persons_common</label>
- <filename>objectexit/oe11.xml</filename>
- </part>
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ <filename>objectexit/oe9.xml</filename>
+ </test>
+ <test ID="oe11">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+ <filename>objectexit/oe11.xml</filename>
</test>
<test ID="oe15">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe15.xml</filename>
- </part>
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <filename>objectexit/oe15.xml</filename>
+ </test>
+ <test ID="listAuthRefs">
+ <method>GET</method>
+ <uri>/cspace-services/objectexit/${oe15.CSID}/authorityrefs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>objectexit/res/authrefs-listAuthrefs.res.xml</filename>
+ </response>
</test>
</testGroup>
-
+
<testGroup ID="makeone" autoDeletePOSTS="false">
- <test ID="oe1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <filename>objectexit/oe1.xml</filename>
- </test>
+ <test ID="oe1">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <filename>objectexit/oe1.xml</filename>
+ </test>
<test ID="oe2">
<method>GET</method>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
<response>
- <expected level="ADDOK" />
+ <expected level="ADDOK"></expected>
<filename>objectexit/res/oe2.res.xml</filename>
<label>objectexit_common</label>
- </response>
+ </response>
+ </test>
+ <test ID="cleanup">
+ <method>DELETE</method>
+ <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
</test>
- <test ID="cleanup" auth="test">
- <method>DELETE</method>
- <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
- </test>
</testGroup>
-
+
<testGroup ID="testStartName" autoDeletePOSTS="false">
- <test ID="oe1x" auth="test">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <filename>objectexit/oe1.xml</filename>
- </test>
+ <test ID="oe1x">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <filename>objectexit/oe1.xml</filename>
+ </test>
<test ID="oe2x">
<method>GET</method>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
<response>
- <expected level="ADDOK" />
+ <expected level="ADDOK"></expected>
<filename>objectexit/res/oe2.res.xml</filename>
<!-- startElement wins over partName. partName adorns the partName with /document/*[local-name()='$partName'] where $partName is the element value. -->
<startElement>/document/*[local-name()='objectexit_common']</startElement>
- </response>
+ </response>
</test>
</testGroup>
-
+
<testGroup ID="checkList" autoDeletePOSTS="true">
- <test ID="oe35" auth="test">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <vars>
- <var ID="exitNumber">checkList-1234</var>
+ <test ID="oe35">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <vars>
+ <var ID="exitNumber">checkList-1234</var>
</vars>
<filename>objectexit/oe35.xml</filename>
</test>
<method>GET</method>
<uri>/cspace-services/objectexit/</uri>
<response>
- <expected level="ADDOK" />
+ <expected level="ADDOK"></expected>
<filename>objectexit/res/oe35.res.xml</filename>
<vars>
- <var ID="targetCSID">${oe35.CSID}</var>
- </vars>
+ <var ID="targetCSID">${oe35.CSID}</var>
+ </vars>
<!--
Look for one <list-item> with the <exitNumber> that
we set in the POST, and see if it is in the response
-->
<startElement>//list-item[./exitNumber='checkList-1234']</startElement>
- </response>
+ </response>
</test>
</testGroup>
<testGroup ID="cleanup" autoDeletePOSTS="true">
- <test ID="oe1" auth="test">
- <method>DELETE</method>
- <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
- </test>
- <test ID="oe1" auth="test">
- <method>DELETE</method>
- <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
- </test>
- <test ID="oe1" auth="test">
- <method>DELETE</method>
- <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
- </test>
+ <test ID="oe1">
+ <method>DELETE</method>
+ <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
+ </test>
+ <test ID="oe1">
+ <method>DELETE</method>
+ <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
+ </test>
+ <test ID="oe1">
+ <method>DELETE</method>
+ <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
+ </test>
</testGroup>
-
+
<testGroup ID="domwalk" autoDeletePOSTS="false">
- <test ID="oe1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe1.xml</filename>
- </part>
- </test>
+ <test ID="oe1">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe1.xml</filename>
+ </part>
+ </test>
<test ID="oe2">
<method>GET</method>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<label>objectexit_common</label>
<filename>objectexit/res/oe2.res.xml</filename>
- </response>
+ </response>
</test>
</testGroup>
<testGroup ID="repeat" autoDeletePOSTS="true">
- <test ID="oeRepeat" auth="admin@core.collectionspace.org">
+ <test ID="oeRepeat" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/objectexit/</uri>
<part>
<!-- ================================================================================ -->
- <testGroup ID="CRUDL" autoDeletePOSTS="true">
- <test ID="oe1" auth="admin@core.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe1.xml</filename>
- </part>
- </test>
+ <testGroup ID="CRUDL" autoDeletePOSTS="true">
+ <test ID="oe1" auth="admin@core.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe1.xml</filename>
+ </part>
+ </test>
<test ID="oe2">
<method>GET</method>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
<response>
<label>objectexit_common</label>
<filename>objectexit/res/oe2.res.xml</filename>
- </response>
+ </response>
</test>
<test ID="oe3">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe3.xml</filename>
- </part>
- </test>
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe3.xml</filename>
+ </part>
+ </test>
<test ID="oe4">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe4.xml</filename>
- </part>
- </test>
- <test ID="oe5">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe5.xml</filename>
- </part>
- </test>
- <!--
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe4.xml</filename>
+ </part>
+ </test>
+ <test ID="oe5">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe5.xml</filename>
+ </part>
+ </test>
+ <!--
<test ID="oe6">
<method>GET</method>
<uri>/cspace-services/objectexit/</uri>
<filename>objectexit/res/oe6.res.xml</filename>
</response>
-->
- <!-- response>oe6.res.xml</response -->
- <!--response elements will need parts, too, e.g. personauthorities_common -->
- <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->
+ <!-- response>oe6.res.xml</response -->
+ <!--response elements will need parts, too, e.g. personauthorities_common -->
+ <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->
<!--
</test>
-->
- <test ID="oe7">
+ <test ID="oe7">
<method>GET</method>
<uri>/cspace-services/objectexit/9223372036854775807</uri>
<expectedCodes>404</expectedCodes>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
<reponse>oe8.res.xml</reponse>
</test>
- <test ID="oe9">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/</uri>
- <part>
- <label>personauthorities_common</label>
- <filename>objectexit/oe9.xml</filename>
- </part>
- </test>
- <test ID="oe10">
+ <test ID="oe9">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ <part>
+ <label>personauthorities_common</label>
+ <filename>objectexit/oe9.xml</filename>
+ </part>
+ </test>
+ <test ID="oe10">
<method>GET</method>
<uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
</test>
-
+
<test ID="oe11">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
- <part>
- <label>persons_common</label>
- <filename>objectexit/oe11.xml</filename>
- </part>
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+ <part>
+ <label>persons_common</label>
+ <filename>objectexit/oe11.xml</filename>
+ </part>
</test>
<test ID="oe12">
<method>GET</method>
<uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
</test>
<test ID="oe13">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
- <part>
- <label>persons_common</label>
- <filename>objectexit/oe13.xml</filename>
- </part>
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+ <part>
+ <label>persons_common</label>
+ <filename>objectexit/oe13.xml</filename>
+ </part>
</test>
<test ID="oe14">
<method>GET</method>
<uri>/cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID}</uri>
</test>
<test ID="oe15">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe15.xml</filename>
- </part>
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe15.xml</filename>
+ </part>
</test>
<test ID="oe16">
<method>GET</method>
<method>DELETE</method>
<uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
</test>
-
+
<test ID="oe19">
<method>DELETE</method>
<uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID}</uri>
<uri>/cspace-services/objectexit/${oe1.CSID}</uri>
</test>
<test ID="oe23">
- <method>PUT</method>
- <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe23.xml</filename>
- </part>
+ <method>PUT</method>
+ <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe23.xml</filename>
+ </part>
</test>
<test ID="oe24">
<method>DELETE</method>
<uri>/cspace-services/objectexit/9223372036854775807</uri>
<expectedCodes>404</expectedCodes>
</test>
- <test ID="oe26">
- <method>PUT</method>
- <uri>/cspace-services/objectexit/9223372036854775807</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe23.xml</filename><!-- won't be found, so just re-using older post file as payload.-->
- </part>
- <expectedCodes>404</expectedCodes>
+ <test ID="oe26">
+ <method>PUT</method>
+ <uri>/cspace-services/objectexit/9223372036854775807</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe23.xml</filename>
+ <!-- won't be found, so just re-using older post file as payload.-->
+ </part>
+ <expectedCodes>404</expectedCodes>
</test>
<test ID="oe27">
<method>GET</method>
<uri>/cspace-services/objectexit/${oe5.CSID}</uri>
</test>
- </testGroup>
+ </testGroup>
<!-- =========== domlist Walk a DOM ================================================ -->
<testGroup ID="domlist" autoDeletePOSTS="true">
- <test ID="oe1" auth="admin@core.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe1.xml</filename>
- </part>
- </test>
+ <test ID="oe1" auth="admin@core.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe1.xml</filename>
+ </part>
+ </test>
<test ID="oe3">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe3.xml</filename>
- </part>
- </test>
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe3.xml</filename>
+ </part>
+ </test>
<test ID="oe4">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe4.xml</filename>
- </part>
- </test>
- <test ID="oe5">
- <method>POST</method>
- <uri>/cspace-services/objectexit/</uri>
- <part>
- <label>objectexit_common</label>
- <filename>objectexit/oe5.xml</filename>
- </part>
- </test>
- <test ID="oe6">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe4.xml</filename>
+ </part>
+ </test>
+ <test ID="oe5">
+ <method>POST</method>
+ <uri>/cspace-services/objectexit/</uri>
+ <part>
+ <label>objectexit_common</label>
+ <filename>objectexit/oe5.xml</filename>
+ </part>
+ </test>
+ <test ID="oe6">
<method>GET</method>
<uri>/cspace-services/objectexit/</uri>
<response>
- <expected level="TEXT" />
+ <expected level="TEXT"></expected>
<filename>objectexit/res/oe6.res.xml</filename>
- </response>
+ </response>
</test>
</testGroup>
-
+
</xmlReplay>
-
-
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>owenCurOwner</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Owen the Cur</foreName><surName>Owner</surName></ns2:persons_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+ <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+ <shortIdentifier>owenCurOwner</shortIdentifier>
+ <foreName>Owen the oe11</foreName>
+ <surName>Owneroe11</surName>
+ <personTermGroupList>
+ <personTermGroup>
+ <termName>John Wayneoe11</termName>
+ <termPrefForLang>false</termPrefForLang>
+ <termDisplayName>John Wayneoe11</termDisplayName>
+ <foreName>oe11forename</foreName>
+ <surName>oe11surname</surName>
+ </personTermGroup>
+ </personTermGroupList>
+ </ns2:persons_common>
+</document>
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor><exitDate>exitDate-1290026474563</exitDate><exitNumber>exitNumber-1290026474563</exitNumber></ns2:objectexit_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="objectexit">
+ <ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb">
+ <depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor>
+ <exitDate>exitDate-1290026474563</exitDate>
+ <exitNumber>exitNumber-1290026474563</exitNumber>
+ </ns2:objectexit_common>
+</document>
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><displayName>ObjectexitPersonAuth</displayName><shortIdentifier>ObjectexitPersonAuth</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName><vocabType>PersonAuthority</vocabType></ns2:personauthorities_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+ <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+ <displayName>ObjectexitPersonAuth</displayName>
+ <shortIdentifier>ObjectexitPersonAuth</shortIdentifier>
+ </ns2:personauthorities_common>
+</document>
--- /dev/null
+<ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref">
+ <pageNum>0</pageNum>
+ <pageSize>40</pageSize>
+ <itemsInPage>1</itemsInPage>
+ <totalItems>1</totalItems>
+ <authority-ref-item>
+ <sourceField>objectexit_common:depositor</sourceField>
+ <refName>
+ urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)
+ </refName>
+ <authDisplayName>ObjectexitPersonAuth</authDisplayName>
+ <uri>
+ /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)
+ </uri>
+ </authority-ref-item>
+</ns3:authority-ref-list>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="persons">
+ <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <!-- Delete all existing relationships. -->
+ </ns3:relations-common-list>
+</document>
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
- <!--
+ <!--
testGroup ID="person" is not live. It works, but may not clean up correctly.
For now, use ID="updatePerson"
-->
- <testGroup ID="person" autoDeletePOSTS="true">
+ <testGroup ID="person" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
<test ID="PersonAuth1" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/personauthorities/</uri>
<filename>person/personauthorities_common.xml</filename>
<vars>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
</vars>
</test>
<test ID="Person1">
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor1</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor1</var>
+ <var ID="termDisplayNameSuffix">actor1</var>
</vars>
</test>
<test ID="Person2">
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor2</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor2</var>
+ <var ID="termDisplayNameSuffix">actor2</var>
</vars>
</test>
<test>
<method>GET</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)</uri>
</test>
-
<test>
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
</test>
-
- <test ID="relatePersons" auth="test">
- <method>POST</method>
- <uri>/cspace-services/relations/</uri>
- <filename>relation/r-1.xml</filename>
- <vars>
+ <test ID="relatePersons">
+ <method>POST</method>
+ <uri>/cspace-services/relations/</uri>
+ <filename>relation/r-1.xml</filename>
+ <vars>
<var ID="subjectCsid">${Person1.CSID}</var>
<var ID="objectCsid">${Person2.CSID}</var>
<var ID="subjectDocumentType">Persons</var>
<var ID="objectDocumentType">Persons</var>
<var ID="relationshipType">hasBroader</var>
- </vars>
- </test>
-
- <test ID="relatePersonsInverse" auth="test">
- <method>POST</method>
- <uri>/cspace-services/relations/</uri>
- <filename>relation/r-1.xml</filename>
- <vars>
- <!-- Person2 and Person1 are switched in this record.
+ </vars>
+ </test>
+ <test ID="relatePersonsInverse">
+ <method>POST</method>
+ <uri>/cspace-services/relations/</uri>
+ <filename>relation/r-1.xml</filename>
+ <vars>
+ <!-- Person2 and Person1 are switched in this record.
Ultimately we don't want any hasNarrower actually stored.
-->
<var ID="subjectCsid">${Person2.CSID}</var>
<var ID="subjectDocumentType">Persons</var>
<var ID="objectDocumentType">Persons</var>
<var ID="relationshipType">hasNarrower</var>
- </vars>
- </test>
-
- </testGroup>
-
- <testGroup ID="addOnePerson" autoDeletePOSTS="false">
+ </vars>
+ </test>
+ </testGroup>
+
+ <testGroup ID="addOnePerson" autoDeletePOSTS="false">
<test ID="Person1">
+ <expectedCodes>404</expectedCodes>
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common_w_relations.xml</filename>
<vars>
- <!--<var ID="inAuthority">${PersonAuth1.CSID}</var>-->
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
</vars>
</test>
-
- </testGroup>
-
- <testGroup ID="updatePerson" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+ </testGroup>
+ <testGroup ID="updatePerson" autoDeletePOSTS="true">
+ <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/personauthorities/</uri>
<filename>person/personauthorities_common.xml</filename>
<vars>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
</vars>
</test>
-
<test ID="Person1">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
</vars>
</test>
-
<test ID="PersonParent">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorParent</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorParent</var>
</vars>
</test>
-
<test ID="PersonChild">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild</var>
</vars>
</test>
-
<test ID="PersonChild2">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild2</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild2</var>
</vars>
</test>
-
-
- <test ID="PersonPUT_1p2c">
+ <test ID="PersonPUT_1p2c">
<method>PUT</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
<filename>person/persons_common_w_relations.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="myCSID">${Person1.CSID}</var>
- <var ID="parentCSID">${PersonParent.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="myCSID">${Person1.CSID}</var>
+ <var ID="parentCSID">${PersonParent.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
</vars>
</test>
-
<test ID="GETPersonPUT_1p2c">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
<test ID="GETPersonPUT_siblings">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
</test>
-
-
- <test ID="PersonPUT_1p">
+ <test ID="PersonPUT_1p">
<method>PUT</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
<filename>person/persons_common_w_relations_2.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="myCSID">${Person1.CSID}</var>
- <var ID="parentCSID">${PersonParent.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="myCSID">${Person1.CSID}</var>
+ <var ID="parentCSID">${PersonParent.CSID}</var>
</vars>
</test>
-
<test ID="GETPersonPUT_1p">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
-
<test ID="PersonPUT_1p1c">
<method>PUT</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
<filename>person/persons_common_w_relations.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="myCSID">${Person1.CSID}</var>
- <var ID="parentCSID">${PersonParent.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="myCSID">${Person1.CSID}</var>
+ <var ID="parentCSID">${PersonParent.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
</vars>
</test>
-
<test ID="GETPersonPUT_1p1c">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
- <test ID="PersonPUT_2c">
+ <test ID="PersonPUT_2c">
<method>PUT</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
<filename>person/persons_common_w_relations_3.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="myCSID">${Person1.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
- <var ID="child2CSID">${PersonChild2.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="myCSID">${Person1.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="child2CSID">${PersonChild2.CSID}</var>
</vars>
</test>
-
<test ID="GETPersonPUT_2c">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
- </testGroup>
-
- !-- ========================= POST a person ===================================================== -->
-
- <testGroup ID="postPerson" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+ <test ID="Person1DeleteAllRels">
+ <method>PUT</method>
+ <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+ <filename>person/generic_persons_common_delete_all_relations_PUT.xml</filename>
+ </test>
+ </testGroup>
+
+ <!-- ========================= POST a person ===================================================== -->
+ <testGroup ID="postPerson" autoDeletePOSTS="true">
+ <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/personauthorities/</uri>
<filename>person/personauthorities_common.xml</filename>
<vars>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
</vars>
</test>
-
<test ID="PersonParent">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorParent</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorParent</var>
</vars>
</test>
-
<test ID="PersonChild">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild</var>
- <var ID="termDisplayNameSuffix">actorChild1</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild</var>
+ <var ID="termDisplayNameSuffix">actorChild1</var>
</vars>
</test>
-
<test ID="PersonChild2">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild2</var>
- <var ID="termDisplayNameSuffix">actorChild2</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild2</var>
+ <var ID="termDisplayNameSuffix">actorChild2</var>
</vars>
</test>
-
<test ID="PersonChild3">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild3</var>
- <var ID="termDisplayNameSuffix">actorChild3</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild3</var>
+ <var ID="termDisplayNameSuffix">actorChild3</var>
</vars>
</test>
-
<test ID="Person1">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common_w_relations_POST.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <!--var ID="targetCSID">${itemCSID}</var-->
- <var ID="parentCSID">${PersonParent.CSID}</var>
- <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
- <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
- <var ID="child2CSID">${PersonChild2.CSID}</var>
- <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
- <var ID="child3CSID">${PersonChild3.CSID}</var>
- <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <!--var ID="targetCSID">${itemCSID}</var-->
+ <var ID="parentCSID">${PersonParent.CSID}</var>
+ <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+ <var ID="child2CSID">${PersonChild2.CSID}</var>
+ <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+ <var ID="child3CSID">${PersonChild3.CSID}</var>
+ <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
</vars>
</test>
-
- <test ID="GETpostPerson">
+ <test ID="GETpostPerson">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
<test ID="GETpostPerson_siblings">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
<response>
- <expected level="ADDOK" />
- <filename>person/res/GETpostPerson_siblings.res.xml</filename>
- <vars>
- <var ID="personCSID">${Person1.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
- <var ID="child2CSID">${PersonChild2.CSID}</var>
- <var ID="child3CSID">${PersonChild3.CSID}</var>
- <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>
- <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>
- </vars>
- <startElement>/document/*[local-name()='relations-common-list']</startElement>
- </response>
- </test>
-
+ <expected level="ADDOK"></expected>
+ <filename>person/res/GETpostPerson_siblings.res.xml</filename>
+ <vars>
+ <var ID="personCSID">${Person1.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="child2CSID">${PersonChild2.CSID}</var>
+ <var ID="child3CSID">${PersonChild3.CSID}</var>
+ <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>
+ <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>
+ </vars>
+ <startElement>/document/*[local-name()='relations-common-list']</startElement>
+ </response>
+ </test>
<test ID="GETpostPerson_allRelations">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
<response>
- <expected level="ADDOK" />
- <filename>person/res/showAllRelations.res.xml</filename>
- <!-- NOTE: vars are referenced in showAllRelations.res.xml
+ <expected level="ADDOK"></expected>
+ <filename>person/res/showAllRelations.res.xml</filename>
+ <!-- NOTE: vars are referenced in showAllRelations.res.xml
from tests in this test group, e.g.
PersonParent.CSID :: ${PersonParent.CSID}
These vars are all in the expression context while this group is active,
because we hang onto all ServiceResult objects for the duration of the group,
and ServiceObjects keep their vars.
-->
- <startElement>/document/*[local-name()='relations-common-list']</startElement>
- </response>
-
- </test>
-
- <test ID="relationsGET">
- <method>GET</method>
- <uri>/cspace-services/relations/</uri>
- </test>
-
- <test ID="relations_sbj">
- <method>GET</method>
- <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>
- </test>
-
- <test ID="relations_obj">
- <method>GET</method>
- <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>
- </test>
-
- </testGroup>
-
- <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+ <startElement>/document/*[local-name()='relations-common-list']</startElement>
+ </response>
+ </test>
+ <test ID="relationsGET">
+ <method>GET</method>
+ <uri>/cspace-services/relations/</uri>
+ </test>
+ <test ID="relations_sbj">
+ <method>GET</method>
+ <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>
+ </test>
+ <test ID="relations_obj">
+ <method>GET</method>
+ <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>
+ </test>
+ <test ID="Person1DeleteAllRels">
+ <method>PUT</method>
+ <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+ <filename>person/generic_persons_common_delete_all_relations_PUT.xml</filename>
+ </test>
+ </testGroup>
+ <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">
+ <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
<method>POST</method>
<uri>/cspace-services/personauthorities/</uri>
<filename>person/personauthorities_common.xml</filename>
<vars>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
</vars>
</test>
-
<test ID="PersonParent">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorParent</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorParent</var>
</vars>
</test>
-
-
<test ID="PersonChild">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild</var>
</vars>
</test>
-
<test ID="PersonChild2">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild2</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild2</var>
</vars>
</test>
-
<test ID="PersonChild3">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActorChild3</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActorChild3</var>
</vars>
</test>
-
-
<test ID="Person1">
<method>POST</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
<filename>person/persons_common_w_relations_POST.xml</filename>
<vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="parentCSID">${PersonParent.CSID}</var>
- <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
- <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
- <var ID="child2CSID">${PersonChild2.CSID}</var>
- <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
- <var ID="child3CSID">${PersonChild3.CSID}</var>
- <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="parentCSID">${PersonParent.CSID}</var>
+ <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+ <var ID="child2CSID">${PersonChild2.CSID}</var>
+ <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+ <var ID="child3CSID">${PersonChild3.CSID}</var>
+ <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
</vars>
</test>
-
- <test ID="GETpostPerson">
+ <test ID="GETpostPerson">
<method>GET</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
- <test ID="GETPersonAuthorityList">
+ <test ID="GETPersonAuthorityList">
<method>GET</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
</test>
-
- <test ID="Person1DeleteRels">
- <method>PUT</method>
- <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
- <filename>person/persons_common_delete_relations_PUT.xml</filename>
- <vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- <var ID="childCSID">${PersonChild.CSID}</var>
- <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
- </vars>
- </test>
-
- <test ID="GETPerson_afterDeleteOneChild">
+ <test ID="Person1DeleteRels">
+ <method>PUT</method>
+ <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+ <filename>person/persons_common_delete_relations_PUT.xml</filename>
+ <vars>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ <var ID="childCSID">${PersonChild.CSID}</var>
+ <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+ </vars>
+ </test>
+ <test ID="GETPerson_afterDeleteOneChild">
<method>GET</method>
<uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
-
- <test ID="Person1DeleteAllRels">
- <method>PUT</method>
- <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
- <filename>person/persons_common_delete_all_relations_PUT.xml</filename>
- <vars>
- <var ID="inAuthority">${PersonAuth1.CSID}</var>
- <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
- <var ID="shortIdentifier">johnWayneActor</var>
- </vars>
- </test>
-
- <test ID="GETPerson_afterDeleteAllRelations">
+ <test ID="Person1DeleteAllRels">
+ <method>PUT</method>
+ <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+ <filename>person/persons_common_delete_all_relations_PUT.xml</filename>
+ <vars>
+ <var ID="inAuthority">${PersonAuth1.CSID}</var>
+ <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+ <var ID="shortIdentifier">johnWayneActor</var>
+ </vars>
+ </test>
+ <test ID="GETPerson_afterDeleteAllRelations">
<method>GET</method>
<uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
</test>
-
-
-
</testGroup>
-
</xmlReplay>
--- /dev/null
+<ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref">
+ <pageNum>0</pageNum>
+ <pageSize>40</pageSize>
+ <itemsInPage>1</itemsInPage>
+ <totalItems>1</totalItems>
+ <authority-ref-item>
+ <sourceField>objectexit_common:depositor</sourceField>
+ <refName>
+ urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)
+ </refName>
+ <authDisplayName>ObjectexitPersonAuth</authDisplayName>
+ <uri>
+ /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)
+ </uri>
+ </authority-ref-item>
+</ns3:authority-ref-list>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
- <!-- Authenticate into the testsci tenant for extension testing -->
- <auths default="admin@testsci.collectionspace.org">
- <auth ID="admin@testsci.collectionspace.org"
- >YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- </auths>
+ <!-- Authenticate into the testsci tenant for extension testing -->
+ <auths default="admin@testsci.collectionspace.org">
+ <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+ </auths>
- <!--
+ <!--
testGroup ID="person" is not live. It works, but may not clean up correctly.
For now, use ID="updatePerson"
-->
- <testGroup ID="person" autoDeletePOSTS="true">
- <test ID="PersonAuth1" auth="admin@testsci.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/</uri>
- <filename>person/personauthorities_common.xml</filename>
- <vars>
- <var ID="authShortIdentifier">TestPersonAuthority</var>
- </vars>
- </test>
- <test ID="Person1">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- <filename>person/persons_common_and_testsci.xml</filename>
- <vars>
- <var ID="shortIdentifier">johnWayneActor1</var>
- <var ID="foreName">John</var>
- <var ID="surName">Wayne</var>
- <var ID="entityType">Actor</var>
- </vars>
- </test>
- <test ID="Person2">
- <method>POST</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- <filename>person/persons_common_and_testsci.xml</filename>
- <vars>
- <var ID="shortIdentifier">billyBob1</var>
- <var ID="foreName">Billy-Bob</var>
- <var ID="surName">Homeboy</var>
- <var ID="entityType">Goof</var>
- </vars>
- </test>
- <test ID="getAuthorityList">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/</uri>
- </test>
- <test ID="getAuthorityByName">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority)</uri>
- </test>
- <test ID="getAuthorityByCSID">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
- </test>
- <test ID="getPersonList">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
- </test>
- <test ID="getPerson1">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
- </test>
+ <testGroup ID="person" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+ <test ID="PersonAuth1" auth="admin@testsci.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ <filename>person/personauthorities_common.xml</filename>
+ <vars>
+ <var ID="authShortIdentifier">TestPersonAuthority</var>
+ </vars>
+ </test>
+ <test ID="Person1">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ <filename>person/persons_common_and_testsci.xml</filename>
+ <vars>
+ <var ID="shortIdentifier">johnWayneActor1</var>
+ <var ID="foreName">John</var>
+ <var ID="surName">Wayne</var>
+ <var ID="entityType">Actor</var>
+ </vars>
+ </test>
+ <test ID="Person2">
+ <method>POST</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ <filename>person/persons_common_and_testsci.xml</filename>
+ <vars>
+ <var ID="shortIdentifier">billyBob1</var>
+ <var ID="foreName">Billy-Bob</var>
+ <var ID="surName">Homeboy</var>
+ <var ID="entityType">Goof</var>
+ </vars>
+ </test>
+ <test ID="getAuthorityList">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/</uri>
+ </test>
+ <test ID="getAuthorityByName">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority)</uri>
+ </test>
+ <test ID="getAuthorityByCSID">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
+ </test>
+ <test ID="getPersonList">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+ </test>
+ <test ID="getPerson1">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+ </test>
- <test ID="UpdatePerson2WithRelations">
- <method>PUT</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
- <filename>person/persons_common_and_testsci_set_broader.xml</filename>
- <vars>
- <var ID="shortIdentifier">billyBob1</var>
- <var ID="foreName">Billy-Bob</var>
- <var ID="surName">Homeboy</var>
- <var ID="entityType">Goof</var>
- <var ID="childCSID">${Person2.CSID}</var>
- <var ID="parentCSID">${Person1.CSID}</var>
- <var ID="parentName">John Wayne</var>
- </vars>
- </test>
+ <test ID="UpdatePerson2WithRelations">
+ <method>PUT</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+ <filename>person/persons_common_and_testsci_set_broader.xml</filename>
+ <vars>
+ <var ID="shortIdentifier">billyBob1</var>
+ <var ID="foreName">Billy-Bob</var>
+ <var ID="surName">Homeboy</var>
+ <var ID="entityType">Goof</var>
+ <var ID="childCSID">${Person2.CSID}</var>
+ <var ID="parentCSID">${Person1.CSID}</var>
+ <var ID="parentName">John Wayne</var>
+ </vars>
+ </test>
- <test ID="getPerson1WithRelations">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
- <response>
- <expected level="ADDOK"/>
- <filename>person/res/testsciPersonWithRelns.res.xml</filename>
- <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
+ <test ID="getPerson1WithRelations">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>person/res/testsciPersonWithRelns.res.xml</filename>
+ <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
from tests in this test group, e.g.
PersonParent.CSID :: ${PersonParent.CSID}
These vars are all in the expression context while this group is active,
because we hang onto all ServiceResult objects for the duration of the group,
and ServiceObjects keep their vars.
-->
- <startElement>/document/*[local-name()='relations-common-list']</startElement>
- </response>
- </test>
-
- <test ID="getPerson2WithRelations">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true</uri>
- <response>
- <expected level="ADDOK"/>
- <filename>person/res/testsciPersonWithRelns.res.xml</filename>
- <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
+ <startElement>/document/*[local-name()='relations-common-list']</startElement>
+ </response>
+ </test>
+
+ <test ID="getPerson2WithRelations">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>person/res/testsciPersonWithRelns.res.xml</filename>
+ <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
from tests in this test group, e.g.
PersonParent.CSID :: ${PersonParent.CSID}
These vars are all in the expression context while this group is active,
because we hang onto all ServiceResult objects for the duration of the group,
and ServiceObjects keep their vars.
-->
- <startElement>/document/*[local-name()='relations-common-list']</startElement>
- </response>
- </test>
+ <startElement>/document/*[local-name()='relations-common-list']</startElement>
+ </response>
+ </test>
- <test ID="createLoanin1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/loansin/</uri>
- <filename>authrefs/loanin.xml</filename>
- <vars>
- <var ID="loannum">42</var>
- <var ID="person">${getPerson1.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="createLoanin1">
+ <method>POST</method>
+ <uri>/cspace-services/loansin/</uri>
+ <filename>authrefs/loanin.xml</filename>
+ <vars>
+ <var ID="loannum">42</var>
+ <var ID="person">${getPerson1.got("//refName")}</var>
+ </vars>
+ </test>
- <test ID="getPerson1RefObjs">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
- <response>
- <expected level="ADDOK"/>
- <filename>person/res/refObjs.res.xml</filename>
- <vars>
- <var ID="numFound">1</var>
- </vars>
- </response>
- </test>
+ <test ID="getPerson1RefObjs">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>person/res/refObjs.res.xml</filename>
+ <vars>
+ <var ID="numFound">1</var>
+ </vars>
+ </response>
+ </test>
- <test ID="createAcquisition1" auth="test">
- <method>POST</method>
- <uri>/cspace-services/acquisitions/</uri>
- <filename>person/acquisition.xml</filename>
- <vars>
- <var ID="acqNum">42</var>
- <var ID="owner">${getPerson1.got("//refName")}</var>
- </vars>
- </test>
+ <test ID="createAcquisition1">
+ <method>POST</method>
+ <uri>/cspace-services/acquisitions/</uri>
+ <filename>person/acquisition.xml</filename>
+ <vars>
+ <var ID="acqNum">42</var>
+ <var ID="owner">${getPerson1.got("//refName")}</var>
+ </vars>
+ </test>
- <test ID="getPerson1RefObjs">
- <method>GET</method>
- <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
- <response>
- <expected level="ADDOK"/>
- <filename>person/res/refObjs.res.xml</filename>
- <vars>
- <var ID="numFound">2</var>
- </vars>
- </response>
- </test>
+ <test ID="getPerson1RefObjs">
+ <method>GET</method>
+ <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>person/res/refObjs.res.xml</filename>
+ <vars>
+ <var ID="numFound">2</var>
+ </vars>
+ </response>
+ </test>
- </testGroup>
+ </testGroup>
</xmlReplay>
-
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
</auths>
- <testGroup ID="makeRelations" autoDeletePOSTS="true">
- <test ID="oe1" auth="test">
+ <testGroup ID="makeRelations" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="oe1">
<method>POST</method>
<uri>/cspace-services/objectexit/</uri>
<filename>relation/oe1.xml</filename>
</test>
- <test ID="oe2" auth="test">
+ <test ID="oe2">
<method>POST</method>
<uri>/cspace-services/objectexit/</uri>
<filename>relation/oe1.xml</filename>
</test>
- <test ID="relate1" auth="test">
+ <test ID="relate1">
<method>POST</method>
<uri>/cspace-services/relations/</uri>
<filename>relation/r-1.xml</filename>
<var ID="relationshipType">hasBroader</var>
</vars>
</test>
- <test ID="relate2" auth="test">
+ <test ID="relate2">
<method>POST</method>
<uri>/cspace-services/relations/</uri>
<filename>relation/r-1.xml</filename>
<var ID="relationshipType">hasBroader</var>
</vars>
</test>
- <test ID="relationsGET" auth="test">
+ <test ID="relationsGET">
<method>GET</method>
<uri>/cspace-services/relations/</uri>
</test>
-->
</testGroup>
- <testGroup ID="makeRelationsNested" autoDeletePOSTS="true">
- <test ID="oe1" auth="test">
+ <testGroup ID="makeRelationsNested" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+ <test ID="oe1">
<method>POST</method>
<uri>/cspace-services/objectexit/</uri>
<filename>relation/oe1.xml</filename>
</test>
- <test ID="oe2" auth="test">
+ <test ID="oe2">
<method>POST</method>
<uri>/cspace-services/objectexit/</uri>
<filename>relation/oe1.xml</filename>
</test>
- <test ID="relate1" auth="test">
+ <test ID="relate1">
<method>POST</method>
<uri>/cspace-services/relations/</uri>
<filename>relation/r-2.xml</filename>
<var ID="relationshipType">hasBroader</var>
</vars>
</test>
- <test ID="relationsGET" auth="test">
+ <test ID="relationsGET">
<method>GET</method>
<uri>/cspace-services/relations/</uri>
</test>
</testGroup>
<testGroup ID="r2only" autoDeletePOSTS="true">
- <test ID="relate" auth="test">
+ <test ID="relate">
<method>POST</method>
<uri>/cspace-services/relations/</uri>
<filename>relation/r-2.xml</filename>
<var ID="relationshipType">hasBroader</var>
</vars>
</test>
- <test ID="relationsGET" auth="test">
+ <test ID="relationsGET">
<method>GET</method>
<uri>/cspace-services/relations/</uri>
</test>
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
-
+
<auths>
<!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
<auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
</auths>
-
- <testGroup ID="testSingle" autoDeletePOSTS="true">
-
- <test ID="createReport1" auth="test">
+
+ <testGroup ID="testSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+
+ <test ID="createReport1">
<method>POST</method>
<uri>/cspace-services/reports/</uri>
<filename>report/report1Record.xml</filename>
<expectedCodes>201</expectedCodes>
</test>
- <test ID="readReport1" auth="test">
+ <test ID="readReport1">
<method>GET</method>
<uri>/cspace-services/reports/${createReport1.CSID}</uri>
</test>
-
- <test ID="createAcquisition1" auth="test">
+
+ <test ID="createAcquisition1">
<method>POST</method>
<uri>/cspace-services/acquisitions/</uri>
<filename>report/acquisition1.xml</filename>
</vars>
<expectedCodes>201</expectedCodes>
</test>
-
+
<!--
This test is still mostly a placeholder, merely verifying that,
with a generated report returned matching the 'application/xml' MIME
the (more permissive) TEXT level appears to be far too lenient.
- ADR 2013-05-13
-->
- <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+ <test ID="testInvokeSingle" autoDeletePOSTS="false">
<method>POST</method>
<uri>/cspace-services/reports/${createReport1.CSID}</uri>
<filename>report/report1InvContextStandalone.xml</filename>
<var ID="acquisitionCSID">${createAcquisition1.CSID}</var>
</vars>
<response>
- <expected level="ADDOK"/>
+ <expected level="ADDOK"></expected>
<filename>report/res/report1.res.xml</filename>
<vars>
<var ID="acquisitionReferenceNumber">${createAcquisition1.acquisitionReferenceNumber}</var>
</response>
<expectedCodes>200</expectedCodes>
</test>
-
+
<!-- See the Batch service tests within the IntegrationTests -->
<!-- module for templates for additional report invocation tests -->
<!-- that can be added here. -->
-
+
</testGroup>
</xmlReplay>
-
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
- <!-- Authenticate into the testsci tenant. By default, versioning -->
- <!-- support is exposed in the Location/Movement/Inventory service -->
- <!-- in that tenant. -->
- <auths default="admin@testsci.collectionspace.org">
- <auth ID="admin@testsci.collectionspace.org"
- >YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
- </auths>
+ <!-- Authenticate into the testsci tenant. By default, versioning -->
+ <!-- support is exposed in the Location/Movement/Inventory service -->
+ <!-- in that tenant. -->
+ <auths default="admin@testsci.collectionspace.org">
+ <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+ </auths>
- <!-- Verifies that, by default: -->
- <!-- * Versioned records are excluded (filtered out) from list results. -->
- <!-- * Only the current version of a record is retrieved on a read request. -->
- <testGroup ID="VersionedRecordFiltering" autoDeletePOSTS="true">
-
- <test ID="CreateMovement" auth="admin@testsci.collectionspace.org">
- <method>POST</method>
- <uri>/cspace-services/movements/</uri>
- <filename>versioning/movement.xml</filename>
- <vars>
- <!-- This currentLocation value should properly be a Storage Location -->
- <!-- or Organization refName, but for the test-only function served by -->
- <!-- this temporary record, this value can instead be an arbitrary string. -->
- <!-- (Note: that this arbitrary string must be uniquely present in one -->
- <!-- and only one Movement record for the search test below to succeed.) -->
- <var ID="currentLocationValue">jlmbsoqtqbfjotldjlmbsoq</var>
- <var ID="currentLocationNoteValue">old current location note</var>
- </vars>
- <expectedCodes>201</expectedCodes>
- </test>
-
- <test ID="ListAllMovementRecords">
- <method>GET</method>
- <uri>/cspace-services/movements</uri>
- </test>
-
- <test ID="UpdateMovement" auth="admin@testsci.collectionspace.org">
- <method>PUT</method>
- <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
- <filename>versioning/movement.xml</filename>
- <vars>
- <var ID="currentLocationValue">${CreateMovement.currentLocationValue}</var>
- <var ID="currentLocationNoteValue">new current location note</var>
- </vars>
- <expectedCodes>200</expectedCodes>
- </test>
-
- <!-- The total number of Movement records reported should not change following -->
- <!-- the update, even though a past version of one Movement document was created -->
- <!-- automatically as a result of that update. -->
- <test ID="ListAllMovementRecordsFollowingUpdate">
- <method>GET</method>
- <uri>/cspace-services/movements</uri>
- <response>
- <expected level="ADDOK"/>
- <vars>
- <var ID="totalItemsValue">${ListAllMovementRecords.got("//totalItems")}</var>
- </vars>
- <filename>versioning/res/movement-list.res.xml</filename>
- </response>
- </test>
-
- <!-- A keyword search on the (intended to be unique) currentLocation value -->
- <!-- should retrieve only one document record, even though there are now two -->
- <!-- documents extant containing that value: the current version and one past -->
- <!-- version, the latter created automatically as a result of the update. -->
- <test ID="SearchReturnsOnlyCurrentVersion">
- <method>GET</method>
- <uri>/cspace-services/movements?kw=${CreateMovement.currentLocationValue}</uri>
- <response>
- <expected level="ADDOK"/>
- <vars>
- <var ID="totalItemsValue">1</var>
- </vars>
- <filename>versioning/res/movement-list.res.xml</filename>
- </response>
- </test>
-
- <!-- Retrieving the document via a read request should return only -->
- <!-- the current version, containing the most recently updated value(s). -->
- <test ID="ReadReturnsOnlyCurrentVersion">
- <method>GET</method>
- <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
- <vars>
- <var ID="currentLocationNoteValue">${UpdateMovement.currentLocationNoteValue}</var>
- </vars>
- <response>
- <expected level="ADDOK"/>
- <filename>versioning/res/movement.res.xml</filename>
- </response>
- </test>
+ <!-- Verifies that, by default: -->
+ <!-- * Versioned records are excluded (filtered out) from list results. -->
+ <!-- * Only the current version of a record is retrieved on a read request. -->
+ <testGroup ID="VersionedRecordFiltering" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
- </testGroup>
+ <test ID="CreateMovement" auth="admin@testsci.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/movements/</uri>
+ <filename>versioning/movement.xml</filename>
+ <vars>
+ <!-- This currentLocation value should properly be a Storage Location -->
+ <!-- or Organization refName, but for the test-only function served by -->
+ <!-- this temporary record, this value can instead be an arbitrary string. -->
+ <!-- (Note: that this arbitrary string must be uniquely present in one -->
+ <!-- and only one Movement record for the search test below to succeed.) -->
+ <var ID="currentLocationValue">jlmbsoqtqbfjotldjlmbsoq</var>
+ <var ID="currentLocationNoteValue">old current location note</var>
+ </vars>
+ <expectedCodes>201</expectedCodes>
+ </test>
-</xmlReplay>
+ <test ID="ListAllMovementRecords">
+ <method>GET</method>
+ <uri>/cspace-services/movements</uri>
+ </test>
+
+ <test ID="UpdateMovement" auth="admin@testsci.collectionspace.org">
+ <method>PUT</method>
+ <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
+ <filename>versioning/movement.xml</filename>
+ <vars>
+ <var ID="currentLocationValue">${CreateMovement.currentLocationValue}</var>
+ <var ID="currentLocationNoteValue">new current location note</var>
+ </vars>
+ <expectedCodes>200</expectedCodes>
+ </test>
+
+ <!-- The total number of Movement records reported should not change following -->
+ <!-- the update, even though a past version of one Movement document was created -->
+ <!-- automatically as a result of that update. -->
+ <test ID="ListAllMovementRecordsFollowingUpdate">
+ <method>GET</method>
+ <uri>/cspace-services/movements</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <vars>
+ <var ID="totalItemsValue">${ListAllMovementRecords.got("//totalItems")}</var>
+ </vars>
+ <filename>versioning/res/movement-list.res.xml</filename>
+ </response>
+ </test>
+
+ <!-- A keyword search on the (intended to be unique) currentLocation value -->
+ <!-- should retrieve only one document record, even though there are now two -->
+ <!-- documents extant containing that value: the current version and one past -->
+ <!-- version, the latter created automatically as a result of the update. -->
+ <test ID="SearchReturnsOnlyCurrentVersion">
+ <method>GET</method>
+ <uri>/cspace-services/movements?kw=${CreateMovement.currentLocationValue}</uri>
+ <response>
+ <expected level="ADDOK"></expected>
+ <vars>
+ <var ID="totalItemsValue">1</var>
+ </vars>
+ <filename>versioning/res/movement-list.res.xml</filename>
+ </response>
+ </test>
+ <!-- Retrieving the document via a read request should return only -->
+ <!-- the current version, containing the most recently updated value(s). -->
+ <test ID="ReadReturnsOnlyCurrentVersion">
+ <method>GET</method>
+ <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
+ <vars>
+ <var ID="currentLocationNoteValue">${UpdateMovement.currentLocationNoteValue}</var>
+ </vars>
+ <response>
+ <expected level="ADDOK"></expected>
+ <filename>versioning/res/movement.res.xml</filename>
+ </response>
+ </test>
+
+ </testGroup>
+
+</xmlReplay>
<document name="vocabularies">
<ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <rev>6</rev>
+ <rev>10</rev>
<shortIdentifier>createReplaceVocabItems</shortIdentifier>
<csid>${csid}</csid>
- <displayName>createReplaceVocabItems Vocabulary</displayName>
+ <displayName>Updated createReplaceVocabItems Vocabulary</displayName>
<description>
- This is a test vocabulary for test createReplaceVocabItems
+ This is an updated test vocabulary created in the createReplaceVocabItems XMLReplay test group
</description>
- <source>createReplaceVocabItems</source>
+ <source>
+ Some updated mythical book posted with item terms in createReplaceVocabItems test group
+ </source>
<refName>
urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems)'createReplaceVocabItems Vocabulary'
</refName>
<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
<pageNum>0</pageNum>
<pageSize>2500</pageSize>
- <itemsInPage>0</itemsInPage>
- <totalItems>0</totalItems>
+ <itemsInPage>3</itemsInPage>
+ <totalItems>3</totalItems>
<fieldsReturned>
csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
</fieldsReturned>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitema)'Replacement item A'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>1</order>
+ <displayName>Replacement item A</displayName>
+ <shortIdentifier>replacementitema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemb)'Replacement item B'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>2</order>
+ <displayName>Replacement item B</displayName>
+ <shortIdentifier>replacementitemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemc)'Replacement item C'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>3</order>
+ <displayName>Replacement item C</displayName>
+ <shortIdentifier>replacementitemc</shortIdentifier>
+ </list-item>
</ns2:abstract-common-list>
</document>
\ No newline at end of file
--- /dev/null
+<document name="vocabularies">
+ <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <rev>10</rev>
+ <shortIdentifier>createUpdateAddDeleteVocabItems</shortIdentifier>
+ <csid>${csid}</csid>
+ <displayName>Updated createUpdateAddDeleteVocabItems Vocabulary</displayName>
+ <description>
+ This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group
+ </description>
+ <source>
+ Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group
+ </source>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems)'createUpdateAddDeleteVocabItems Vocabulary'
+ </refName>
+ <vocabType>enum</vocabType>
+ </ns2:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <pageSize>2500</pageSize>
+ <itemsInPage>4</itemsInPage>
+ <totalItems>4</totalItems>
+ <fieldsReturned>
+ csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+ </fieldsReturned>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditema)'Added item A'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>2</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemb)'Added item B'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>3</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemc)'Added item C'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>4</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(createItem301)'Updated createItem301'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>1</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>1</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+ <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>Updated createUpdateAddDeleteVocabItems Vocabulary</displayName>
+ <shortIdentifier>createUpdateAddDeleteVocabItems</shortIdentifier>
+ <description>This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group</description>
+ <source>Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group</source>
+ </ns3:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <list-item>
+ <order>1</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>2</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>3</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>4</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
--- /dev/null
+<document name="vocabularies">
+ <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <rev>8</rev>
+ <shortIdentifier>createUpdateAddOnlyVocabItems</shortIdentifier>
+ <csid>${csid}</csid>
+ <displayName>Updated createUpdateAddOnlyVocabItems Vocabulary</displayName>
+ <description>
+ This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group
+ </description>
+ <source>
+ Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group
+ </source>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems)'createUpdateAddOnlyVocabItems Vocabulary'
+ </refName>
+ <vocabType>enum</vocabType>
+ </ns2:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <pageSize>2500</pageSize>
+ <itemsInPage>6</itemsInPage>
+ <totalItems>6</totalItems>
+ <fieldsReturned>
+ csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+ </fieldsReturned>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditema)'Added item A'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>4</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemb)'Added item B'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>5</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemc)'Added item C'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>6</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem101)'createItem101'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>1</order>
+ <displayName>createItem101</displayName>
+ <shortIdentifier>createItem101</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem201)'createItem201'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>2</order>
+ <displayName>createItem201</displayName>
+ <shortIdentifier>createItem201</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem301)'Updated createItem301'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>1</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>3</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+ <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>Updated createUpdateAddOnlyVocabItems Vocabulary</displayName>
+ <shortIdentifier>createUpdateAddOnlyVocabItems</shortIdentifier>
+ <description>This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group</description>
+ <source>Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group</source>
+ </ns3:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <list-item>
+ <order>3</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>4</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>5</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>6</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
--- /dev/null
+<document name="vocabularies">
+ <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <rev>10</rev>
+ <shortIdentifier>createUpdateAddSoftDeleteVocabItems</shortIdentifier>
+ <csid>${csid}</csid>
+ <displayName>Updated createUpdateAddSoftDeleteVocabItems Vocabulary</displayName>
+ <description>
+ This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group
+ </description>
+ <source>
+ Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group
+ </source>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems)'createUpdateAddSoftDeleteVocabItems Vocabulary'
+ </refName>
+ <vocabType>enum</vocabType>
+ </ns2:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <pageSize>2500</pageSize>
+ <itemsInPage>6</itemsInPage>
+ <totalItems>6</totalItems>
+ <fieldsReturned>
+ csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+ </fieldsReturned>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditema)'Added item A'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>2</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemb)'Added item B'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>3</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemc)'Added item C'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>4</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem101)'createItem101'
+ </refName>
+ <workflowState>deleted</workflowState>
+ <rev>1</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>1</order>
+ <displayName>createItem101</displayName>
+ <shortIdentifier>createItem101</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem201)'createItem201'
+ </refName>
+ <workflowState>deleted</workflowState>
+ <rev>1</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>2</order>
+ <displayName>createItem201</displayName>
+ <shortIdentifier>createItem201</shortIdentifier>
+ </list-item>
+ <list-item>
+ <refName>
+ urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem301)'Updated createItem301'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>1</rev>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <order>1</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+ <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>Updated createUpdateAddSoftDeleteVocabItems Vocabulary</displayName>
+ <shortIdentifier>createUpdateAddSoftDeleteVocabItems</shortIdentifier>
+ <description>This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group</description>
+ <source>Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group</source>
+ </ns3:vocabularies_common>
+ <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <list-item>
+ <order>1</order>
+ <displayName>Updated createItem301</displayName>
+ <shortIdentifier>createItem301</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>2</order>
+ <displayName>Added item A</displayName>
+ <shortIdentifier>addeditema</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>3</order>
+ <displayName>Added item B</displayName>
+ <shortIdentifier>addeditemb</shortIdentifier>
+ </list-item>
+ <list-item>
+ <order>4</order>
+ <displayName>Added item C</displayName>
+ <shortIdentifier>addeditemc</shortIdentifier>
+ </list-item>
+ </ns2:abstract-common-list>
+</document>
<auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
</auths>
+ <!--
+ Test adding to a vocabulary's terms with an entirely new set of terms.
+ -->
+ <testGroup ID="UpdateAddSoftDeleteVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+ <test ID="createUpdateAddSoftDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ <filename>vocabulary/vocab-Template.xml</filename>
+ </test>
+ <test ID="createItem101">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">1</var>
+ </vars>
+ </test>
+ <test ID="createItem201">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">2</var>
+ </vars>
+ </test>
+ <test ID="createItem301">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">3</var>
+ </vars>
+ </test>
+ <test ID="updateUpdateAddSoftDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>PUT</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?omittedItemAction=softdelete</uri>
+ <filename>vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml</filename>
+ </test>
+ <test ID="getUpdateAddSoftDeleteVocabItems">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?showItems=true</uri>
+ <response>
+ <vars>
+ <var ID="csid">${createUpdateAddSoftDeleteVocabItems.CSID}</var>
+ </vars>
+ <expected level="ADDOK" />
+ <filename>vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml</filename>
+ </response>
+ </test>
+ </testGroup>
+
+ <!--
+ Test adding to a vocabulary's terms with an entirely new set of terms.
+ -->
+ <testGroup ID="UpdateAddOnlyVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+ <test ID="createUpdateAddOnlyVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ <filename>vocabulary/vocab-Template.xml</filename>
+ </test>
+ <test ID="createItem101">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">1</var>
+ </vars>
+ </test>
+ <test ID="createItem201">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">2</var>
+ </vars>
+ </test>
+ <test ID="createItem301">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">3</var>
+ </vars>
+ </test>
+ <test ID="updateUpdateAddOnlyVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>PUT</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}</uri>
+ <filename>vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml</filename>
+ </test>
+ <test ID="getUpdateAddOnlyVocabItems">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}?showItems=true</uri>
+ <response>
+ <vars>
+ <var ID="csid">${createUpdateAddOnlyVocabItems.CSID}</var>
+ </vars>
+ <expected level="ADDOK" />
+ <filename>vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml</filename>
+ </response>
+ </test>
+ </testGroup>
+
<!--
Test replace a vocabulary's terms with an entirely new set of terms.
-->
</test>
<test ID="updateReplaceVocabItems" auth="admin@testsci.collectionspace.org">
<method>PUT</method>
- <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}</uri>
- <filename>vocabulary/ReplaceVocabItems/ReplaceVocabItems.res.xml</filename>
- </test>
-<!--
- <test ID="deleteReplaceVocabItems">
- <method>DELETE</method>
- <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}/items</uri>
- </test>
- <test ID="getReplaceVocabItems">
- <method>GET</method>
- <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}</uri>
+ <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}?omittedItemAction=delete</uri>
+ <filename>vocabulary/ReplaceVocabItems/replaceWithItems-vocab.xml</filename>
</test>
<test ID="getReplaceVocabItems">
<method>GET</method>
<var ID="csid">${createReplaceVocabItems.CSID}</var>
</vars>
<expected level="ADDOK" />
- <label>vocabularies_common</label>
- <filename>vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml</filename>
+ <filename>vocabulary/ReplaceVocabItems/responses/replaceVocabItems.res.xml</filename>
+ </response>
+ </test>
+ </testGroup>
+
+ <!--
+ Test replace a vocabulary's terms with an entirely new set of terms.
+ -->
+ <testGroup ID="UpdateAddDeleteVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+ <test ID="createUpdateAddDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ <filename>vocabulary/vocab-Template.xml</filename>
+ </test>
+ <test ID="createItem101">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">1</var>
+ </vars>
+ </test>
+ <test ID="createItem201">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">2</var>
+ </vars>
+ </test>
+ <test ID="createItem301">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+ <filename>vocabulary/vocab-Item-template.xml</filename>
+ <vars>
+ <var ID="order">3</var>
+ </vars>
+ </test>
+ <test ID="updateUpdateAddDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+ <method>PUT</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?omittedItemAction=delete</uri>
+ <filename>vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml</filename>
+ </test>
+ <test ID="getUpdateAddDeleteVocabItems">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?showItems=true</uri>
+ <response>
+ <vars>
+ <var ID="csid">${createUpdateAddDeleteVocabItems.CSID}</var>
+ </vars>
+ <expected level="ADDOK" />
+ <filename>vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml</filename>
</response>
</test>
- -->
</testGroup>
<testGroup ID="DeleteVocabJustItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
<uri>/cspace-services/vocabularies/</uri>
<filename>vocabulary/vocab-Template.xml</filename>
</test>
- <test ID="createItem1" auth="cpw">
+ <test ID="createItem1">
<method>POST</method>
<uri>/cspace-services/vocabularies/${createEmptyVocab.CSID}/items/</uri>
<filename>vocabulary/vocab-Item-template.xml</filename>
<run controlFile="report/report.xml" />
<run controlFile="authrefs/authrefs.xml" testGroup="AuthRefs" />
- <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />
+ <run controlFile="vocabulary/vocabulary.xml" />
<run controlFile="authrefs/authrefsSimple.xml" testGroup="AuthRefsSimple" />
<run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />
<run controlFile="authority/authority.xml" testGroup="TestAuthoritiesMultiVocabSearch" />
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.client.XmlTools;
import org.collectionspace.services.client.workflow.WorkflowClient;
+
import org.collectionspace.services.common.CSWebApplicationException;
import org.collectionspace.services.common.NuxeoBasedResource;
import org.collectionspace.services.common.ResourceMap;
import org.collectionspace.services.common.repository.RepositoryClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
-import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthorityItemSpecifier;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.SpecifierForm;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
+
import org.collectionspace.services.config.ClientType;
import org.collectionspace.services.config.service.ServiceBindingType;
import org.collectionspace.services.jaxb.AbstractCommonList;
import org.collectionspace.services.nuxeo.client.java.NuxeoRepositoryClientImpl;
import org.collectionspace.services.nuxeo.util.NuxeoUtils;
import org.collectionspace.services.workflow.WorkflowCommon;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthorityItemSpecifier;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.SpecifierForm;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
+import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
import org.collectionspace.services.description.ServiceDescription;
+
import org.jboss.resteasy.util.HttpResponseCodes;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.DocumentModelList;
// We omit the parentShortId, only needed when doing a create...
AuthorityItemDocumentModelHandler handler = (AuthorityItemDocumentModelHandler)createItemDocumentHandler(ctx, parentcsid, parentShortId);
handler.setShouldUpdateRevNumber(shouldUpdateRevNumber);
- if (isProposed != null) {
- handler.setIsProposed(isProposed);
- }
- if (isSASItem != null) {
- handler.setIsSASItem(isSASItem);
+ //
+ // Update the SAS fields if either value is non-null
+ //
+ boolean updateSASFields = isProposed != null || isSASItem != null;
+ handler.setshouldUpdateSASFields(updateSASFields);
+ if (updateSASFields == true) {
+ handler.setshouldUpdateSASFields(true);
+ if (isProposed != null) {
+ handler.setIsProposed(isProposed);
+ }
+ if (isSASItem != null) {
+ handler.setIsSASItem(isSASItem);
+ }
}
+
getRepositoryClient(ctx).update(ctx, itemcsid, handler);
result = ctx.getOutput();
protected String authorityItemCommonSchemaName;
private String authorityItemTermGroupXPathBase;
+ private boolean shouldUpdateSASFields = true;
private boolean syncHierarchicalRelationships = false;
private boolean isProposed = false; // used by local authority to propose a new shared item. Allows local deployments to use new terms until they become official
private boolean isSAS = false; // used to indicate if the authority item originated as a SAS item
abstract public String getParentCommonSchemaName();
+ //
+ // Getter and Setter for 'shouldUpdateSASFields'
+ //
+ public boolean getShouldUpdateSASFields() {
+ return shouldUpdateSASFields;
+ }
+
+ public void setshouldUpdateSASFields(boolean flag) {
+ shouldUpdateSASFields = flag;
+ }
+
//
// Getter and Setter for 'proposed'
//
if (this.getShouldUpdateRevNumber() == true && !isMarkedAsSASItem) { // We won't update rev numbers on synchronization with SAS items and on local changes to SAS items
updateRevNumbers(wrapDoc);
}
- //
- // If this is a proposed item (not part of the SAS), mark it as such
- //
- documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.PROPOSED,
- new Boolean(this.getIsProposed()));
- //
- // If it is a SAS authority item, mark it as such
- //
- documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.SAS,
- new Boolean(this.getIsSASItem()));
+
+ if (getShouldUpdateSASFields() == true) {
+ //
+ // If this is a proposed item (not part of the SAS), mark it as such
+ //
+ documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.PROPOSED,
+ new Boolean(this.getIsProposed()));
+ //
+ // If it is a SAS authority item, mark it as such
+ //
+ documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.SAS,
+ new Boolean(this.getIsSASItem()));
+ }
}
/**
* may be expected to be deleted by certain tests.
* @throws Exception
*/
- @AfterClass(alwaysRun=true)
+ @Override
+ @AfterClass(alwaysRun=true)
public void cleanUp() throws Exception {
String noTest = System.getProperty("noTestCleanup");
- if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+ if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
if (logger.isDebugEnabled()) {
logger.debug("Skipping Cleanup phase ...");
}
if (logger.isDebugEnabled()) {
logger.debug("Cleaning up temporary resources created for testing ...");
}
- PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+ //
+ // Delete the loansin records before the person items/terms
+ //
+ LoaninClient loaninClient = new LoaninClient();
+ for (String csid : loaninIdsCreated) {
+ Response res = null;
+ try {
+ res = loaninClient.delete(csid);
+ if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+ throw new Exception(String.format("Could not delete loansin record with CSID=%s", csid));
+ }
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
+ }
+ //
// Delete Person resource(s) (before PersonAuthority resources).
-
- for (String resourceId : personIdsCreated) {
- // Note: Any non-success responses are ignored and not reported.
- personAuthClient.deleteItem(personAuthCSID, resourceId).close();
+ //
+ PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+ for (String csid : personIdsCreated) {
+ Response res = null;
+ try {
+ res = personAuthClient.deleteItem(personAuthCSID, csid);
+ if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+ throw new Exception(String.format("Could not delete person item/term record with CSID=%s inside person authority with CSID=%s",
+ csid, personAuthCSID));
+ }
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
}
-
- // Delete PersonAuthority resource(s).
- // Note: Any non-success response is ignored and not reported.
+ //
+ // Delete the PersonAuthority resource.
+ //
if (personAuthCSID != null) {
- personAuthClient.delete(personAuthCSID);
- // Delete Loans In resource(s).
- LoaninClient loaninClient = new LoaninClient();
- for (String resourceId : loaninIdsCreated) {
- // Note: Any non-success responses are ignored and not reported.
- loaninClient.delete(resourceId).close();
- }
+ Response res = null;
+ try {
+ res = personAuthClient.delete(personAuthCSID);
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
}
}
// ---------------------------------------------------------------
// Utility methods used by tests above
// ---------------------------------------------------------------
- public String getServiceName() {
+ @Override
+ public String getServiceName() {
return SERVICE_NAME;
}
* may be expected to be deleted by certain tests.
* @throws Exception
*/
- @AfterClass(alwaysRun=true)
+ @Override
+ @AfterClass(alwaysRun=true)
public void cleanUp() throws Exception {
String noTest = System.getProperty("noTestCleanup");
- if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+ if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
if (logger.isDebugEnabled()) {
logger.debug("Skipping Cleanup phase ...");
}
if (logger.isDebugEnabled()) {
logger.debug("Cleaning up temporary resources created for testing ...");
}
+ //
+ // Delete the loansout record(s) first
+ //
+ LoanoutClient loanoutClient = new LoanoutClient();
+ for (String resourceId : loanoutIdsCreated) {
+ Response res = null;
+ try {
+ res = loanoutClient.delete(resourceId);
+ if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+ throw new Exception(String.format("Could not delete the Loansout record=%s",
+ resourceId));
+ }
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
+ }
+ //
+ // Delete the person terms/items before the person authority
+ //
PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
- // Delete Person resource(s) (before PersonAuthority resources).
for (String resourceId : personIdsCreated) {
- // Note: Any non-success responses are ignored and not reported.
- personAuthClient.deleteItem(personAuthCSID, resourceId).close();
+ Response res = null;
+ try {
+ res = personAuthClient.deleteItem(personAuthCSID, resourceId);
+ if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+ throw new Exception(String.format("Could not delete person term=%s from authority=%s",
+ resourceId, personAuthCSID));
+ }
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
}
- // Delete PersonAuthority resource(s).
- // Note: Any non-success response is ignored and not reported.
+ //
+ // Finally, delete the PersonAuthority resource(s).
+ //
if (personAuthCSID != null) {
- personAuthClient.delete(personAuthCSID).close();
- // Delete Loans In resource(s).
- LoanoutClient loanoutClient = new LoanoutClient();
- for (String resourceId : loanoutIdsCreated) {
- // Note: Any non-success responses are ignored and not reported.
- loanoutClient.delete(resourceId).close();
- }
+ Response res = null;
+ try {
+ res = personAuthClient.delete(personAuthCSID);
+ if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+ throw new Exception(String.format("Could not delete the Person authority=%s",
+ personAuthCSID));
+ }
+ } catch (Throwable t) {
+ if (res != null) res.close();
+ throw t;
+ }
}
}
// ---------------------------------------------------------------
// Utility methods used by tests above
// ---------------------------------------------------------------
- public String getServiceName() {
+ @Override
+ public String getServiceName() {
return SERVICE_NAME;
}
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
public static final String TERM_INFO_GROUP_XPATH_BASE = "vocabularyTermGroup";
- public static String SHOW_ITEMS_QP = "showItems"; // query param on GET of vocabulary to get list of items included in the result payload
+
+ //
+ // Request query parameter constants
+ //
+ public static final String SHOW_ITEMS_QP = "showItems"; // query param on GET of vocabulary to get list of items included in the result payload
+ public static final String OMITTED_ITEM_ACTION_QP = "omittedItemAction"; // values can be "delete", "softdelete", "ignore"; the value of "ignore" is the default
+ public static final String DELETE_OMITTED_ITEMS = "delete";
+ public static final String SOFTDELETE_OMITTED_ITEMS = "softdelete";
+ public static final String IGNORE_OMITTED_ITEMS = "ignore";
+
//
// Subitem constants
//
import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.common.document.DocumentException;
import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.JaxbUtils;
import org.collectionspace.services.common.repository.RepositoryClient;
import org.collectionspace.services.common.vocabulary.AuthorityResource;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
private final static String vocabularyItemServiceName = "vocabularyitems";
private final static String VOCABULARYITEMS_COMMON = "vocabularyitems_common";
-
+
final Logger logger = LoggerFactory.getLogger(VocabularyResource.class);
public VocabularyResource() {
try {
DocumentHandler<?, AbstractCommonList, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);
String csid = repoClient.create(ctx, handler);
- handleItemsPayload(Method.POST, repoSession, csid, resourceMap, uriInfo, input);
+ //
+ // Handle any supplied list of items/terms
+ //
+ handleItemsPayload(Method.POST, ctx, csid, resourceMap, uriInfo, input);
UriBuilder path = UriBuilder.fromResource(resourceClass);
path.path("" + csid);
Response response = Response.created(path.build()).build();
@Override
public byte[] updateAuthority(
@Context ResourceMap resourceMap,
- @Context UriInfo uriInfo,
+ @Context UriInfo ui,
@PathParam("csid") String specifier,
String xmlPayload) {
PoxPayloadOut result = null;
try {
+ UriInfoWrapper uriInfo = new UriInfoWrapper(ui); // We need to make the queryParams maps read-write instead of read-only
PoxPayloadIn theUpdate = new PoxPayloadIn(xmlPayload);
Specifier spec = Specifier.getSpecifier(specifier, "updateAuthority", "UPDATE");
- ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate);
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate, uriInfo);
RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient = this.getRepositoryClient(ctx);
CoreSessionInterface repoSession = repoClient.getRepositorySession(ctx);
csid = getRepositoryClient(ctx).findDocCSID(null, ctx, whereClause);
}
getRepositoryClient(ctx).update(ctx, csid, handler);
- handleItemsPayload(Method.PUT, repoSession, csid, resourceMap, uriInfo, theUpdate);
+ handleItemsPayload(Method.PUT, ctx, csid, resourceMap, uriInfo, theUpdate);
result = ctx.getOutput();
} catch (Throwable t) {
repoSession.setTransactionRollbackOnly();
return result.getBytes();
}
+ private void updateWithItemsPayload(
+ AbstractCommonList itemsList,
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+ String parentIdentifier,
+ ResourceMap resourceMap,
+ UriInfo uriInfo,
+ PoxPayloadIn input) throws Exception {
+
+ CoreSessionInterface repoSession = (CoreSessionInterface) existingCtx.getCurrentRepositorySession();
+ //
+ // First try to update and/or create items in the incoming payload
+ //
+ for (ListItem item : itemsList.getListItem()) {
+ String errMsg = null;
+ boolean success = true;
+ Response response = null;
+ PoxPayloadOut payloadOut = null;
+ PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
+ String itemSpecifier = getSpecifier(item);
+ if (itemSpecifier != null) {
+ try {
+ payloadOut = updateAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemSpecifier, itemXmlPayload);
+ if (payloadOut == null) {
+ success = false;
+ errMsg = String.format("Could not update the term list payload of vocabuary '%s'.", parentIdentifier);
+ }
+ } catch (DocumentNotFoundException dnf) {
+ //
+ // Since the item doesn't exist, we're being ask to create it
+ //
+ response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
+ if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
+ success = false;
+ errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
+ }
+ }
+ } else {
+ success = false;
+ errMsg = String.format("Could not update the term list payload of vocabuary '%s' because one of the item is missing a CSID or short identifier value.",
+ parentIdentifier);
+ }
+ //
+ // Throw an exception as soon as we have problems with any item
+ //
+ if (success == false) {
+ throw new DocumentException(errMsg);
+ }
+ }
+
+ //
+ // Next, delete the items that were omitted from the incoming payload
+ //
+ if (shouldDeleteOmittedItems(uriInfo) == true) {
+ String omittedItemAction = getOmittedItemAction(uriInfo);
+ Set<String> shortIdsInPayload = getListOfShortIds(itemsList);
+ AbstractCommonList abstractCommonList = this.getAuthorityItemList(existingCtx, parentIdentifier, uriInfo);
+ if (abstractCommonList != null && !Tools.isEmpty(abstractCommonList.getListItem())) {
+ if (omittedItemAction.equalsIgnoreCase(VocabularyClient.DELETE_OMITTED_ITEMS)) {
+ deleteAuthorityItems(existingCtx, abstractCommonList, shortIdsInPayload, parentIdentifier);
+ } else {
+ sotfDeleteAuthorityItems(existingCtx, abstractCommonList, shortIdsInPayload, parentIdentifier);
+ }
+ }
+ }
+ }
+
+ private void deleteAuthorityItems(
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+ AbstractCommonList abstractCommonList,
+ Set<String> shortIdsInPayload,
+ String parentIdentifier) throws Exception {
+
+ for (ListItem item : abstractCommonList.getListItem()) {
+ String shortId = getShortId(item);
+ if (shortIdsInPayload.contains(shortId) == false) {
+ deleteAuthorityItem(existingCtx, parentIdentifier, getCsid(item), AuthorityServiceUtils.UPDATE_REV);
+ }
+ }
+ }
+
+ private void sotfDeleteAuthorityItems(
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+ AbstractCommonList abstractCommonList,
+ Set<String> shortIdsInPayload,
+ String parentIdentifier) throws Exception {
+
+ for (ListItem item : abstractCommonList.getListItem()) {
+ String shortId = getShortId(item);
+ if (shortIdsInPayload.contains(shortId) == false) {
+ //deleteAuthorityItem(existingCtx, parentIdentifier, getCsid(item), AuthorityServiceUtils.UPDATE_REV);
+ this.updateItemWorkflowWithTransition(existingCtx, parentIdentifier, getCsid(item),
+ WorkflowClient.WORKFLOWTRANSITION_DELETE, AuthorityServiceUtils.UPDATE_REV);
+ }
+ }
+ }
+
+ private boolean shouldDeleteOmittedItems(UriInfo uriInfo) throws DocumentException {
+ boolean result = false;
+
+ String omittedItemAction = getOmittedItemAction(uriInfo);
+ if (Tools.isEmpty(omittedItemAction) == false) {
+ switch (omittedItemAction) {
+ case VocabularyClient.DELETE_OMITTED_ITEMS:
+ case VocabularyClient.SOFTDELETE_OMITTED_ITEMS:
+ result = true;
+ break;
+ case VocabularyClient.IGNORE_OMITTED_ITEMS:
+ // do nothing
+ break;
+ default:
+ String msg = String.format("Unknown value '%s' for update on a vocabulary/termlist resource.", omittedItemAction);
+ throw new DocumentException(msg);
+ }
+ }
+
+ return result;
+ }
+
+ private String getOmittedItemAction(UriInfo uriInfo) {
+ MultivaluedMap<String,String> queryParams = uriInfo.getQueryParameters();
+ String omittedItemAction = queryParams.getFirst(VocabularyClient.OMITTED_ITEM_ACTION_QP);
+ return omittedItemAction;
+ }
+
+ /*
+ * Returns the set of short identifiers in the abstract common list of authority items
+ */
+ private Set<String> getListOfShortIds(AbstractCommonList itemsList) {
+ HashSet<String> result = new HashSet<String>();
+
+ for (ListItem item : itemsList.getListItem()) {
+ result.add(getShortId(item));
+ }
+
+ return result;
+ }
+
+ private void createWithItemsPayload(
+ AbstractCommonList itemsList,
+ ServiceContext existingCtx,
+ String parentIdentifier,
+ ResourceMap resourceMap,
+ UriInfo uriInfo,
+ PoxPayloadIn input) throws Exception {
+
+ for (ListItem item : itemsList.getListItem()) {
+ String errMsg = null;
+ boolean success = true;
+ Response response = null;
+ PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
+
+ CoreSessionInterface repoSession = (CoreSessionInterface) existingCtx.getCurrentRepositorySession();
+ response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
+ if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
+ success = false;
+ errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
+ }
+ //
+ // Throw an exception as soon as we have problems with any item
+ //
+ if (success == false) {
+ throw new DocumentException(errMsg);
+ }
+ }
+ }
+
private boolean handleItemsPayload(
Method method,
- CoreSessionInterface repoSession,
+ ServiceContext existingCtx,
String parentIdentifier,
ResourceMap resourceMap,
UriInfo uriInfo,
PayloadInputPart abstractCommonListPart = input.getPart(PoxPayload.ABSTRACT_COMMON_LIST_ROOT_ELEMENT_LABEL);
if (abstractCommonListPart != null) {
AbstractCommonList itemsList = (AbstractCommonList) abstractCommonListPart.getBody();
- for (ListItem item : itemsList.getListItem()) {
- String errMsg = null;
- boolean success = true;
- Response response = null;
- PoxPayloadOut payloadOut = null;
- PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
- switch (method) {
- case POST:
- response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
- if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
- success = false;
- errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
- }
- break;
- case PUT:
- String itemSpecifier = getSpecifier(item);
- if (itemSpecifier != null) {
- payloadOut = updateAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemSpecifier, itemXmlPayload);
- if (payloadOut == null) {
- success = false;
- errMsg = String.format("Could not update the term list payload of vocabuary '%s'.", parentIdentifier);
- }
- } else {
- success = false;
- errMsg = String.format("Could not update the term list payload of vocabuary '%s' because one of the item is missing a CSID or short identifier value.",
- parentIdentifier);
- }
- break;
- }
- //
- // Throw an exception as soon as we have problems with any item
- //
- if (success == false) {
- throw new DocumentException(errMsg);
- }
- }
+ switch (method) {
+ case POST:
+ createWithItemsPayload(itemsList, existingCtx, parentIdentifier, resourceMap, uriInfo, input);
+ break;
+ case PUT:
+ updateWithItemsPayload(itemsList, existingCtx, parentIdentifier, resourceMap, uriInfo, input);
+ break;
+ }
}
return result;
- }
+ }
+
+ private String getCsid(ListItem item) {
+ String result = null;
+
+ for (Element ele : item.getAny()) {
+ String fieldName = ele.getTagName();
+ String fieldValue = ele.getTextContent();
+ if (fieldName.equalsIgnoreCase("csid")) {
+ result = fieldValue;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ private String getShortId(ListItem item) {
+ String result = null;
+
+ for (Element ele : item.getAny()) {
+ String fieldName = ele.getTagName();
+ String fieldValue = ele.getTextContent();
+ if (fieldName.equalsIgnoreCase("shortIdentifier")) {
+ result = fieldValue;
+ break;
+ }
+ }
+
+ return result;
+ }
/**
* We'll return null if we can create a specifier from the list item.
private String getSpecifier(ListItem item) {
String result = null;
- String csid = null;
- for (Element ele : item.getAny()) {
- String fieldName = ele.getTagName();
- String fieldValue = ele.getTextContent();
- if (fieldName.equalsIgnoreCase("csid")) {
- result = csid = fieldValue;
- break;
- }
- }
-
+ String csid = getCsid(item);
if (csid == null) {
- String shortId = null;
- for (Element ele : item.getAny()) {
- String fieldName = ele.getTagName();
- String fieldValue = ele.getTextContent();
- if (fieldName.equalsIgnoreCase("shortIdentifier")) {
- shortId = fieldValue;
- break;
- }
- }
-
+ String shortId = getShortId(item);
if (shortId != null) {
result = Specifier.createShortIdURNValue(shortId);
}