Coder Social home page Coder Social logo

hugaertsdries / toezicht-forms-harvester Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lblod/toezicht-forms-harvester

0.0 1.0 0.0 70 KB

Script to generate form data for Toezicht based on spreadsheets

License: MIT License

Ruby 99.80% Shell 0.20%

toezicht-forms-harvester's Introduction

Toezicht Forms Harvester

This script generates form data frontent-loket/toezicht component.

Google spreadsheet is used as data source. Please read this tutorial to get started.

Expected input

./google_api_credentials
contains the api credentials to access the data dumps. We provide you with a key

Expected output

output/touzicht-forms.ttl
File with forms in a .ttl file.

Extending the forms

Some recipes...

Basic

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.

Advanced: Nested subforms

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.

Running the harvester

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

Developing the script

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

toezicht-forms-harvester's People

Contributors

cecemel avatar erikap avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.