Regarding Collections and size

Hi all,

I'm long overdue giving a proper introduction to this list. The one I did send a month or two ago was regarding how to put together a Hydra API for a particular URL scheme. We've long since sorted that out - sorry for not updating the issue, but I hope that what we are currently doing will be a nice example for Hydra. It's making a lot of sense to us and once we had our URL scheme laid out, the whole process has been quite straightforward (+1 for emerging standards!)

The problem I have at the moment is regarding the Collection definition. I am writing a website which consumes our fledgling Hydra API and makes use of Collections of entities for display. The issue is that the information in a Collection isn't quite enough to drive the interface in a simple fashion. Essentially, what I really need is the ability to communicate the page size of a PartialCollectionView (PCV), maybe as part of the parent Collection, or on the PCV itself. This allows the interface to very simply determine whether to show First/Next/Previous/Last navigation by considering the current paging index, the total number of items and the page size.

I can think of two methods to get that information at the moment, both of which ideally I'd like to avoid:


1.       Looking for a PCV in the returned data from the API and reacting to whether there are first/next/previous/last items within it, but that feels brittle somehow.



2.       By always trying to retrieve the first page of results, the page size can be discovered, i.e. the totalItems value is greater than the count of the members, so assume page size is the number of members returned.


Would a viewSize or pageSize item added to the definition of a Collection (or PartialCollectionView) be amenable?


Once we have some resources available for the API documentation then I'll gladly pass them on.

Best wishes,

Adam.


________________________________

CONFIDENTIALITY NOTICE: This private and confidential e-mail has been sent to you by Digirati Limited. This is a UK limited company, registration number SC235053 The information in this e-mail (which includes any files transmitted with it) is confidential and may also be legally privileged. It is intended for the addressee only. Access to this e-mail by anyone else is unauthorized. It is not to be relied upon by any person other than the addressee except with our prior written approval. If no such approval is given, we will not accept any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting, on such information. Unauthorized recipients are required to maintain confidentiality. If you have received this e-mail in error please notify the originator immediately, destroy any copies and delete it from your computer system. The unauthorized use, dissemination, forwarding, printing or copying of this e-mail is prohibited.

Thank you.

Digirati Limited, Unit G 4, The Hub, 70 Pacific Quay, Glasgow G51 1EA | 31 Clerkenwell Close, London EC1R 0AU
Telephone +44 (0)845 643 4370: website: www.digirati.com

Received on Friday, 18 March 2016 15:19:25 UTC