dlcs / iiif-presentation

Allows for the creation and management of IIIF manifests
MIT License
0 stars 0 forks source link

Support paging of Collections #8

Closed sarahos closed 1 day ago

sarahos commented 2 weeks ago

Add a pager, effective when header supplied, on Storage Collections

example endpoint: https://localhost:7230/1/collections/b157e325-3fe5-459b-8b80-b7a62213334a?page=1&pageSize=100


From the PR (linked below)

This PR resolves #8

In order to support paging, this PR adds a set of query params to GET storage collections. These are as follows:

There are also default page sizes (set to 100 by default) and max page page sizes (1000 by default) which can be set in settings.

The default page size is used when no query params are set, and the max automatically overrides any value larger than it to the max, so that we avoid requests for millions of items in a single page

Additionally, ordering has been added to paging, so that retrieved items are consistent. There are 2 query params that support this:

You can order on the current fields:

An example of using these query params would be something like the following:

https://localhost:7230/1/collections/0909385a-d8bb-4254-b7a5-f3f3a7939c3a?page=1&pageSize=3&orderByDescending=slug

This PR also adds the values next and last to view, which will appear when there are more, and/or previous pages to view