diff --git a/README.md b/README.md index 1d72b3f..ddce2c5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## Introduction -A Drupal 8/9 module that serializes PREMIS metadata generated by various Islandora modules and microsrevices. This module produces PREMIS v3 in Turtle RDF for a node by appending `/premis` to the end of the node's URL, e.g., `https://localhost/node/250/premis`. +A Drupal 8/9 module that serializes PREMIS metadata generated by various Islandora modules and microsrevices, including Islandora, JSON-LD, and Riprap. This module produces PREMIS v3 in Turtle RDF for a node by appending `/premis` to the end of the node's URL, e.g., `https://localhost/node/250/premis`. -This module is not ready for prodcution use. But could be soon with your feedback and testing! +Feedback on what PREMIS entities and events you'd like to see in this output is welcome. Output will look like this: @@ -72,6 +72,8 @@ Note that the fixity events are added by the [Islandora Riprap](https://github.c * [Islandora 8](https://github.com/Islandora/islandora) +If [Islandora Riprap](https://github.com/mjordan/islandora_riprap) is installed, fixity check events will be added to the PREMIS output. + ## Installation 1. Clone this repo into your Islandora's `drupal/web/modules/contrib` directory. diff --git a/islandora_premis.module b/islandora_premis.module index e9f6b41..bc97073 100644 --- a/islandora_premis.module +++ b/islandora_premis.module @@ -37,11 +37,19 @@ function islandora_premis_islandora_premis_turtle_alter($nid, &$turtle) { if (count($media) > 0) { foreach ($media as $medium) { $file = $media_source->getSourceFile($medium); - $binary_resource_url = $file_uri_lookup->getUrl($medium->id()); - if (is_null($binary_resource_url)) { + $file_url = $file_uri_lookup->getUrl($medium->id()); + if (is_null($file_url)) { return; } + $binary_resource_url = $file_url; + if (\Drupal::moduleHandler()->moduleExists('islandora_riprap')) { + $riprap_config = \Drupal::config('islandora_riprap.settings'); + if ($riprap_config->get('use_drupal_urls')) { + $binary_resource_url = $islandora_riprap_utils->getLocalUrl($medium->id()); + } + } + // Register some namespaces. $ns = new RdfNamespace(); $ns->set('premisObject', 'http://www.loc.gov/premis/rdf/v3/Object');