Adds annotations to Mirador 4 implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
astanley 0c862b9785 added View All Annotations tab 2 weeks ago
build added View All Annotations tab 2 weeks ago
dist added View All Annotations tab 2 weeks ago
src/Controller added View All Annotations tab 2 weeks ago
README.md added View All Annotations tab 2 weeks ago
build.sh initial commit 2 months ago
composer.json initial commit 2 months ago
islandora_mirador_annotations.info.yml initial commit 2 months ago
islandora_mirador_annotations.install added View All Annotations tab 2 weeks ago
islandora_mirador_annotations.libraries.yml added View All Annotations tab 2 weeks ago
islandora_mirador_annotations.module added View All Annotations tab 2 weeks ago
islandora_mirador_annotations.permissions.yml initial commit 2 months ago
islandora_mirador_annotations.routing.yml added View All Annotations tab 2 weeks ago

README.md

Islandora Mirador Annotations

Standalone Drupal add-on for islandora_mirador that adds persistent Mirador 4 annotations using Mirador Annotation Editor (MAE).

Features

  • Leaves the base islandora_mirador module untouched.
  • Drupal-backed persistent Web Annotations.
  • Existing MAE per-canvas annotation editor/sidebar.
  • All annotations sidebar for multi-page manifests.
  • All-annotations results are grouped by canvas/page label and searchable.
  • Clicking an annotation in the all-annotations panel jumps Mirador to that canvas.
  • A single Drupal query loads annotations for the complete manifest; it does not make one Drupal request per page.

Architecture

This module alters the base viewer library dependency so the viewer loads this module's annotated Mirador bundle. The bundle contains Mirador, the normal Islandora image-tools/text-overlay/download plugins, MAE, a Drupal persistence adapter, and the All Annotations companion-window plugin.

MAE's incompatible annotationSagaPlugin is excluded and its canvas-loading behavior is replaced locally.

Install

drush en islandora_mirador_annotations -y
drush cr

Grant view mirador annotations to roles that may see annotations and manage mirador annotations to roles that may create/edit/delete them.

Build assets

cd build
npm install
npm run build

Vite writes:

dist/main.js
dist/main.css

Both compiled files should be committed to the module repository so Composer users do not need Node/npm/Vite.

Endpoints

Current-canvas AnnotationPage:

GET /islandora-mirador/annotations?canvas=<canvas URI>

Manifest-wide read endpoint used by the All Annotations panel:

POST /islandora-mirador/annotations/manifest
Content-Type: application/json

{"canvasIds":["https://.../canvas/1","https://.../canvas/2"]}

Annotation writes use POST/PATCH/DELETE on /islandora-mirador/annotations and are protected by Drupal permissions and X-CSRF-Token.

All annotations click-to-focus

Selecting an entry in the All annotations panel switches to its canvas, selects the Mirador annotation so its target is highlighted, and, when the annotation contains an xywh FragmentSelector, zooms OpenSeadragon to that region with a small amount of padding. Both pixel and percent xywh selectors are supported.

0.2.5 annotation targeting

The All Annotations panel uses the Web Annotation target.source as the authoritative canvas when it differs from the persistence row's canvas id. It also zooms to MAE SvgSelector geometry when an xywh FragmentSelector is not available.