digitalutsc / islandora_web_annotations

An Islandora module that enables annotation on Islandora objects, following the W3C Web annotation model.
GNU General Public License v3.0
7 stars 5 forks source link

use .json instead of .bin when downloading WADM datastreams #200

Closed kimpham54 closed 7 years ago

kimpham54 commented 7 years ago

Description Datastream downloads through the Drupal interface adds a .bin extension instead of the appropriate extension

Steps to Reproduce Go to an annotation Manage > Datastreams Download WADMContainer datastream

Go to an annotation container Manage > Datastreams Download WADMContainer datastream

Expected Behaviour Download a file with a .json extension

Actual Behaviour Download a file with a .bin extension

This issue has occurred with other modules: https://jira.duraspace.org/browse/ISLANDORA-1257?jql=text%20~%20%22bin%20datastream%22

MarcusBarnes commented 7 years ago

As the WADMContainer datastream is JSON-LD, to be more conformant the .jsonld extension is best. See: https://stackoverflow.com/a/41453240/850828.

kimpham54 commented 7 years ago

that's fine

MarcusBarnes commented 7 years ago

I note that JSON-LD is not in https://github.com/Islandora/islandora/blob/7.x/includes/mimetype.utils.inc#L97-L271. In order to address this issue, we may have to suggest that JSON-LD be added to islandora_mime_mapping and push to Islandora core following steps for contributing (JIRA ticket, etc.). I'll test this modification locally and report back.

MarcusBarnes commented 7 years ago

I've confirmed locally that adding "jsonld" => "application/ld+json", to the array returned by islandora_mime_mapping function does the trick: The WADMContainer datastream is downloaded with the .jsonld file extension rather than .bin. I'll suggest this modification to the main Islanodora project and update this ticket based on how that goes.

MarcusBarnes commented 7 years ago

Pull-request https://github.com/Islandora/islandora/pull/682 has been merged. To fully resolve this issue will require updating one's Islandora module to https://github.com/Islandora/islandora/commit/0e80b2ba177145f181047aeb78ddd05f45545f72.