Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTDA9-298: hOCR media use term creation option #5

Merged
merged 5 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: { }