Table of Contents
Paging
Table of Contents
List representations, such as assetlist and collectionlist, are paged to allow clients to retrieve large result sets in smaller chunks. Paging uses a request to the server to retrieve only part of the list, allowing the client to scroll or "page" through the content.
If the list contains very few elements, the paging attribute can have the value null indicating that paging is not available.
Maximum paging limits
Paging results are subject to product-specific limits:
-
Fotoware On-premises and older Fotoware Veloz deployments that use Index Manager support paging through up to 100,000 assets (up to page 3999 when returning 25 assets per page).
- Fotoware Veloz deployments that use Cosmos DB support paging through up to 10,000 assets (up to page 399 when returning 25 assets per page).
When a search returns more assets than the paging limit, only the first set of assets within the limit can be reached through paging. Clients should not assume that paging provides access to all matching assets in very large result sets.
Paging may be limited to a maximum number of assets, depending on the deployment type. For details, see Maximum paging limits above.
JSON format
paging: {
prev: "",
next: "/fotoweb/archives/5001-testarchive/;p=1",
first: "/fotoweb/archives/5001-testarchive/",
last: "/fotoweb/archives/5001-testarchive/;p=0"
}
As shown above, the paging attribute has links to previous and next pages, as well as first and last pages.
Note
- Clients should not compute page URLs but use the available attributes above.
- Also, do not assume the number of elements per page. The number of elements may vary; using the attributes above, FotoWeb will make the paging work as intended.
Accept headers/media types for collections
| Accept header | Usage |
|---|---|
| application/vnd.fotoware.collection+json | This media type can only be requested for the first page of a collection. This is because the “collection” media type contains both a list of assets and a list of sub-collections (folders), so it wouldn’t be clear which list is being “paged”. |
| application/vnd.fotoware.assetlist+json | Used for paging of the asset list |
| application/vnd.fotoware.collectionlist+json | Used for paging of the sub-collection list |
Paging attributes
| Attribute | Description |
|---|---|
paging |
Paging information. Ifnull, the list is not paged, i.e., the representation contains the entire list. |
paging.next |
URL of next page. If |
paging.prev |
URL of the previous page. If |
paging.first |
URL of the first page. This attribute is nevernullor""(empty string), and can be used for restarting navigation at the beginning of the list. |
paging.last |
URL of the last page. If nullor""(empty string), then the last page is not known because it is not known how many pages there are. If the last page is unknown, clients can continue paging.next until no further pages are available. |
Paging behavior
The attributes paging.first and paging.last have identical values on all pages, assuming that the contents of the list do not change during iteration.
If paging is not null for one page, then it is not null for any page.
For the page retrieved from paging.last, paging.next is nullor""(empty string).
For the page retrieved from paging.first, paging.prev is nullor""(empty string).
Any page reached from a paging.next link has a valid paging.prev link that links back to its referrer, assuming that the contents of the list do not change during iteration
Any page reached from a paging.prev link has a valid paging.next link that links back to its referrer, assuming that the contents of the list do not change during iteration
The contents of some lists may change at any time, so it is recommended not to assume that paging.last stays the same during iteration.
Client considerations
Clients should not make any assumptions about:
- Whether or not a list is paged (i.e., they should always check if
pagingisnulland act accordingly). - Whether or not
paging.lastisnullor""(empty string). - The format of page URLs or the meaning of any parts, including, but not limited to, the order of page numbers (increasing or decreasing).
- The number of elements of a page, or whether or not different pages of the same list have the same number of elements.
- The maximum number of assets that can be accessed through paging, as deployment-specific limits may apply.