Skip to content

Mixed manifests provisional canvases and merging of manifests implementation#442

Merged
JackLewis-digirati merged 27 commits intodevelopfrom
feature/mixedManifestsProvisionalCanvases
Aug 28, 2025
Merged

Mixed manifests provisional canvases and merging of manifests implementation#442
JackLewis-digirati merged 27 commits intodevelopfrom
feature/mixedManifestsProvisionalCanvases

Conversation

@JackLewis-digirati
Copy link
Copy Markdown
Collaborator

@JackLewis-digirati JackLewis-digirati commented Aug 5, 2025

resolves #432
resolves #433
resolves #448
resolves #450

This PR modifies the provisional canvas paintings to work with the new mixed manifests feature.

Additionally, the manifest merger has been updated to provide final manifests that work with a mixture of items and painted resources

There has been a modification to settings to allow the settings based path generator to generate provisional paths, as opposed to the config generator. This has meant a reorganisation of settings and the api now implements the presentationApiUrl settings previously only available in the background handler.

An example of this new settings block now looks like this:

"PathSettings": {
    "PresentationApiUrl": "https://localhost:7230",
    "CustomerPresentationApiUrl": {
      "2": "https://dlcs-dev.example",
      "3": "https://dlcs-test.example"
    },
    "PathRules": {
      "Defaults": {
        "ResourcePublic": "/presentation/{hierarchyPath}",
        "ManifestPrivate": "/{customerId}/manifests/{resourceId}",
        "CollectionPrivate": "/{customerId}/collections/{resourceId}",
        "Canvas": "/{customerId}/canvases/{resourceId}"
      },
      "Overrides": {
        "example.com": {
          "ResourcePublic": "https://foo.com/{customerId}/{hierarchyPath}",
          "ManifestPrivate": "/{customerId}/manifests/{resourceId}",
          "CollectionPrivate": "/{customerId}/collections/{resourceId}",
          "Canvas": "/{customerId}/canvases/{resourceId}"
        }
      }
    }

Note

where these settings supersede settings with the same name in the previous iteration

Important

this PR will require changes to the terraform

Note

This PR also reverts changes from #290 which disallows manifests being created with either assets or items in the MVP

@JackLewis-digirati JackLewis-digirati force-pushed the feature/mixedManifestsProvisionalCanvases branch from d2a1593 to 3356bb8 Compare August 5, 2025 13:23
@JackLewis-digirati JackLewis-digirati changed the title Feature/mixed manifests provisional canvases Mixed manifests provisional canvases and merging of manifests implementation Aug 11, 2025
@JackLewis-digirati JackLewis-digirati marked this pull request as ready for review August 11, 2025 16:33
@JackLewis-digirati JackLewis-digirati requested a review from a team as a code owner August 11, 2025 16:33
@JackLewis-digirati JackLewis-digirati force-pushed the feature/mixedManifestsProvisionalCanvases branch from 7e4d043 to 35a3120 Compare August 12, 2025 08:10
Copy link
Copy Markdown
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments. I think items / item is overused in params and vars and more accurate naming might help clarify what's happening?

Comment thread src/IIIFPresentation/API/Features/Manifest/ManifestWriteService.cs Outdated
Comment thread src/IIIFPresentation/API/Converters/ManifestConverter.cs
Comment thread src/IIIFPresentation/API/Converters/ManifestConverter.cs Outdated
Comment thread src/IIIFPresentation/API/Converters/ManifestConverter.cs Outdated
Comment thread src/IIIFPresentation/API/Converters/ManifestConverter.cs Outdated
Comment thread src/IIIFPresentation/API/Converters/ManifestConverter.cs Outdated
Comment thread src/IIIFPresentation/API/Features/Manifest/ManifestWriteService.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs Outdated
Copy link
Copy Markdown
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on call, couple of issues to resolve

  • Invalid canvas.Id on matched Canvas results in the Canvas being ignored (extra slug - https://localhost:7230/presentation/7/canvases/asimov)
  • Receiving "Error creating DLCS space" when there was a general DLCS error. This was related to attempting to delete null AssetId (maybe one for another ticket)?
  • General comment - too much reliance on canvasOriginalId. We can accept different forms of CanvasId, which we reduce to the "id" part but we join on canvasOriginalId, which could result in us joining 2 different forms.
  • Empty annotationPages ("items": []) in a matched canvas breaks handling (check .IsNullOrEmpty() rather than == null somewhere?)
  • GenerateProvisionalCanvas() - if matched canvas then we should add provisional paintingAnnotation. Linked to above, don't use canvasOriginalId for matching.

@JackLewis-digirati JackLewis-digirati force-pushed the feature/mixedManifestsProvisionalCanvases branch from cd8a17a to 3cba772 Compare August 26, 2025 11:10
Copy link
Copy Markdown
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - did some manual tests locally. Skimmed code due to size, couple of point raised but minor and mostly around comments.

Comment thread src/IIIFPresentation/Services/Manifests/ManifestItemsParser.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/ManifestMerger.cs Outdated
Comment thread src/IIIFPresentation/Services/Manifests/Helpers/CanvasHelper.cs
@JackLewis-digirati JackLewis-digirati merged commit 6d5a8c0 into develop Aug 28, 2025
4 checks passed
@JackLewis-digirati JackLewis-digirati deleted the feature/mixedManifestsProvisionalCanvases branch August 28, 2025 13:43
JackLewis-digirati added a commit that referenced this pull request Oct 30, 2025
This pulls out the work done in #442 to ONLY include the section on rewritten path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants