Re : Re: Call for consensus for the pagination design (ISSUE-42)

Hi guys,

Huge +1 on this, had the same thoughts some time ago (think I wrote about it). It allows for full flexibility to exploit Hydra's pagination mechanism. Assuming the page number is somewhere in the URI as digits seems pretty reasonable to me :)

Regards,

Tom Panier, web developer
@_neemzy - neemzy.org

----- Mail d'origine -----
De: László Lajos Jánszky <laszlo.janszky@gmail.com>
À: Markus Lanthaler <markus.lanthaler@gmx.net>
Cc: public-hydra@w3.org
Envoyé: Wed, 28 Oct 2015 18:47:17 +0100 (CET)
Objet: Re: Call for consensus for the pagination design (ISSUE-42)

I was wondering, is there a way to control the available links? I mean first, prev, next, last is not always enough. Even google use different type of pagination strategy. 3 random sites with pagination:

1. google `[f] [p] [5] [6] [7] [8] [9] [10*] [11] [12] [13] [14] [n] [l]`
2. garmin forum `[page-select-input] [f] [p] [41] [49] [50] [51*] [52] [53] [61] [101] [151] [n] [l]`
3. a random forum `[f] [p] [page-select-input] [n] [l] {items-per-page-select-input}`

I assume we need a 5th link relation to describe other pages than first, prev, next, last. The page select input could use an URI template with the same link relation.

2015-10-18 21:18 GMT+02:00 Markus Lanthaler <markus.lanthaler@gmx.net>:
> It looks like the latest pagination design [1] stroke the right balance and
> finally allows us to move past this contentious issue. Briefly summarized,
> the main issues of the currently specified pagination design is that the
> collection and their pages are conflated which yields to a number of
> problems in practice. This has been tracked as ISSUE-42 [2].
>
> The proposed solution for that issue is to look at pages of a collection as
> specific *views* on a single underlying collection instead of thinking of
> the collection as the sum of its pages. More concretely, the proposal is to
>  - replace PagedCollection with PartialCollectionView
>  - replace firstPage/nextPage/previousPage/lastPage with
> first/next/previous/last
>  - associate totalItems with Collection instead of PagedCollection
>  - remove itemsPerPage for the time being (we will likely re-introduce it
> with a different name)
>
> The representation of a specific view on a collection would look somewhat
> like this with the new proposed design:
>
>   {
>     "@id": "http://api.example.com/an-issue/comments",
>     "@type": "Collection",
>     "member": [ ... ],
>     "totalItems": 150,
>     "view": {
>       "@id": "/an-issue/comments?page=3",
>       "@type": "PartialCollectionView",
>       "first": "/an-issue/comments",
>       "previous": "/an-issue/comments?page=2",
>       "next": "/an-issue/comments?page=4",
>       "last": "/an-issue/comments?page=498",
>     }
>   }
>
>
> This serves as a call for consensus. Before I proceed with marking ISSUE-42
> [2] as resolved and implementing the changes in the spec, I would like to
> ask if anyone has any concerns or objections against this proposal.
>
> Please submit your comments by Saturday, October 24th.
>
>
> Thanks,
> Markus
>
>
> [1] https://lists.w3.org/Archives/Public/public-hydra/2015Oct/0121.html
> [2] https://github.com/HydraCG/Specifications/issues/42
>
>
> --
> Markus Lanthaler
> @markuslanthaler
>
>

Received on Wednesday, 28 October 2015 23:31:52 UTC