InputForm Configuration —
I am presenting a brief overview of the approach followed by me during my previous project on input-form configuration.
I created an InputFormImporter which imported the input-forms from a default XML file present in the /config folder into the database. This was necessary for loading the default form.
The major DB changes were as follows-
Following tables were added.
1.InputForm- To represent a new added input-form.
Columns-
inputform_id - Primary key to represent the particular form
name - String vale of the inputform name
2.collection2inputform-To map a collection to an inputform.
Columns-
id(PK)
collection_id(FK)
inputform_id(FK)
3.InputFormPage-To represent a page of the form submission step.
Columns-
page_id(PK)
name
4.form2page- To map a page to any particular input-form
id(PK)
form_id(FK)
page_id(FK)
5.InputFormField-To represent a submission field in a particular page.
field_id
repeatable
inputtype_id(FK)
label(FK)
hint(FK)
6.field2page --To map a submission field to a page
field_id(FK)
page_id(FK)
7.valuepair – To represent a particular selection list
valuepair_id(PK)
name
inputtype_id(FK)
8.valuepairelement- To represent a particular selection-list element.
valuepair_element_id
language
stored_value
displayed_value
valuepair_id
9.input-type – To represent content-type
inputtype_id(FK)
name
Screenshots are attached.
The basic API additions were as follows-
InputForm-Class representing an inputform
It had basic methods for creating a new inputform and updating the DB.
InputFormField-Class representing an input-form field
It had basic methods for creating a new inputform-field and map it to the corresponding metadata_field_id
InputFormPage-Class representing an input-form page
It had methods for creating a new page and adding fields to it.
ValuePair-Class representing a value-pair
Methods to add new selection list or remove an existing one.
ValuePairElement-Class representing a value-pair element
Methods to add a new selection-list element and map it to a selection-list.
The code for these new classes is available at ---
I will add more details as required once this part of the project is started.
Screenshots -