-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from ConductionNL/development
Development to main
- Loading branch information
Showing
31 changed files
with
2,026 additions
and
135 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...igurations/xxllnc-zoekendpoint-woo/mappings/Mapping-Xxllnc Zaak to Publicatie-v0.0.3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"@context": { | ||
"schema": "http:\/\/schema.org", | ||
"register": "501" | ||
}, | ||
"@type": "mapping", | ||
"@id": "http:\/\/nextcloud.local\/index.php\/apps\/openconnector\/api\/mappings\/1", | ||
"name": "Xxllnc Zaak to Publicatie", | ||
"description": "", | ||
"version": "0.0.3", | ||
"reference": "http:\/\/nextcloud.local\/index.php\/apps\/openconnector\/api\/mappings\/1", | ||
"mapping": { | ||
"title": "{{ values['case.subject'] }}", | ||
"summary": "{{ values['attribute.woo_samenvatting'] }}", | ||
"description": "{{ values['attribute.woo_beschrijving'] }}", | ||
"category": "{{ values['attribute.woo_categorie'] }}", | ||
"featured": false, | ||
"status": "Published", | ||
"attachmentCount": 0, | ||
"published": "{{ values['attribute.woo_publicatiedatum'] }}", | ||
"modified": "{{ \"now\"|date(\"Y-m-d\\\\TH:i:s.v\\\\Z\") }}", | ||
"license": "eupl2", | ||
"catalog": "1bcb99cd-7e47-4242-b7a7-ac7d36fe5d5e", | ||
"attachments": "[{% set fileCount = 0 %}{% for file in values['attribute.woo_publicatie'] %}{% if fileCount > 0 %}, {% endif %}\"\/api\/v1\/case\/{{id}}\/document\/{{file.uuid}}\/download\"{% set fileCount = fileCount + 1 %}{% endfor %}{% for file in values['attribute.woo_inventarisatielijst'] %}{% if fileCount > 0 %}, {% endif %}\"\/api\/v1\/case\/{{id}}\/document\/{{file.uuid}}\/download\"{% set fileCount = fileCount + 1 %}{% endfor %}{% for file in values['attribute.woo_informatieverzoek'] %}{% if fileCount > 0 %}, {% endif %}\"\/api\/v1\/case\/{{id}}\/document\/{{file.uuid}}\/download\"{% set fileCount = fileCount + 1 %}{% endfor %}{% for file in values['attribute.woo_besluit'] %}{% if fileCount > 0 %}, {% endif %}\"\/api\/v1\/case\/{{id}}\/document\/{{file.uuid}}\/download\"{% set fileCount = fileCount + 1 %}{% endfor %}]" | ||
}, | ||
"unset": [ | ||
"" | ||
], | ||
"cast": { | ||
"title": "unsetIfValue==", | ||
"summary": "unsetIfValue==", | ||
"description": "unsetIfValue==", | ||
"category": "unsetIfValue==", | ||
"published": "unsetIfValue==", | ||
"modified": "unsetIfValue==", | ||
"attachments": "jsonToArray" | ||
}, | ||
"passThrough": false | ||
} |
22 changes: 0 additions & 22 deletions
22
configurations/xxllnc-zoekendpoint-woo/mappings/xxllnc-document-to-attachment
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
configurations/xxllnc-zoekendpoint-woo/mappings/xxllnc-zoek-endpoint-to-publication.json
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
configurations/xxllnc-zoekendpoint-woo/rules/Rule-Fetch Xxllnc files-v0.0.1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"@context": { | ||
"schema": "http:\/\/schema.org", | ||
"register": "501" | ||
}, | ||
"@type": "rule", | ||
"@id": "http:\/\/nextcloud.local\/index.php\/apps\/openconnector\/api\/rules\/4", | ||
"name": "Fetch Xxllnc files", | ||
"description": null, | ||
"reference": "http:\/\/nextcloud.local\/index.php\/apps\/openconnector\/api\/rules\/4", | ||
"version": "0.0.1", | ||
"action": "post", | ||
"timing": "after", | ||
"conditions": { | ||
"==": [ | ||
1, | ||
1 | ||
] | ||
}, | ||
"type": "fetch_file", | ||
"configuration": { | ||
"fetch_file": { | ||
"source": 3, | ||
"filePath": "attachments", | ||
"method": "GET", | ||
"sourceConfiguration": [] | ||
} | ||
}, | ||
"order": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Synchronization Actions | ||
|
||
## Concept | ||
|
||
Just as with Endpoints, synchronizations can trigger additional actions (at this moment called rules). | ||
These can change the content of an object, but also trigger additional synchronizations. | ||
|
||
These actions can be created by creating a rule (an action) and adding it by id to the property | ||
actions in the Synchronization. | ||
|
||
## Synchronizing files | ||
In order to fetch a file from an external source and store it in the Nextcloud Filesystem in a way that OpenRegister can | ||
connect it to an object, there are two predefined actions: | ||
|
||
- `fetch_file`: This action downloads the file and substitutes the base encoded content into the variable that contained the file url | ||
- `write_file`: This action takes a file's content in base encoding and the filename (otherwise it will use a default filename), and writes it to the filesystem. | ||
|
||
### Fetch file | ||
|
||
This action should be run on timing `after` (when the object has been stored). | ||
The action takes the following parameters in the `configuration` property: | ||
|
||
- `source` (required): The id of the source where the file can be downloaded | ||
- `filePath` (required): The dot path of the location in the input object that contains the file url or file path. | ||
- `method` (optional): The HTTP method that should be used to fetch the file. Defaults to GET | ||
- `sourceConfiguration` (optional): Additional configuration for the source that only holds for fetching files. | ||
|
||
When properly configured this action will download the file from the given source and substitute the base64 encoded content in the returned object. | ||
It is preferred to run this action in combination with `write_file` immediately after, so the file contents are properly stored in the Nextcloud file system instead of written to a database. | ||
|
||
### Write file | ||
|
||
This action should be run on timing `after`, and if combined with `fetch_file` it should be run in order after `fetch_file`. | ||
The action takes the followin parameters in the `configuration` property: | ||
|
||
- `filePath` (required): The dot path of the location in the input object that contains the base64 encoded content of the file. | ||
- `fileNamePath` (required): The dot path of the location in the input object that contains the filename | ||
|
||
This will write the file to the nextcloud filesystem in the folder that belongs to the written object, and substitutes the file content in the returned data with the path of the object in the Nextcloud File System. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\OpenConnector\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\DB\Types; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
/** | ||
* FIXME Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version1Date20250123100521 extends SimpleMigrationStep { | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure(): ISchemaWrapper $schemaClosure | ||
* @param array $options | ||
*/ | ||
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure(): ISchemaWrapper $schemaClosure | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
/** | ||
* @var ISchemaWrapper $schema | ||
*/ | ||
$schema = $schemaClosure(); | ||
|
||
if ($schema->hasTable(tableName: 'openconnector_synchronizations') === true) { | ||
$table = $schema->getTable(tableName: 'openconnector_synchronizations'); | ||
if ($table->hasColumn('actions') === false){ | ||
$table->addColumn(name: 'actions', typeName: Types::JSON)->setNotnull(false)->setDefault('[]'); | ||
} | ||
} | ||
|
||
return $schema; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure(): ISchemaWrapper $schemaClosure | ||
* @param array $options | ||
*/ | ||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { | ||
} | ||
} |
Oops, something went wrong.