Re: Pagination (ISSUE-42)

Hi everyone

I think we're all revolving around similar goals and issues in a peculiar dance, without explicitly agreeing nor disagreeing.

Having read the recent discussions it occurs to me that we all agree only that large collections need to be broken into smaller pages, which is kind natural. I like Ruben's idea on how to improve that design. However there are multiple ideas for defining links between those pages. I can think of 4 (which can be combined too)

1. first, last, next, previous
2. offset, limit
3. a number of direct links to nearest pages (seen commonly)
4. template based

My proposal is that maybe we shouldn't define any explicit terms for those link in the core Hydra vocabulary. If we keep the current next,last,etc properties it seems to suggest to newcomers that this is "the right way" for designing partial collections. Having said that I see where Andrew's email comes from.

What I think should stay in core vocab is just the general structure. In current state of affairs that would be hydra:Collection, hydra:Page, hydra:pageOf and hydra:pagination. The last would be where any server-supplied controls would be, regardless of how the pages are addressed. It is after all a resource like any other and maybe shouldn't be treated in a special way.

What do you guys think?

Regards,
Tom

February 4 2015 3:37 AM, "László Lajos Jánszky" <laszlo.janszky@gmail.com> wrote:

> I think we can easily add a hydra:pageSize property and your problem
> is solved with: offset = (pageIndex-1)*pageSize, limit = pageSize, so
> if you got an URI template you can get the page you want. Ofc this is
> not a complete custom range support, but we usually don't need custom
> ranges just pagination. I guess by binary data custom ranges can be
> good.

Received on Wednesday, 4 February 2015 08:10:19 UTC