From: remillet Date: Wed, 24 Jan 2018 01:18:47 +0000 (-0800) Subject: DRYD-202: More support for term/item lists in POSTs and PUTs to vocabulary resources. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=170b0003bbaada3d8f1b4ffb1b977d0ac0de111e;p=tmp%2Fjakarta-migration.git DRYD-202: More support for term/item lists in POSTs and PUTs to vocabulary resources. --- diff --git a/services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java b/services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java index 587a41906..1567c6c6a 100644 --- a/services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java +++ b/services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java @@ -781,6 +781,10 @@ public class XmlReplay { serviceResult.error = msg; serviceResult.failureReason = " : SYSTEM ERROR; "; results.add(serviceResult); + // + // Fail fast + // + throw t; } } if (Tools.isTrue(autoDeletePOSTS) && param_autoDeletePOSTS){ diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml index 5f974a5c3..f21b64fd3 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml @@ -3,72 +3,69 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - - - - POST - /cspace-services/acquisitions/ - acquisitions/ac1.xml - + + + + POST + /cspace-services/acquisitions/ + acquisitions/ac1.xml + GET /cspace-services/acquisitions/${ac1.CSID} - + acquisitions/res/ac1.res.xml - - - + + + - - - POST - /cspace-services/acquisitions/ - acquisitions/ac1.xml - - - + + + POST + /cspace-services/acquisitions/ + acquisitions/ac1.xml + + + GET /cspace-services/acquisitions/${ac1.CSID} - + - acquisitions/res/ac1.res.xml - - + acquisitions/res/ac1.res.xml + + + + + POST + /cspace-services/acquisitions/ + acquisitions/ac2.xml + - - POST - /cspace-services/acquisitions/ - acquisitions/ac2.xml - - GET /cspace-services/acquisitions/${ac2.CSID} - + - acquisitions/res/ac2.res.xml - + acquisitions/res/ac2.res.xml + GET /cspace-services/acquisitions/?sortBy=&pgNum=0&pgSz=10 - + acquisitions/res/ac3list.res.xml - + - + - + - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml index ff361053f..53f8374e5 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml @@ -4,7 +4,7 @@ testGroup ID="person" is not live. It works, but may not clean up correctly. For now, use ID="updatePerson" --> - + POST /cspace-services/personauthorities/ @@ -31,7 +31,7 @@ /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID} - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -41,7 +41,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -51,7 +51,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -61,7 +61,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -71,7 +71,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -81,7 +81,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -91,7 +91,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -101,7 +101,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -111,7 +111,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml @@ -121,7 +121,7 @@ - + POST /cspace-services/loansout/ authrefs/loanout.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml index 18f76bd43..8a6672b36 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml @@ -5,7 +5,7 @@ For now, use ID="updatePerson" --> - + POST /cspace-services/intakes/ authrefs/intake1.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml index badb978d1..7a2bae39e 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml @@ -1,97 +1,97 @@ - - - - POST - /cspace-services/personauthorities/ - authrefs/newPersonAuthority.xml - - - POST - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - authrefs/newPerson1.xml - - - POST - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - authrefs/newPerson2.xml - + + + POST + /cspace-services/personauthorities/ + authrefs/newPersonAuthority.xml + + + POST + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + authrefs/newPerson1.xml + + + POST + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + authrefs/newPerson2.xml + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID} - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID} + - - POST - /cspace-services/loansout/ - authrefs/loanout.xml - - 42 - ${GetPerson1.got("//refName")} - - + + POST + /cspace-services/loansout/ + authrefs/loanout.xml + + 42 + ${GetPerson1.got("//refName")} + + - - POST - /cspace-services/loansout/ - authrefs/loanout.xml - - 102 - ${GetPerson2.got("//refName")} - - + + POST + /cspace-services/loansout/ + authrefs/loanout.xml + + 102 + ${GetPerson2.got("//refName")} + + - - GET - /cspace-services/loansout/${loanout1.CSID}/authorityrefs - - - authrefs/res/foo.res.xml - - + + GET + /cspace-services/loansout/${loanout1.CSID}/authorityrefs + + + authrefs/res/foo.res.xml + + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs - - - authrefs/res/refObjs.res.xml - - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs + + + authrefs/res/refObjs.res.xml + + - - POST - /cspace-services/orgauthorities/ - authrefs/orgauthorities_common.xml - - - - POST - /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/ - authrefs/organizations_common.xml - - ${GetPerson1.got("//refName")} - ${GetPerson2.got("//refName")} - - + + POST + /cspace-services/orgauthorities/ + authrefs/orgauthorities_common.xml + - - GET - /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs - - - authrefs/res/foo.res.xml - - - + + POST + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/ + authrefs/organizations_common.xml + + ${GetPerson1.got("//refName")} + ${GetPerson2.got("//refName")} + + + + + GET + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs + + + authrefs/res/foo.res.xml + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml index e9e1925cb..1eca2584e 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml @@ -1,62 +1,62 @@ - - - - POST - /cspace-services/personauthorities/ - authrefs/newPersonAuthority.xml - - - POST - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - authrefs/newPerson1.xml - + + + POST + /cspace-services/personauthorities/ + authrefs/newPersonAuthority.xml + + + POST + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + authrefs/newPerson1.xml + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} + - - POST - /cspace-services/loansin/ - authrefs/loanin.xml - - 42 - ${GetPerson1.got("//refName")} - - + + POST + /cspace-services/loansin/ + authrefs/loanin.xml + + 42 + ${GetPerson1.got("//refName")} + + - - GET - /cspace-services/loansin/${loanin1.CSID}/ - - - authrefs/res/foo.res.xml - - + + GET + /cspace-services/loansin/${loanin1.CSID}/ + + + authrefs/res/foo.res.xml + + - - GET - /cspace-services/loansin/${loanin1.CSID}/authorityrefs - - - authrefs/res/foo.res.xml - - + + GET + /cspace-services/loansin/${loanin1.CSID}/authorityrefs + + + authrefs/res/foo.res.xml + + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs - - - authrefs/res/refObjs.res.xml - - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs + + + authrefs/res/refObjs.res.xml + + - + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml index 9e011213a..ab8cb26e0 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml @@ -9,7 +9,7 @@ - + @@ -105,7 +105,7 @@ - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -166,7 +166,7 @@ 201 - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -207,7 +207,7 @@ - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -255,7 +255,7 @@ - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -283,7 +283,7 @@ - + POST @@ -382,7 +382,7 @@ 200 - + POST /cspace-services/batch/${createBatchRecordWithTiebreaker.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -423,7 +423,7 @@ 200 - + POST /cspace-services/batch/${createBatchRecordWithTiebreaker.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -458,7 +458,7 @@ 200 - + POST /cspace-services/batch/${createBatchRecordWithTiebreaker.CSID} batch/batch-invoke-updateobjloc-single.xml @@ -484,7 +484,7 @@ - + POST @@ -579,7 +579,7 @@ 201 - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-list.xml @@ -624,7 +624,7 @@ - + POST @@ -752,7 +752,7 @@ 201 - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-group.xml @@ -799,7 +799,7 @@ - + POST @@ -997,7 +997,7 @@ 201 - + POST /cspace-services/batch/${createBatchRecord.CSID} batch/batch-invoke-updateobjloc-nocontext.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml index 1621f330c..7684a080a 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml @@ -6,7 +6,7 @@ YmlnYmlyZEBjc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - + @@ -82,18 +82,18 @@ - - + + POST /cspace-services/batch/ batch/TestCreateAndLinkLoanOutBatchJob.xml - + POST /cspace-services/collectionobjects/ batch/collObj1.xml - + POST /cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID} batch/batch-invoke-single.xml @@ -101,7 +101,7 @@ ${createCollObj1.CSID} - + POST /cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID} batch/batch-invoke-list.xml @@ -109,7 +109,7 @@ ${createCollObj1.CSID} - + POST 400 /cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID} @@ -118,7 +118,7 @@ ${createCollObj1.CSID} - + POST 400 /cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID} @@ -127,11 +127,11 @@ ${createCollObj1.CSID} - + GET /cspace-services/batch?doctype=CollectionObject&inv=single - + GET /cspace-services/batch?doctype=Intake&inv=group diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-adv-search.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-adv-search.xml index 79e18b11d..069c0dd32 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-adv-search.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-adv-search.xml @@ -6,7 +6,7 @@ YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - + POST @@ -26,7 +26,7 @@ - + POST diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml index 17e187153..bc9801a0d 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml @@ -2,75 +2,52 @@ - 59PnafP1k9rcuGNMxbCfyQ3TphxKBqecsJI2Yv5vrms= + YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA= + - - - - - - + + + + + 401,403 POST /cspace-services/dimensions/ - - - dimension/1.xml - + dimension/1.xml - - - - 201,403 + + 201 POST /cspace-services/dimensions/ - - - dimension/1.xml - + dimension/1.xml - - - - - - - 201 - POST - /cspace-services/dimensions/ - - - dimension/1.xml - - + + + 201 + POST + /cspace-services/dimensions/ + dimension/1.xml + - - + GET /cspace-services/dimensions/${dimPOST.CSID} - + PUT /cspace-services/dimensions/${dimPOST.CSID} - - - dimension/2-put.xml - + dimension/2-put.xml - + GET /cspace-services/dimensions/${dimPOST.CSID} - - - + - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml index 2e9afdc0f..787ad27ab 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml @@ -1,11 +1,8 @@ - - dimensionType-1288727556164 - entryNumber-1288727556164 - entryDate-1288727556164 - + + dimensionType-1288727556164 + entryNumber-1288727556164 + entryDate-1288727556164 + - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml index 04c2eb725..0df70ffbb 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml @@ -640,7 +640,7 @@ - + POST diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml index 7df8f2059..c64b8fa6b 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml @@ -3,26 +3,16 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - - - - POST - /cspace-services/loansin/ - - - loanin/li1.xml - - - - - - - DELETE - /cspace-services/loansin/8080b6b8-393a-4e8a-b823 - - - + + + POST + /cspace-services/loansin/ + + + loanin/li1.xml + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml index ae9687d53..41a39dfca 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml @@ -3,17 +3,14 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - - - - POST - /cspace-services/loansout/ - loanout/1.xml - + + + + POST + /cspace-services/loansout/ + loanout/1.xml + - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml index 81eadadb0..244dbaeef 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml @@ -3,87 +3,85 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - + - + - POST - /cspace-services/personauthorities/ - - - objectexit/oe9.xml - - - - POST - /cspace-services/personauthorities/${oe9.CSID}/items/ - - - objectexit/oe11.xml - + POST + /cspace-services/personauthorities/ + objectexit/oe9.xml + + + POST + /cspace-services/personauthorities/${oe9.CSID}/items/ + objectexit/oe11.xml - POST - /cspace-services/objectexit/ - - - objectexit/oe15.xml - + POST + /cspace-services/objectexit/ + objectexit/oe15.xml + + + GET + /cspace-services/objectexit/${oe15.CSID}/authorityrefs + + + objectexit/res/authrefs-listAuthrefs.res.xml + - + - - POST - /cspace-services/objectexit/ - objectexit/oe1.xml - + + POST + /cspace-services/objectexit/ + objectexit/oe1.xml + GET /cspace-services/objectexit/${oe1.CSID} - + objectexit/res/oe2.res.xml - + + + + DELETE + /cspace-services/objectexit/${oe1.CSID} - - DELETE - /cspace-services/objectexit/${oe1.CSID} - - + - - POST - /cspace-services/objectexit/ - objectexit/oe1.xml - + + POST + /cspace-services/objectexit/ + objectexit/oe1.xml + GET /cspace-services/objectexit/${oe1.CSID} - + objectexit/res/oe2.res.xml /document/*[local-name()='objectexit_common'] - + - + - - POST - /cspace-services/objectexit/ - - checkList-1234 + + POST + /cspace-services/objectexit/ + + checkList-1234 objectexit/oe35.xml @@ -91,52 +89,52 @@ GET /cspace-services/objectexit/ - + objectexit/res/oe35.res.xml - ${oe35.CSID} - + ${oe35.CSID} + //list-item[./exitNumber='checkList-1234'] - + - - DELETE - /cspace-services/objectexit/065aa56e-a4f5-44b7-955e - - - DELETE - /cspace-services/objectexit/1735327c-f9bb-42c7-959b - - - DELETE - /cspace-services/objectexit/106cb53d-ee79-44e3-8665 - + + DELETE + /cspace-services/objectexit/065aa56e-a4f5-44b7-955e + + + DELETE + /cspace-services/objectexit/1735327c-f9bb-42c7-959b + + + DELETE + /cspace-services/objectexit/106cb53d-ee79-44e3-8665 + - + - - POST - /cspace-services/objectexit/ - - - objectexit/oe1.xml - - + + POST + /cspace-services/objectexit/ + + + objectexit/oe1.xml + + GET /cspace-services/objectexit/${oe1.CSID} - + objectexit/res/oe2.res.xml - + @@ -144,7 +142,7 @@ - + POST /cspace-services/objectexit/ @@ -156,48 +154,48 @@ - - - POST - /cspace-services/objectexit/ - - - objectexit/oe1.xml - - + + + POST + /cspace-services/objectexit/ + + + objectexit/oe1.xml + + GET /cspace-services/objectexit/${oe1.CSID} objectexit/res/oe2.res.xml - + - POST - /cspace-services/objectexit/ - - - objectexit/oe3.xml - - + POST + /cspace-services/objectexit/ + + + objectexit/oe3.xml + + - POST - /cspace-services/objectexit/ - - - objectexit/oe4.xml - - - - POST - /cspace-services/objectexit/ - - - objectexit/oe5.xml - - - - - - + + + - + GET /cspace-services/objectexit/9223372036854775807 404 @@ -222,50 +220,50 @@ /cspace-services/objectexit/${oe1.CSID} oe8.res.xml - - POST - /cspace-services/personauthorities/ - - - objectexit/oe9.xml - - - + + POST + /cspace-services/personauthorities/ + + + objectexit/oe9.xml + + + GET /cspace-services/personauthorities/${oe9.CSID} - + - POST - /cspace-services/personauthorities/${oe9.CSID}/items/ - - - objectexit/oe11.xml - + POST + /cspace-services/personauthorities/${oe9.CSID}/items/ + + + objectexit/oe11.xml + GET /cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID} - POST - /cspace-services/personauthorities/${oe9.CSID}/items/ - - - objectexit/oe13.xml - + POST + /cspace-services/personauthorities/${oe9.CSID}/items/ + + + objectexit/oe13.xml + GET /cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID} - POST - /cspace-services/objectexit/ - - - objectexit/oe15.xml - + POST + /cspace-services/objectexit/ + + + objectexit/oe15.xml + GET @@ -279,7 +277,7 @@ DELETE /cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID} - + DELETE /cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID} @@ -297,12 +295,12 @@ /cspace-services/objectexit/${oe1.CSID} - PUT - /cspace-services/objectexit/${oe1.CSID} - - - objectexit/oe23.xml - + PUT + /cspace-services/objectexit/${oe1.CSID} + + + objectexit/oe23.xml + DELETE @@ -313,14 +311,15 @@ /cspace-services/objectexit/9223372036854775807 404 - - PUT - /cspace-services/objectexit/9223372036854775807 - - - objectexit/oe23.xml - - 404 + + PUT + /cspace-services/objectexit/9223372036854775807 + + + objectexit/oe23.xml + + + 404 GET @@ -356,54 +355,52 @@ /cspace-services/objectexit/${oe5.CSID} - + - - POST - /cspace-services/objectexit/ - - - objectexit/oe1.xml - - + + POST + /cspace-services/objectexit/ + + + objectexit/oe1.xml + + - POST - /cspace-services/objectexit/ - - - objectexit/oe3.xml - - + POST + /cspace-services/objectexit/ + + + objectexit/oe3.xml + + - POST - /cspace-services/objectexit/ - - - objectexit/oe4.xml - - - - POST - /cspace-services/objectexit/ - - - objectexit/oe5.xml - - - + POST + /cspace-services/objectexit/ + + + objectexit/oe4.xml + + + + POST + /cspace-services/objectexit/ + + + objectexit/oe5.xml + + + GET /cspace-services/objectexit/ - + objectexit/res/oe6.res.xml - + - + - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml index 2b55fdd12..955f11e01 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml @@ -1,2 +1,17 @@ -7f441679-ab83-4832-85f9owenCurOwnerurn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)truetrueOwen the CurOwner - + + + + owenCurOwner + Owen the oe11 + Owneroe11 + + + John Wayneoe11 + false + John Wayneoe11 + oe11forename + oe11surname + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml index 3c358d87a..aba0de97a 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml @@ -1,2 +1,8 @@ -urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)exitDate-1290026474563exitNumber-1290026474563 - + + + + urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor) + exitDate-1290026474563 + exitNumber-1290026474563 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml index 41fbedd9a..ca8c61e8e 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml @@ -1,2 +1,7 @@ -ObjectexitPersonAuthObjectexitPersonAuthurn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'PersonAuthority - + + + + ObjectexitPersonAuth + ObjectexitPersonAuth + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml new file mode 100644 index 000000000..bc55d9643 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml @@ -0,0 +1,16 @@ + + 0 + 40 + 1 + 1 + + objectexit_common:depositor + + urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor) + + ObjectexitPersonAuth + + /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor) + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml new file mode 100644 index 000000000..c43a76448 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml index 6ff2193ae..e0c664ef1 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml @@ -1,16 +1,16 @@ - - + POST /cspace-services/personauthorities/ person/personauthorities_common.xml - CSPACE3739PersonAuthority + CSPACE3739PersonAuthority @@ -18,9 +18,10 @@ /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor1 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor1 + actor1 @@ -28,16 +29,16 @@ /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor2 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor2 + actor2 GET /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority) - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} @@ -54,26 +55,24 @@ GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - - - POST - /cspace-services/relations/ - relation/r-1.xml - + + POST + /cspace-services/relations/ + relation/r-1.xml + ${Person1.CSID} ${Person2.CSID} Persons Persons hasBroader - - - - - POST - /cspace-services/relations/ - relation/r-1.xml - - ${Person2.CSID} @@ -81,421 +80,379 @@ Persons Persons hasNarrower - - - - - - + + + + + + 404 POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common_w_relations.xml - - CSPACE3739PersonAuthority + CSPACE3739PersonAuthority - - - - - + + + POST /cspace-services/personauthorities/ person/personauthorities_common.xml - CSPACE3739PersonAuthority + CSPACE3739PersonAuthority - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorParent + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorParent - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild2 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild2 - - - + PUT /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} person/persons_common_w_relations.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${Person1.CSID} - ${PersonParent.CSID} - ${PersonChild.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${Person1.CSID} + ${PersonParent.CSID} + ${PersonChild.CSID} - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true - - - + PUT /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} person/persons_common_w_relations_2.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${Person1.CSID} - ${PersonParent.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${Person1.CSID} + ${PersonParent.CSID} - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - - PUT /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} person/persons_common_w_relations.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${Person1.CSID} - ${PersonParent.CSID} - ${PersonChild.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${Person1.CSID} + ${PersonParent.CSID} + ${PersonChild.CSID} - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - - + PUT /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} person/persons_common_w_relations_3.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${Person1.CSID} - ${PersonChild.CSID} - ${PersonChild2.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${Person1.CSID} + ${PersonChild.CSID} + ${PersonChild2.CSID} - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - - - !-- ========================= POST a person ===================================================== --> - - - + + PUT + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} + person/generic_persons_common_delete_all_relations_PUT.xml + + + + + + POST /cspace-services/personauthorities/ person/personauthorities_common.xml - CSPACE3739PersonAuthority + CSPACE3739PersonAuthority - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorParent + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorParent - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild - actorChild1 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild + actorChild1 - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild2 - actorChild2 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild2 + actorChild2 - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild3 - actorChild3 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild3 + actorChild3 - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common_w_relations_POST.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - - ${PersonParent.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID} - ${PersonChild.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} - ${PersonChild2.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID} - ${PersonChild3.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + + ${PersonParent.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID} + ${PersonChild.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} + ${PersonChild2.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID} + ${PersonChild3.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID} - - + GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true - - person/res/GETpostPerson_siblings.res.xml - - ${Person1.CSID} - ${PersonChild.CSID} - ${PersonChild2.CSID} - ${PersonChild3.CSID} - ${PersonChild2.termDisplayNameSuffix} - ${PersonChild3.termDisplayNameSuffix} - - /document/*[local-name()='relations-common-list'] - - - + + person/res/GETpostPerson_siblings.res.xml + + ${Person1.CSID} + ${PersonChild.CSID} + ${PersonChild2.CSID} + ${PersonChild3.CSID} + ${PersonChild2.termDisplayNameSuffix} + ${PersonChild3.termDisplayNameSuffix} + + /document/*[local-name()='relations-common-list'] + + GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true - - person/res/showAllRelations.res.xml - - /document/*[local-name()='relations-common-list'] - - - - - - GET - /cspace-services/relations/ - - - - GET - /cspace-services/relations?sbj=${PersonAuth1.CSID} - - - - GET - /cspace-services/relations?obj=${PersonAuth1.CSID} - - - - - - + /document/*[local-name()='relations-common-list'] + + + + GET + /cspace-services/relations/ + + + GET + /cspace-services/relations?sbj=${PersonAuth1.CSID} + + + GET + /cspace-services/relations?obj=${PersonAuth1.CSID} + + + PUT + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} + person/generic_persons_common_delete_all_relations_PUT.xml + + + + POST /cspace-services/personauthorities/ person/personauthorities_common.xml - CSPACE3739PersonAuthority + CSPACE3739PersonAuthority - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorParent + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorParent - - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild2 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild2 - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActorChild3 + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActorChild3 - - POST /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ person/persons_common_w_relations_POST.xml - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${PersonParent.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID} - ${PersonChild.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} - ${PersonChild2.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID} - ${PersonChild3.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID} + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${PersonParent.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID} + ${PersonChild.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} + ${PersonChild2.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID} + ${PersonChild3.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID} - - + GET /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true - - + GET /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/ - - - PUT - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} - person/persons_common_delete_relations_PUT.xml - - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - ${PersonChild.CSID} - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} - - - - + + PUT + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} + person/persons_common_delete_relations_PUT.xml + + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + ${PersonChild.CSID} + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID} + + + GET /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true - - - - PUT - /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} - person/persons_common_delete_all_relations_PUT.xml - - ${PersonAuth1.CSID} - CSPACE3739PersonAuthority - johnWayneActor - - - - + + PUT + /cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID} + person/persons_common_delete_all_relations_PUT.xml + + ${PersonAuth1.CSID} + CSPACE3739PersonAuthority + johnWayneActor + + + GET /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true - - - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml new file mode 100644 index 000000000..bc55d9643 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml @@ -0,0 +1,16 @@ + + 0 + 40 + 1 + 1 + + objectexit_common:depositor + + urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor) + + ObjectexitPersonAuth + + /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor) + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/testsciperson.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/testsciperson.xml index 3e0cf50b2..f4b1bec86 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/testsciperson.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/testsciperson.xml @@ -1,161 +1,159 @@ - - - YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - + + + YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + - - - - POST - /cspace-services/personauthorities/ - person/personauthorities_common.xml - - TestPersonAuthority - - - - POST - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - person/persons_common_and_testsci.xml - - johnWayneActor1 - John - Wayne - Actor - - - - POST - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - person/persons_common_and_testsci.xml - - billyBob1 - Billy-Bob - Homeboy - Goof - - - - GET - /cspace-services/personauthorities/ - - - GET - /cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority) - - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID} - - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ - - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} - + + + POST + /cspace-services/personauthorities/ + person/personauthorities_common.xml + + TestPersonAuthority + + + + POST + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + person/persons_common_and_testsci.xml + + johnWayneActor1 + John + Wayne + Actor + + + + POST + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + person/persons_common_and_testsci.xml + + billyBob1 + Billy-Bob + Homeboy + Goof + + + + GET + /cspace-services/personauthorities/ + + + GET + /cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority) + + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID} + + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/ + + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID} + - - PUT - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID} - person/persons_common_and_testsci_set_broader.xml - - billyBob1 - Billy-Bob - Homeboy - Goof - ${Person2.CSID} - ${Person1.CSID} - John Wayne - - + + PUT + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID} + person/persons_common_and_testsci_set_broader.xml + + billyBob1 + Billy-Bob + Homeboy + Goof + ${Person2.CSID} + ${Person1.CSID} + John Wayne + + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true - - - person/res/testsciPersonWithRelns.res.xml - - /document/*[local-name()='relations-common-list'] - - - - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true - - - person/res/testsciPersonWithRelns.res.xml - - /document/*[local-name()='relations-common-list'] - - + /document/*[local-name()='relations-common-list'] + + - - POST - /cspace-services/loansin/ - authrefs/loanin.xml - - 42 - ${getPerson1.got("//refName")} - - + + POST + /cspace-services/loansin/ + authrefs/loanin.xml + + 42 + ${getPerson1.got("//refName")} + + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs - - - person/res/refObjs.res.xml - - 1 - - - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs + + + person/res/refObjs.res.xml + + 1 + + + - - POST - /cspace-services/acquisitions/ - person/acquisition.xml - - 42 - ${getPerson1.got("//refName")} - - + + POST + /cspace-services/acquisitions/ + person/acquisition.xml + + 42 + ${getPerson1.got("//refName")} + + - - GET - /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs - - - person/res/refObjs.res.xml - - 2 - - - + + GET + /cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs + + + person/res/refObjs.res.xml + + 2 + + + - + - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml index bce5372a3..934e534f8 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml @@ -5,18 +5,18 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - - + + POST /cspace-services/objectexit/ relation/oe1.xml - + POST /cspace-services/objectexit/ relation/oe1.xml - + POST /cspace-services/relations/ relation/r-1.xml @@ -28,7 +28,7 @@ hasBroader - + POST /cspace-services/relations/ relation/r-1.xml @@ -41,7 +41,7 @@ hasBroader - + GET /cspace-services/relations/ @@ -54,18 +54,18 @@ --> - - + + POST /cspace-services/objectexit/ relation/oe1.xml - + POST /cspace-services/objectexit/ relation/oe1.xml - + POST /cspace-services/relations/ relation/r-2.xml @@ -77,14 +77,14 @@ hasBroader - + GET /cspace-services/relations/ - + POST /cspace-services/relations/ relation/r-2.xml @@ -96,7 +96,7 @@ hasBroader - + GET /cspace-services/relations/ diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml index 1b0ccaf78..51ee94662 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml @@ -1,25 +1,25 @@ - + YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - - - - + + + + POST /cspace-services/reports/ report/report1Record.xml 201 - + GET /cspace-services/reports/${createReport1.CSID} - - + + POST /cspace-services/acquisitions/ report/acquisition1.xml @@ -28,7 +28,7 @@ 201 - + - + POST /cspace-services/reports/${createReport1.CSID} report/report1InvContextStandalone.xml @@ -48,7 +48,7 @@ ${createAcquisition1.CSID} - + report/res/report1.res.xml ${createAcquisition1.acquisitionReferenceNumber} @@ -56,12 +56,11 @@ 200 - + - + - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml index 5d4201c0d..a3c6f621c 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml @@ -1,96 +1,94 @@ - - - - - YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - + + + + + YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + - - - - - - - POST - /cspace-services/movements/ - versioning/movement.xml - - - - - - - jlmbsoqtqbfjotldjlmbsoq - old current location note - - 201 - - - - GET - /cspace-services/movements - - - - PUT - /cspace-services/movements/${CreateMovement.CSID} - versioning/movement.xml - - ${CreateMovement.currentLocationValue} - new current location note - - 200 - - - - - - - GET - /cspace-services/movements - - - - ${ListAllMovementRecords.got("//totalItems")} - - versioning/res/movement-list.res.xml - - - - - - - - - GET - /cspace-services/movements?kw=${CreateMovement.currentLocationValue} - - - - 1 - - versioning/res/movement-list.res.xml - - - - - - - GET - /cspace-services/movements/${CreateMovement.CSID} - - ${UpdateMovement.currentLocationNoteValue} - - - - versioning/res/movement.res.xml - - + + + + - + + POST + /cspace-services/movements/ + versioning/movement.xml + + + + + + + jlmbsoqtqbfjotldjlmbsoq + old current location note + + 201 + - + + GET + /cspace-services/movements + + + + PUT + /cspace-services/movements/${CreateMovement.CSID} + versioning/movement.xml + + ${CreateMovement.currentLocationValue} + new current location note + + 200 + + + + + + + GET + /cspace-services/movements + + + + ${ListAllMovementRecords.got("//totalItems")} + + versioning/res/movement-list.res.xml + + + + + + + + + GET + /cspace-services/movements?kw=${CreateMovement.currentLocationValue} + + + + 1 + + versioning/res/movement-list.res.xml + + + + + + GET + /cspace-services/movements/${CreateMovement.CSID} + + ${UpdateMovement.currentLocationNoteValue} + + + + versioning/res/movement.res.xml + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml index c6f84fdec..9eb678e11 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml @@ -1,13 +1,15 @@ - 6 + 10 createReplaceVocabItems ${csid} - createReplaceVocabItems Vocabulary + Updated createReplaceVocabItems Vocabulary - This is a test vocabulary for test createReplaceVocabItems + This is an updated test vocabulary created in the createReplaceVocabItems XMLReplay test group - createReplaceVocabItems + + Some updated mythical book posted with item terms in createReplaceVocabItems test group + urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems)'createReplaceVocabItems Vocabulary' @@ -16,10 +18,46 @@ 0 2500 - 0 - 0 + 3 + 3 csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitema)'Replacement item A' + + project + 0 + false + true + 1 + Replacement item A + replacementitema + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemb)'Replacement item B' + + project + 0 + false + true + 2 + Replacement item B + replacementitemb + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemc)'Replacement item C' + + project + 0 + false + true + 3 + Replacement item C + replacementitemc + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml new file mode 100644 index 000000000..fba9c64d9 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml @@ -0,0 +1,75 @@ + + + 10 + createUpdateAddDeleteVocabItems + ${csid} + Updated createUpdateAddDeleteVocabItems Vocabulary + + This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group + + + Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems)'createUpdateAddDeleteVocabItems Vocabulary' + + enum + + + 0 + 2500 + 4 + 4 + + csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditema)'Added item A' + + project + 0 + false + true + 2 + Added item A + addeditema + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemb)'Added item B' + + project + 0 + false + true + 3 + Added item B + addeditemb + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemc)'Added item C' + + project + 0 + false + true + 4 + Added item C + addeditemc + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(createItem301)'Updated createItem301' + + project + 1 + false + true + 1 + Updated createItem301 + createItem301 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml new file mode 100644 index 000000000..6128aceac --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml @@ -0,0 +1,31 @@ + + + + Updated createUpdateAddDeleteVocabItems Vocabulary + createUpdateAddDeleteVocabItems + This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group + Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group + + + + 1 + Updated createItem301 + createItem301 + + + 2 + Added item A + addeditema + + + 3 + Added item B + addeditemb + + + 4 + Added item C + addeditemc + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml new file mode 100644 index 000000000..2150bfa85 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml @@ -0,0 +1,99 @@ + + + 8 + createUpdateAddOnlyVocabItems + ${csid} + Updated createUpdateAddOnlyVocabItems Vocabulary + + This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group + + + Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems)'createUpdateAddOnlyVocabItems Vocabulary' + + enum + + + 0 + 2500 + 6 + 6 + + csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditema)'Added item A' + + project + 0 + false + true + 4 + Added item A + addeditema + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemb)'Added item B' + + project + 0 + false + true + 5 + Added item B + addeditemb + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemc)'Added item C' + + project + 0 + false + true + 6 + Added item C + addeditemc + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem101)'createItem101' + + project + 0 + false + true + 1 + createItem101 + createItem101 + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem201)'createItem201' + + project + 0 + false + true + 2 + createItem201 + createItem201 + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem301)'Updated createItem301' + + project + 1 + false + true + 3 + Updated createItem301 + createItem301 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml new file mode 100644 index 000000000..a8ef9e491 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml @@ -0,0 +1,31 @@ + + + + Updated createUpdateAddOnlyVocabItems Vocabulary + createUpdateAddOnlyVocabItems + This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group + Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group + + + + 3 + Updated createItem301 + createItem301 + + + 4 + Added item A + addeditema + + + 5 + Added item B + addeditemb + + + 6 + Added item C + addeditemc + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml new file mode 100644 index 000000000..9f5991f24 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml @@ -0,0 +1,99 @@ + + + 10 + createUpdateAddSoftDeleteVocabItems + ${csid} + Updated createUpdateAddSoftDeleteVocabItems Vocabulary + + This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group + + + Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems)'createUpdateAddSoftDeleteVocabItems Vocabulary' + + enum + + + 0 + 2500 + 6 + 6 + + csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditema)'Added item A' + + project + 0 + false + true + 2 + Added item A + addeditema + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemb)'Added item B' + + project + 0 + false + true + 3 + Added item B + addeditemb + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemc)'Added item C' + + project + 0 + false + true + 4 + Added item C + addeditemc + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem101)'createItem101' + + deleted + 1 + false + true + 1 + createItem101 + createItem101 + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem201)'createItem201' + + deleted + 1 + false + true + 2 + createItem201 + createItem201 + + + + urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem301)'Updated createItem301' + + project + 1 + false + true + 1 + Updated createItem301 + createItem301 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml new file mode 100644 index 000000000..e3fa5bdbb --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml @@ -0,0 +1,31 @@ + + + + Updated createUpdateAddSoftDeleteVocabItems Vocabulary + createUpdateAddSoftDeleteVocabItems + This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group + Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group + + + + 1 + Updated createItem301 + createItem301 + + + 2 + Added item A + addeditema + + + 3 + Added item B + addeditemb + + + 4 + Added item C + addeditemc + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml index f9bb9190e..b02a86342 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml @@ -6,6 +6,108 @@ YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + + + + POST + /cspace-services/vocabularies/ + vocabulary/vocab-Template.xml + + + POST + /cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 1 + + + + POST + /cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 2 + + + + POST + /cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 3 + + + + PUT + /cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?omittedItemAction=softdelete + vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml + + + GET + /cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?showItems=true + + + ${createUpdateAddSoftDeleteVocabItems.CSID} + + + vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml + + + + + + + + POST + /cspace-services/vocabularies/ + vocabulary/vocab-Template.xml + + + POST + /cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 1 + + + + POST + /cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 2 + + + + POST + /cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 3 + + + + PUT + /cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID} + vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml + + + GET + /cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}?showItems=true + + + ${createUpdateAddOnlyVocabItems.CSID} + + + vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml + + + + @@ -41,17 +143,8 @@ PUT - /cspace-services/vocabularies/${createReplaceVocabItems.CSID} - vocabulary/ReplaceVocabItems/ReplaceVocabItems.res.xml - - + + + POST + /cspace-services/vocabularies/ + vocabulary/vocab-Template.xml + + + POST + /cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 1 + + + + POST + /cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 2 + + + + POST + /cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/ + vocabulary/vocab-Item-template.xml + + 3 + + + + PUT + /cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?omittedItemAction=delete + vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml + + + GET + /cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?showItems=true + + + ${createUpdateAddDeleteVocabItems.CSID} + + + vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml - --> @@ -201,7 +343,7 @@ /cspace-services/vocabularies/ vocabulary/vocab-Template.xml - + POST /cspace-services/vocabularies/${createEmptyVocab.CSID}/items/ vocabulary/vocab-Item-template.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml index 03449900d..92e45c48f 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml @@ -37,7 +37,7 @@ - + diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index cd910aae5..4bd707726 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -49,6 +49,7 @@ import org.collectionspace.services.client.PoxPayloadIn; 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; @@ -79,7 +80,10 @@ import org.collectionspace.services.common.query.QueryManager; 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; @@ -91,10 +95,9 @@ import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentFilter; 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; @@ -773,12 +776,21 @@ public abstract class AuthorityResource // 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(); diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 7cc8e3ed2..7a60881e5 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -94,6 +94,7 @@ public abstract class AuthorityItemDocumentModelHandler 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 @@ -115,6 +116,17 @@ public abstract class AuthorityItemDocumentModelHandler 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' // @@ -870,16 +882,19 @@ public abstract class AuthorityItemDocumentModelHandler 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())); + } } /** diff --git a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java index df8e25ba6..b8ef0b8eb 100644 --- a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java +++ b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java @@ -333,10 +333,11 @@ public class LoaninAuthRefsTest extends BaseServiceTest { * 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 ..."); } @@ -345,31 +346,58 @@ public class LoaninAuthRefsTest extends BaseServiceTest { 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; } diff --git a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java index eac316a5e..94076561f 100644 --- a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java +++ b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java @@ -324,10 +324,11 @@ public class LoanoutAuthRefsTest extends BaseServiceTest { * 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 ..."); } @@ -336,29 +337,63 @@ public class LoanoutAuthRefsTest extends BaseServiceTest { 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; } diff --git a/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java b/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java index 3159c1b6d..b733c7646 100644 --- a/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java +++ b/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java @@ -38,7 +38,16 @@ public class VocabularyClient extends AuthorityClientImpl 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(); @@ -137,14 +145,15 @@ public class VocabularyResource extends @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 ctx = createServiceContext(theUpdate); + ServiceContext ctx = createServiceContext(theUpdate, uriInfo); RepositoryClient repoClient = this.getRepositoryClient(ctx); CoreSessionInterface repoSession = repoClient.getRepositorySession(ctx); @@ -158,7 +167,7 @@ public class VocabularyResource extends 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(); @@ -172,9 +181,175 @@ public class VocabularyResource extends return result.getBytes(); } + private void updateWithItemsPayload( + AbstractCommonList itemsList, + ServiceContext 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 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 existingCtx, + AbstractCommonList abstractCommonList, + Set 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 existingCtx, + AbstractCommonList abstractCommonList, + Set 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 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 getListOfShortIds(AbstractCommonList itemsList) { + HashSet result = new HashSet(); + + 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, @@ -184,46 +359,48 @@ public class VocabularyResource extends 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. @@ -234,27 +411,9 @@ public class VocabularyResource extends 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); }