Islandora-Collaboration-Group / islandora_webform

islandora_webform
GNU General Public License v3.0
6 stars 8 forks source link

Support integration with Webform Matrix Component module #19

Open patdunlavey opened 8 years ago

patdunlavey commented 8 years ago

One of the potentials of the islandora webform module is to dramatically reduce the user pain compared with dealing with lengthy MODS forms. The webform matrix component module (https://www.drupal.org/project/webform_matrix_component) could theoretically permit a single webform component to stand in for all the text fields in the MODS form!

You could configure your matrix component to have two elements: a select list of field names, and a text field for value. Then use its add-row link (ajax) to add values for an arbitrary number of MODS fields.

Conceivably this could be implemented directly in iwi by mapping the matrix component to an xml datastream, and then when rendering the form component, pull the field paths out of the xml schema dynamically. Then during ingest, matrix component values mapping would be determined by the chosen field path for each row of the submission data.

But one could use the webform_matrix_component module now by: 1 - Manually setting up the fields select list in the matrix component's configuration 2 - Writing a hook_iwi_set_form_element_alter to pull those values out of the submission and map them to the appropriate field path in a call to iwi_set_form_element_byhash().