Skip to content

Commit

Permalink
Merge pull request #5 from discoverygarden/feature/media-use-term
Browse files Browse the repository at this point in the history
CTDA9-298: hOCR media use term creation option
  • Loading branch information
nchiasson-dgi authored May 8, 2023
2 parents 42d1187 + 657425e commit c885571
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 33 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Islandora hOCR

## Introduction

Adds the hOCR derivative functionality. (WIP)

## Usage
Currently, this module provides an install hook. Enabling the module will generate the hOCR (https://discoverygarden.ca/use#hocr) media use term.

Currently, this module contains a migration facilitating the creation of a media use term for use in common Islandora configurations. Enabling the module will expose the `islandora_hocr_media_uses` migration to generate a media use term of the URI `https://discoverygarden.ca/use#hocr`.

```shell
# Flow might be something like:
drush en islandora_hocr
drush migrate:import islandora_hocr_media_uses
```

## Installation
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"name": "discoverygarden/islandora_hocr",
"type": "drupal-module",
"license": "GPL-3.0-or-later",
"require": {
"islandora/islandora": "^2"
}
"require": {}
}
4 changes: 1 addition & 3 deletions islandora_hocr.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ description: Adds hOCR functionality
package: DGI Helpers
type: module
core_version_requirement: ^8 || ^9
dependencies:
- islandora:islandora
- islandora_core_feature:islandora_core_feature
dependencies: {}
26 changes: 0 additions & 26 deletions islandora_hocr.install

This file was deleted.

46 changes: 46 additions & 0 deletions migrations/islandora_hocr_media_uses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
id: islandora_hocr_media_uses
migration_tags:
- islandora
migration_group: islandora
label: 'Islandora hOCR Media Use(s)'
source:
plugin: embedded_data
data_rows:
- name: hOCR
description: hOCR Derivative Term
url: https://discoverygarden.ca/use#hocr
ids:
url:
type: string
process:
name: name
description: description
field_external_uri: url
_tid_from_name:
- plugin: entity_lookup
ignore_case: true
source: name
entity_type: taxonomy_term
value_key: name
bundle_key: vid
bundle: islandora_media_use
_tid_from_external_url:
- plugin: entity_lookup
ignore_case: true
source: url
entity_type: taxonomy_term
value_key: field_external_uri
bundle_key: vid
bundle: islandora_media_use
tid:
- plugin: null_coalesce
source:
- '@_tid_from_external_url'
- '@_tid_from_name'
- plugin: skip_on_empty
method: process
destination:
plugin: 'entity:taxonomy_term'
default_bundle: islandora_media_use
migration_dependencies:
required: { }

0 comments on commit c885571

Please sign in to comment.