RE: Pagination - let's finalize the collection design (ISSUE-42)

On 14 Okt 2015 at 17:48, Thomas Hoppe wrote:
> Hi Markus,
> 
> we are currently implement an offset based pagination scheme using
> the existing hydra terms this looks something like this:
> 
> "@type": "PagedCollection",
> "totalItems": 342,
> "itemsPerPage": 100,
> "firstPage": "/elements/",
> "lastPage": "/elements/?offset=300",
> "nextPage": "/elements/?offset=100"
> ...
> 
> As far as I can see, this would be also possible with the view based
> approach.

Yes, definitely.


> The only question for me is what about `totalItems` and
> `itemsPerPage`. Do you propose to drop them or translate them to the
> view based model?

No, I don't propose to drop them.


> Of course there are cases where you cannot determine them
> but this is not an issue as nothing needs to be mandatory returned by a
> RESTful server.
> 
> Speaking of use-cases... what about changing the size of the view (the
> number of items shown in the view). I think we have never discussed this
> before. I can imagine a IRI template based link for this whose property
> _might_ also make sense in Hydra.

Yes, this would be addressed the same ways as jumping directly to a specific
page/offset. The server would give the client a hypermedia control
explaining how to do that and what the ranges for the various parameters
are.


--
Markus Lanthaler
@markuslanthaler

Received on Wednesday, 14 October 2015 19:04:17 UTC