diff --git a/docs/src/docs/asciidoc/includes/_data.adoc b/docs/src/docs/asciidoc/includes/_data.adoc index e7b9fe9c696c90bfdc4f3135a4c4cddbc0e323bf..d793e1a6620c23b5e2de5ae59684321d7ae059b4 100644 --- a/docs/src/docs/asciidoc/includes/_data.adoc +++ b/docs/src/docs/asciidoc/includes/_data.adoc @@ -41,6 +41,18 @@ In onderstaande tabel een overzicht van typen die worden gebruikt. |`rgbz:auditItem` |Verzorgt de opslag van 1 audit item. Bevat eigenschappen: `rgbz:auditToelichting`, `rgbz:auditClientId`, `rgbz:auditUserId`, `rgbz:auditUserRepresentation` en `rgbz:auditStatusCode`. +|`rgbz:bestandsdeel` +|Verzorgt de opslag van bestandsdeel informatie. + +|`rgbz:bestandsdeelItem` +|Verzorgt de opslag van 1 bestandsdeel item. Bevat eigenschappen: `rgbz:bestandsdeelParent`, `rgbz:bestandsdeelVolgnummer`, `rgbz:bestandsdeelVoltooid`. + +|`rgbz:verzending` +|Verzorgt de opslag van verzending informatie. + +|`rgbz:verzendingItem` +|Verzorgt de opslag van 1 verzending item. Bevat eigenschappen: `rgbz:betrokkene`, `rgbz:aardRelatie`, `rgbz:toelichting`, `rgbz:ontvangstdatumVerzending`, `rgbz:verzenddatumVerzending`, `rgbz:contactPersoon`, `rgbz:contactpersoonnaam`, `rgbz:faxnummer`, `rgbz:emailadres`, `rgbz:mijnOverheid`, `rgbz:telefoonnummer`, `rgbz:huisletter`, `rgbz:huisnummer`, `rgbz:huisnummerToevoeging`, `rgbz:naamOpenbareRuimte`, `rgbz:postcode`, `rgbz:woonplaatsnaam`, `rgbz:adresBuitenland1`, `rgbz:adresBuitenland2`, `rgbz:adresBuitenland3`, `rgbz:landPostadres`, `rgbz:postBusOfAntwoordnummer`, `rgbz:postadresPostcode`, `rgbz:postadresType`, `rgbz:woonplaatsnaamPostadres`. + |=== ==== Aspecten @@ -58,9 +70,6 @@ Aspecten zijn een fundamenteel concept met betrekking tot content modellering in |`rgbz:enkelvoudigInformatieobject` |Alle eigenschappen voor het enkelvoudigInformatieobject (EIO) item. -|`rgbz:bestandsdeel` -|Alle eigenschappen voor het bestandsdeel item. Bevat eigenschappen voor koppeling aan enkelvoudigInformatieobject. - |`rgbz:versionable` |Zorgt ervoor dat versiebeheer actief wordt bij het bijwerken van eigenschappen. @@ -70,6 +79,12 @@ Aspecten zijn een fundamenteel concept met betrekking tot content modellering in |`rgbz:gebruiksrechten` |Definieert child association voor het opslaan van gebruiksrecht items. +|`rgbz:bestandsdelen` +|Definieert child association voor het opslaan van bestandsdeel items. + +|`rgbz:verzendingen` +|Definieert child association voor het opslaan van verzending items. + |=== ===== rgbz:base @@ -158,27 +173,6 @@ Aspecten zijn een fundamenteel concept met betrekking tot content modellering in |=== -===== rgbz:bestandsdeel - -[cols="30,20,50"] -.Overzicht metadata -|=== -|Naam |Type (Multiplicity) |Omschrijving - -|`rgbz:bestandsdeelParent` -|`d:noderef (0..1)` -| NodeRef van het informatieobject waar het bestandsdeel onderdeel van is. - -|`rgbz:bestandsdeelVolgnummer` -|`d:int (0..1)` -| Het volgnummer van het bestandsdeel. - -|`rgbz:bestandsdeelVoltooid` -|`d:boolean (0..1)` -| Boolean om aante geven of het bestandsdeel is geupload. - -|=== - ifdef::backend-pdf[<<<] ==== Waardebeperkingen diff --git a/docs/src/docs/asciidoc/includes/_external_interfaces.adoc b/docs/src/docs/asciidoc/includes/_external_interfaces.adoc index c0a1a532a51d60950fe0c2c751eef142446ab989..25ac0be85422c78d7c73f9873e6001825240c56c 100644 --- a/docs/src/docs/asciidoc/includes/_external_interfaces.adoc +++ b/docs/src/docs/asciidoc/includes/_external_interfaces.adoc @@ -154,4 +154,40 @@ Het doel van deze sectie is om alles wat belangrijk is vanuit een API perspectie |=== +=== Verzendingen + +[cols="12,46,42"] +|=== +| Methode | URL | Omschrijving + +| GET +| `/alfresco/service/drc/v1/verzendingen` +| Alle VERZENDINGen opvragen op basis van parameters: `aardRelatie`, `informatieobject`, `betrokkene` en `page`. + +| GET +| `/alfresco/service/drc/v1/verzendingen/{uuid}` +| Een specifiek VERZENDING opvragen. + +| POST +| `/alfresco/service/drc/v1/verzendingen` +| Maak een VERZENDING aan. + +| PUT +| `/alfresco/service/drc/v1/verzendingen` +| Werk een VERZENDING in zijn geheel bij. + +| PATCH +| `/alfresco/service/drc/v1/verzendingen` +| Werk een VERZENDING deels bij. + +| DELETE +| `/alfresco/service/drc/v1/verzendingen/{uuid}` +| Verwijder een VERZENDING. + +| HEAD +| `/alfresco/service/drc/v1/verzendingen/{uuid}` +| Vraag de headers op die je bij een GET request zou krijgen. + +|=== + ifdef::backend-pdf[<<<] \ No newline at end of file diff --git a/docs/src/docs/asciidoc/includes/_introduction.adoc b/docs/src/docs/asciidoc/includes/_introduction.adoc index 7a5d726028d960e35784ab7a181f92a186919d42..4a168abe64c7c9966bbf6d1a84d69c74e74eb5df 100644 --- a/docs/src/docs/asciidoc/includes/_introduction.adoc +++ b/docs/src/docs/asciidoc/includes/_introduction.adoc @@ -21,7 +21,7 @@ drc.folderPath=/{year}/{month}/{uuid} drc.maxItems=100 # Default chunk size for file parts (Bestandsdelen). This value represents Bytes -drc.maxChunkSize=2097152 +drc.maxChunkSize=104857600 # Property validations drc.validation.enabled=true @@ -44,7 +44,7 @@ Indien de documenten in een andere site moeten worden geplaatst, zal `drc.siteSh Voor het opvragen van documenten wordt standaard 100 items per pagina getoond. Dit kan worden aangepast met `drc.maxItems`. Deze waarde kan maximaal ingesteld worden tot 1000 items. -Voor Bestandsdelen staat standaard een grote van 2 MB. Dit kan worden aangepast met `drc.maxChunkSize`. Deze waarde wordt genoteerd in Bytes. Deze property bepaald hoeveel Bestandsdelen er worden aangemaakt bij het aanmaken van een Enkelvoudiginformatieobject zonder inhoud. +Voor Bestandsdelen staat standaard een grote van 100 MB. Dit kan worden aangepast met `drc.maxChunkSize`. Deze waarde wordt genoteerd in Bytes. Deze property bepaald hoeveel Bestandsdelen er worden aangemaakt bij het aanmaken van een Enkelvoudiginformatieobject zonder inhoud. In Alfresco krijgt alle content standaard een uniek nummer. Dit nummer wordt gebruikt voor eigenschap `rgbz:identificatie`. Er is de mogelijkheid om het identificatienummer aan te passen waarbij een datum wordt toegevoegd of een standaard tekst. Standaard wordt het nummer als volgt weergegeven: `0000000001`. diff --git a/docs/src/docs/asciidoc/includes/_quality_attributes.adoc b/docs/src/docs/asciidoc/includes/_quality_attributes.adoc index f31cddd8518682557bd319938df46c694df09fcc..782fb7e07504fe53db17d76bcf3b6b47cd5cb7dc 100644 --- a/docs/src/docs/asciidoc/includes/_quality_attributes.adoc +++ b/docs/src/docs/asciidoc/includes/_quality_attributes.adoc @@ -9,8 +9,8 @@ Het project documentregistratiecomponent (DRC) Test Automation System (TAS) REST * `test_enkelvoudiginformatieobject.py`; * `test_auth.py`; * `test_upload.py`; -* `test_caching.py`. - -Dit project bevat de mogelijkheid om zowel *DRC Gemma* (referentie-implementatie), *DRC Open Zaak* als *DRC Alfresco* te testen. Meer informatie over de unit tests kan men vinden op de volgende url: https://git.contezza.nl/develop/products/drc-tas-restapi. +* `test_caching.py`; +* `test_validation.py`. +* `test_verzending.py` ifdef::backend-pdf[<<<] \ No newline at end of file diff --git a/integration-tests/docker/docker-compose.yml b/integration-tests/docker/docker-compose.yml index 03aaf79fcf51625b688536fe9ae407aa8e419c2d..09297ee6e2fc5c740a449578e8a69e6dc6df28d1 100644 --- a/integration-tests/docker/docker-compose.yml +++ b/integration-tests/docker/docker-compose.yml @@ -141,7 +141,7 @@ services: - open-notificaties.local drc.local: - image: ghcr.io/vng-realisatie/documenten-api:1.4.3 + image: ghcr.io/vng-realisatie/documenten-api:1.5.0 platform: linux/amd64 environment: - TZ=Europe/Amsterdam diff --git a/integration-tests/run-tests.sh b/integration-tests/run-tests.sh index 37bceaf187b993df1de12cac1b937b3aa6bec70c..c1bcb97130dc7a6d2fece4b44e9e0fe07180d5e1 100755 --- a/integration-tests/run-tests.sh +++ b/integration-tests/run-tests.sh @@ -44,7 +44,7 @@ cat <<EOL >$TEST_POM EOL # Run Maven test with the temporary POM file -docker run -it --network=dev_network -v "$(pwd)":/root -w /root adoptopenjdk/maven-openjdk11:latest mvn test -f $TEST_POM -Dnashorn.args=--no-deprecation-warning -Denv=$ENV_PARAM +docker run --rm -it --network=dev_network -v "$(pwd)":/root -w /root adoptopenjdk/maven-openjdk11:latest mvn test -f $TEST_POM -Dnashorn.args=--no-deprecation-warning -Denv=$ENV_PARAM # Clean up temporary POM file rm $TEST_POM diff --git a/integration-tests/src/main/java/nl/contezza/drc/dataprovider/DRCDataProvider.java b/integration-tests/src/main/java/nl/contezza/drc/dataprovider/DRCDataProvider.java index 9405ba77768196bc1e8a270b8a48e6e629dff046..c9270a3418560ff58ee162f570a13c16b883b362 100644 --- a/integration-tests/src/main/java/nl/contezza/drc/dataprovider/DRCDataProvider.java +++ b/integration-tests/src/main/java/nl/contezza/drc/dataprovider/DRCDataProvider.java @@ -1,6 +1,8 @@ package nl.contezza.drc.dataprovider; import java.security.SecureRandom; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.Base64; import java.util.Date; import java.util.UUID; @@ -52,6 +54,7 @@ public class DRCDataProvider { json.put("beschrijving", "test_beschrijving"); json.put("informatieobjecttype", iot); json.put("vertrouwelijkheidaanduiding", "openbaar"); + json.put("verschijningsvorm", "Een verschijningsvorm"); return json.toString(); } @@ -339,6 +342,74 @@ public class DRCDataProvider { return json.toString(); } + @DataProvider(name = "create_verzending") + public static String createVerzending(String eioUrl, VerzendingAddressType adressType) { + + JSONObject json = new JSONObject(); + json.put("betrokkene", "http://een.link"); + json.put("informatieobject", eioUrl); + json.put("aardRelatie", "afzender"); + json.put("toelichting", "Test verzending"); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + json.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + json.put("verzenddatum", LocalDate.now().format(formatter)); + json.put("contactPersoon", "http://een.link"); + json.put("contactpersoonnaam", "Test verzending"); + + if (adressType != null) { + switch (adressType) { + case BINNENLANDS_CORRESPONDENTIEADRES: + JSONObject binnenlandsCorrespondentieadres = new JSONObject(); + binnenlandsCorrespondentieadres.put("huisletter", "A"); + binnenlandsCorrespondentieadres.put("huisnummer", 123); + binnenlandsCorrespondentieadres.put("huisnummerToevoeging", "Bis"); + binnenlandsCorrespondentieadres.put("naamOpenbareRuimte", "Test"); + binnenlandsCorrespondentieadres.put("postcode", "1234AB"); + binnenlandsCorrespondentieadres.put("woonplaatsnaam", "Amsterdam"); + json.put("binnenlandsCorrespondentieadres", binnenlandsCorrespondentieadres); + break; + + case BUITENLANDS_CORRESPONDENTIEADRES: + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "1st Avenue"); + buitenlandsCorrespondentieadres.put("adresBuitenland2", "Suite 101"); + buitenlandsCorrespondentieadres.put("adresBuitenland3", "NY 10001"); + buitenlandsCorrespondentieadres.put("landPostadres", "http://een.link"); + json.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + break; + + case CORRESPONDENTIE_POSTADRES: + JSONObject correspondentiePostadres = new JSONObject(); + correspondentiePostadres.put("postBusOfAntwoordnummer", 567); + correspondentiePostadres.put("postadresPostcode", "5678CD"); + correspondentiePostadres.put("postadresType", "antwoordnummer"); + correspondentiePostadres.put("woonplaatsnaam", "Utrecht"); + json.put("correspondentiePostadres", correspondentiePostadres); + break; + + case FAX: + json.put("faxnummer", "0201234567"); + break; + + case EMAIL: + json.put("emailadres", "test@link.nl"); + break; + + case PHONE: + json.put("telefoonnummer", "0612345678"); + break; + + case GOVERMENT: + json.put("mijnOverheid", true); + break; + + default: + break; + } + } + return json.toString(); + } + @DataProvider(name = "unlock") public static String unlock(String lockId) { JSONObject json = new JSONObject(); @@ -354,4 +425,14 @@ public class DRCDataProvider { } return json.toString(); } + + public enum VerzendingAddressType { + BINNENLANDS_CORRESPONDENTIEADRES, + BUITENLANDS_CORRESPONDENTIEADRES, + CORRESPONDENTIE_POSTADRES, + FAX, + EMAIL, + PHONE, + GOVERMENT; + } } diff --git a/integration-tests/src/main/java/nl/contezza/drc/service/EIOService.java b/integration-tests/src/main/java/nl/contezza/drc/service/EIOService.java index d6fcae857e44975458db57b329f10fb29bd561b1..4b890b225d3f53859a71189637f860de8587271f 100644 --- a/integration-tests/src/main/java/nl/contezza/drc/service/EIOService.java +++ b/integration-tests/src/main/java/nl/contezza/drc/service/EIOService.java @@ -54,7 +54,7 @@ public class EIOService { public Response testCreate(RequestSpecification requestSpecification, JSONObject jsonObject) { // @formatter:off return given() - .spec(DRCRequestSpecification.getDefault()) + .spec(requestSpecification) .body(jsonObject.toString()) .when() .post("/enkelvoudiginformatieobjecten") @@ -270,6 +270,20 @@ public class EIOService { // @formatter:on } + public Response partialUpdate(RequestSpecification requestSpecification, String eioUrl, JSONObject body) { + String id = eioUrl.substring(eioUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(requestSpecification) + .when() + .body(body.toString()) + .patch("/enkelvoudiginformatieobjecten/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + public Response testIntegrityCreate(String iot, JSONObject integrity) { // @formatter:off return given() diff --git a/integration-tests/src/main/java/nl/contezza/drc/service/VerzendingenService.java b/integration-tests/src/main/java/nl/contezza/drc/service/VerzendingenService.java new file mode 100644 index 0000000000000000000000000000000000000000..3a19f04ebb681478384f129cc2531750e9cd74a5 --- /dev/null +++ b/integration-tests/src/main/java/nl/contezza/drc/service/VerzendingenService.java @@ -0,0 +1,230 @@ +package nl.contezza.drc.service; + +import static io.restassured.RestAssured.given; + +import java.util.HashMap; +import java.util.Map; + +import org.json.JSONObject; + +// import java.util.HashMap; +// import java.util.Map; + +import io.restassured.response.Response; +import io.restassured.specification.RequestSpecification; +// import lombok.AllArgsConstructor; +import nl.contezza.drc.dataprovider.DRCDataProvider; + +public class VerzendingenService { + public Response create(String eioUrl) { + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .body(DRCDataProvider.createVerzending(eioUrl, DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)) + .when() + .post("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + public Response create(JSONObject jsonObject) { + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .body(jsonObject.toString()) + .when() + .post("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + public Response create(RequestSpecification req, String eioUrl) { + // @formatter:off + return given() + .spec(req) + .body(DRCDataProvider.createVerzending(eioUrl, DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)) + .when() + .post("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + /** + * Get enkelvoudiginformatieobject (EIO) + * + * @param id String identificatie + * @param version Integer version number + * @return Response response of request + */ + public Response get(String verzendingUrl) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .when() + .get("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response get(RequestSpecification requestSpecification, String verzendingUrl) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(requestSpecification) + .when() + .get("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response list(String aardRelatie, String informatieobject, String betrokkene, Integer page) { + Map<String, String> params = new HashMap<String, String>(); + if (aardRelatie != null) { + params.put("aardRelatie", aardRelatie); + } + + if (informatieobject != null) { + params.put("informatieobject", informatieobject); + } + + if (betrokkene != null) { + params.put("betrokkene", betrokkene); + } + + if (page != null) { + params.put("page", String.valueOf(page)); + } + // @formatter:off + return given() + .params(params) + .spec(DRCRequestSpecification.getDefault()) + .when() + .get("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + public Response list(RequestSpecification requestSpecification, String aardRelatie, String informatieobject, + String betrokkene, Integer page) { + Map<String, String> params = new HashMap<String, String>(); + if (aardRelatie != null) { + params.put("aardRelatie", aardRelatie); + } + + if (informatieobject != null) { + params.put("informatieobject", informatieobject); + } + + if (betrokkene != null) { + params.put("betrokkene", betrokkene); + } + + if (page != null) { + params.put("page", String.valueOf(page)); + } + // @formatter:off + return given() + .params(params) + .spec(requestSpecification) + .when() + .get("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + public Response list(Map<String, String> params) { + // @formatter:off + return given() + .params(params) + .spec(DRCRequestSpecification.getDefault()) + .when() + .get("/verzendingen") + .then() + .extract() + .response(); + // @formatter:on + } + + public Response update(String verzendingUrl, JSONObject jsonObject) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .body(jsonObject.toString()) + .when() + .put("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response partialUpdate(String verzendingUrl, JSONObject body) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .when() + .body(body.toString()) + .patch("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response partialUpdate(RequestSpecification requestSpecification, String verzendingUrl, JSONObject body) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(requestSpecification) + .when() + .body(body.toString()) + .patch("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response delete(String verzendingUrl) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .when() + .delete("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } + + public Response getHead(String verzendingUrl) { + String id = verzendingUrl.substring(verzendingUrl.lastIndexOf('/') + 1).trim(); + // @formatter:off + return given() + .spec(DRCRequestSpecification.getDefault()) + .when() + .head("/verzendingen/" + id) + .then() + .extract() + .response(); + // @formatter:on + } +} diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/EnkelvoudigInformatieObjectVersionHistoryTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/EnkelvoudigInformatieObjectVersionHistoryTest.java index f3e96f5a0435e479b9d9720e6f1521d450234b76..25022e1070fa488735f978f3bf7ba0cf43d1c7dc 100644 --- a/integration-tests/src/test/java/nl/contezza/drc/tests/EnkelvoudigInformatieObjectVersionHistoryTest.java +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/EnkelvoudigInformatieObjectVersionHistoryTest.java @@ -44,7 +44,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L336">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_update() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -86,7 +86,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L380">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_partial_update() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -124,7 +124,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L409">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_delete() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -159,7 +159,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_delete_fails_on_locked() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -170,7 +170,11 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { eioService.lock(eioUrl); Response res = eioService.delete(eioUrl); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals(json.getString("invalidParams[0].reason"), + "Locked objects cannot be destroyed"); } /** @@ -178,7 +182,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L423">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_detail_retrieves_latest_version() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -208,7 +212,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L436">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_list_shows_latest_versions() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -254,7 +258,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L462">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_detail_filter_by_version() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -285,7 +289,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L475">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_detail_filter_by_wrong_version_gives_404() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -309,7 +313,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { Assert.assertEquals(res.getStatusCode(), 404); } - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_detail_filter_by_registratie_op() { EIOService eioService = new EIOService(); @@ -346,7 +350,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L505">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_detail_filter_by_wrong_registratie_op_gives_404() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath(eioService.testCreate(informatieobjecttypeUrl, new Date()).asString()); @@ -363,7 +367,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L517">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_download_content_filter_by_version() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -392,7 +396,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { * "https://github.com/VNG-Realisatie/documenten-api/blob/1.0.0/src/drc/api/tests/test_enkelvoudiginformatieobject.py#L540">python * code</a>}. */ - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_download_content_filter_by_registratie() { EIOService eioService = new EIOService(); JsonPath json = new JsonPath( @@ -422,7 +426,7 @@ public class EnkelvoudigInformatieObjectVersionHistoryTest extends RestTest { Assert.assertEquals(data, "inhoud1"); } - @Test(groups = "EnkelvoudigInformatieObjectVersionHistory") + @Test(groups = "EnkelvoudigInformatieObjectVersionHistory", enabled = true) public void test_eio_version_number_during_locked() { EIOService eioService = new EIOService(); diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingTest.java index 0ecd5cce0711a30b4657d8da5e90e20870fabd89..1ba5d1394a233567b22c46d76dea6a53e361f181 100644 --- a/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingTest.java +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingTest.java @@ -1,8 +1,22 @@ package nl.contezza.drc.tests; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; + +import org.json.JSONObject; +import org.testng.Assert; import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; +import io.restassured.path.json.JsonPath; +import io.restassured.response.Response; +import nl.contezza.drc.dataprovider.DRCDataProvider; import nl.contezza.drc.rest.RestTest; +import nl.contezza.drc.service.EIOService; +import nl.contezza.drc.service.VerzendingenService; +import nl.contezza.drc.service.ZRCService; +import nl.contezza.drc.service.ZTCService; //@Log4j2 public class VerzendingTest extends RestTest { @@ -12,42 +26,331 @@ public class VerzendingTest extends RestTest { */ @BeforeTest(groups = "Verzending") public void init() { + // Create random catalogi + ZTCService ztcService = new ZTCService(); + JsonPath json = new JsonPath(ztcService.createCatalogus().asString()); + + // Create informatieobjecttype + String catalogusUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + json = new JsonPath(ztcService.createInformatieObjectType(catalogusUrl).asString()); + informatieobjecttypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype + json = new JsonPath(ztcService.createZaaktype(catalogusUrl).asString()); + + String zaaktypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype-informatieobjecttype + Response res = ztcService.createZiot(zaaktypeUrl, informatieobjecttypeUrl); + Assert.assertEquals(res.getStatusCode(), 201); + // Publish informatieobjecttype + String id = informatieobjecttypeUrl.substring(informatieobjecttypeUrl.lastIndexOf('/') + 1).trim(); + + res = ztcService.publishInformatieObjectType(id); + Assert.assertEquals(res.getStatusCode(), 200); + + // Publish zaaktype + res = ztcService.publishIZaaktype(zaaktypeUrl); + Assert.assertEquals(res.getStatusCode(), 200); + + ZRCService zrcService = new ZRCService(); + zaakTestObject = new JsonPath(zrcService.createZaak(zaaktypeUrl).asString()); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L23">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_list() { + EIOService eioService = new EIOService(); + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + String verzendingUrl1 = new JsonPath(verzendingenService.create(eioUrl).asString()).getString("url"); + String verzendingUrl2 = new JsonPath(verzendingenService.create(eioUrl).asString()).getString("url"); + + res = verzendingenService.list(null, eioUrl, null, null); + + Assert.assertEquals(res.getStatusCode(), 200); + json = new JsonPath(res.asString()); + Assert.assertEquals((int) res.body().path("results.size()"), 2); + + List<String> urls = json.getList("results.url"); + Assert.assertTrue(urls.contains(verzendingUrl1), "Expected URL '" + verzendingUrl1 + "' not found in results."); + Assert.assertTrue(urls.contains(verzendingUrl2), "Expected URL '" + verzendingUrl2 + "' not found in results."); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L33">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_detail() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + res = verzendingenService.create(testVerzending); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + Response resGet = verzendingenService.get(verzendingUrl); + + Assert.assertEquals(resGet.getStatusCode(), 200); + json = new JsonPath(resGet.asString()); + JsonPath jsonTestObject = new JsonPath(testVerzending.toString()); + + Assert.assertEquals(json.getString("betrokkene"), jsonTestObject.getString("betrokkene")); + Assert.assertEquals(json.getString("informatieobject"), jsonTestObject.getString("informatieobject")); + Assert.assertEquals(json.getString("aardRelatie"), jsonTestObject.getString("aardRelatie")); + Assert.assertEquals(json.getString("toelichting"), jsonTestObject.getString("toelichting")); + Assert.assertEquals(json.getString("ontvangstdatum"), jsonTestObject.getString("ontvangstdatum")); + Assert.assertEquals(json.getString("verzenddatum"), jsonTestObject.getString("verzenddatum")); + Assert.assertEquals(json.getString("contactPersoon"), jsonTestObject.getString("contactPersoon")); + Assert.assertEquals(json.getString("contactpersoonnaam"), jsonTestObject.getString("contactpersoonnaam")); + + // Binnenlands Correspondentieadres + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.huisletter"), + jsonTestObject.getString("binnenlandsCorrespondentieadres.huisletter")); + Assert.assertEquals(json.getInt("binnenlandsCorrespondentieadres.huisnummer"), + jsonTestObject.getInt("binnenlandsCorrespondentieadres.huisnummer")); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.huisnummerToevoeging"), + jsonTestObject.getString("binnenlandsCorrespondentieadres.huisnummerToevoeging")); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.naamOpenbareRuimte"), + jsonTestObject.getString("binnenlandsCorrespondentieadres.naamOpenbareRuimte")); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.postcode"), + jsonTestObject.getString("binnenlandsCorrespondentieadres.postcode")); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.woonplaatsnaam"), + jsonTestObject.getString("binnenlandsCorrespondentieadres.woonplaatsnaam")); + + // Buitenlands Correspondentieadres + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), + ""); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland2"), + ""); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland3"), + ""); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.landPostadres"), + ""); + + // Correspondentie Postadres + Assert.assertNull(json.get("correspondentiePostadres.postBusOfAntwoordnummer")); + Assert.assertEquals(json.getString("correspondentiePostadres.postadresPostcode"), + ""); + Assert.assertEquals(json.getString("correspondentiePostadres.postadresType"), + ""); + Assert.assertEquals(json.getString("correspondentiePostadres.woonplaatsnaam"), + ""); + + Assert.assertNull(json.getString("faxnummer")); + Assert.assertNull(json.getString("emailadres")); + Assert.assertEquals(json.getBoolean("mijnOverheid"), false); + Assert.assertNull(json.getString("telefoonnummer")); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L87">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_create() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + Assert.assertEquals( + json.getString("binnenlandsCorrespondentieadres.huisletter"), + "Q"); + + Assert.assertEquals(json.getInt("binnenlandsCorrespondentieadres.huisnummer"), 1); + + Assert.assertEquals( + json.getString("binnenlandsCorrespondentieadres.huisnummerToevoeging"), + "XYZ"); + + Assert.assertEquals( + json.getString("binnenlandsCorrespondentieadres.naamOpenbareRuimte"), + "ParkY"); + + Assert.assertEquals( + json.getString("binnenlandsCorrespondentieadres.postcode"), + "1800XY"); + + Assert.assertEquals( + json.getString("binnenlandsCorrespondentieadres.woonplaatsnaam"), + "Alkmaar"); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L156">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + String newEioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + testVerzendingUpdate.put("informatieobject", newEioUrl); + JSONObject address = testVerzending.getJSONObject("buitenlandsCorrespondentieadres"); + address.put("adresBuitenland1", "another_address"); + address.put("adresBuitenland2", "Suite 102"); + address.put("adresBuitenland3", "NY 10002"); + address.put("landPostadres", "http://een.link"); + testVerzendingUpdate.put("buitenlandsCorrespondentieadres", address); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("informatieobject"), newEioUrl); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), + "another_address"); + res = verzendingenService.get(verzendingUrl); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("informatieobject"), newEioUrl); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), + "another_address"); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L197">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_partial_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + testVerzending.put("betrokkene", "https://foo.com/PersoonY"); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/PersoonX"); + + res = verzendingenService.partialUpdate(verzendingUrl, body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("betrokkene"), "https://foo.com/PersoonX"); + res = verzendingenService.get(verzendingUrl); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("betrokkene"), "https://foo.com/PersoonX"); } - // TODO: create test - // @Test(groups = "Verzending") + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_verzending.py#L212">python + * code</a>}. + */ + @Test(groups = "Verzending", enabled = true) public void test_delete() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + Response res = verzendingenService.create(eioUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + res = verzendingenService.delete(verzendingUrl); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 204); + + res = verzendingenService.get(verzendingUrl); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 404); } } diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingValidationTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingValidationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..9a20b2b00ec86dc161a37dee35ee9026069af36c --- /dev/null +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/VerzendingValidationTest.java @@ -0,0 +1,778 @@ +package nl.contezza.drc.tests; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; + +import org.json.JSONObject; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import io.restassured.path.json.JsonPath; +import io.restassured.response.Response; +import nl.contezza.drc.dataprovider.DRCDataProvider; +import nl.contezza.drc.rest.RestTest; +import nl.contezza.drc.service.EIOService; +import nl.contezza.drc.service.VerzendingenService; +import nl.contezza.drc.service.ZRCService; +import nl.contezza.drc.service.ZTCService; + +public class VerzendingValidationTest extends RestTest { + + /** + * Create necessary dependencies when creating enkelvoudiginformatieobject. + */ + @BeforeTest(groups = "VerzendingValidationTest") + public void init() { + // Create random catalogi + ZTCService ztcService = new ZTCService(); + JsonPath json = new JsonPath(ztcService.createCatalogus().asString()); + + // Create informatieobjecttype + String catalogusUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + json = new JsonPath(ztcService.createInformatieObjectType(catalogusUrl).asString()); + informatieobjecttypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype + json = new JsonPath(ztcService.createZaaktype(catalogusUrl).asString()); + + String zaaktypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype-informatieobjecttype + Response res = ztcService.createZiot(zaaktypeUrl, informatieobjecttypeUrl); + Assert.assertEquals(res.getStatusCode(), 201); + + // Publish informatieobjecttype + String id = informatieobjecttypeUrl.substring(informatieobjecttypeUrl.lastIndexOf('/') + 1).trim(); + + res = ztcService.publishInformatieObjectType(id); + Assert.assertEquals(res.getStatusCode(), 200); + + // Publish zaaktype + res = ztcService.publishIZaaktype(zaaktypeUrl); + Assert.assertEquals(res.getStatusCode(), 200); + + ZRCService zrcService = new ZRCService(); + zaakTestObject = new JsonPath(zrcService.createZaak(zaaktypeUrl).asString()); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L503">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_multiple_addressess_create() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "Adres 1"); + buitenlandsCorrespondentieadres.put("adresBuitenland2", "Adres 2"); + buitenlandsCorrespondentieadres.put("adresBuitenland3", "Adres 3"); + buitenlandsCorrespondentieadres.put("landPostadres", "https://foo.com/landY"); + body.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + JSONObject correspondentiePostadres = new JSONObject(); + correspondentiePostadres.put("postBusOfAntwoordnummer", "1"); + correspondentiePostadres.put("postadresPostcode", "3322DT"); + correspondentiePostadres.put("postadresType", "antwoordnummer"); + correspondentiePostadres.put("woonplaatsnaam", "4"); + body.put("correspondentiePostadres", correspondentiePostadres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L553">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_multiple_address_types_create_fails() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + body.put("emailadres", "test@gmail.com"); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L592">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_no_address_create() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L622">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_create_different_correspondence_types() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + List<String[]> correspondenseTypes = List.of( + new String[] { "emailadres", "test@gmail.com" }, + new String[] { "faxnummer", "2133145" }, + new String[] { "mijnOverheid", "True" }); + + for (String[] correspondenseType : correspondenseTypes) { + String key = correspondenseType[0]; + String value = correspondenseType[1]; + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + body.put(key, value); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + } + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L657">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_add_address_to_already_existing_address_partial_update() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + partialUpdateBody.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L682">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_add_fax_to_already_existing_mijn_overheid_partial_update_fails() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, DRCDataProvider.VerzendingAddressType.GOVERMENT)); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + partialUpdateBody.put("faxnummer", "1234"); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L695">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_add_fax_to_already_existing_mijn_overheid_partial_update() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, DRCDataProvider.VerzendingAddressType.GOVERMENT)); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + partialUpdateBody.put("betrokkene", "https://foo.com/PersoonX"); + partialUpdateBody.put("faxnummer", "1234"); + partialUpdateBody.put("mijnOverheid", "False"); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L711">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_add_email_to_already_existing_mijn_overheid_partial_update() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, DRCDataProvider.VerzendingAddressType.FAX)); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + partialUpdateBody.put("betrokkene", "https://foo.com/PersoonX"); + partialUpdateBody.put("faxnummer", JSONObject.NULL); + partialUpdateBody.put("emailadres", "test@gmail.com"); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L726">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_add_address_to_already_existing_address_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L768">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_remove_address_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + testVerzendingUpdate.remove("binnenlandsCorrespondentieadres"); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "invalid-address"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L801">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_change_address_partial_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + testVerzendingUpdate.put("buitenlandsCorrespondentieadres", JSONObject.NULL); + + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + testVerzendingUpdate.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + + // buitenlandsCorrespondentieadres + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), ""); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.landPostadres"), ""); + + // binnenlandsCorrespondentieadres + Assert.assertEquals(json.getInt("binnenlandsCorrespondentieadres.huisnummer"), 1); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.naamOpenbareRuimte"), "ParkY"); + Assert.assertEquals(json.getString("binnenlandsCorrespondentieadres.woonplaatsnaam"), "Alkmaar"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L841">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_no_address_change_update() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "Breedstraat"); + buitenlandsCorrespondentieadres.put("landPostadres", "https://example.com"); + + body.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + partialUpdateBody.put("verzenddatum", LocalDate.now().plusDays(1).format(formatter)); + partialUpdateBody.put("contactPersoon", "https://foo.com/PersoonX"); + partialUpdateBody.put("contactpersoonnaam", "PersoonX"); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), "Breedstraat"); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.landPostadres"), "https://example.com"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L870">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_change_same_address_partial_update() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "Breedstraat"); + buitenlandsCorrespondentieadres.put("landPostadres", "https://example.com"); + + body.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "Adres 1"); + buitenlandsCorrespondentieadres.put("adresBuitenland2", ""); + buitenlandsCorrespondentieadres.put("adresBuitenland3", ""); + buitenlandsCorrespondentieadres.put("landPostadres", "https://foo.com/landY"); + + partialUpdateBody.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.adresBuitenland1"), "Adres 1"); + Assert.assertEquals(json.getString("buitenlandsCorrespondentieadres.landPostadres"), "https://foo.com/landY"); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L900">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_update() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + String newEioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(); + testVerzendingUpdate.put("betrokkene", "https://foo.com/persoonX"); + testVerzendingUpdate.put("informatieobject", newEioUrl); + testVerzendingUpdate.put("aardRelatie", "geadresseerde"); + testVerzendingUpdate.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + testVerzendingUpdate.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + testVerzendingUpdate.put("verzenddatum", LocalDate.now().format(formatter)); + + testVerzendingUpdate.put("contactPersoon", "https://foo.com/persoonY"); + testVerzendingUpdate.put("contactpersoonnaam", "persoonY"); + + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland1", "Adres 1"); + buitenlandsCorrespondentieadres.put("adresBuitenland2", "Adres 2"); + buitenlandsCorrespondentieadres.put("adresBuitenland3", "Adres 3"); + buitenlandsCorrespondentieadres.put("landPostadres", "https://foo.com/landY"); + testVerzendingUpdate.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("informatieobject"), newEioUrl); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L939">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_postal_code_validation() { + + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject body = new JSONObject( + DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.CORRESPONDENTIE_POSTADRES)); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject partialUpdateBody = new JSONObject(); + + JSONObject correspondentiePostadres = new JSONObject(); + correspondentiePostadres.put("postBusOfAntwoordnummer", "1"); + correspondentiePostadres.put("postadresPostcode", "18800RR"); + correspondentiePostadres.put("postadresType", "antwoordnummer"); + correspondentiePostadres.put("woonplaatsnaam", "4"); + partialUpdateBody.put("correspondentiePostadres", correspondentiePostadres); + + res = verzendingenService.partialUpdate(verzendingUrl, partialUpdateBody); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + Assert.assertEquals(json.getString("invalidParams[0].reason"), "Postcode moet 6 tekens lang zijn."); + } + + /** + * See {@link <a href= + * "https://github.com/VNG-Realisatie/documenten-api/blob/1.3.0/src/drc/api/tests/test_validation.py#L963">python + * code</a>}. + */ + @Test(groups = "VerzendingValidationTest", enabled = true) + public void test_required_buitenlands_correspondentieadres() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + JSONObject buitenlandsCorrespondentieadres = new JSONObject(); + buitenlandsCorrespondentieadres.put("adresBuitenland2", "Adres 2"); + buitenlandsCorrespondentieadres.put("adresBuitenland3", "Adres 3"); + buitenlandsCorrespondentieadres.put("landPostadres", "https://foo.com/landY"); + body.put("buitenlandsCorrespondentieadres", buitenlandsCorrespondentieadres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].name"), + "buitenlandsCorrespondentieadres.adresBuitenland_1"); + Assert.assertEquals( + json.getString("invalidParams[0].code"), + "required"); + } +} diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomEnkelvoudigInformatieObjectTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomEnkelvoudigInformatieObjectTest.java new file mode 100644 index 0000000000000000000000000000000000000000..563ad49fd45990674bef017bc062a87f7d3c93dd --- /dev/null +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomEnkelvoudigInformatieObjectTest.java @@ -0,0 +1,94 @@ +package nl.contezza.drc.tests.custom; + +import java.util.Base64; + +import org.json.JSONObject; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import io.restassured.path.json.JsonPath; +import io.restassured.response.Response; +import nl.contezza.drc.rest.RestTest; +import nl.contezza.drc.service.EIOService; +import nl.contezza.drc.service.ZTCService; + +public class CustomEnkelvoudigInformatieObjectTest extends RestTest { + + /** + * Create necessary dependencies when creating enkelvoudiginformatieobject. + */ + @BeforeTest(groups = "CustomUpload") + public void init() { + // Create random catalogi + ZTCService ztcService = new ZTCService(); + JsonPath json = new JsonPath(ztcService.createCatalogus().asString()); + + // Create informatieobjecttype + String catalogusUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + json = new JsonPath(ztcService.createInformatieObjectType(catalogusUrl).asString()); + informatieobjecttypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // @formatter:off + Response res = ztcService.publishInformatieObjectType(informatieobjecttypeUrl.substring(informatieobjecttypeUrl.lastIndexOf('/') + 1).trim()); + Assert.assertEquals(res.getStatusCode(), 200); + // @formatter:on + } + + @Test(groups = "CustomEnkelvoudigInformatieObjectTest", enabled = true) + public void test_verschijningsvorm() { + EIOService eioService = new EIOService(); + + // Validate verschijningsvorm at POST + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + JSONObject createdEio = new JSONObject(json.prettify()); + + Assert.assertEquals(res.getStatusCode(), 201); + Assert.assertEquals(json.getString("verschijningsvorm"), "Een verschijningsvorm"); + + String eioUrl = json.getString("url"); + + // Validate verschijningsvorm at GET + res = eioService.getEIO(eioUrl, null); + json = new JsonPath(res.asString()); + + Assert.assertEquals(json.getString("verschijningsvorm"), "Een verschijningsvorm"); + + res = eioService.lock(eioUrl); + + Assert.assertEquals(res.getStatusCode(), 200); + + String lock = res.body().path("lock"); + + // Validate verschijningsvorm at PATCH + JSONObject body = new JSONObject(); + body.put("verschijningsvorm", "Een andere verschijningsvorm"); + body.put("lock", lock); + + res = eioService.partialUpdate(eioUrl, body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("verschijningsvorm"), "Een andere verschijningsvorm"); + + // Validate verschijningsvorm at PUT + body = new JSONObject(); + body.put("verschijningsvorm", "Een update verschijningsvorm"); + body.put("beschrijving", "beschrijving2"); + body.put("inhoud", Base64.getEncoder().encodeToString("some file content".getBytes())); + body.put("bestandsomvang", "some file content".getBytes().length); + body.put("lock", lock); + + JSONObject mergedJson = mergeJSONObjects(createdEio, body); + mergedJson.remove("ondertekening"); + mergedJson.remove("integriteit"); + + // Update EIO + res = eioService.update(eioUrl, mergedJson); + json = new JsonPath(res.asString()); + Assert.assertEquals(res.getStatusCode(), 200); + Assert.assertEquals(json.getString("verschijningsvorm"), "Een update verschijningsvorm"); + } +} diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomUpdateIOTTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomUpdateIOTTest.java index d059958bdb7988bc6545b7308691da47f3f9ffad..8b4f96ff8a5ee9165d2fd56bf847ea7b04c161c5 100644 --- a/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomUpdateIOTTest.java +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomUpdateIOTTest.java @@ -1,5 +1,7 @@ package nl.contezza.drc.tests.custom; +import java.util.Base64; + import org.json.JSONObject; import org.testng.Assert; import org.testng.annotations.BeforeTest; @@ -18,6 +20,8 @@ import nl.contezza.drc.service.ZTCService; // @Log4j2 public class CustomUpdateIOTTest extends RestTest { + private final String SAMPLE_CONTENT = "some file content"; + private String informatieobjecttypeUrl2 = null; /** @@ -47,8 +51,8 @@ public class CustomUpdateIOTTest extends RestTest { Assert.assertEquals(res.getStatusCode(), 200); } - @Test(groups = "CustomUpdateIOT") - public void test_update_IOT() { + @Test(groups = "CustomUpdateIOT", enabled = true) + public void test_partial_update_IOT() { EIOService eioService = new EIOService(); // Create EIO @@ -64,4 +68,38 @@ public class CustomUpdateIOTTest extends RestTest { Response res = eioService.partialUpdate(eioUrl, body); Assert.assertEquals(res.getStatusCode(), 200); } + + @Test(groups = "CustomUpdateIOT", enabled = true) + public void test_update_IOT() { + EIOService eioService = new EIOService(); + + // Create EIO + JsonPath json = new JsonPath( + eioService.testCreate(informatieobjecttypeUrl).asString()); + + JSONObject createdEio = new JSONObject(json.prettify()); + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + // Do lock + json = new JsonPath(eioService.lock(eioUrl).asString()); + + JSONObject body = new JSONObject(); + body.put("informatieobjecttype", informatieobjecttypeUrl2); + body.put("inhoud", + Base64.getEncoder().encodeToString(SAMPLE_CONTENT.getBytes())); + body.put("bestandsomvang", SAMPLE_CONTENT.getBytes().length); + body.put("lock", json.getString("lock")); + + JSONObject mergedJson = mergeJSONObjects(createdEio, body); + mergedJson.remove("ondertekening"); + mergedJson.remove("integriteit"); + + // Update EIO + Response res = eioService.update(eioUrl, mergedJson); + Assert.assertEquals(res.getStatusCode(), 200); + + json = new JsonPath(res.body().asString()); + + Assert.assertEquals(json.getString("informatieobjecttype"), informatieobjecttypeUrl2); + } } \ No newline at end of file diff --git a/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomVerzendingTest.java b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomVerzendingTest.java new file mode 100644 index 0000000000000000000000000000000000000000..1c4951da3b6a6c48b0a776121485b4275430faaa --- /dev/null +++ b/integration-tests/src/test/java/nl/contezza/drc/tests/custom/CustomVerzendingTest.java @@ -0,0 +1,250 @@ +package nl.contezza.drc.tests.custom; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +import org.json.JSONObject; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import io.restassured.path.json.JsonPath; +import io.restassured.response.Response; +import nl.contezza.drc.dataprovider.DRCDataProvider; +import nl.contezza.drc.rest.RestTest; +import nl.contezza.drc.service.EIOService; +import nl.contezza.drc.service.VerzendingenService; +import nl.contezza.drc.service.ZRCService; +import nl.contezza.drc.service.ZTCService; + +//@Log4j2 +public class CustomVerzendingTest extends RestTest { + + /** + * Create necessary dependencies when creating enkelvoudiginformatieobject. + */ + @BeforeTest(groups = "CustomVerzending") + public void init() { + // Create random catalogi + ZTCService ztcService = new ZTCService(); + JsonPath json = new JsonPath(ztcService.createCatalogus().asString()); + + // Create informatieobjecttype + String catalogusUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + json = new JsonPath(ztcService.createInformatieObjectType(catalogusUrl).asString()); + informatieobjecttypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype + json = new JsonPath(ztcService.createZaaktype(catalogusUrl).asString()); + + String zaaktypeUrl = json.getString("url").replace(ZTC_BASE_URI, ZTC_DOCKER_URI); + + // Create zaaktype-informatieobjecttype + Response res = ztcService.createZiot(zaaktypeUrl, informatieobjecttypeUrl); + Assert.assertEquals(res.getStatusCode(), 201); + + // Publish informatieobjecttype + String id = informatieobjecttypeUrl.substring(informatieobjecttypeUrl.lastIndexOf('/') + 1).trim(); + + res = ztcService.publishInformatieObjectType(id); + Assert.assertEquals(res.getStatusCode(), 200); + + // Publish zaaktype + res = ztcService.publishIZaaktype(zaaktypeUrl); + Assert.assertEquals(res.getStatusCode(), 200); + + ZRCService zrcService = new ZRCService(); + zaakTestObject = new JsonPath(zrcService.createZaak(zaaktypeUrl).asString()); + } + + @Test(groups = "CustomVerzending", enabled = true) + public void test_create_multiple_addresses() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + body.put("telefoonnummer", "0612345678"); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].reason"), + "Verzending must contain precisely one correspondentieadress"); + } + + @Test(groups = "CustomVerzending", enabled = true) + public void test_create_single_address() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "geadresseerde"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + Assert.assertNull(json.getString("telefoonnummer")); + } + + @Test(groups = "CustomVerzending", enabled = true) + public void test_update_with_multiple_addresses() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + JSONObject testVerzendingUpdate = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BUITENLANDS_CORRESPONDENTIEADRES)); + + res = verzendingenService.update(verzendingUrl, testVerzendingUpdate); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertEquals( + json.getString("invalidParams[0].reason"), + "Verzending must contain precisely one correspondentieadress"); + + } + + @Test(groups = "CustomVerzending", enabled = true) + public void test_create_unkown_aardRelatie() { + EIOService eioService = new EIOService(); + + Response res = eioService.testCreate(informatieobjecttypeUrl); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + + String eioUrl = json.getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + + JSONObject body = new JSONObject(); + body.put("betrokkene", "https://foo.com2/persoonX"); + body.put("informatieobject", eioUrl); + body.put("aardRelatie", "onbekend"); + body.put("toelichting", "Verzending van XYZ"); + + // Date formatting + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + body.put("ontvangstdatum", LocalDate.now().minusDays(3).format(formatter)); + body.put("verzenddatum", LocalDate.now().format(formatter)); + + body.put("contactPersoon", "https://foo.com/persoonY"); + body.put("contactpersoonnaam", "persoonY"); + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = new JSONObject(); + binnenlandsAdres.put("huisletter", "Q"); + binnenlandsAdres.put("huisnummer", 1); + binnenlandsAdres.put("huisnummerToevoeging", "XYZ"); + binnenlandsAdres.put("naamOpenbareRuimte", "ParkY"); + binnenlandsAdres.put("postcode", "1800XY"); + binnenlandsAdres.put("woonplaatsnaam", "Alkmaar"); + + body.put("binnenlandsCorrespondentieadres", binnenlandsAdres); + + res = verzendingenService.create(body); + json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 400); + + Assert.assertNull(json.getString("telefoonnummer")); + } + + @Test(groups = "CustomVerzending", enabled = true) + public void test_eio_head_cache_header() { + EIOService eioService = new EIOService(); + + String eioUrl = new JsonPath(eioService.testCreate(informatieobjecttypeUrl).asString()).getString("url"); + + VerzendingenService verzendingenService = new VerzendingenService(); + JSONObject testVerzending = new JSONObject(DRCDataProvider.createVerzending(eioUrl, + DRCDataProvider.VerzendingAddressType.BINNENLANDS_CORRESPONDENTIEADRES)); + Response res = verzendingenService.create(testVerzending); + JsonPath json = new JsonPath(res.asString()); + + Assert.assertEquals(res.getStatusCode(), 201); + String verzendingUrl = json.getString("url"); + + res = verzendingenService.getHead(verzendingUrl); + Assert.assertNotNull(res.getHeader("ETag")); + Assert.assertEquals(res.getStatusCode(), 200); + } +} diff --git a/platform/src/main/java/nl/contezza/drc/helper/DRCValidationHelper.java b/platform/src/main/java/nl/contezza/drc/helper/DRCValidationHelper.java index 2362665bc8b67d5e36b100dbcfa303b7271bbe5f..9916190cd569f55cffad9293ae1ea48fb1b261a9 100644 --- a/platform/src/main/java/nl/contezza/drc/helper/DRCValidationHelper.java +++ b/platform/src/main/java/nl/contezza/drc/helper/DRCValidationHelper.java @@ -97,6 +97,10 @@ public class DRCValidationHelper { public static final String CODE_INCORRECT_LOCK_ID = "incorrect-lock-id"; public static final String CODE_UNKNOWN_PARAMETERS = "unknown-parameters"; public static final String CODE_DESTROY_LOCKED = "destroy-locked"; + public static final String CODE_INVALID_ADDRESS = "invalid-address"; + public static final String CODE_INVALID_CHOICE = "invalid_choice"; + public static final String CODE_INVALID_LENGTH_6_POSTCODE = "invalid-length"; + public static final String CODE_MAX_LENGTH_6_POSTCODE = "max_length"; private static final HashMap<String, String> codeType = new HashMap<String, String>(); @@ -129,7 +133,11 @@ public class DRCValidationHelper { codeType.put(CODE_INCONSISTENT_RELATION, "Inconsistent relation."); codeType.put(CODE_FILE_SIZE, "The size of upload file should match the 'bestandsomvang' field or file size is not correct."); - codeType.put(CODE_DESTROY_LOCKED, "Locked objects cannot be destroyed."); + codeType.put(CODE_DESTROY_LOCKED, "Locked objects cannot be destroyed"); + codeType.put(CODE_INVALID_ADDRESS, "Verzending must contain precisely one correspondentieadress"); + codeType.put(CODE_INVALID_CHOICE, "De waarde is een ongeldige keuze."); + codeType.put(CODE_INVALID_LENGTH_6_POSTCODE, "Postcode moet 6 tekens lang zijn."); + codeType.put(CODE_MAX_LENGTH_6_POSTCODE, "Zorg ervoor dat dit veld niet meer dan 6 karakters bevat."); } }; @@ -417,7 +425,7 @@ public class DRCValidationHelper { } invalidParams = validatePropInformatieobject((String) props.get(RGBZModel.PROP_INFORMATIEOBJECT), - invalidParams); + invalidParams, true); invalidParams = validatePropStartdatum(props.get(RGBZModel.PROP_STARTDATUM), invalidParams); invalidParams = validatePropOmschrijvingVoorwaarden((String) props.get(RGBZModel.PROP_OMSCHRIJVING_VOORWAARDEN), invalidParams); @@ -430,6 +438,98 @@ public class DRCValidationHelper { return props; } + /** + * Validate gebruikrsrecht properties before processing. + * + * @param props Map<QName, Serializable> properties + * @param req WebScriptRequest request + * @return Map<QName, Serializable> properties (not modified) + */ + public Map<QName, Serializable> validateVerzendingen(Map<QName, Serializable> props, WebScriptRequest req) { + if (!isValidationEnabled()) { + return props; + } + + // Get JSON request + JSONObject jsonRequest = (JSONObject) req.parseContent(); + + // Create new list + List<DRCFieldValidationError> invalidParams = new ArrayList<DRCFieldValidationError>(); + + // We do need to have properties to validate + if (props.size() == 0) { + invalidParams.add(newFieldValidationError("body", CODE_INVALID)); + createDrcException(CODE_INVALID, 400, invalidParams); + } + + // Get the method + String method = req.getServiceMatch().getWebScript().getDescription().getMethod(); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Method: " + method); + } + + if ("POST".equals(method) || "PUT".equals(method)) { + invalidParams = validatePropInformatieobject((String) props.get(RGBZModel.PROP_INFORMATIEOBJECT), + invalidParams, true); + invalidParams = validatePropAardRelatie( + (String) props.get(RGBZModel.PROP_AARD_RELATIE), invalidParams, true); + + invalidParams = validatePropBetrokkene((String) props.get(RGBZModel.PROP_BETROKKENE), invalidParams, true); + + invalidParams = validatePropContactPersoon((String) props.get(RGBZModel.PROP_CONTACTPERSOON), invalidParams, + true); + + } else if ("PATCH".equals(method)) { + invalidParams = validatePropInformatieobject((String) props.get(RGBZModel.PROP_INFORMATIEOBJECT), + invalidParams, false); + invalidParams = validatePropAardRelatie( + (String) props.get(RGBZModel.PROP_AARD_RELATIE), invalidParams, false); + + invalidParams = validatePropBetrokkene((String) props.get(RGBZModel.PROP_BETROKKENE), invalidParams, false); + + invalidParams = validatePropContactPersoon((String) props.get(RGBZModel.PROP_CONTACTPERSOON), invalidParams, + false); + } + + // validate addresses + if (jsonRequest.has("binnenlandsCorrespondentieadres") && !jsonRequest.isNull( + "binnenlandsCorrespondentieadres")) { + invalidParams = validatePropHuisnummer((Long) props.get(RGBZModel.PROP_HUISNUMMER), invalidParams); + invalidParams = validatePropNaamOpenbareRuimte((String) props.get(RGBZModel.PROP_NAAM_OPENBARE_RUIMTE), + invalidParams); + invalidParams = validatePropWoonplaatsnaam((String) props.get(RGBZModel.PROP_WOONPLAATSNAAM), + invalidParams); + } + + if (jsonRequest.has("buitenlandsCorrespondentieadres") && !jsonRequest.isNull( + "buitenlandsCorrespondentieadres")) { + invalidParams = validatePropAdresBuitenland1((String) props.get(RGBZModel.PROP_ADRES_BUITENLAND1), + invalidParams); + invalidParams = validatePropLandPostadres((String) props.get(RGBZModel.PROP_LAND_POSTADRES), + invalidParams); + } + + if (jsonRequest.has("correspondentiePostadres") && !jsonRequest.isNull( + "correspondentiePostadres")) { + invalidParams = validatePropPostBusOfAntwoordnummer( + (Long) props.get(RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER), invalidParams); + invalidParams = validatePropPostadresPostcode((String) props.get(RGBZModel.PROP_POSTADRES_POSTCODE), + invalidParams); + invalidParams = validatePropPostadresType((String) props.get(RGBZModel.PROP_POSTADRES_TYPE), + invalidParams); + invalidParams = validatePropWoonplaatsnaamCorrespondentiePostadres( + (String) props.get(RGBZModel.PROP_WOONPLAATSNAAM_POSTADRES), + invalidParams); + } + + // Only throw excep when there are validation errors + if (invalidParams.size() > 0) { + createDrcException(CODE_INVALID, 400, invalidParams); + } + + return props; + } + /** * Validate saving status in releation with ontvangstdatum is not possible. * @@ -687,6 +787,91 @@ public class DRCValidationHelper { } } + /** + * This checks if a Verzending has exactly one address, looking in the request + * and the saved properties, if present. + * It will throw a WebScriptException when a different number of addresses are + * found. + * + * @param jsonRequest The JSON request of the operation + * @param props The properties of the saved nodeRef + * @param isPut Boolean specifying that the validation is for a PUT + * request + */ + public void validateVerzendingMultipleAdresses(JSONObject jsonRequest, Map<QName, Serializable> props, + boolean isPut) { + + int countAdresses = 0; + boolean hasExplicitAddress = false; + + // Check if PUT request explicitly provides an address + hasExplicitAddress = hasExplicitAddress(jsonRequest); + + if (isPut && !hasExplicitAddress) { + List<DRCFieldValidationError> invalidParams = new ArrayList<>(); + invalidParams.add(newFieldValidationError( + "nonFieldErrors", CODE_INVALID_ADDRESS)); + createDrcException(CODE_INVALID, 400, invalidParams); + } + + if (props == null) { + props = new HashMap<>(); + } + + countAdresses += shouldCount(jsonRequest, "binnenlandsCorrespondentieadres", + props, RGBZModel.PROP_HUISNUMMER) ? 1 : 0; + countAdresses += shouldCount(jsonRequest, "buitenlandsCorrespondentieadres", props, + RGBZModel.PROP_ADRES_BUITENLAND1) ? 1 : 0; + countAdresses += shouldCount(jsonRequest, "correspondentiePostadres", props, + RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER) ? 1 : 0; + + countAdresses += shouldCount(jsonRequest, "faxnummer", props, RGBZModel.PROP_FAXNUMMER) ? 1 : 0; + countAdresses += shouldCount(jsonRequest, "emailadres", props, RGBZModel.PROP_EMAILADRES) ? 1 : 0; + countAdresses += shouldCountBoolean(jsonRequest, "mijnOverheid", props, RGBZModel.PROP_MIJNOVERHEID) ? 1 + : 0; + countAdresses += shouldCount(jsonRequest, "telefoonnummer", props, RGBZModel.PROP_TELEFOONNUMMER) ? 1 + : 0; + + if (countAdresses != 1) { + List<DRCFieldValidationError> invalidParams = new ArrayList<>(); + invalidParams.add(newFieldValidationError( + "nonFieldErrors", CODE_INVALID_ADDRESS)); + createDrcException(CODE_INVALID, 400, invalidParams); + } + } + + private boolean shouldCount(JSONObject json, String key, Map<QName, Serializable> props, QName propKey) { + boolean hasJsonValue = json.has(key) && !json.isNull(key); + boolean hasExistingValue = props.containsKey(propKey); + + if (json.has(key) && json.isNull(key)) { + return false; + } + return hasJsonValue || hasExistingValue; + } + + private boolean shouldCountBoolean(JSONObject json, String key, Map<QName, Serializable> props, QName propKey) { + boolean hasJsonValue = json.has(key) && json.optBoolean(key, false); + boolean hasExistingValue = props.containsKey(propKey); + + if (!hasJsonValue && json.has(key)) { + return false; + } + + return hasJsonValue || hasExistingValue; + } + + private boolean hasExplicitAddress(JSONObject json) { + return json.has("binnenlandsCorrespondentieadres") || + json.has("buitenlandsCorrespondentieadres") || + json.has("correspondentiePostadres") || + json.has("faxnummer") && !json.isNull("faxnummer") && !json.optString("faxnummer").isEmpty() || + json.has("emailadres") && !json.isNull("emailadres") && !json.optString("emailadres").isEmpty() || + json.has("mijnOverheid") && json.optBoolean("mijnOverheid") || + json.has("telefoonnummer") && !json.isNull("telefoonnummer") + && !json.optString("telefoonnummer").isEmpty(); + } + /** * Validate if string data is ISO8601 notation. * @@ -976,9 +1161,11 @@ public class DRCValidationHelper { } private List<DRCFieldValidationError> validatePropInformatieobject(String value, - List<DRCFieldValidationError> invalidParams) { + List<DRCFieldValidationError> invalidParams, boolean isMandatory) { if (value == null || value.isEmpty()) { - invalidParams.add(newFieldValidationError("informatieobject", CODE_MANDATORY)); + if (isMandatory) { + invalidParams.add(newFieldValidationError("informatieobject", CODE_MANDATORY)); + } } else { NodeRef ref = drcService.findNode(value); if (ref == null) { @@ -1019,4 +1206,124 @@ public class DRCValidationHelper { return invalidParams; } + + private List<DRCFieldValidationError> validatePropAardRelatie(String value, + List<DRCFieldValidationError> invalidParams, boolean isMandatory) { + if (value == null || value.isEmpty()) { + if (isMandatory) { + invalidParams.add(newFieldValidationError("aardRelatie", CODE_REQUIRED)); + } + + } else if (!(value.equals("afzender") || value.equals("geadresseerde"))) { + invalidParams.add(newFieldValidationError("aardRelatie", CODE_INVALID_CHOICE)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropBetrokkene(String value, + List<DRCFieldValidationError> invalidParams, boolean isMandatory) { + if (value == null || value.isEmpty()) { + if (isMandatory) { + invalidParams.add(newFieldValidationError("betrokkene", CODE_REQUIRED)); + } + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropContactPersoon(String value, + List<DRCFieldValidationError> invalidParams, boolean isMandatory) { + if (value == null || value.isEmpty()) { + if (isMandatory) { + invalidParams.add(newFieldValidationError("contactPersoon", CODE_REQUIRED)); + } + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropHuisnummer(Long value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value == 0) { + invalidParams.add(newFieldValidationError("binnenlandsCorrespondentieadres.huisnummer", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropNaamOpenbareRuimte(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams + .add(newFieldValidationError("binnenlandsCorrespondentieadres.naamOpenbareRuimte", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropWoonplaatsnaam(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams + .add(newFieldValidationError("binnenlandsCorrespondentieadres.woonplaatsnaam", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropAdresBuitenland1(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams + .add(newFieldValidationError("buitenlandsCorrespondentieadres.adresBuitenland_1", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropLandPostadres(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams.add(newFieldValidationError("buitenlandsCorrespondentieadres.landPostadres", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropPostBusOfAntwoordnummer(Long value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value == 0) { + invalidParams + .add(newFieldValidationError("correspondentiePostadres.postBusOfAntwoordnummer", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropPostadresPostcode(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams.add(newFieldValidationError("correspondentiePostadres.postadresPostcode", CODE_REQUIRED)); + } else { + if (value.length() != 6) { + invalidParams.add(newFieldValidationError("correspondentiePostadres.postadresPostcode", + CODE_INVALID_LENGTH_6_POSTCODE)); + } + + if (value.length() > 6) { + invalidParams.add(newFieldValidationError("correspondentiePostadres.postadresPostcode", + CODE_MAX_LENGTH_6_POSTCODE)); + } + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropPostadresType(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams.add(newFieldValidationError("correspondentiePostadres.postadresType", CODE_REQUIRED)); + } + return invalidParams; + } + + private List<DRCFieldValidationError> validatePropWoonplaatsnaamCorrespondentiePostadres(String value, + List<DRCFieldValidationError> invalidParams) { + if (value == null || value.isEmpty()) { + invalidParams.add(newFieldValidationError("correspondentiePostadres.woonplaatsnaam", CODE_REQUIRED)); + } + return invalidParams; + } + } \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/model/RGBZModel.java b/platform/src/main/java/nl/contezza/drc/model/RGBZModel.java index acd27eaf1a1331a61aa92036fceb2e532acdd09f..61faee717b2ff564ad9a9511476044217932fa2f 100644 --- a/platform/src/main/java/nl/contezza/drc/model/RGBZModel.java +++ b/platform/src/main/java/nl/contezza/drc/model/RGBZModel.java @@ -33,11 +33,14 @@ public interface RGBZModel { QName TYPE_AUDIT_ITEM = QName.createQName(URI, "auditItem"); QName TYPE_BESTANDSDEEL = QName.createQName(URI, "bestandsdeel"); QName TYPE_BESTANDSDEEL_ITEM = QName.createQName(URI, "bestandsdeelItem"); + QName TYPE_VERZENDING = QName.createQName(URI, "verzending"); + QName TYPE_VERZENDING_ITEM = QName.createQName(URI, "verzendingItem"); QName ASSOC_OBJECT_INFORMATIEOBJECT_ITEMS = QName.createQName(URI, "objectinformatieobjectItems"); QName ASSOC_GEBRUIKSRECHT_ITEMS = QName.createQName(URI, "gebruiksrechtItems"); QName ASSOC_AUDIT_ITEMS = QName.createQName(URI, "auditItems"); QName ASSOC_BESTANDSDEEL_ITEMS = QName.createQName(URI, "bestandsdeelItems"); + QName ASSOC_VERZENDING_ITEMS = QName.createQName(URI, "verzendingItems"); QName ASPECT_ENKELVOUDIGINFORMATIEOBJECT = QName.createQName(URI, "enkelvoudigInformatieobject"); QName ASPECT_BESTANDSDELEN = QName.createQName(URI, "bestandsdelen"); @@ -64,6 +67,7 @@ public interface RGBZModel { QName PROP_STARTDATUM = QName.createQName(URI, "startdatum"); QName PROP_EINDDATUM = QName.createQName(URI, "einddatum"); QName PROP_OMSCHRIJVING_VOORWAARDEN = QName.createQName(URI, "omschrijvingVoorwaarden"); + QName PROP_VERSCHIJNINGSVORM = QName.createQName(URI, "verschijningsvorm"); QName PROP_AUDIT_TOELICHTING = QName.createQName(URI, "auditToelichting"); QName PROP_AUDIT_USER_ID = QName.createQName(URI, "auditUserId"); QName PROP_AUDIT_USER_REPRESENTATION = QName.createQName(URI, "auditUserRepresentation"); @@ -72,4 +76,36 @@ public interface RGBZModel { QName PROP_BESTANDSDEEL_PARENT = QName.createQName(URI, "bestandsdeelParent"); QName PROP_BESTANDSDEEL_VOLGNUMMER = QName.createQName(URI, "bestandsdeelVolgnummer"); QName PROP_BESTANDSDEEL_VOLTOOID = QName.createQName(URI, "bestandsdeelVoltooid"); + + QName PROP_BETROKKENE = QName.createQName(URI, "betrokkene"); + QName PROP_AARD_RELATIE = QName.createQName(URI, "aardRelatie"); + QName PROP_TOELICHTING = QName.createQName(URI, "toelichting"); + QName PROP_ONTVANGSTDATUM_VERZENDING = QName.createQName(URI, "ontvangstdatumVerzending"); + QName PROP_VERZENDDATUM_VERZENDING = QName.createQName(URI, "verzenddatumVerzending"); + QName PROP_CONTACTPERSOON = QName.createQName(URI, "contactPersoon"); + QName PROP_CONTACTPERSOONNAAM = QName.createQName(URI, "contactpersoonnaam"); + QName PROP_FAXNUMMER = QName.createQName(URI, "faxnummer"); + QName PROP_EMAILADRES = QName.createQName(URI, "emailadres"); + QName PROP_MIJNOVERHEID = QName.createQName(URI, "mijnOverheid"); + QName PROP_TELEFOONNUMMER = QName.createQName(URI, "telefoonnummer"); + + // Binnenlands Correspondentieadres + QName PROP_HUISLETTER = QName.createQName(URI, "huisletter"); + QName PROP_HUISNUMMER = QName.createQName(URI, "huisnummer"); + QName PROP_HUISNUMMER_TOEVOEGING = QName.createQName(URI, "huisnummerToevoeging"); + QName PROP_NAAM_OPENBARE_RUIMTE = QName.createQName(URI, "naamOpenbareRuimte"); + QName PROP_POSTCODE = QName.createQName(URI, "postcode"); + QName PROP_WOONPLAATSNAAM = QName.createQName(URI, "woonplaatsnaam"); + + // Buitenlands Correspondentieadres + QName PROP_ADRES_BUITENLAND1 = QName.createQName(URI, "adresBuitenland1"); + QName PROP_ADRES_BUITENLAND2 = QName.createQName(URI, "adresBuitenland2"); + QName PROP_ADRES_BUITENLAND3 = QName.createQName(URI, "adresBuitenland3"); + QName PROP_LAND_POSTADRES = QName.createQName(URI, "landPostadres"); + + // Correspondentie Postadres + QName PROP_POSTBUS_ANTWOORDNUMMER = QName.createQName(URI, "postBusOfAntwoordnummer"); + QName PROP_POSTADRES_POSTCODE = QName.createQName(URI, "postadresPostcode"); + QName PROP_POSTADRES_TYPE = QName.createQName(URI, "postadresType"); + QName PROP_WOONPLAATSNAAM_POSTADRES = QName.createQName(URI, "woonplaatsnaamPostadres"); } \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/service/DRCService.java b/platform/src/main/java/nl/contezza/drc/service/DRCService.java index 58489c04b4c98d2922022dd8767b5b260192f7dd..40ac3e31bb2bbfe350a4621f668b5fec1ea9191f 100644 --- a/platform/src/main/java/nl/contezza/drc/service/DRCService.java +++ b/platform/src/main/java/nl/contezza/drc/service/DRCService.java @@ -96,6 +96,7 @@ public class DRCService { private static final String QNAME_GEBRUIKSRECHT_ITEMS = "gebruiksrechtItems"; private static final String QNAME_AUDIT_ITEMS = "auditItems"; private static final String QNAME_BESTANDSDEEL_ITEMS = "bestandsdeelItems"; + private static final String QNAME_VERZENDING_ITEMS = "verzendingItems"; private static final String QUERY_OIO_OBJ_INFOBJ = "TYPE:\"rgbz:objectinformatieobjectItem\" AND =@rgbz\\:object:\"%s\" AND =@rgbz\\:informatieobject:\"%s\""; private static final String QUERY_OIO_OBJ = "TYPE:\"rgbz:objectinformatieobjectItem\" AND =@rgbz\\:object:\"%s\""; @@ -776,6 +777,70 @@ public class DRCService { return result; } + /** + * Create Verzending item. + * + * @param fileRef NodeRef the file + * @param props Map<QName, Serializable> list of properties to store on + * Verzending item + * @return NodeRef the Verzending node + */ + public NodeRef createVerzendingItem(NodeRef fileRef, Map<QName, Serializable> props) { + NodeRef nodeRef = createNode(getChildAssocVerzendingenItems(fileRef), RGBZModel.TYPE_VERZENDING_ITEM); + if (props != null) { + nodeService.addProperties(nodeRef, props); + } + return nodeRef; + } + + /** + * Get the child assoc root node to store all verzendingen types. + * + * @param fileRef NodeRef the file + * @return NodeRef the node reference of child assoc verzendingen + */ + public NodeRef getChildAssocVerzendingenItems(NodeRef fileRef) { + List<ChildAssociationRef> items = nodeService.getChildAssocs(fileRef, RGBZModel.ASSOC_VERZENDING_ITEMS, + QName.createQName(RGBZModel.URI, QNAME_VERZENDING_ITEMS)); + if (items.isEmpty() || items.size() == 0) { + String uuid = UUID.randomUUID().toString(); + Map<QName, Serializable> props = new HashMap<QName, Serializable>(); + props.put(ContentModel.PROP_NODE_UUID, uuid); + props.put(ContentModel.PROP_NAME, uuid); + + ChildAssociationRef childRef = nodeService.createNode(fileRef, RGBZModel.ASSOC_VERZENDING_ITEMS, + QName.createQName(RGBZModel.URI, QNAME_VERZENDING_ITEMS), + RGBZModel.TYPE_VERZENDING, + props); + + return childRef.getChildRef(); + } + return nodeService.getChildAssocs(fileRef, RGBZModel.ASSOC_VERZENDING_ITEMS, + QName.createQName(RGBZModel.URI, QNAME_VERZENDING_ITEMS)).get(0).getChildRef(); + } + + /** + * Get all Verzending items from enkelvoudiginformatieobject. This excludes + * working copies. + * + * @param fileRef NodeRef the file + * @return List<NodeRef> list of Verzendingen + */ + public List<NodeRef> getVerzendingItems(NodeRef fileRef) { + List<NodeRef> result = new ArrayList<NodeRef>(); + List<ChildAssociationRef> items = nodeService.getChildAssocs(fileRef, RGBZModel.ASSOC_VERZENDING_ITEMS, + QName.createQName(RGBZModel.URI, QNAME_VERZENDING_ITEMS)); + if (items != null && items.size() > 0) { + NodeRef root = items.get(0).getChildRef(); + for (FileInfo fi : fileFolderService.list(root)) { + if (!checkOutCheckInService.isWorkingCopy(fi.getNodeRef())) { + result.add(fi.getNodeRef()); + } + } + } + return result; + } + /** * Create node where the name is also the UUID. * diff --git a/platform/src/main/java/nl/contezza/drc/webscript/AbstractDrcDeclarativeWebScript.java b/platform/src/main/java/nl/contezza/drc/webscript/AbstractDrcDeclarativeWebScript.java index fa8a07d0fc99014abdaaf4ec361a51b7ca6cc9af..cb53c8889fe16a0b68513413724ef864b977907a 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/AbstractDrcDeclarativeWebScript.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/AbstractDrcDeclarativeWebScript.java @@ -77,12 +77,15 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri public static final String PARAM_INFORMATIEOBJECT = "informatieobject"; public static final String PARAM_IDENTIFICATIE = "identificatie"; public static final String PARAM_BRONORGANISATIE = "bronorganisatie"; + public static final String PARAM_AARD_RELATIE = "aardRelatie"; + public static final String PARAM_BETROKKENE = "betrokkene"; public static final String PARAM_PAGE = "page"; public static final String ENDPOINT_EIO = "%s/service/drc/v1/enkelvoudiginformatieobjecten"; public static final String ENDPOINT_OIO = "%s/service/drc/v1/objectinformatieobjecten"; public static final String ENDPOINT_GEBRUIKSRECHTEN = "%s/service/drc/v1/gebruiksrechten"; public static final String ENDPOINT_BESTANDSDELEN = "%s/service/drc/v1/bestandsdelen"; + public static final String ENDPOINT_VERZENDINGEN = "%s/api/v1/verzendingen"; public static final String DATE_FORMAT_0 = "yyyy-MM-dd"; public static final String DATE_FORMAT_1 = "yyyy-MM-dd'T'HH:mm:ss'Z'"; @@ -91,6 +94,7 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri public static final String SCOPE_AUDIT_LEZEN = "audittrails.lezen"; public static final String SCOPE_DOCUMENTEN_AANMAKEN = "documenten.aanmaken"; public static final String SCOPE_DOCUMENTEN_BIJWERKEN = "documenten.bijwerken"; + public static final String SCOPE_DOCUMENTEN_GEFORCEERD_BIJWERKEN = "documenten.geforceerd-bijwerken"; public static final String SCOPE_DOCUMENTEN_GEFORCEERD_UNLOCK = "documenten.geforceerd-unlock"; public static final String SCOPE_DOCUMENTEN_LEZEN = "documenten.lezen"; public static final String SCOPE_DOCUMENTEN_LOCK = "documenten.lock"; @@ -176,6 +180,7 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri } } } else if (SCOPE_DOCUMENTEN_LEZEN.equalsIgnoreCase(scope) || SCOPE_DOCUMENTEN_BIJWERKEN.equalsIgnoreCase(scope) + || SCOPE_DOCUMENTEN_GEFORCEERD_BIJWERKEN.equalsIgnoreCase(scope) || SCOPE_DOCUMENTEN_LOCK.equalsIgnoreCase(scope) || SCOPE_DOCUMENTEN_GEFORCEERD_UNLOCK.equalsIgnoreCase(scope) || SCOPE_DOCUMENTEN_VERWIJDEREN.equalsIgnoreCase(scope)) { @@ -289,7 +294,7 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri * @param oioOrGebruiksrechtRef NodeRef the node reference * @param req WebScriptRequest request */ - protected void validateGebruiksrechtOrOIOAuth(NodeRef oioOrGebruiksrechtRef, WebScriptRequest req) { + protected void validateItemOrOIOAuth(NodeRef nodeRef, WebScriptRequest req) { // Get auth levels List<AuthLevel> authLevels = drcAutorisatiesService.getAuthLevels(drcService.getClientId(req)); // Client has no configuration set @@ -301,7 +306,7 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri return; } - String informatieobject = (String) nodeService.getProperty(oioOrGebruiksrechtRef, + String informatieobject = (String) nodeService.getProperty(nodeRef, RGBZModel.PROP_INFORMATIEOBJECT); NodeRef eioRef = drcService.findNode(informatieobject); @@ -336,13 +341,13 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri } /** - * Is authorized to access OIO/Gebruiksrecht based on EIO. + * Is authorized to access OIO/Gebruiksrecht/Verzending based on EIO. * - * @param nodeRef NodeRef the oioRef / gebruiksrecht + * @param nodeRef NodeRef the oioRef / gebruiksrecht / Verzending * @param authLevels List<AuthLevel> auth levels * @return Boolean true when user can access EIO */ - protected Boolean canAccessGebruikersrechtOrOIO(NodeRef nodeRef, List<AuthLevel> authLevels) { + protected Boolean canAccessItemOrOIO(NodeRef nodeRef, List<AuthLevel> authLevels) { String informatieobject = (String) nodeService.getProperty(nodeRef, RGBZModel.PROP_INFORMATIEOBJECT); NodeRef eioRef = drcService.findNode(informatieobject); @@ -484,6 +489,12 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri } } + if (getJsonString(jsonRequest, RGBZModel.PROP_VERSCHIJNINGSVORM.getLocalName()) != null) { + props.put(RGBZModel.PROP_VERSCHIJNINGSVORM, + getJsonString(jsonRequest, RGBZModel.PROP_VERSCHIJNINGSVORM.getLocalName()) == "null" ? null + : getJsonString(jsonRequest, RGBZModel.PROP_VERSCHIJNINGSVORM.getLocalName())); + } + Long bestandsomvang = getJsonLong(jsonRequest, "bestandsomvang"); if (bestandsomvang != null || jsonRequest.has("bestandsomvang")) { props.put(RGBZModel.PROP_BESTANDSOMVANG, bestandsomvang); @@ -565,6 +576,208 @@ public abstract class AbstractDrcDeclarativeWebScript extends DeclarativeWebScri return drcValidationHelper.validateGebruiksrechten(props, req); } + /** + * Get properties map based on the json request. + * + * @param jsonRequest JSONObject json + * @return Map<QName, Serializable> map to set on node reference + */ + protected Map<QName, Serializable> getVerzendingenPropertiesMap(JSONObject jsonRequest, WebScriptRequest req) { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("JSON: " + jsonRequest); + } + + Map<QName, Serializable> props = new HashMap<>(); + + if (getJsonString(jsonRequest, RGBZModel.PROP_BETROKKENE.getLocalName()) != null) { + props.put(RGBZModel.PROP_BETROKKENE, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_BETROKKENE.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_BETROKKENE.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_INFORMATIEOBJECT.getLocalName()) != null) { + props.put(RGBZModel.PROP_INFORMATIEOBJECT, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_INFORMATIEOBJECT.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_INFORMATIEOBJECT.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_AARD_RELATIE.getLocalName()) != null) { + props.put(RGBZModel.PROP_AARD_RELATIE, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_AARD_RELATIE.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_AARD_RELATIE.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_TOELICHTING.getLocalName()) != null) { + props.put(RGBZModel.PROP_TOELICHTING, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_TOELICHTING.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_TOELICHTING.getLocalName())); + } + + Date ontvangstdatum = getJsonDate(jsonRequest, RGBZModel.PROP_ONTVANGSTDATUM.getLocalName(), DATE_FORMAT_0); + if (ontvangstdatum != null) { + props.put(RGBZModel.PROP_ONTVANGSTDATUM_VERZENDING, ontvangstdatum); + } + + Date verzenddatum = getJsonDate(jsonRequest, RGBZModel.PROP_VERZENDDATUM.getLocalName(), DATE_FORMAT_0); + if (verzenddatum != null) { + props.put(RGBZModel.PROP_VERZENDDATUM_VERZENDING, verzenddatum); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOON.getLocalName()) != null) { + props.put(RGBZModel.PROP_CONTACTPERSOON, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOON.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOON.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOONNAAM.getLocalName()) != null) { + props.put(RGBZModel.PROP_CONTACTPERSOONNAAM, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOONNAAM.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_CONTACTPERSOONNAAM.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_FAXNUMMER.getLocalName()) != null) { + props.put(RGBZModel.PROP_FAXNUMMER, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_FAXNUMMER.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_FAXNUMMER.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_EMAILADRES.getLocalName()) != null) { + props.put(RGBZModel.PROP_EMAILADRES, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_EMAILADRES.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_EMAILADRES.getLocalName())); + } + + if (getJsonBoolean(jsonRequest, RGBZModel.PROP_MIJNOVERHEID.getLocalName()) != null) { + props.put(RGBZModel.PROP_MIJNOVERHEID, + getJsonBoolean(jsonRequest, RGBZModel.PROP_MIJNOVERHEID.getLocalName())); + } + + if (getJsonString(jsonRequest, RGBZModel.PROP_TELEFOONNUMMER.getLocalName()) != null) { + props.put(RGBZModel.PROP_TELEFOONNUMMER, + "null".equals(getJsonString(jsonRequest, RGBZModel.PROP_TELEFOONNUMMER.getLocalName())) ? null + : getJsonString(jsonRequest, RGBZModel.PROP_TELEFOONNUMMER.getLocalName())); + } + + // Binnenlands correspondentieadres + JSONObject binnenlandsAdres = getJsonObject(jsonRequest, "binnenlandsCorrespondentieadres"); + if (binnenlandsAdres != null || (jsonRequest.has("binnenlandsCorrespondentieadres") + && jsonRequest.isNull("binnenlandsCorrespondentieadres"))) { + props.put(RGBZModel.PROP_HUISLETTER, null); + props.put(RGBZModel.PROP_HUISNUMMER, null); + props.put(RGBZModel.PROP_HUISNUMMER_TOEVOEGING, null); + props.put(RGBZModel.PROP_NAAM_OPENBARE_RUIMTE, null); + props.put(RGBZModel.PROP_POSTCODE, null); + props.put(RGBZModel.PROP_WOONPLAATSNAAM, null); + } + + if (binnenlandsAdres != null) { + if (getJsonString(binnenlandsAdres, RGBZModel.PROP_HUISLETTER.getLocalName()) != null) { + props.put(RGBZModel.PROP_HUISLETTER, + getJsonString(binnenlandsAdres, RGBZModel.PROP_HUISLETTER.getLocalName()).equals("null") ? null + : getJsonString(binnenlandsAdres, RGBZModel.PROP_HUISLETTER.getLocalName())); + } + if (getJsonLong(binnenlandsAdres, RGBZModel.PROP_HUISNUMMER.getLocalName()) != null) { + props.put(RGBZModel.PROP_HUISNUMMER, + getJsonLong(binnenlandsAdres, RGBZModel.PROP_HUISNUMMER.getLocalName())); + } + if (getJsonString(binnenlandsAdres, RGBZModel.PROP_HUISNUMMER_TOEVOEGING.getLocalName()) != null) { + props.put(RGBZModel.PROP_HUISNUMMER_TOEVOEGING, + getJsonString(binnenlandsAdres, RGBZModel.PROP_HUISNUMMER_TOEVOEGING.getLocalName()) + .equals("null") ? null + : getJsonString(binnenlandsAdres, + RGBZModel.PROP_HUISNUMMER_TOEVOEGING.getLocalName())); + } + if (getJsonString(binnenlandsAdres, RGBZModel.PROP_NAAM_OPENBARE_RUIMTE.getLocalName()) != null) { + props.put(RGBZModel.PROP_NAAM_OPENBARE_RUIMTE, + getJsonString(binnenlandsAdres, RGBZModel.PROP_NAAM_OPENBARE_RUIMTE.getLocalName()) + .equals("null") ? null + : getJsonString(binnenlandsAdres, + RGBZModel.PROP_NAAM_OPENBARE_RUIMTE.getLocalName())); + } + if (getJsonString(binnenlandsAdres, RGBZModel.PROP_POSTCODE.getLocalName()) != null) { + props.put(RGBZModel.PROP_POSTCODE, + getJsonString(binnenlandsAdres, RGBZModel.PROP_POSTCODE.getLocalName()).equals("null") ? null + : getJsonString(binnenlandsAdres, RGBZModel.PROP_POSTCODE.getLocalName())); + } + if (getJsonString(binnenlandsAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName()) != null) { + props.put(RGBZModel.PROP_WOONPLAATSNAAM, + getJsonString(binnenlandsAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName()).equals("null") + ? null + : getJsonString(binnenlandsAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName())); + } + } + + // Buitenlands correspondentieadres + JSONObject buitenlandsAdres = getJsonObject(jsonRequest, "buitenlandsCorrespondentieadres"); + if (buitenlandsAdres != null || (jsonRequest.has("buitenlandsCorrespondentieadres") && + jsonRequest.isNull("buitenlandsCorrespondentieadres"))) { + props.put(RGBZModel.PROP_ADRES_BUITENLAND1, null); + props.put(RGBZModel.PROP_ADRES_BUITENLAND2, null); + props.put(RGBZModel.PROP_ADRES_BUITENLAND3, null); + props.put(RGBZModel.PROP_LAND_POSTADRES, null); + } + if (buitenlandsAdres != null) { + if (getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND1.getLocalName()) != null) { + props.put(RGBZModel.PROP_ADRES_BUITENLAND1, + getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND1.getLocalName()).equals("null") + ? null + : getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND1.getLocalName())); + } + if (getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND2.getLocalName()) != null) { + props.put(RGBZModel.PROP_ADRES_BUITENLAND2, + getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND2.getLocalName()).equals("null") + ? null + : getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND2.getLocalName())); + } + if (getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND3.getLocalName()) != null) { + props.put(RGBZModel.PROP_ADRES_BUITENLAND3, + getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND3.getLocalName()).equals("null") + ? null + : getJsonString(buitenlandsAdres, RGBZModel.PROP_ADRES_BUITENLAND3.getLocalName())); + } + if (getJsonString(buitenlandsAdres, RGBZModel.PROP_LAND_POSTADRES.getLocalName()) != null) { + props.put(RGBZModel.PROP_LAND_POSTADRES, + getJsonString(buitenlandsAdres, RGBZModel.PROP_LAND_POSTADRES.getLocalName()).equals("null") + ? null + : getJsonString(buitenlandsAdres, RGBZModel.PROP_LAND_POSTADRES.getLocalName())); + } + } + + // Correspondentie postadres + JSONObject postAdres = getJsonObject(jsonRequest, "correspondentiePostadres"); + if (postAdres != null || (jsonRequest.has("correspondentiePostadres") && + jsonRequest.isNull("correspondentiePostadres"))) { + props.put(RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER, null); + props.put(RGBZModel.PROP_POSTADRES_POSTCODE, null); + props.put(RGBZModel.PROP_POSTADRES_TYPE, null); + props.put(RGBZModel.PROP_WOONPLAATSNAAM_POSTADRES, null); + } + if (postAdres != null) { + if (getJsonLong(postAdres, RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER.getLocalName()) != null) { + props.put(RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER, + getJsonLong(postAdres, RGBZModel.PROP_POSTBUS_ANTWOORDNUMMER.getLocalName())); + } + if (getJsonString(postAdres, RGBZModel.PROP_POSTADRES_POSTCODE.getLocalName()) != null) { + props.put(RGBZModel.PROP_POSTADRES_POSTCODE, + getJsonString(postAdres, RGBZModel.PROP_POSTADRES_POSTCODE.getLocalName()).equals("null") ? null + : getJsonString(postAdres, RGBZModel.PROP_POSTADRES_POSTCODE.getLocalName())); + } + if (getJsonString(postAdres, RGBZModel.PROP_POSTADRES_TYPE.getLocalName()) != null) { + props.put(RGBZModel.PROP_POSTADRES_TYPE, + getJsonString(postAdres, RGBZModel.PROP_POSTADRES_TYPE.getLocalName()).equals("null") ? null + : getJsonString(postAdres, RGBZModel.PROP_POSTADRES_TYPE.getLocalName())); + } + if (getJsonString(postAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName()) != null) { + props.put(RGBZModel.PROP_WOONPLAATSNAAM_POSTADRES, + getJsonString(postAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName()).equals("null") + ? null + : getJsonString(postAdres, RGBZModel.PROP_WOONPLAATSNAAM.getLocalName())); + } + } + + return drcValidationHelper.validateVerzendingen(props, req); + } + /** * Get noderef from URL. * diff --git a/platform/src/main/java/nl/contezza/drc/webscript/V1Get.java b/platform/src/main/java/nl/contezza/drc/webscript/V1Get.java index ffab8db3ccfe4af453fb1c94eaafbeabde102738..391095eab4369968bc822d56783e84fb7c6166ac 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/V1Get.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/V1Get.java @@ -44,6 +44,7 @@ public class V1Get extends AbstractDrcDeclarativeWebScript { map.put("gebruiksrechten", getUrl(ENDPOINT_GEBRUIKSRECHTEN)); map.put("objectinformatieobjecten", getUrl(ENDPOINT_OIO)); map.put("bestandsdelen", getUrl(ENDPOINT_BESTANDSDELEN)); + map.put("verzendingen", getUrl(ENDPOINT_VERZENDINGEN)); return map; } diff --git a/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenGet.java b/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenGet.java index 31eadc03f9bd8ca691775edbf15c7a4cb013960d..34069f6978e4092dab946ccbc22111292c6c4eb1 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenGet.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenGet.java @@ -47,7 +47,7 @@ public class GebruiksrechtenGet extends AbstractDrcDeclarativeWebScript { NodeRef nodeRef = buildNodeRef(templateArgs); if (nodeRef != null) { - validateGebruiksrechtOrOIOAuth(nodeRef, req); + validateItemOrOIOAuth(nodeRef, req); Map<String, Object> model = new HashMap<String, Object>(); model.put("item", buildModel(nodeRef)); @@ -87,7 +87,7 @@ public class GebruiksrechtenGet extends AbstractDrcDeclarativeWebScript { List<Map<String, Object>> items = new ArrayList<Map<String, Object>>(resultSet.length()); for (int i = 0; i < resultSet.length(); i++) { ResultSetRow row = resultSet.getRow(i); - if (canAccessGebruikersrechtOrOIO(row.getNodeRef(), authLevels)) { + if (canAccessItemOrOIO(row.getNodeRef(), authLevels)) { items.add(buildModel(row.getNodeRef())); } } diff --git a/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenHead.java b/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenHead.java index 081eba78fc84200ab11e28ce83f95b7ab9853757..cef93d19de59ff725761627631381487a88ddfd1 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenHead.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/gebruiksrechten/GebruiksrechtenHead.java @@ -41,7 +41,7 @@ public class GebruiksrechtenHead extends AbstractDrcDeclarativeWebScript { NodeRef nodeRef = buildNodeRef(templateArgs); if (nodeRef != null) { - validateGebruiksrechtOrOIOAuth(nodeRef, req); + validateItemOrOIOAuth(nodeRef, req); // Generate eTag String curETag = ETag.generate((Date) nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIED)); diff --git a/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenGet.java b/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenGet.java index 1d7d5506fc04b82e538ec0e6fb96ebe248f4ce39..1007bc5b67c4bc72e2da505d0a969fa41c0f37b5 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenGet.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenGet.java @@ -54,7 +54,7 @@ public class ObjectinformatieobjectenGet extends AbstractDrcDeclarativeWebScript drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 404); } - validateGebruiksrechtOrOIOAuth(nodeRef, req); + validateItemOrOIOAuth(nodeRef, req); Map<String, Object> model = new HashMap<String, Object>(); model.put("item", buildModel(nodeRef)); @@ -95,7 +95,7 @@ public class ObjectinformatieobjectenGet extends AbstractDrcDeclarativeWebScript List<Map<String, Object>> items = new ArrayList<Map<String, Object>>(resultSet.length()); for (int i = 0; i < resultSet.length(); i++) { ResultSetRow row = resultSet.getRow(i); - if (canAccessGebruikersrechtOrOIO(row.getNodeRef(), authLevels)) { + if (canAccessItemOrOIO(row.getNodeRef(), authLevels)) { items.add(buildModel(row.getNodeRef())); } } diff --git a/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenHead.java b/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenHead.java index 0075c1453b9575b895082537f91734aa937c2b2a..d30b4031b6ec2faefda2416eb3ee97fadebcb6b6 100644 --- a/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenHead.java +++ b/platform/src/main/java/nl/contezza/drc/webscript/objectinformatieobjecten/ObjectinformatieobjectenHead.java @@ -49,7 +49,7 @@ public class ObjectinformatieobjectenHead extends AbstractDrcDeclarativeWebScrip drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 404); } - validateGebruiksrechtOrOIOAuth(nodeRef, req); + validateItemOrOIOAuth(nodeRef, req); // Generate eTag String curETag = ETag.generate((Date) nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIED)); diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenDelete.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenDelete.java new file mode 100644 index 0000000000000000000000000000000000000000..4e3eaad92aec1c9ebe296432a7dd0752378f6efa --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.service.cmr.repository.NodeRef; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenDelete extends AbstractDrcDeclarativeWebScript { + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars(); + NodeRef nodeRef = buildNodeRef(templateArgs); + + if (nodeRef == null) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 400); + } + + fileFolderService.delete(nodeRef); + + status.setCode(204); + + Map<String, Object> model = new HashMap<String, Object>(); + model.put("message", String.format("Node with uuid '%s' deleted.", templateArgs.get("uuid"))); + return model; + } +} \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenGet.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenGet.java new file mode 100644 index 0000000000000000000000000000000000000000..ee8a25041c479e7ad6f9004535bbf2923df60d2d --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenGet.java @@ -0,0 +1,200 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.template.TemplateNode; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.search.ResultSet; +import org.alfresco.service.cmr.search.ResultSetRow; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCFieldValidationError; +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.service.AuthLevel; +import nl.contezza.drc.util.ETag; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenGet extends AbstractDrcDeclarativeWebScript { + + private static final String API_UUID = "/drc/v1/verzendingen/{uuid}"; + private static final String QUERY_VERZENDINGEN = "+TYPE:\"rgbz:verzendingItem\" %s"; + + @Value("${drc.maxItems}") + private Integer maxItems; + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars(); + Map<String, Object> model = new HashMap<String, Object>(); + + switch (req.getServiceMatch().getTemplate()) { + case API_UUID: { + NodeRef nodeRef = buildNodeRef(templateArgs); + if (nodeRef != null) { + + validateItemOrOIOAuth(nodeRef, req); + // model.put("item", buildModel(nodeRef)); + model.put("item", new TemplateNode(nodeRef, serviceRegistry, null)); + model.put("url", getUrl(ENDPOINT_VERZENDINGEN)); + + // Generate eTag + String curETag = ETag.generate((Date) nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIED)); + + // Get header info to match eTag + List<String> eTags = req.getHeader("If-None-Match") == null ? new ArrayList<String>() + : Arrays.asList(req.getHeader("If-None-Match").split(",")); + if (eTags.contains("\"" + curETag + "\"")) { + status.setCode(304); + } + + cache.setETag(curETag); + + } else { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 404); + } + break; + } + default: + // Get auth levels + List<AuthLevel> authLevels = drcAutorisatiesService.getAuthLevels(drcService.getClientId(req)); + + if (!isAuthorized(authLevels)) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_PERMISSION_DENIED, 403); + } + + // Build query + String query = buildQuery(req.getParameter("informatieobject"), + req.getParameter("aardRelatie"), + req.getParameter("betrokkene")); + + // When AC is enabled the query need te be modified by adding iot according to + // auth levels + // query = modifyQueryBasedOnAuthLevels(query, authLevels); + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Query: " + query); + } + + // Only accept 3 params + String[] params = req.getParameterNames(); + for (String param : params) { + if (!param.equalsIgnoreCase(PARAM_AARD_RELATIE) + && !param.equalsIgnoreCase(PARAM_INFORMATIEOBJECT) + && !param.equalsIgnoreCase(PARAM_BETROKKENE) + && !param.equalsIgnoreCase(PARAM_PAGE)) { + List<DRCFieldValidationError> invalidParams = new ArrayList<DRCFieldValidationError>(); + invalidParams.add(drcValidationHelper.newFieldValidationError("nonFieldErrors", + DRCValidationHelper.CODE_UNKNOWN_PARAMETERS)); + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_INVALID, 400, invalidParams); + } + } + + // Get page if provided + Integer page = getPage(req); + + if (page == 0) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 404); + } + + // Calculate skipcount + Integer skipCount = 0; + if (page != 1) { + skipCount = (page - 1) * maxItems; + } + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug(String.format("Page: %s. SkipCount: %s. Max items: %s. ", page, skipCount, maxItems)); + } + + // Execute search + ResultSet resultSet = drcService.performFTSSearch(query, maxItems, skipCount); + + // Validate next page + Boolean hasNext = resultSet.getNumberFound() > (skipCount * maxItems) + && resultSet.getNumberFound() > maxItems; + + // Validate previous page + Boolean hasPrevious = false; + if (resultSet.getNumberFound() != 0 && skipCount != 0 && page != 1) { + hasPrevious = true; + } + + // Add nodes to model + List<TemplateNode> items = new ArrayList<TemplateNode>(resultSet.length()); + for (int i = 0; i < resultSet.length(); i++) { + ResultSetRow row = resultSet.getRow(i); + if (canAccessItemOrOIO(row.getNodeRef(), authLevels)) { + items.add(new TemplateNode(row.getNodeRef(), serviceRegistry, null)); + } + } + + if (page != 1 && items.size() == 0) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 404); + } + // @formatter:off + model.put("next", getNextPage(req, page, (int) resultSet.getNumberFound(), hasNext, maxItems)); + model.put("previous", getPreviousPage(req, page, (int) resultSet.getNumberFound(), hasPrevious, maxItems)); + model.put("count", resultSet.getNumberFound()); + model.put("items", (Serializable) items); + model.put("url", getUrl(ENDPOINT_VERZENDINGEN)); + // @formatter:on + } + return model; + } + + /** + * build (lucene) search query for type 'rgbz:verzendingItem'. + * + * @param eio String url + * @param aardRelatie String Enum ("afzender", "geadresseerde") + * @param betrokkene String Name + * @return A search query + */ + public String buildQuery(String eio, String aardRelatie, String betrokkene) { + + String query = ""; + + if (query.length() == 0) { + query = String.format(QUERY_VERZENDINGEN, ""); + } + // "+TYPE:\"rgbz:verzendingItem\" %s" + if (eio != null && !eio.isEmpty() && !eio.equalsIgnoreCase("null")) { + query += String.format("AND =@rgbz\\:informatieobject:\"%s\"", eio); + } + + if (aardRelatie != null && !aardRelatie.isEmpty() && !aardRelatie.equalsIgnoreCase("null")) { + query += String.format("AND =@rgbz\\:aardRelatie:\"%s\"", aardRelatie); + } + + if (betrokkene != null && !betrokkene.isEmpty() && !betrokkene.equalsIgnoreCase("null")) { + query += String.format("AND =@rgbz\\:betrokkene:\"%s\"", betrokkene); + } + + return query; + } +} \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenHead.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenHead.java new file mode 100644 index 0000000000000000000000000000000000000000..b85fcd6c11dde1028a9b92c370861cab7124e2f5 --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenHead.java @@ -0,0 +1,68 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.repository.NodeRef; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.util.ETag; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenHead extends AbstractDrcDeclarativeWebScript { + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + // Get UUID if provided + Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars(); + + if (templateArgs.get("uuid") != null) { + NodeRef nodeRef = buildNodeRef(templateArgs); + if (nodeRef != null) { + + validateItemOrOIOAuth(nodeRef, req); + + // Generate eTag + String curETag = ETag.generate((Date) nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIED)); + + // Get header info to match eTag + List<String> eTags = req.getHeader("If-None-Match") == null ? new ArrayList<String>() + : Arrays.asList(req.getHeader("If-None-Match").split(",")); + if (eTags.contains("\"" + curETag + "\"")) { + status.setCode(304); + } + + cache.setETag(curETag); + + return null; + } else { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 400); + } + } + + return null; + } + +} \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPatch.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPatch.java new file mode 100644 index 0000000000000000000000000000000000000000..d079aa99201612acc921c324aeb2b4767318be97 --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPatch.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.repo.template.TemplateNode; +import org.alfresco.service.cmr.repository.NodeRef; +import org.json.JSONObject; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenPatch extends AbstractDrcDeclarativeWebScript { + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + // Get UUID + Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars(); + NodeRef nodeRef = buildNodeRef(templateArgs); + + if (nodeRef == null) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 400); + } + + JSONObject jsonRequest = (JSONObject) req.parseContent(); + drcValidationHelper.validateVerzendingMultipleAdresses(jsonRequest, nodeService.getProperties(nodeRef), false); + + // Update properties + nodeService.addProperties(nodeRef, getVerzendingenPropertiesMap(jsonRequest, req)); + + // Build model + Map<String, Object> model = new HashMap<String, Object>(); + model.put("item", new TemplateNode(nodeRef, serviceRegistry, null)); + model.put("url", getUrl(ENDPOINT_VERZENDINGEN)); + return model; + } +} \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPost.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPost.java new file mode 100644 index 0000000000000000000000000000000000000000..37f196b3dfd2b43bdf24694697b61ea2dbf48fe7 --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPost.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.repo.template.TemplateNode; +import org.alfresco.service.cmr.repository.NodeRef; +import org.json.JSONObject; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.service.DRCService; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenPost extends AbstractDrcDeclarativeWebScript { + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + JSONObject jsonRequest = (JSONObject) req.parseContent(); + + if (!isAuthorized(req, SCOPE_DOCUMENTEN_AANMAKEN)) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_PERMISSION_DENIED, 403); + } + + drcValidationHelper.validateVerzendingMultipleAdresses(jsonRequest, null, false); + + // Create target location + Map<String, String> map = new HashMap<String, String>(); + String path = DRCService.replace("/verzendingen/{year}/{month}/{day}", drcService.getDateTimeMap(map)); + NodeRef parentRef = drcService.createFolderStructure(drcService.getSite().getNodeRef(), path); + + // Get verzending and create item + NodeRef nodeRef = drcService.createVerzendingItem(parentRef, + getVerzendingenPropertiesMap(jsonRequest, req)); + + // Set correct status + status.setCode(201); + + Map<String, Object> model = new HashMap<String, Object>(); + model.put("item", new TemplateNode(nodeRef, serviceRegistry, null)); + model.put("url", getUrl(ENDPOINT_VERZENDINGEN)); + return model; + } +} \ No newline at end of file diff --git a/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPut.java b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPut.java new file mode 100644 index 0000000000000000000000000000000000000000..371ec72cffd965da413e70f40715badfa9f28e3e --- /dev/null +++ b/platform/src/main/java/nl/contezza/drc/webscript/verzendingen/VerzendingenPut.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022-2025 Contezza BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package nl.contezza.drc.webscript.verzendingen; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.repo.template.TemplateNode; +import org.alfresco.service.cmr.repository.NodeRef; +import org.json.JSONObject; +import org.springframework.extensions.webscripts.Cache; +import org.springframework.extensions.webscripts.Status; +import org.springframework.extensions.webscripts.WebScriptRequest; + +import nl.contezza.drc.helper.DRCValidationHelper; +import nl.contezza.drc.webscript.AbstractDrcDeclarativeWebScript; + +public class VerzendingenPut extends AbstractDrcDeclarativeWebScript { + + @Override + protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { + // Get UUID + Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars(); + NodeRef nodeRef = buildNodeRef(templateArgs); + + if (nodeRef == null) { + drcValidationHelper.createDrcException(DRCValidationHelper.CODE_NOT_FOUND, 400); + } + + // Update properties + JSONObject jsonRequest = (JSONObject) req.parseContent(); + drcValidationHelper.validateVerzendingMultipleAdresses(jsonRequest, nodeService.getProperties(nodeRef), true); + + // Update properties + nodeService.addProperties(nodeRef, getVerzendingenPropertiesMap(jsonRequest, req)); + + // Build model + Map<String, Object> model = new HashMap<String, Object>(); + model.put("item", new TemplateNode(nodeRef, serviceRegistry, null)); + model.put("url", getUrl(ENDPOINT_VERZENDINGEN)); + return model; + } +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/context/webscript-context.xml b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/context/webscript-context.xml index 1edb20258c23724508a703e92074e131d4c2400d..b764c254333607da815b3f904f07b415b02534e6 100644 --- a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/context/webscript-context.xml +++ b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/context/webscript-context.xml @@ -3,12 +3,15 @@ <beans> - <bean id="abstract-drc" class="nl.contezza.drc.AbstractDrcDeclarativeWebScript" abstract="true" parent="webscript" /> + <bean id="abstract-drc" class="nl.contezza.drc.AbstractDrcDeclarativeWebScript" abstract="true" + parent="webscript" /> <!-- Root API and Schema --> - <bean id="webscript.nl.contezza.drc.v1.get" class="nl.contezza.drc.webscript.V1Get" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.schema.get" class="nl.contezza.drc.webscript.V1SchemaGet" parent="webscript"> + <bean id="webscript.nl.contezza.drc.v1.get" class="nl.contezza.drc.webscript.V1Get" + parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.schema.get" class="nl.contezza.drc.webscript.V1SchemaGet" + parent="webscript"> <property name="nodeService" ref="nodeService" /> <property name="permissionService" ref="PermissionService" /> <property name="mimetypeService" ref="mimetypeService" /> @@ -19,7 +22,8 @@ <!-- Enkelvoudiginformatieobjecten --> <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.download.get" - class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenDownloadGet" parent="webscript"> + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenDownloadGet" + parent="webscript"> <property name="nodeService" ref="nodeService" /> <property name="contentService" ref="ContentService" /> <property name="permissionService" ref="PermissionService" /> @@ -30,31 +34,79 @@ <property name="drcValidationHelper" ref="DRCValidationHelper" /> </bean> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.get" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenGet" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.head" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenHead" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.post" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPost" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.put" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPut" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.patch" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPatch" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.delete" class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenDelete" parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.get" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenGet" + parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.head" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenHead" + parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.post" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPost" + parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.put" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPut" + parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.patch" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenPatch" + parent="abstract-drc" /> + <bean + id="webscript.nl.contezza.drc.enkelvoudiginformatieobjecten.enkelvoudiginformatieobjecten.delete" + class="nl.contezza.drc.webscript.enkelvoudiginformatieobjecten.EnkelvoudiginformatieobjectenDelete" + parent="abstract-drc" /> <!-- Gebruiksrechten --> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.get" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenGet" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.head" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenHead" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.post" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPost" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.put" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPut" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.patch" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPatch" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.delete" class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenDelete" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.get" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenGet" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.head" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenHead" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.post" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPost" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.put" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPut" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.patch" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenPatch" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.gebruiksrechten.gebruiksrechten.delete" + class="nl.contezza.drc.webscript.gebruiksrechten.GebruiksrechtenDelete" + parent="abstract-drc" /> + + <!-- Verzendingen--> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.get" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenGet" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.head" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenHead" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.post" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenPost" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.put" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenPut" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.patch" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenPatch" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.verzendingen.verzendingen.delete" + class="nl.contezza.drc.webscript.verzendingen.VerzendingenDelete" parent="abstract-drc" /> <!-- Objectinformatieobjecten --> - <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.get" class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenGet" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.head" class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenHead" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.post" class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenPost" parent="abstract-drc" /> - <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.delete" class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenDelete" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.get" + class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenGet" + parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.head" + class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenHead" + parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.post" + class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenPost" + parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.objectinformatieobjecten.objectinformatieobjecten.delete" + class="nl.contezza.drc.webscript.objectinformatieobjecten.ObjectinformatieobjectenDelete" + parent="abstract-drc" /> <!-- Bestandsdelen --> - <bean id="webscript.nl.contezza.drc.bestandsdelen.bestandsdelen.put" class="nl.contezza.drc.webscript.bestandsdelen.BestandsdelenPut" parent="abstract-drc" /> + <bean id="webscript.nl.contezza.drc.bestandsdelen.bestandsdelen.put" + class="nl.contezza.drc.webscript.bestandsdelen.BestandsdelenPut" parent="abstract-drc" /> </beans> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/files/openapi.yaml b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/files/openapi.yaml index e507bd41ee4fff83e86ca9919fe16506f8460592..52ec40fdd495ae9bde49bd36312b981b23da0d60 100644 --- a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/files/openapi.yaml +++ b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/files/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Documenten API - version: 1.2.3 + version: 1.3.0 description: "Een API om een documentregistratiecomponent (DRC) te benaderen.\n\n\ In een documentregistratiecomponent worden INFORMATIEOBJECTen opgeslagen. Een\n\ @@ -1063,7 +1063,7 @@ paths: description: "Dit cre\xEBert altijd een nieuwe versie van het (ENKELVOUDIG)\ \ INFORMATIEOBJECT. \n \n**Er wordt gevalideerd op**\n- correcte `lock` waarde\n\ - - het `informatieobjecttype` mag niet gewijzigd worden\n- status NIET `definitief`" + - status NIET `definitief`" summary: Werk een (ENKELVOUDIG) INFORMATIEOBJECT in zijn geheel bij. parameters: - in: path @@ -1252,7 +1252,7 @@ paths: description: "Dit cre\xEBert altijd een nieuwe versie van het (ENKELVOUDIG)\ \ INFORMATIEOBJECT. \n\n**Er wordt gevalideerd op**\n - correcte `lock` waarde\n\ - - het `informatieobjecttype` mag niet gewijzigd worden\n - status NIET `definitief`" + \ - status NIET `definitief`" summary: Werk een (ENKELVOUDIG) INFORMATIEOBJECT deels bij. parameters: - in: path @@ -3939,6 +3939,1043 @@ paths: schema: $ref: "#/components/schemas/ObjectInformatieObject" description: OK + /verzendingen: + get: + operationId: verzending_list + description: Deze lijst kan gefilterd wordt met query-string parameters. + summary: Alle VERZENDINGen opvragen. + parameters: + - name: aardRelatie + required: false + in: query + description: + Omschrijving van de aard van de relatie van de BETROKKENE tot + het INFORMATIEOBJECT. + schema: + type: string + enum: + - afzender + - geadresseerde + - name: informatieobject + required: false + in: query + description: + URL-referentie naar het informatieobject dat is ontvangen of + verzonden. + schema: + type: string + format: uri + - name: betrokkene + required: false + in: query + description: + URL-referentie naar de betrokkene waarvan het informatieobject + is ontvangen of waaraan dit is verzonden. + schema: + type: string + format: uri + - name: page + required: false + in: query + description: Een pagina binnen de gepagineerde set resultaten. + schema: + type: integer + tags: + - verzendingen + responses: + "200": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedVerzendingList" + description: OK + "400": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ValidatieFout" + description: Bad request + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + post: + operationId: verzending_create + description: Voeg VERZENDINGen toe voor een INFORMATIEOBJECT en een BETROKKENE. + summary: Maak een VERZENDING aan. + parameters: + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + description: Content type van de verzoekinhoud. + required: true + tags: + - verzendingen + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/VerzendingRequest" + required: true + responses: + "201": + headers: + Location: + schema: + type: string + format: uri + description: URL waar de resource leeft. + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/Verzending" + description: Created + "400": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ValidatieFout" + description: Bad request + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + /verzendingen/{uuid}: + get: + operationId: verzending_retrieve + description: Een specifieke VERZENDING opvragen. + summary: Een specifieke VERZENDING opvragen. + parameters: + - in: path + name: uuid + schema: + type: string + format: uuid + description: Unieke resource identifier (UUID4) + title: uuid + required: true + - in: header + name: If-None-Match + schema: + type: string + description: + "Voer een voorwaardelijk verzoek uit. Deze header moet \xE9\xE9\ + n of meerdere ETag-waardes bevatten van resources die de consumer gecached\ + \ heeft. Indien de waarde van de ETag van de huidige resource voorkomt in\ + \ deze set, dan antwoordt de provider met een lege HTTP 304 request. Zie\ + \ [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match)\ + \ voor meer informatie." + examples: + OneValue: + value: '"79054025255fb1a26e4bc422aef54eb4"' + summary: "E\xE9n ETag-waarde" + MultipleValues: + value: '"79054025255fb1a26e4bc422aef54eb4", "e4d909c290d0fb1ca068ffaddf22cbd0"' + summary: Meerdere ETag-waardes + tags: + - verzendingen + responses: + "200": + headers: + ETag: + schema: + type: string + description: + De ETag berekend op de response body JSON. Indien twee + resources exact dezelfde ETag hebben, dan zijn deze resources identiek + aan elkaar. Je kan de ETag gebruiken om caching te implementeren. + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/Verzending" + description: OK + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "404": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not found + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + put: + operationId: verzending_update + description: Werk een VERZENDING in zijn geheel bij. + summary: Werk een VERZENDING in zijn geheel bij. + parameters: + - in: path + name: uuid + schema: + type: string + format: uuid + description: Unieke resource identifier (UUID4) + title: uuid + required: true + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + description: Content type van de verzoekinhoud. + required: true + tags: + - verzendingen + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/VerzendingRequest" + required: true + responses: + "200": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/Verzending" + description: OK + "400": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ValidatieFout" + description: Bad request + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "404": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not found + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + patch: + operationId: verzending_partial_update + description: Werk een VERZENDING relatie deels bij. + summary: Werk een VERZENDING relatie deels bij. + parameters: + - in: path + name: uuid + schema: + type: string + format: uuid + description: Unieke resource identifier (UUID4) + title: uuid + required: true + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + description: Content type van de verzoekinhoud. + required: true + tags: + - verzendingen + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PatchedVerzendingRequest" + responses: + "200": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/Verzending" + description: OK + "400": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ValidatieFout" + description: Bad request + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "404": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not found + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + delete: + operationId: verzending_destroy + description: Verwijder een VERZENDING. + summary: Verwijder een VERZENDING + parameters: + - in: path + name: uuid + schema: + type: string + format: uuid + description: Unieke resource identifier (UUID4) + title: uuid + required: true + tags: + - verzendingen + responses: + "204": + description: No content + "401": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unauthorized + "403": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Forbidden + "404": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not found + "406": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Not acceptable + "409": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Conflict + "410": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Gone + "415": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Unsupported media type + "429": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Too many requests + "500": + headers: + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/problem+json: + schema: + $ref: "#/components/schemas/Fout" + description: Internal server error + head: + operationId: verzending_headers + description: Vraag de headers op die je bij een GET request zou krijgen. + summary: "De headers voor een specifiek(e) VERZENDING opvragen " + parameters: + - in: path + name: uuid + schema: + type: string + format: uuid + description: Unieke resource identifier (UUID4) + title: uuid + required: true + - in: header + name: If-None-Match + schema: + type: string + description: + "Voer een voorwaardelijk verzoek uit. Deze header moet \xE9\xE9\ + n of meerdere ETag-waardes bevatten van resources die de consumer gecached\ + \ heeft. Indien de waarde van de ETag van de huidige resource voorkomt in\ + \ deze set, dan antwoordt de provider met een lege HTTP 304 request. Zie\ + \ [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match)\ + \ voor meer informatie." + examples: + OneValue: + value: '"79054025255fb1a26e4bc422aef54eb4"' + summary: "E\xE9n ETag-waarde" + MultipleValues: + value: '"79054025255fb1a26e4bc422aef54eb4", "e4d909c290d0fb1ca068ffaddf22cbd0"' + summary: Meerdere ETag-waardes + tags: + - verzendingen + responses: + "200": + headers: + ETag: + schema: + type: string + description: + De ETag berekend op de response body JSON. Indien twee + resources exact dezelfde ETag hebben, dan zijn deze resources identiek + aan elkaar. Je kan de ETag gebruiken om caching te implementeren. + API-version: + schema: + type: string + description: + "Geeft een specifieke API-versie aan in de context van + een specifieke aanroep. Voorbeeld: 1.2.1." + content: + application/json: + schema: + $ref: "#/components/schemas/Verzending" + description: OK components: responses: "400": diff --git a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model.properties b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model.properties index f78fd53bf3964c64c82f649983ebd7b94dc68e1f..0506daa9551831dddfbf0234a0541880ce256fba 100644 --- a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model.properties +++ b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model.properties @@ -34,6 +34,7 @@ rgbz_model.property.rgbz_integriteitAlgoritme.title=Algoritme (integriteit) rgbz_model.property.rgbz_integriteitWaarde.title=Waarde (integriteit) rgbz_model.property.rgbz_integriteitDatum.title=Datum (integriteit) rgbz_model.property.rgbz_informatieobjecttype.title=Informatieobjecttype +rgbz_model.property.rgbz_verschijningsvorm.title=Verschijningsvorm #Constraints listconstraint.rgbz_vertrouwelijkheidaanduidingConstraint.openbaar=Openbaar diff --git a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model_nl.properties b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model_nl.properties index f78fd53bf3964c64c82f649983ebd7b94dc68e1f..0506daa9551831dddfbf0234a0541880ce256fba 100644 --- a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model_nl.properties +++ b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/messages/rgbz-model_nl.properties @@ -34,6 +34,7 @@ rgbz_model.property.rgbz_integriteitAlgoritme.title=Algoritme (integriteit) rgbz_model.property.rgbz_integriteitWaarde.title=Waarde (integriteit) rgbz_model.property.rgbz_integriteitDatum.title=Datum (integriteit) rgbz_model.property.rgbz_informatieobjecttype.title=Informatieobjecttype +rgbz_model.property.rgbz_verschijningsvorm.title=Verschijningsvorm #Constraints listconstraint.rgbz_vertrouwelijkheidaanduidingConstraint.openbaar=Openbaar diff --git a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/model/rgbz-model.xml b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/model/rgbz-model.xml index 4008a70c3d58af7ccf7cc928bbc8b1e45e8bb01b..0f01692b29513eeb8c2eac87f20399ec10edefa0 100644 --- a/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/model/rgbz-model.xml +++ b/platform/src/main/resources/alfresco/module/alfresco-documenten-api-platform/model/rgbz-model.xml @@ -130,6 +130,15 @@ </parameter> </constraint> + <constraint name="rgbz:lengte6" type="LENGTH"> + <parameter name="maxLength"> + <value>6</value> + </parameter> + <parameter name="minLength"> + <value>0</value> + </parameter> + </constraint> + </constraints> <types> @@ -231,6 +240,105 @@ </properties> </type> + <!-- Verzendingen --> + + <type name="rgbz:verzending"> + <parent>cm:folder</parent> + </type> + + <type name="rgbz:verzendingItem"> + <parent>cm:folder</parent> + <properties> + <property name="rgbz:betrokkene"> + <type>d:text</type> + </property> + <property name="rgbz:aardRelatie"> + <type>d:text</type> + </property> + <property name="rgbz:toelichting"> + <type>d:text</type> + </property> + <property name="rgbz:ontvangstdatumVerzending"> + <type>d:date</type> + </property> + <property name="rgbz:verzenddatumVerzending"> + <type>d:date</type> + </property> + <property name="rgbz:contactPersoon"> + <type>d:text</type> + </property> + <property name="rgbz:contactpersoonnaam"> + <type>d:text</type> + </property> + <property name="rgbz:faxnummer"> + <type>d:text</type> + </property> + <property name="rgbz:emailadres"> + <type>d:text</type> + </property> + <property name="rgbz:mijnOverheid"> + <type>d:boolean</type> + </property> + <property name="rgbz:telefoonnummer"> + <type>d:text</type> + </property> + + <!-- Binnenlands Correspondentieadres --> + <property name="rgbz:huisletter"> + <type>d:text</type> + </property> + <property name="rgbz:huisnummer"> + <type>d:int</type> + </property> + <property name="rgbz:huisnummerToevoeging"> + <type>d:text</type> + </property> + <property name="rgbz:naamOpenbareRuimte"> + <type>d:text</type> + </property> + <property name="rgbz:postcode"> + <type>d:text</type> + <constraints> + <constraint ref="rgbz:lengte6" /> + </constraints> + </property> + <property name="rgbz:woonplaatsnaam"> + <type>d:text</type> + </property> + + <!-- Buitenlands Correspondentieadres --> + <property name="rgbz:adresBuitenland1"> + <type>d:text</type> + </property> + <property name="rgbz:adresBuitenland2"> + <type>d:text</type> + </property> + <property name="rgbz:adresBuitenland3"> + <type>d:text</type> + </property> + <property name="rgbz:landPostadres"> + <type>d:text</type> + </property> + + <!-- Correspondentie Postadres --> + <property name="rgbz:postBusOfAntwoordnummer"> + <type>d:int</type> + </property> + <property name="rgbz:postadresPostcode"> + <type>d:text</type> + <constraints> + <constraint ref="rgbz:lengte6" /> + </constraints> + </property> + <property name="rgbz:postadresType"> + <type>d:text</type> + </property> + <property name="rgbz:woonplaatsnaamPostadres"> + <type>d:text</type> + </property> + </properties> + </type> + </types> <aspects> @@ -302,6 +410,9 @@ <constraint ref="rgbz:vertrouwelijkheidaanduidingConstraint" /> </constraints> </property> + <property name="rgbz:verschijningsvorm"> + <type>d:text</type> + </property> <!-- Wordt gebruikt ter ondersteuning van bestandsdelen --> @@ -397,6 +508,23 @@ </associations> </aspect> + <aspect name="rgbz:verzendingen"> + <associations> + <child-association name="rgbz:verzendingItems"> + <source> + <mandatory>false</mandatory> + <many>false</many> + </source> + <target> + <class>rgbz:verzending</class> + <mandatory enforced="true">true</mandatory> + <many>false</many> + </target> + <duplicate>false</duplicate> + </child-association> + </associations> + </aspect> + <aspect name="rgbz:audits"> <associations> <child-association name="rgbz:auditItems"> diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.get.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.get.json.ftl index b0a7d0bd213b006697c864b87aaae06455bf48d9..d959f1f037422c90e41bc827a67fa078d14670f3 100644 --- a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.get.json.ftl +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.get.json.ftl @@ -35,6 +35,7 @@ "locked" : <#if item.isLocked || item.isWorkingCopy>true<#else>false</#if>, "bestandsdelen" : [<#list item.bestandsdelen as part><@renderFileParts part /><#if part_has_next>,</#if></#list>], "indicatieGebruiksrecht" : <#if item.properties["rgbz:indicatieGebruiksrecht"]??>${item.properties["rgbz:indicatieGebruiksrecht"]?c}<#else>null</#if>, + "verschijningsvorm" : "${item.properties["rgbz:verschijningsvorm"]!""}", "ondertekening": { "soort": "${item.properties["rgbz:ondertekeningSoort"]!""}", "datum": <#if item.properties["rgbz:ondertekeningDatum"]??>"<@dateFormat item.properties["rgbz:ondertekeningDatum"] />"<#else>null</#if> diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.patch.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.patch.json.ftl index e93e302978ea24756b8d9a85c72018f90c2ef726..5cb312cfc1159ce04af3c37f87b96635aa291708 100644 --- a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.patch.json.ftl +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.patch.json.ftl @@ -34,6 +34,7 @@ "locked" : <#if bestandsdelen?? && bestandsdelen?size == 1>true<#else>${item.isLocked?c}</#if>, "bestandsdelen" : [<#list bestandsdelen as part><@renderFileParts part /><#if part_has_next>,</#if></#list>], "indicatieGebruiksrecht" : <#if item.properties["rgbz:indicatieGebruiksrecht"]??>${item.properties["rgbz:indicatieGebruiksrecht"]?c}<#else>null</#if>, + "verschijningsvorm" : "${item.properties["rgbz:verschijningsvorm"]!""}", "ondertekening": <#if item.properties["rgbz:ondertekeningDatum"]??>{ "soort": "${item.properties["rgbz:ondertekeningSoort"]!""}", "datum": "<@dateFormat item.properties["rgbz:ondertekeningDatum"] />" diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.post.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.post.json.ftl index 4b2c695f47f5b54a147d77274f710f6a4e887fdf..acba9790de1956a64e6cbfef94712dde5a8e6a23 100644 --- a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.post.json.ftl +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.post.json.ftl @@ -35,6 +35,7 @@ "locked" : <#if lock??>true<#else>${item.isLocked?c}</#if>, "bestandsdelen" : [<#list item.bestandsdelen as part><@renderFileParts part /><#if part_has_next>,</#if></#list>], "indicatieGebruiksrecht" : <#if item.properties["rgbz:indicatieGebruiksrecht"]??>${item.properties["rgbz:indicatieGebruiksrecht"]?c}<#else>null</#if>, + "verschijningsvorm" : "${item.properties["rgbz:verschijningsvorm"]!""}", "ondertekening": { "soort": "${item.properties["rgbz:ondertekeningSoort"]!""}", "datum": <#if item.properties["rgbz:ondertekeningDatum"]??>"<@dateFormat item.properties["rgbz:ondertekeningDatum"] />"<#else>null</#if> diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.put.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.put.json.ftl index 3c8292fb8fc5bd94c23a607dfd80c40330a2d55b..921bfa4837e6842c8610200961e193e807c57527 100644 --- a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.put.json.ftl +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/enkelvoudiginformatieobjecten/enkelvoudiginformatieobjecten.put.json.ftl @@ -34,6 +34,7 @@ "locked" : ${item.isLocked?c}, "bestandsdelen" : [<#list item.bestandsdelen as part><@renderFileParts part /><#if part_has_next>,</#if></#list>], "indicatieGebruiksrecht" : <#if item.properties["rgbz:indicatieGebruiksrecht"]??>${item.properties["rgbz:indicatieGebruiksrecht"]?c}<#else>null</#if>, + "verschijningsvorm" : "${item.properties["rgbz:verschijningsvorm"]!""}", "ondertekening": <#if item.properties["rgbz:ondertekeningDatum"]??>{ "soort": "${item.properties["rgbz:ondertekeningSoort"]!""}", "datum": "<@dateFormat item.properties["rgbz:ondertekeningDatum"] />" diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/v1.get.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/v1.get.json.ftl index 1a18a0235adda48e228d0f0ee74de8959c3ca228..8bb811df8c1fb62bc46541e99106120379f43095 100644 --- a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/v1.get.json.ftl +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/v1.get.json.ftl @@ -4,5 +4,6 @@ "gebruiksrechten" : "${gebruiksrechten}", "objectinformatieobjecten" : "${objectinformatieobjecten}", "bestandsdelen" : "${bestandsdelen}" + "verzendingen" : "${verzendingen}" } </#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..05702fc0bc8063e18a9604e95375a5fe40586a9a --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.desc.xml @@ -0,0 +1,8 @@ +<webscript> + <shortname>Verzendingen Delete</shortname> + <description>Verzendingen Delete</description> + <url>/drc/v1/verzendingen/{uuid}</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..2f1ff3ef1dfddde51874a6eaccec3edeacf37654 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.403.ftl @@ -0,0 +1,12 @@ + +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..31d7041d64bd86ced8b1a81d7801abf1c25e22dc --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.delete.json.ftl @@ -0,0 +1,5 @@ +<#escape x as jsonUtils.encodeJSONString(x)> + { + "message" : "${message!""}" + } +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..f108fc22b9925495badc6c9ea20d764bb0631929 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.desc.xml @@ -0,0 +1,9 @@ +<webscript> + <shortname>Verzendingen Get</shortname> + <description>Verzendingen Get</description> + <url>/drc/v1/verzendingen</url> + <url>/drc/v1/verzendingen/{uuid}</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.304.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.304.ftl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..7d4d6d889c64c89714071ad0b92c91d5efe4cbe1 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.403.ftl @@ -0,0 +1,11 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..393c824ce5d5e15ebc8683583ffcd72b0c2c84f0 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.get.json.ftl @@ -0,0 +1,58 @@ +<#macro renderItem item> + <#escape y as jsonUtils.encodeJSONString(y)> + { + <#if item??> + "url": "${url}/${item.id}", + "betrokkene": "${item.properties["rgbz:betrokkene"]!""}", + "informatieobject": "${item.properties["rgbz:informatieobject"]!""}", + "aardRelatie": "${item.properties["rgbz:aardRelatie"]!""}", + "toelichting": "${item.properties["rgbz:toelichting"]!""}", + "ontvangstdatum": "<#if item.properties["rgbz:ontvangstdatumVerzending"]??>${item.properties["rgbz:ontvangstdatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "verzenddatum": "<#if item.properties["rgbz:verzenddatumVerzending"]??>${item.properties["rgbz:verzenddatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "contactPersoon": "${item.properties["rgbz:contactPersoon"]!""}", + "contactpersoonnaam": "${item.properties["rgbz:contactpersoonnaam"]!""}", + "binnenlandsCorrespondentieadres": { + "huisnummer": <#if item.properties["rgbz:huisnummer"]??>${item.properties["rgbz:huisnummer"]?c}<#else>null</#if>, + "huisletter": "${item.properties["rgbz:huisletter"]!""}", + "huisnummerToevoeging": "${item.properties["rgbz:huisnummerToevoeging"]!""}", + "naamOpenbareRuimte": "${item.properties["rgbz:naamOpenbareRuimte"]!""}", + "postcode": "${item.properties["rgbz:postcode"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaam"]!""}" + }, + "buitenlandsCorrespondentieadres": { + "adresBuitenland1": "${item.properties["rgbz:adresBuitenland1"]!""}", + "adresBuitenland2": "${item.properties["rgbz:adresBuitenland2"]!""}", + "adresBuitenland3": "${item.properties["rgbz:adresBuitenland3"]!""}", + "landPostadres": "${item.properties["rgbz:landPostadres"]!""}" + }, + "correspondentiePostadres": { + "postBusOfAntwoordnummer": <#if item.properties["rgbz:postbusAntwoordnummer"]??>${item.properties["rgbz:postbusAntwoordnummer"]?c}<#else>null</#if>, + "postadresPostcode": "${item.properties["rgbz:postadresPostcode"]!""}", + "postadresType": "${item.properties["rgbz:postadresType"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaamPostadres"]!""}" + }, + "faxnummer": <#if item.properties["rgbz:faxnummer"]??>"${item.properties["rgbz:faxnummer"]}"<#else>null</#if>, + "emailadres": <#if item.properties["rgbz:emailadres"]??>"${item.properties["rgbz:emailadres"]}"<#else>null</#if>, + "mijnOverheid": <#if item.properties["rgbz:mijnOverheid"]??>${item.properties["rgbz:mijnOverheid"]?c}<#else>false</#if>, + "telefoonnummer": <#if item.properties["rgbz:telefoonnummer"]??>"${item.properties["rgbz:telefoonnummer"]}"<#else>null</#if> + </#if> + } + </#escape> +</#macro> + +<#if item??> + <@renderItem item /> +<#elseif items??> + { + "count" : ${count?c}, + "next": <#if next??>"${next}"<#else>null</#if>, + "previous": <#if previous??>"${previous}"<#else>null</#if>, + "results": [ + <#list items as item> + <@renderItem item /><#if item_has_next>,</#if> + </#list> + ] + } +<#else> + {} +</#if> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..b820bc23832399820c1adf91d6e89a26a10e11b8 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.desc.xml @@ -0,0 +1,8 @@ +<webscript> + <shortname>Verzendingen Head</shortname> + <description>Verzendingen Head</description> + <url>/drc/v1/verzendingen/{uuid}</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..7d4d6d889c64c89714071ad0b92c91d5efe4cbe1 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.403.ftl @@ -0,0 +1,11 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.head.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..74929e064164694c7d0969a77349c0acafa68f19 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.desc.xml @@ -0,0 +1,8 @@ +<webscript> + <shortname>Verzendingen Patch</shortname> + <description>Verzendingen Patch</description> + <url>/drc/v1/verzendingen/{uuid}</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..7d4d6d889c64c89714071ad0b92c91d5efe4cbe1 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.403.ftl @@ -0,0 +1,11 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..6aff98ae9c2bf04ce1360ec7d51d76f41667d45c --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.patch.json.ftl @@ -0,0 +1,39 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +{ + <#if item??> + "url": "${url}/${item.id}", + "betrokkene": "${item.properties["rgbz:betrokkene"]!""}", + "informatieobject": "${item.properties["rgbz:informatieobject"]!""}", + "aardRelatie": "${item.properties["rgbz:aardRelatie"]!""}", + "toelichting": "${item.properties["rgbz:toelichting"]!""}", + "ontvangstdatum": "<#if item.properties["rgbz:ontvangstdatumVerzending"]??>${item.properties["rgbz:ontvangstdatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "verzenddatum": "<#if item.properties["rgbz:verzenddatumVerzending"]??>${item.properties["rgbz:verzenddatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "contactPersoon": "${item.properties["rgbz:contactPersoon"]!""}", + "contactpersoonnaam": "${item.properties["rgbz:contactpersoonnaam"]!""}", + "binnenlandsCorrespondentieadres": { + "huisnummer": <#if item.properties["rgbz:huisnummer"]??>${item.properties["rgbz:huisnummer"]?c}<#else>null</#if>, + "huisletter": "${item.properties["rgbz:huisletter"]!""}", + "huisnummerToevoeging": "${item.properties["rgbz:huisnummerToevoeging"]!""}", + "naamOpenbareRuimte": "${item.properties["rgbz:naamOpenbareRuimte"]!""}", + "postcode": "${item.properties["rgbz:postcode"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaam"]!""}" + }, + "buitenlandsCorrespondentieadres": { + "adresBuitenland1": "${item.properties["rgbz:adresBuitenland1"]!""}", + "adresBuitenland2": "${item.properties["rgbz:adresBuitenland2"]!""}", + "adresBuitenland3": "${item.properties["rgbz:adresBuitenland3"]!""}", + "landPostadres": "${item.properties["rgbz:landPostadres"]!""}" + }, + "correspondentiePostadres": { + "postBusOfAntwoordnummer": <#if item.properties["rgbz:postbusAntwoordnummer"]??>${item.properties["rgbz:postbusAntwoordnummer"]?c}<#else>null</#if>, + "postadresPostcode": "${item.properties["rgbz:postadresPostcode"]!""}", + "postadresType": "${item.properties["rgbz:postadresType"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaamPostadres"]!""}" + }, + "faxnummer": <#if item.properties["rgbz:faxnummer"]??>"${item.properties["rgbz:faxnummer"]}"<#else>null</#if>, + "emailadres": <#if item.properties["rgbz:emailadres"]??>"${item.properties["rgbz:emailadres"]}"<#else>null</#if>, + "mijnOverheid": <#if item.properties["rgbz:mijnOverheid"]??>${item.properties["rgbz:mijnOverheid"]?c}<#else>false</#if>, + "telefoonnummer": <#if item.properties["rgbz:telefoonnummer"]??>"${item.properties["rgbz:telefoonnummer"]}"<#else>null</#if> + </#if> +} +</#escape> diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..1d71290e0926bd7393b73247c245832834bdec6c --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.desc.xml @@ -0,0 +1,8 @@ +<webscript> + <shortname>Verzendingen Post</shortname> + <description>Verzendingen Post</description> + <url>/drc/v1/verzendingen</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..7d4d6d889c64c89714071ad0b92c91d5efe4cbe1 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.403.ftl @@ -0,0 +1,11 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..6aff98ae9c2bf04ce1360ec7d51d76f41667d45c --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.post.json.ftl @@ -0,0 +1,39 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +{ + <#if item??> + "url": "${url}/${item.id}", + "betrokkene": "${item.properties["rgbz:betrokkene"]!""}", + "informatieobject": "${item.properties["rgbz:informatieobject"]!""}", + "aardRelatie": "${item.properties["rgbz:aardRelatie"]!""}", + "toelichting": "${item.properties["rgbz:toelichting"]!""}", + "ontvangstdatum": "<#if item.properties["rgbz:ontvangstdatumVerzending"]??>${item.properties["rgbz:ontvangstdatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "verzenddatum": "<#if item.properties["rgbz:verzenddatumVerzending"]??>${item.properties["rgbz:verzenddatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "contactPersoon": "${item.properties["rgbz:contactPersoon"]!""}", + "contactpersoonnaam": "${item.properties["rgbz:contactpersoonnaam"]!""}", + "binnenlandsCorrespondentieadres": { + "huisnummer": <#if item.properties["rgbz:huisnummer"]??>${item.properties["rgbz:huisnummer"]?c}<#else>null</#if>, + "huisletter": "${item.properties["rgbz:huisletter"]!""}", + "huisnummerToevoeging": "${item.properties["rgbz:huisnummerToevoeging"]!""}", + "naamOpenbareRuimte": "${item.properties["rgbz:naamOpenbareRuimte"]!""}", + "postcode": "${item.properties["rgbz:postcode"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaam"]!""}" + }, + "buitenlandsCorrespondentieadres": { + "adresBuitenland1": "${item.properties["rgbz:adresBuitenland1"]!""}", + "adresBuitenland2": "${item.properties["rgbz:adresBuitenland2"]!""}", + "adresBuitenland3": "${item.properties["rgbz:adresBuitenland3"]!""}", + "landPostadres": "${item.properties["rgbz:landPostadres"]!""}" + }, + "correspondentiePostadres": { + "postBusOfAntwoordnummer": <#if item.properties["rgbz:postbusAntwoordnummer"]??>${item.properties["rgbz:postbusAntwoordnummer"]?c}<#else>null</#if>, + "postadresPostcode": "${item.properties["rgbz:postadresPostcode"]!""}", + "postadresType": "${item.properties["rgbz:postadresType"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaamPostadres"]!""}" + }, + "faxnummer": <#if item.properties["rgbz:faxnummer"]??>"${item.properties["rgbz:faxnummer"]}"<#else>null</#if>, + "emailadres": <#if item.properties["rgbz:emailadres"]??>"${item.properties["rgbz:emailadres"]}"<#else>null</#if>, + "mijnOverheid": <#if item.properties["rgbz:mijnOverheid"]??>${item.properties["rgbz:mijnOverheid"]?c}<#else>false</#if>, + "telefoonnummer": <#if item.properties["rgbz:telefoonnummer"]??>"${item.properties["rgbz:telefoonnummer"]}"<#else>null</#if> + </#if> +} +</#escape> diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.desc.xml b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.desc.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6a710b6091b552181a750707ce34ddd8ae1ee4b --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.desc.xml @@ -0,0 +1,8 @@ +<webscript> + <shortname>Verzendingen Put</shortname> + <description>Verzendingen Put</description> + <url>/drc/v1/verzendingen/{uuid}</url> + <authentication>user</authentication> + <format default="json">argument</format> + <family>Documentregistratiecomponent (DRC)</family> +</webscript> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.400.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.400.ftl new file mode 100644 index 0000000000000000000000000000000000000000..4f2bcf7c6bd17b7b11f51fad89417f528296e1b7 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.400.ftl @@ -0,0 +1,20 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}", + "invalidParams": [ + <#list json.invalidParams as param> + { + "name" : "${param.name}", + "code" : "${param.code}", + "reason" : "${param.reason}" + } + <#if param_has_next>,</#if> + </#list>] +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.403.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.403.ftl new file mode 100644 index 0000000000000000000000000000000000000000..7d4d6d889c64c89714071ad0b92c91d5efe4cbe1 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.403.ftl @@ -0,0 +1,11 @@ +<#assign code = status.message?split(" {")[0]> +<#assign message = "{" + status.message?split(" {")[1]> +<#assign json = message?eval> +{ + "type": "", + "code": "${json.code}", + "title": "${json.title}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.500.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.500.ftl new file mode 100644 index 0000000000000000000000000000000000000000..d505470b7fe2dc5bca87f5deb4e388b680349cc4 --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.500.ftl @@ -0,0 +1,11 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +<#assign code = status.message?split(" ")[0]> +{ + "type": "", + "code": "${code}", + "title": "${status.message}", + "status": ${status.code}, + "detail": "${status.codeDescription}", + "instance": "${code}" +} +</#escape> \ No newline at end of file diff --git a/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.ftl b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.ftl new file mode 100644 index 0000000000000000000000000000000000000000..6aff98ae9c2bf04ce1360ec7d51d76f41667d45c --- /dev/null +++ b/platform/src/main/resources/alfresco/templates/webscripts/nl/contezza/drc/verzendingen/verzendingen.put.json.ftl @@ -0,0 +1,39 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +{ + <#if item??> + "url": "${url}/${item.id}", + "betrokkene": "${item.properties["rgbz:betrokkene"]!""}", + "informatieobject": "${item.properties["rgbz:informatieobject"]!""}", + "aardRelatie": "${item.properties["rgbz:aardRelatie"]!""}", + "toelichting": "${item.properties["rgbz:toelichting"]!""}", + "ontvangstdatum": "<#if item.properties["rgbz:ontvangstdatumVerzending"]??>${item.properties["rgbz:ontvangstdatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "verzenddatum": "<#if item.properties["rgbz:verzenddatumVerzending"]??>${item.properties["rgbz:verzenddatumVerzending"]?date?string("yyyy-MM-dd")}</#if>", + "contactPersoon": "${item.properties["rgbz:contactPersoon"]!""}", + "contactpersoonnaam": "${item.properties["rgbz:contactpersoonnaam"]!""}", + "binnenlandsCorrespondentieadres": { + "huisnummer": <#if item.properties["rgbz:huisnummer"]??>${item.properties["rgbz:huisnummer"]?c}<#else>null</#if>, + "huisletter": "${item.properties["rgbz:huisletter"]!""}", + "huisnummerToevoeging": "${item.properties["rgbz:huisnummerToevoeging"]!""}", + "naamOpenbareRuimte": "${item.properties["rgbz:naamOpenbareRuimte"]!""}", + "postcode": "${item.properties["rgbz:postcode"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaam"]!""}" + }, + "buitenlandsCorrespondentieadres": { + "adresBuitenland1": "${item.properties["rgbz:adresBuitenland1"]!""}", + "adresBuitenland2": "${item.properties["rgbz:adresBuitenland2"]!""}", + "adresBuitenland3": "${item.properties["rgbz:adresBuitenland3"]!""}", + "landPostadres": "${item.properties["rgbz:landPostadres"]!""}" + }, + "correspondentiePostadres": { + "postBusOfAntwoordnummer": <#if item.properties["rgbz:postbusAntwoordnummer"]??>${item.properties["rgbz:postbusAntwoordnummer"]?c}<#else>null</#if>, + "postadresPostcode": "${item.properties["rgbz:postadresPostcode"]!""}", + "postadresType": "${item.properties["rgbz:postadresType"]!""}", + "woonplaatsnaam": "${item.properties["rgbz:woonplaatsnaamPostadres"]!""}" + }, + "faxnummer": <#if item.properties["rgbz:faxnummer"]??>"${item.properties["rgbz:faxnummer"]}"<#else>null</#if>, + "emailadres": <#if item.properties["rgbz:emailadres"]??>"${item.properties["rgbz:emailadres"]}"<#else>null</#if>, + "mijnOverheid": <#if item.properties["rgbz:mijnOverheid"]??>${item.properties["rgbz:mijnOverheid"]?c}<#else>false</#if>, + "telefoonnummer": <#if item.properties["rgbz:telefoonnummer"]??>"${item.properties["rgbz:telefoonnummer"]}"<#else>null</#if> + </#if> +} +</#escape> diff --git a/pom.xml b/pom.xml index cab41247313089ad0fdc938c919c467512c9925b..f87f3b8f012602d334e735cd06f543efc2093588 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>nl.contezza.tezza</groupId> <artifactId>alfresco-documenten-api</artifactId> @@ -21,7 +23,7 @@ <alfresco.bomDependencyArtifactId>acs-packaging</alfresco.bomDependencyArtifactId> <!-- License --> - <contezza.license.version>7.3-2025-02</contezza.license.version> + <contezza.license.version>7.3-2026-02</contezza.license.version> <!-- Alfresco Content Services Versions --> <alfresco.platform.version>7.3.1</alfresco.platform.version> @@ -41,8 +43,10 @@ <docker.share.image>${image.registry}/base/alfresco-enterprise-share/7</docker.share.image> <docker.ass.image>${image.registry}/base/alfresco-search-services</docker.ass.image> <docker.activemq.image>${image.registry}/docker.io/alfresco/alfresco-activemq</docker.activemq.image> - <docker.transform-core-aio.image>${image.registry}/docker.io/alfresco/alfresco-transform-core-aio</docker.transform-core-aio.image> - <docker.shared-file-store.image>${image.registry}/quay.io/alfresco/alfresco-shared-file-store</docker.shared-file-store.image> + <docker.transform-core-aio.image> + ${image.registry}/docker.io/alfresco/alfresco-transform-core-aio</docker.transform-core-aio.image> + <docker.shared-file-store.image> + ${image.registry}/quay.io/alfresco/alfresco-shared-file-store</docker.shared-file-store.image> <docker.transform-router.image>${image.registry}/quay.io/alfresco/alfresco-transform-router</docker.transform-router.image> <!-- Alfresco Modules --> @@ -99,8 +103,8 @@ <connection>scm:git:https://git.contezza.nl/community/${project.artifactId}.git</connection> <url>https://git.contezza.nl/community/${project.artifactId}.git</url> <developerConnection>scm:git:https://git.contezza.nl/community/${project.artifactId}.git</developerConnection> - <tag>HEAD</tag> - </scm> + <tag>HEAD</tag> + </scm> <build> <pluginManagement> diff --git a/share/src/main/resources/alfresco/messages/drc.properties b/share/src/main/resources/alfresco/messages/drc.properties index 3d6be07e3d8b5ca9fa2664b1ffe17f49389c11f9..861b64f0cf166debed70e835d83d1388b39daa13 100644 --- a/share/src/main/resources/alfresco/messages/drc.properties +++ b/share/src/main/resources/alfresco/messages/drc.properties @@ -1 +1,2 @@ -aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject \ No newline at end of file +aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject +type.rgbz_verzendingItem=Verzending \ No newline at end of file diff --git a/share/src/main/resources/alfresco/messages/drc_en.properties b/share/src/main/resources/alfresco/messages/drc_en.properties index 3d6be07e3d8b5ca9fa2664b1ffe17f49389c11f9..861b64f0cf166debed70e835d83d1388b39daa13 100644 --- a/share/src/main/resources/alfresco/messages/drc_en.properties +++ b/share/src/main/resources/alfresco/messages/drc_en.properties @@ -1 +1,2 @@ -aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject \ No newline at end of file +aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject +type.rgbz_verzendingItem=Verzending \ No newline at end of file diff --git a/share/src/main/resources/alfresco/messages/drc_nl.properties b/share/src/main/resources/alfresco/messages/drc_nl.properties index 3d6be07e3d8b5ca9fa2664b1ffe17f49389c11f9..861b64f0cf166debed70e835d83d1388b39daa13 100644 --- a/share/src/main/resources/alfresco/messages/drc_nl.properties +++ b/share/src/main/resources/alfresco/messages/drc_nl.properties @@ -1 +1,2 @@ -aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject \ No newline at end of file +aspect.rgbz_enkelvoudigInformatieobject=Enkelvoudiginformatieobject +type.rgbz_verzendingItem=Verzending \ No newline at end of file diff --git a/share/src/main/resources/alfresco/web-extension/site-config/drc-config.xml b/share/src/main/resources/alfresco/web-extension/site-config/drc-config.xml index 5c991760aa181b8c482dc3a8d61ea603b2662d23..47417f7356f6e7755012247b8ec15b029684ccf2 100644 --- a/share/src/main/resources/alfresco/web-extension/site-config/drc-config.xml +++ b/share/src/main/resources/alfresco/web-extension/site-config/drc-config.xml @@ -22,7 +22,8 @@ <show id="rgbz:informatieobjecttype" /> </field-visibility> <appearance> - <set id="rgbzEnkelvoudigInformatieobjectPanel" label-id="aspect.rgbz_enkelvoudigInformatieobject" appearance="panel" /> + <set id="rgbzEnkelvoudigInformatieobjectPanel" + label-id="aspect.rgbz_enkelvoudigInformatieobject" appearance="panel" /> <field id="rgbz:identificatie" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:bronorganisatie" set="rgbzEnkelvoudigInformatieobjectPanel" /> @@ -32,17 +33,84 @@ <field id="rgbz:link" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:ontvangstdatum" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:verzenddatum" set="rgbzEnkelvoudigInformatieobjectPanel" /> - <field id="rgbz:vertrouwelijkheidaanduiding" set="rgbzEnkelvoudigInformatieobjectPanel" /> - <field id="rgbz:indicatieGebruiksrecht" set="rgbzEnkelvoudigInformatieobjectPanel" /> + <field id="rgbz:vertrouwelijkheidaanduiding" + set="rgbzEnkelvoudigInformatieobjectPanel" /> + <field id="rgbz:indicatieGebruiksrecht" + set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:ondertekeningSoort" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:ondertekeningDatum" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:integriteitAlgoritme" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:integriteitWaarde" set="rgbzEnkelvoudigInformatieobjectPanel" /> <field id="rgbz:integriteitDatum" set="rgbzEnkelvoudigInformatieobjectPanel" /> - <field id="rgbz:informatieobjecttype" set="rgbzEnkelvoudigInformatieobjectPanel" readonly="true" /> + <field id="rgbz:informatieobjecttype" set="rgbzEnkelvoudigInformatieobjectPanel" + readonly="true" /> </appearance> </form> </forms> </config> - + + <config evaluator="node-type" condition="rgbz:verzendingItem"> + <forms> + <form> + <field-visibility> + <show id="rgbz:betrokkene" /> + <show id="rgbz:aardRelatie" /> + <show id="rgbz:toelichting" /> + <show id="rgbz:ontvangstdatumVerzending" /> + <show id="rgbz:verzenddatumVerzending" /> + <show id="rgbz:contactPersoon" /> + <show id="rgbz:contactpersoonnaam" /> + <show id="rgbz:faxnummer" /> + <show id="rgbz:emailadres" /> + <show id="rgbz:mijnOverheid" /> + <show id="rgbz:telefoonnummer" /> + <show id="rgbz:huisletter" /> + <show id="rgbz:huisnummer" /> + <show id="rgbz:huisnummerToevoeging" /> + <show id="rgbz:naamOpenbareRuimte" /> + <show id="rgbz:postcode" /> + <show id="rgbz:woonplaatsnaam" /> + <show id="rgbz:adresBuitenland1" /> + <show id="rgbz:adresBuitenland2" /> + <show id="rgbz:adresBuitenland3" /> + <show id="rgbz:landPostadres" /> + <show id="rgbz:postBusOfAntwoordnummer" /> + <show id="rgbz:postadresPostcode" /> + <show id="rgbz:postadresType" /> + <show id="rgbz:woonplaatsnaamPostadres" /> + </field-visibility> + <appearance> + <set id="rgbzVerzendingItemPanel" label-id="type.rgbz_verzendingItem" + appearance="panel" /> + + <field id="rgbz:betrokkene" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:aardRelatie" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:toelichting" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:ontvangstdatumVerzending" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:verzenddatumVerzending" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:contactPersoon" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:contactpersoonnaam" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:faxnummer" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:emailadres" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:mijnOverheid" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:telefoonnummer" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:huisletter" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:huisnummer" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:huisnummerToevoeging" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:naamOpenbareRuimte" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:postcode" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:woonplaatsnaam" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:adresBuitenland1" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:adresBuitenland2" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:adresBuitenland3" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:landPostadres" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:postBusOfAntwoordnummer" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:postadresPostcode" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:postadresType" set="rgbzVerzendingItemPanel" /> + <field id="rgbz:woonplaatsnaamPostadres" set="rgbzVerzendingItemPanel" /> + </appearance> + </form> + </forms> + </config> + </alfresco-config> \ No newline at end of file