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

0540 link for opening multiple canvases #564

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80676a1
Draft of 0540
giacomomarchioro Oct 25, 2024
1aeef8c
Update index
giacomomarchioro Oct 25, 2024
962abae
Update link
giacomomarchioro Oct 25, 2024
0fd8792
Merge pull request #549 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Oct 25, 2024
1c5c0b6
Fix typos and add link
giacomomarchioro Nov 12, 2024
762b247
Merge pull request #553 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Nov 12, 2024
bf8908b
Removed inline JSON
giacomomarchioro Nov 22, 2024
04e0555
Merge pull request #558 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Nov 22, 2024
16de24b
changes id.url to id.path
giacomomarchioro Nov 22, 2024
d91f760
Merge pull request #559 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Nov 22, 2024
ac0d98f
fix broken link
giacomomarchioro Nov 29, 2024
1a2f689
Merge pull request #563 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Nov 29, 2024
2ebc063
corrects manifest
giacomomarchioro Dec 6, 2024
1144ac4
Update recipe/0540-link-for-opening-multiple-canvases/index.md
giacomomarchioro Dec 6, 2024
9de7f42
add second manifest
giacomomarchioro Dec 6, 2024
2be4d55
add restrictions and editor comments
giacomomarchioro Dec 6, 2024
6e98a26
change links to the new manifests
giacomomarchioro Dec 6, 2024
f180566
add image
giacomomarchioro Dec 6, 2024
c1da98f
Merge pull request #567 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Dec 6, 2024
d562a10
change related recipes and corrects typos
giacomomarchioro Dec 6, 2024
0f0f06f
Merge pull request #568 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Dec 6, 2024
3b01668
change url formatting and correct typo
giacomomarchioro Dec 13, 2024
e90cd5e
Merge pull request #569 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro Dec 13, 2024
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
1 change: 1 addition & 0 deletions _includes/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@

[0434]: {{ site.cookbook_url | absolute_url }}/recipe/0434-choice-av/ "Multiple Choice of Audio Formats in a Single View (Canvas)"
[0489]: {{ site.cookbook_url | absolute_url }}/recipe/0489-multimedia-canvas/ "Rendering Multiple Media Types on a Time-Based Canvas"
[0540]: {{ site.cookbook_url | absolute_url }}/recipe/0540-link-for-opening-multiple-canvases/ "Sharing a link for opening two or more Canvases"

[cookbook-process]: {{site.cookbook_url | absolute_url }}/recipe

Expand Down
4 changes: 3 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ _(leading on to segmentation examples later)_
* [Linking to Structured Metadata][0053] (8)


## Sharing IIIF content
## Sharing IIIF content
Recipes using [Content State API](https://iiif.io/api/content-state/1.0/)

* [Loading a manifest with a viewer using a link][0466]
* [Open a specific region of a canvas in a viewer][0485]
* [Sharing a link for opening two or more Canvases][0540]



## Technical
Expand Down
28 changes: 28 additions & 0 deletions recipe/0540-link-for-opening-multiple-canvases/annotation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "{{ id.url }}",
"type": "Annotation",
"motivation": ["contentState"],
"target": [
{
"id": "{{ id.path }}/canvas/2",
"type": "Canvas",
"partOf": [
{
"id": "{{ id.path }}/manifest-2.json",
"type": "Manifest"
}
]
},
{
"id": "{{ id.path }}/canvas/p2",
"type": "Canvas",
"partOf": [
{
"id": "{{ id.path }}/manifest.json",
"type": "Manifest"
}
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions recipe/0540-link-for-opening-multiple-canvases/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Sharing a link for opening two or more Canvases
id: 540
layout: recipe
tags: [annotation, content-state]
summary: "Allows users to use Content State API to open two canvases at the same time."
viewers:
topic:
- content-state
---

## Use Case

I want to compare pages from two different manuscripts and share a link to open both on the same view. I want to share a link to a colleague showing two similar paintings in two different collections. I want to save my current workspace (open Canvases in the current viewer) for later use. I want to open my current workspace with another viewer.

![Illustration of a possible way of visualizing two Canvases from different IIIF objects.](canvases_sides_by_side.jpeg)

## Implementation Notes

Some viewers already implement custom formats for exporting the current workspace for sharing or later use. The Content State API could be used for the same purpose, adding the advantage of direct loading of the workspace using a crafted link with the `iiif-content` query parameter. The [multiple targets for a comparison view section](https://iiif.io/api/content-state/1.0/#53-multiple-targets-for-a-comparison-view) describes a method for targetting two Canvases at the same time; each Canvas could be from a different Manifest.

For this purpose, we create an Annotation with `motivation` set to `["contentState"]`.
The value of the `target` property of the Annotation is a list containing the `id` of the Canvases and a `partOf` property with the `id` of the Manifests they belong to.

We can hence encode the Annotation as explained in the [Content State encoding guidelines](https://iiif.io/api/content-state/1.0/#6-content-state-encoding), and then pass the encoded value, using the `iiif-content` query parameter of the viewer landing page:

```
https://example.org/viewer?iiif-content=JTdCJTIyJTQwY29udGV4dCUyMiUzQSUyMmh0dHAlM0ElMkYlMkZpaWlmLmlvJTJGYXBpJTJGcHJlc2VudGF0aW9uJTJGMyUyRmNvbnRleHQuanNvbiUyMiUyQyUyMmlkJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZwcmV2aWV3LmlpaWYuaW8lMkZjb29rYm9vayUyRjA1NDAtbGluay1mb3Itb3BlbmluZy1tdWx0aXBsZS1jYW52YXNlcyUyRnJlY2lwZSUyRjA1NDAtbGluay1mb3Itb3BlbmluZy1t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wbGUtY2FudmFzZXMlMkZtYW5pZmVzdC5qc29uJTIyJTJDJTIydHlwZSUyMiUzQSUyMk1hbmlmZXN0JTIyJTdEJTVEJTdEJTVEJTdE
````

giacomomarchioro marked this conversation as resolved.
Show resolved Hide resolved
## Restrictions

The Content State API does not define how the viewer should show the two Canvases. It only mentions:

“This data structure can be used by clients to load the resource required, present a particular part of the resource to the user.” [https://iiif.io/api/content-state/1.0/#content-state](https://iiif.io/api/content-state/1.0/#content-state)

Viewers may show the Canvases side by side or decide to use different approaches (e.g. opening two browser tabs).
## Example
In this example we want to compare two paintings of the Colosseum from two different Manifests.
We can notice that the Colosseum painting of the first Manifest is in the second Canvas.

The Annotation will target the `id` of the two Canvases we want to compare and contain a reference to the two Manifests as shown in the example:

{% include content-state-viewers.html iiif-content="annotation.json" viewers="" %}

{% include jsonviewer.html src="annotation.json" %}

The expected result should show the two Canvases of the two Manifest depicting the Colosseum.

## Related Recipes

* [Open a specific region of a canvas in a viewer][0485] shows how open a region of interest of a Canvas.
* [Link for loading a manifest][0466] another example of Content State API.

{% include acronyms.md %}
{% include links.md %}

51 changes: 51 additions & 0 deletions recipe/0540-link-for-opening-multiple-canvases/manifest-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "{{ id.url }}/manifest-2.json",
"type": "Manifest",
"label": {
"en": [
"The Colosseum"
]
},
"items": [
{
"id": "{{ id.path }}/canvas/2",
"type": "Canvas",
"height": 1529,
"width": 2048,
"label": {
"en": [
"The Colosseum"
]
},
"items": [
{
"id": "{{ id.path }}/anno-page/2",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/anno/2",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://iiif.io/api/image/3.0/example/reference/71b9228e087f15c75b628214cd9f647d-The_Colosseum/full/max/0/default.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 1529,
"width": 2048,
"service": [
{
"id": "https://iiif.io/api/image/3.0/example/reference/71b9228e087f15c75b628214cd9f647d-The_Colosseum",
"profile": "level1",
"type": "ImageService3"
}
]
},
"target": "{{ id.path }}/canvas/2"
}
]
}
]
}
]
}
76 changes: 76 additions & 0 deletions recipe/0540-link-for-opening-multiple-canvases/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "{{ id.url }}/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Two monuments in Rome"
]
},
"items": [
{
"id": "{{ id.path }}/canvas/p1",
"type": "Canvas",
"label": {
"en": [
"The Temple of Vesta Rome"
]
},
"height": 1464,
"width": 2048,
"items": [
{
"id": "{{ id.path }}/page/p1/1",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/annotation/p0001-image",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://fixtures.iiif.io/images/Yale/ycba/The_Temple_of_Vesta_Rome.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 1464,
"width": 2048
},
"target": "{{ id.path }}/canvas/p1"
}
]
}
]
},
{
"id": "{{ id.path }}/canvas/p2",
"type": "Canvas",
"label": {
"en": [
"The Colosseum"
]
},
"height": 1302,
"width": 2048,
"items": [
{
"id": "{{ id.path }}/page/p2/1",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/annotation/p0002-image",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://fixtures.iiif.io/images/Yale/ycba/The_Colosseum_Rome2.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 1302,
"width": 2048
},
"target": "{{ id.path }}/canvas/p2"
}
]
}
]
}
]
}
Loading