Skip to content

Manage Manifests

Jana Rajakumar edited this page Feb 21, 2018 · 10 revisions

Reference: https://iiif.library.utoronto.ca/presentation/v2/#!/Manifest/ManifestByItemDelete

Table of Contents

IIIF Reference: http://iiif.io/api/presentation/2.1/#manifest

Create a Manifest

  • A manifest can be created by sending a POST request to {identifier}/manifest with the required parameters.
  • For example:
{
   "manifest":{
      "@id":"http://example.org/iiif/book1/manifest",
      "label":"some manifest label parent",
      "sequences":[
         {
            "@id":"http://example.org/iiif/book1/sequence/normal",
            "@type":"sc:Sequence",
            "label":"Current Page Order",
            "viewingDirection":"left-to-right",
            "viewingHint":"paged",
            "canvases":[
               {
                  "canvas":{
                     "@id":"http://example.org/iiif/book1/canvas/p5",
                     "@type":"sc:Canvas",
                     "label":"p. 1",
                     "height":1000,
                     "width":750,
                     "thumbnail":{
                        "@id":"http://example.org/iiif/book1/canvas/p1/thumb.jpg",
                        "@type":"dctypes:Image",
                        "height":200,
                        "width":150
                     },
                     "images":[
                        {
                           "@type":"oa:Annotation",
                           "motivation":"sc:painting",
                           "stylesheet":{
                              "@type":[
                                 "oa:CssStyle",
                                 "cnt:ContentAsText"
                              ],
                              "chars":".red {color: red;}"
                           },
                           "resource":{
                              "@id":"https://dlcs.io/iiif-img/default.jpg",
                              "@type":"oa:SpecificResource",
                              "style":"red",
                              "format":"image/jpeg",
                              "full":{
                                 "@type":"cnt:ContentAsText",
                                 "chars":"Rubrics are Red, ..."
                              }
                           },
                           "on":"http://example.org/iiif/book1/canvas/p1#xywh=100,150,500,30"
                        }
                     ],
                     "otherContent":[
                        {
                           "@id":"http://example.org/iiif/book1/list/p1",
                           "@type":"sc:AnnotationList"
                        }
                     ]
                  }
               }
            ]
         }
      ],
      "structures":[
         {
            "@id":"http://example.org/iiif/book1/range/r0",
            "@type":"sc:Range",
            "label":"Table of Contents",
            "viewingHint":"top",
            "members":[
               {
                  "@id":"http://example.org/iiif/book1/canvas/cover",
                  "@type":"sc:Canvas",
                  "label":"Front Cover"
               },
               {
                  "@id":"http://example.org/iiif/book1/range/r1",
                  "@type":"sc:Range",
                  "label":"Introduction",
                  "contentLayer":"http://example.org/iiif/book1/layer/introTexts"
               },
               {
                  "@id":"http://example.org/iiif/book1/canvas/backCover",
                  "@type":"sc:Canvas",
                  "label":"Back Cover"
               }
            ]
         }
      ]
   }
}
  • This would create the manifest for the item to-p and also create all of its provided sub-sequences and ranges recursively.
  • Each sub-sequence and range will have an upward link to this manifest defined in their belongsTo field with this manifest @id.
  • The new manifest will also have a list of @ids in its children field. This value along with the belongsTo are later used to re-construct the manifest when viewing.
  • Suppose any of the sub-sequence or range already exists, those objects will be updated with any new values from this request. Those objects will also be updated to have their belongsTo field to contain this new manifest @id.

Update a Manifest

  • A manifest can be updated by sending a PUT request to /{identifier}/manifest with fields that need to be updated.
  • Updating a manifest without any of its sub-sequences or ranges in the request body would not affect its children unless the @id is being changed. In this case, an internal update will be performed on all of its children to update their belongsTo values.
  • Suppose any of the sub-sequence or range does not exist, those objects will be created with new values from this request. Those objects will also be updated to have their belongsTo field to contain this new manifest @id.

Delete a Manifest

  • A manifest can be deleted by sending a DELETE request to /{identifier}/manifest. Beware that this will also delete all sub-sequences and ranges under this manifest recursively.

View a Manifest

  • A single manifest can be viewed at /{identifier}/maniest. This lists all sub-collections and manifests that have the requested manifest @id in their belongsTo field.

FAQ

  • How to create a manifest without an @id?

  • A POST with no @id in the request body will simply use the identifier for that object to generate the @id.

  • How to hide a specific sub-sequence or range when viewing a manifest ?

  • This can be achieved by sending a PUT request to the object that needs to be hidden by updating the hidden property to true.

{"sequence: {"hidden": true}} or {"range: {"hidden": true}}
  • How to change the order of sub-sequences or ranges of a parent manifest?
  • This can be achieved by sending a PUT request to the parent manifest with the correct order of @ids for sub-sequences and ranges.
  • This would auto-update the order field of all the sub-sequences and ranges.
{"manifest": {
 "sequences": [{"@id": "id-of-sequence-1"}, {"@id": "id-of-sequence-2"}], 
 "structures": [{"@id": "id-of-range-1"}, {"@id": "id-of-range-2"}]
}}
Clone this wiki locally