|
|
1 week ago | |
|---|---|---|
| build | 1 week ago | |
| dist | 1 week ago | |
| src/Controller | 1 week ago | |
| README.md | 1 week ago | |
| build.sh | 1 week ago | |
| composer.json | 1 week ago | |
| islandora_mirador_annotations.info.yml | 1 week ago | |
| islandora_mirador_annotations.install | 1 week ago | |
| islandora_mirador_annotations.libraries.yml | 1 week ago | |
| islandora_mirador_annotations.module | 1 week ago | |
| islandora_mirador_annotations.permissions.yml | 1 week ago | |
| islandora_mirador_annotations.routing.yml | 1 week ago | |
README.md
Islandora Mirador Annotations
Standalone Drupal add-on for islandora_mirador that adds persistent Mirador 4 annotations using Mirador Annotation Editor (MAE).
Architecture
The base islandora_mirador module is not patched. This module:
- Alters the base viewer library dependency so the viewer loads this module's annotated Mirador bundle.
- Builds that bundle from the same Mirador 4 plugins used by Islandora plus MAE.
- Excludes MAE's currently incompatible
annotationSagaPluginand replaces only its annotation-loading behavior. - Adds a Drupal-backed MAE adapter.
- Stores each Web Annotation as JSON in
islandora_mirador_annotation. - Exposes an IIIF
AnnotationPageat/islandora-mirador/annotations?canvas=.... - Protects POST/PATCH/DELETE with Drupal permissions and
X-CSRF-Token.
Install
Place this directory next to islandora_mirador, then enable it:
drush en islandora_mirador_annotations -y
drush cr
Grant permissions as appropriate. For example, to let anonymous and authenticated users see annotations, grant view mirador annotations to those roles. Grant manage mirador annotations only to roles that may create/edit/delete annotations.
The module automatically sets MAE to read-only when the current user does not have manage mirador annotations.
Build dist/main.js
The build project is retained under build/.
cd build
npm install
npm run build
Vite writes the bundle to ../dist/main.js.
The bundle intentionally contains Mirador itself, the Islandora image-tools/text-overlay/download plugins, and MAE in one dependency graph. This avoids loading a second React/MUI runtime beside the base Mirador bundle.
Base module
No changes to islandora_mirador are required. When this module is disabled, the base viewer returns to its normal islandora_mirador/mirador dependency after a cache rebuild.
Endpoint
GET:
/islandora-mirador/annotations?canvas=<canvas URI>
returns:
{
"id": "...",
"type": "AnnotationPage",
"items": []
}
MAE writes through the same endpoint using POST, PATCH, and DELETE.