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

PathTemplates handles assetPath formatting #902

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

donaldgray
Copy link
Member

@donaldgray donaldgray commented Sep 16, 2024

Known formatting list only, can be expanded as required.

{assetPath} is a PathTemplate value that can be replaced, this PR adds functionality to handle a format (e.g. {assetPath:3US}). 3US is the only currently supported format, this will replace 3 underscores ___ with a slash /.

This will allow identifiers that contain invalid characters to be reflected back in "id" properties.

Formatting is only supported for assetPath - {customer}, {space} etc left as-is.

assetPath is more than just the "asset" part of the Id, it's the "asset" part and also any asset-delivery parameters. E.g. for /iiif-img/2/1/foo/full/!1024,1024/0/default.jpg it will be foo/full/!1024,1024/0/default.jpg so any path rewrite formatters would need to be aware of this to not collide with IIIF parameters.

A concrete examples is, for an image with Id 2/1/foo___bar-baz being replaced on info.json:

  • Default Template: /{prefix}/{customer}/{space}/{assetPath} => /iiif-img/2/1/foo___bar-baz/info.json
  • Template: /{prefix}/ark:{assetPath:3US} => /iiif-img/ark:foo/bar-baz/info.json

Warning

This is only for asset-delivery paths, auth paths will not use this same rewrite logic.

Known formatting list only, can be expanded as required
@donaldgray donaldgray force-pushed the feature/path_template_extensions branch from 03f129b to a8f87d1 Compare September 16, 2024 16:06
@donaldgray donaldgray merged commit 63574fa into main Sep 18, 2024
9 checks passed
@donaldgray donaldgray deleted the feature/path_template_extensions branch September 18, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants