Closed axfelix closed 7 years ago
@axfelix will test PR in the morning.
@axfelix, I'd like to offer an alternative method of providing a UI for assigning the DOI resourceType value. In this implementation, I wrote a separate module that uses Drupal's hook_form_alter()
to add the select list containing the resrouceType enumerated list, and a custom theme preprocess function to insert the value the user selects into the DataCite XML template. I'm attaching a .zip of the module; to test it, in the 7.x branch of islandora_doi_framework, enable the new module. You should see the select list in the DOI form, and on submission you see the selected value in the DataCite XML.
The reason I prefer this approach is that it customizes the "framework" to suit a specific use case using standard Drupal API techniques. The implementation you offered in your PR would require changing the API provided by islandora_doi_framework (as described in islandora_doi_framework.api.php), and while I'm not opposed to doing that if necessary, I'd like to avoid doing it unless Drupal techniques like hook_form_alter()
and custom theme overrides won't work.
Can you give it a test?
Hi Mark,
It appears to work as expected! I'm perfectly happy with this over my version, thanks.
If you're OK with this approach, let's go with it since it also serves as a nice illustration of how a site can extend the framework. You want to host it on your GH repo, and I can link to it from the framework's readme?
Being that you wrote it, I'd be happy with you hosting it, unless you're trying to avoid an additional maintenance burden...
No problem, I don't mind hosting it. If you want to add to it substantially, you're welcome to fork later if that's convenient.
So should I create a repo for this module and then close your PR?
Go for it!
OK, will do so this evening. Thanks for the use case!
Thanks for improving on it and getting it upstream so quickly.
OK, resourceTypes module is now available at https://github.com/mjordan/islandora_doi_sfu. Closing this issue and the associated PR.
For cases where we don't want to define a single consistent mapping from dc:type to DataCite's ResourceType field per the current configuration options, there should be an option to manually select a ResourceType value via drop-down at DOI assignment.