forked from alxp/islandora
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Bring back hOCR term config item in IIIF Manifest Views style. #953
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adam-vessey
reviewed
Jun 21, 2023
adam-vessey
reviewed
Jul 13, 2023
adam-vessey
reviewed
Jul 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presently in conflict with upstream.
At IslandroaCon 2023 the following items were agreed on:
Closing this PR since it represents work that we'd be und-doing later. (Hopefully sooner) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub Issue: (link)
What does this Pull Request do?
Brings back the config item on IIIF Manifest Views style plugin so that a site builder can choose the term to retrieve hOCR text from on a sibling Media entity.
What's new?
We outsmarted ourselves trying to retrieve a related media item using Views relationships. It turns out that this does not work if a row's object has an image media but no hOCR media.*
This rolls back the commit where I removed the options form to explicitly select the term, and adds more descriptive help text.
(i.e. Regeneration activity, etc.)? No
How should this be tested?
From a new instance of the starter site, e.g. 'make starter_dev' in ISLE-DC:
Back up your existing site config if you want to return to it with 'make config:export', then copy the files in codebase/config/sync to a temporary folder.
Run composer require islandora/islandora_mirador "islandora/islandora:dev-946-hocr-media as 2.7.x-dev". If composer gives you trouble you may need to chmod -R u+w web/sites/default and / or generate a GitHub API token. Alternatively you can just check out this issue branch manually.
I've attached a zip file with configs for setting up what you need to test this change. Import the attached configs:
config-import.zip
3.1. Unzip the file into your codebase folder so it is accessible inside ISLE-DC, e.g., to codebase/config. The files will be in a folder called 'config-import'./
3.2. Inside Docker's Drupal image, run the command: drush config:import --partial --source=/var/www/drupal/config/config-import
create a new term in the Media Use taxonomy with URL set to https://discoverygarden.ca/use#hocr (likely to be the future one we use.)
We should now be able to test hOCR generateion:
Add a Repository Item with Model 'Paged Content'
Upload one or more TIFFs with text on them as children, using Model 'Page', media type 'File' and media use 'Original File'.
You can monitor hOCR derivative generation with the logger, docker compose logs -f hypercube
After derivatives are generated you should see 'hOCR Extracted Text' media as part of the items on the Media tab.
Next test the IIIF Manifest:
Go to Admin > Structure > Views and edit the IIIF Manifest view.
Click 'Settings' next to IIF Manifest in the Format section on the left.
You should see a new config form element, allowing you to choose the Media Use term for hOCR Extracted Text:
Append '/manifest' to the URL of the Paged Content node you created earlier. This should print a manifest including "SeeAlso" entries where the hOCR URLs are included.
The node page itself should include a Mirador viewer with the Text Overlay plugin enabled. Text should be slectable. You can turn this off via Mirador's UI in the top-right. If the text selection buttons don't appear, try clearing Drupal's cache.
image
Next go to one of the children objects, and click on the Media tab. Delete the hOCR Extracted Text media, then go back to the original book page. You should still see the image in Mirador, but it won't have a text overlay.
The part of this PR that is new is the Views Plugin setting. The rest is already in Islandora
Documentation Status
Additional Notes:
Any additional information that you think would be helpful when reviewing this
PR.
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers
@rosiel