Open bondjimbond opened 5 years ago
The only major difference between the XML Forms version and this one is the logging that happens within the function, but that could probably be done where the function is called.
I've been poking around this topic (as my hope is to create a hook around the mods-to-dc transform function), and frustratingly, every module is doing the same thing: writing its own code (AND hosting its own mods_to_dc.xsl files).
I've written a ticket for it: https://jira.duraspace.org/browse/ISLANDORA-2425
I'm not sure how difficult it would be to modify all those modules to rely on a single shared function, though.
If we centralize to a single shared function, I will implement it in CRUD.
I've been looking around to see if there's a single function where DC datastreams are transformed from MODS. And I'm a bit surprised to see that the code is getting rewritten in various modules instead of just getting included from a core module.
Example: https://github.com/SFULibrary/islandora_datastream_crud/blob/4f19f99d3f4f1783f13ff59afd8948c4271ea740/includes/utilities.inc#L369
Does this do anything substantially differently from https://github.com/Islandora/islandora_xml_forms/blob/228cd4a62ffe2ad0b0426b2648eabe4205b81662/builder/xml_form_builder.module#L700 and/or https://github.com/Islandora/islandora_xml_forms/blob/0bc8de441851594a5f16a4bc7db98ec6a78b2758/builder/includes/associations.inc#L206 ?
If it's relatively easy to call the transform function, would that be preferable to having it rewritten here? I ask because I ultimately would like to build a hook in the Form Builder module that triggers any time the DC transform happens.