Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinventing the wheel? #72

Open
bondjimbond opened this issue May 1, 2019 · 3 comments
Open

Reinventing the wheel? #72

bondjimbond opened this issue May 1, 2019 · 3 comments

Comments

@bondjimbond
Copy link
Contributor

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:

function islandora_datastream_crud_regenerate_dc($object, $source_dsid) {

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.

@mjordan
Copy link
Collaborator

mjordan commented May 1, 2019

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.

@bondjimbond
Copy link
Contributor Author

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.

@mjordan
Copy link
Collaborator

mjordan commented May 1, 2019

If we centralize to a single shared function, I will implement it in CRUD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants