-
Notifications
You must be signed in to change notification settings - Fork 32
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
glenrobson
wants to merge
23
commits into
master
Choose a base branch
from
0540-link-for-opening-multiple-canvases
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
80676a1
Draft of 0540
giacomomarchioro 1aeef8c
Update index
giacomomarchioro 962abae
Update link
giacomomarchioro 0fd8792
Merge pull request #549 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro 1c5c0b6
Fix typos and add link
giacomomarchioro 762b247
Merge pull request #553 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro bf8908b
Removed inline JSON
giacomomarchioro 04e0555
Merge pull request #558 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro 16de24b
changes id.url to id.path
giacomomarchioro d91f760
Merge pull request #559 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro ac0d98f
fix broken link
giacomomarchioro 1a2f689
Merge pull request #563 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro 2ebc063
corrects manifest
giacomomarchioro 1144ac4
Update recipe/0540-link-for-opening-multiple-canvases/index.md
giacomomarchioro 9de7f42
add second manifest
giacomomarchioro 2be4d55
add restrictions and editor comments
giacomomarchioro 6e98a26
change links to the new manifests
giacomomarchioro f180566
add image
giacomomarchioro c1da98f
Merge pull request #567 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro d562a10
change related recipes and corrects typos
giacomomarchioro 0f0f06f
Merge pull request #568 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro 3b01668
change url formatting and correct typo
giacomomarchioro e90cd5e
Merge pull request #569 from giacomomarchioro/0540-link-for-opening-m…
giacomomarchioro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
28 changes: 28 additions & 0 deletions
28
recipe/0540-link-for-opening-multiple-canvases/annotation.json
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
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": "https://iiif.io/api/cookbook/recipe/0318-navPlace-navDate/canvas/2", | ||
"type": "Canvas", | ||
"partOf": [ | ||
{ | ||
"id": "https://iiif.io/api/cookbook/recipe/0318-navPlace-navDate/manifest-2.json", | ||
"type": "Manifest" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "{{ id.path }}/canvas/p2", | ||
"type": "Canvas", | ||
"partOf": [ | ||
{ | ||
"id": "{{ id.path }}/manifest", | ||
"type": "Manifest" | ||
} | ||
] | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||
--- | ||||||
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. | ||||||
|
||||||
## Implementation Notes | ||||||
|
||||||
Some viewers already implement custom formats for exporting the current workspace for sharing or later use. 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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor suggestion:
Suggested change
|
||||||
|
||||||
For this purpose, we create an Annotation with `motivation` set to `["contentState"]`. | ||||||
The value of the the `target` attribute of the Annotation is a list containing the `id` of the Canvases and a `partOf` attribute with the `id` of the Manifests they belong to. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would property be better than attribute here?
Suggested change
|
||||||
|
||||||
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 string to the viewer as the value of the `iiif-content` query parameter. | ||||||
|
||||||
giacomomarchioro marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
## Restrictions | ||||||
|
||||||
None known. | ||||||
|
||||||
## Example | ||||||
In this example we want to compare two painting of the Colosseum from two different Manifests. | ||||||
One of the two Manifest is available at the following [link](manifest.json). We can notice that the Colosseum painting is in the second Canvas. The other Manifest is from another recipe, and can be [accessed here](https://iiif.io/api/cookbook/recipe/0318-navPlace-navDate/manifest-2.json). | ||||||
|
||||||
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 | ||||||
|
||||||
* [Simplest Manifest - Image][0001] shows the basic structure of a IIIF Manifest using Presentation API 3.0. | ||||||
* [A simple book][0009] shows the manifest structure. | ||||||
* [Link for loading a manifest][0466] another example of Content State API. | ||||||
|
||||||
{% include acronyms.md %} | ||||||
{% include links.md %} | ||||||
|
76 changes: 76 additions & 0 deletions
76
recipe/0540-link-for-opening-multiple-canvases/manifest.json
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
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" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.
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.
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.
This results in a 404 and this property in the json:
"id": "https://preview.iiif.io/cookbook/0540-link-for-opening-multiple-canvases/recipe/0540-link-for-opening-multiple-canvases/canvas/p2",
I think we need this: