This script generates form data frontent-loket/toezicht component.
Google spreadsheet is used as data source. Please read this tutorial to get started.
- ./google_api_credentials
- contains the api credentials to access the data dumps. We provide you with a key
- output/touzicht-forms.ttl
- File with forms in a .ttl file.
Some recipes...
Changes will mostly be related to the decision types. Adding, removing a field or adding a new decision type
In file TypeBesluit_Eigenschap_Rel-aangepast.xlsx[PROD]
you will be able to do so.
To add a field:
- add a Row
- column ID should be big enough and unique number within the sheet
- TYPEBESLUITID, is the type of decision the form relates to. It is the ID in
TypeBesluit-aangepast.xlsx[PROD]
- EIGENSCHAPID, is the ID of the field you want to add. Located in
Eigenschap-aangepast.xlsx[PROD]
- TYPE-MAP: copy paste from other rows.
Recently, we needed to nest a subform based on the value of another input-field (type reglement).
Here you will have to modify dynamic-subforms [not based on besluittype]
To add a subform:
- add a Row
- ID == id of the subform
- ORIG_EIGENSCHAP_ID: is the ID of the field which should trigger a subform. Located in
Eigenschap-aangepast.xlsx[PROD]
- EIGENSCHAPWAARDE_ID: the value of the field on which the subform should appear. You should provide the ID from
Eigenschapwaarde.xlsx[PROD]
- EIGENSCHAPID: is the ID of the field you want to add to the subform. Located in
Eigenschap-aangepast.xlsx[PROD]
- TYPE-MAP: copy paste from other rows.
The script can be executed in a Docker container through the following command:
docker run -it --rm -v "$PWD":/app -w /app ruby:2.5 ./run.sh
Start a Docker container:
docker run -it --name toezicht-forms-harvester -v "$PWD":/app -w /app ruby:2.5 /bin/bash
Execute the following commands in the Docker container:
bundle install
ruby app.rb