Skip to content

Commit

Permalink
Merge pull request #553 from giacomomarchioro/0540-link-for-opening-m…
Browse files Browse the repository at this point in the history
…ultiple-canvases

Fix typos and add link
  • Loading branch information
giacomomarchioro authored Nov 12, 2024
2 parents 0fd8792 + 1c5c0b6 commit 762b247
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions recipe/0540-link-for-opening-multiple-canvases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,29 @@ topic:

## Use Case

I want to compare pages from two different manuscripts and share a link to open both of them 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 users. I want to open my current workspace with another viewer.

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 costum 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.
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.

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.

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.


## Restrictions

None known.

## Example
In this example we want to compare two painting of the Colosseum from two different Manifest.
In this example we want to compare two painting of the Colosseum from two different Manifests.
One of the two Manifest is reported here:

{% include manifest_links.html viewers="" manifest="manifest.json" %}

{% include jsonviewer.html src="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:
Expand All @@ -39,7 +42,7 @@ The Annotation will target the `id` of the two Canvases we want to compare and c

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

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

## Related Recipes

Expand Down

0 comments on commit 762b247

Please sign in to comment.