SFULibrary / islandora_doi_framework

Utility module that provides a framework for other modules to assign DOIs (Digital Object Identifiers) to objects.
GNU General Public License v3.0
5 stars 1 forks source link

Add the ability to select resource type manually for DataCite API #4

Closed axfelix closed 7 years ago

axfelix commented 7 years ago

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.

mjordan commented 7 years ago

@axfelix will test PR in the morning.

mjordan commented 7 years ago

@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?

islandora_doi_sfu.zip

axfelix commented 7 years ago

Hi Mark,

It appears to work as expected! I'm perfectly happy with this over my version, thanks.

mjordan commented 7 years ago

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?

axfelix commented 7 years ago

Being that you wrote it, I'd be happy with you hosting it, unless you're trying to avoid an additional maintenance burden...

mjordan commented 7 years ago

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.

mjordan commented 7 years ago

So should I create a repo for this module and then close your PR?

axfelix commented 7 years ago

Go for it!

mjordan commented 7 years ago

OK, will do so this evening. Thanks for the use case!

axfelix commented 7 years ago

Thanks for improving on it and getting it upstream so quickly.

mjordan commented 7 years ago

OK, resourceTypes module is now available at https://github.com/mjordan/islandora_doi_sfu. Closing this issue and the associated PR.