-
Notifications
You must be signed in to change notification settings - Fork 4
Home
This page will explain you how to add a new form in the Toezicht module of loket. This form will appear as an option of the "Type Dossier" dropdown.
First of we will start with creating the actual form structure. To make our lives simpler we can use manage-submission-form-tooling to help us with this task.
Create a folder that will contain the new form:
manage-submission-form-tooling/formSkeleton/forms/{MY_NEW_FORM_NAME_HERE}/form.ttl
In the new form.ttl file we can start defining the new form.
fieldGroups:{NFG_UUID} a form:FieldGroup ;
mu:uuid "{NFG_UUID}" ;
form:hasField
###Opmerking/comment###
fields:0cdfe85f-ec65-498f-bd26-0ec611967de0,
###Bestanden/files###
fields:c7c5a589-0785-4032-a4bd-ee589add3c39.
The form starts with a new fieldgroup. This New FieldGroup(NFG) should have a new UUID. (replace NFG_UUID by a newly generated uuid). You define fields in new form under form:hasField
. These fields can be custom or premade. You can find a list of premade fieldgroups in the following file: manage-submission-form-tooling/formSkeleton/inputFields/input-fields.ttl
. To add a field simply copy the field URI (e.g.fields:b9d831c5-da21-40d6-aac8-65feb4783d76) and add it under the form:hasField prefix.
After adding all fields to the form we still have to add a new ConditionalFieldGroup(NCFG).
fields:{NCFG_UUID} a form:ConditionalFieldGroup ;
mu:uuid "{NCFG_UUID}";
form:conditions
[ a form:SingleCodelistValue ;
form:grouping form:Bag ;
sh:path rdf:type ;
form:conceptScheme <concept-scheme-subject> ;
form:customValue <custom-value-subject>
] ;
form:hasFieldGroup fieldGroups:{NFG_UUID} .
This NCFG will set the conditions as to who and when to show the form. We are interested in the following prefixes: form:conceptScheme & form:customValue.
form:conceptScheme attaches it to another field that is defined as conceptScheme. In this case we want to make the form appear when it has been selected from the "Type Dossier" Dropdown.
An example is Agenda. In the very first image under #Description you can see the dropdown values of Type Dossier. The agenda form does not show up by default. You first need to click on it before the whole form will appears.
Agenda has been selected from the dropdown. Now the Agenda form appears.
To add our form to the list of Type Dossier we can just copy/paste the Type Dossier concept-scheme URI:
form:conceptScheme <http://lblod.data.gift/concept-schemes/71e6455e-1204-46a6-abf4-87319f58eaa5> ;
This section needs more information
For form:customValue we want to add a new BesluitDocumentType(NBDT)
form:customValue <https://data.vlaanderen.be/id/concept/BesluitDocumentType/{NBDT_UUID}>
note: we will need the new besluitDocumentType URI later to connect define who can view the new form option.
After following the steps above and adding some triples to connect everything together we should end up with a file that looks like this:
fieldGroups:{NFG_UUID} a form:FieldGroup ;
mu:uuid "{NFG_UUID}" ;
form:hasField
###Opmerking/comment###
fields:0cdfe85f-ec65-498f-bd26-0ec611967de0,
###Bestanden/files###
fields:c7c5a589-0785-4032-a4bd-ee589add3c39.
fields:0827fafe-ad19-49e1-8b2e-105d2c08a54a form:hasConditionalFieldGroup fields:{NCFG_UUID}.
fields:{NCFG_UUID} a form:ConditionalFieldGroup ;
mu:uuid "{NCFG_UUID}";
form:conditions
[ a form:SingleCodelistValue ;
form:grouping form:Bag ;
sh:path rdf:type ;
form:conceptScheme <http://lblod.data.gift/concept-schemes/71e6455e-1204-46a6-abf4-87319f58eaa5> ;
form:customValue <https://data.vlaanderen.be/id/concept/BesluitDocumentType/{NBDT_UUID}>
] ;
form:hasFieldGroup fieldGroups:{NFG_UUID} .
Important to know:
- All values in curly brackets {} need to be replaced by newly generated UUID's.
- Make sure the UUID's match when needed. (e.g. NCFG_UUID must be different from NFG_UUID and must match all other NCFG_UUID fields)
- the form:conceptScheme value in this case references the 'Type Dossier' dropdown field.