From a5a5b4967195f8ef6e0bae73e0190939b1853e9f Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 26 Nov 2024 12:26:27 +0100 Subject: [PATCH 1/2] Config files for xxllnc suite --- .../xxllnc-suite-to-publications.json | 14 +++++++++++++ .../sharepoint-woo/sources/xxllnc-suite.json | 20 +++++++++++++++++++ .../xxllnc-suite-to-publications.json | 19 ++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 configurations/sharepoint-woo/mappings/xxllnc-suite-to-publications.json create mode 100644 configurations/sharepoint-woo/sources/xxllnc-suite.json create mode 100644 configurations/sharepoint-woo/synchronizations/xxllnc-suite-to-publications.json diff --git a/configurations/sharepoint-woo/mappings/xxllnc-suite-to-publications.json b/configurations/sharepoint-woo/mappings/xxllnc-suite-to-publications.json new file mode 100644 index 0000000..17e38a8 --- /dev/null +++ b/configurations/sharepoint-woo/mappings/xxllnc-suite-to-publications.json @@ -0,0 +1,14 @@ +{ + "name": "Xxllnc suite to Publication", + "description": "", + "version": "", + "reference": "", + "mapping": { + "title": "omschrijving", + "summary": "statustoelichting", + "description": "statusomschrijving" + }, + "unset": [], + "cast": [], + "passThrough": false +} \ No newline at end of file diff --git a/configurations/sharepoint-woo/sources/xxllnc-suite.json b/configurations/sharepoint-woo/sources/xxllnc-suite.json new file mode 100644 index 0000000..ba40f10 --- /dev/null +++ b/configurations/sharepoint-woo/sources/xxllnc-suite.json @@ -0,0 +1,20 @@ +{ + "name": "Xxllnc suite API", + "description": "Xxllnc suite API", + "reference": null, + "version": "0.0.0", + "location": "", + "isEnabled": true, + "type": "api", + "authorizationHeader": null, + "auth": "none", + "authorizationPassthroughMethod": "header", + "authenticationConfig": [], + "configuration": { + "auth.0": "username", + "auth.1": "password" + }, + "logRetention": 3600, + "errorRetention": 86400, + "test": false +} \ No newline at end of file diff --git a/configurations/sharepoint-woo/synchronizations/xxllnc-suite-to-publications.json b/configurations/sharepoint-woo/synchronizations/xxllnc-suite-to-publications.json new file mode 100644 index 0000000..6dfedf8 --- /dev/null +++ b/configurations/sharepoint-woo/synchronizations/xxllnc-suite-to-publications.json @@ -0,0 +1,19 @@ +{ + "name": "Xxllnc suite to Publications", + "description": "", + "version": "0.0.1", + "sourceId": "1", + "sourceType": "api", + "sourceHash": "", + "sourceTargetMapping": "1", + "sourceConfig": { + "idPosition": "id", + "resultsPosition": "results", + "endpoint": "/tlb/zaaksysteem/api/v1/zaken", + "headers": [], + "query.startdatum__gte": "2024-07-06", + "query.einddatum__lt": "2024-08-01" + }, + "targetId": "1/1", + "targetType": "register/schema" +} \ No newline at end of file From d161898aea45c5efec7ac3a0c60aa4f1396adc61 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 26 Nov 2024 12:26:59 +0100 Subject: [PATCH 2/2] Fix for dot notated config in synchronization.sourceConfig --- lib/Service/CallService.php | 2 +- lib/Service/SynchronizationService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/CallService.php b/lib/Service/CallService.php index 4a86c60..561d667 100644 --- a/lib/Service/CallService.php +++ b/lib/Service/CallService.php @@ -260,7 +260,7 @@ public function call( * * @return array The updated config array. */ - private function applyConfigDot(array $config): array + public function applyConfigDot(array $config): array { $dotConfig = new Dot($config); $unsetKeys = []; diff --git a/lib/Service/SynchronizationService.php b/lib/Service/SynchronizationService.php index 4fefad8..986a415 100644 --- a/lib/Service/SynchronizationService.php +++ b/lib/Service/SynchronizationService.php @@ -422,7 +422,7 @@ public function getAllObjectsFromApi(Synchronization $synchronization, ?bool $is $source = $this->sourceMapper->find(id: $synchronization->getSourceId()); // Lets get the source config - $sourceConfig = $synchronization->getSourceConfig(); + $sourceConfig = $this->callService->applyConfigDot($synchronization->getSourceConfig()); $endpoint = $sourceConfig['endpoint'] ?? ''; $headers = $sourceConfig['headers'] ?? []; $query = $sourceConfig['query'] ?? [];