In order to accomodate large lists of projects, stories, and tasks
in a way that response quickly to user requests, I've added limited
support for oslo's paginate_query method. Search responses now also
include metadata headers that allow us to manage paging in our
result set: X-Limit, X-Marker, X-Total.
Using Markers, instead of offsets, comes with a tradeoff - calculating
the _current_ page of the result can only be done in client memory by
loading all previous records and determining where the marker lives.
It probably makes sense to also permit offset, or to only allow offset
and determine the marker record based on that.
The benefit of using marker-style paging is that - rather than using
a paging metaphor, we can implement an 'infinite scroll' UI on long
lists of records. Whether that's a good idea remains to be seen.
Additional changes -
- Page size maximum and default is configurable
- I had to change getAllStories to a distinct subselect, because
left joins were screwing up our result sets.
Change-Id: I058a4182d2b454edbbfb7db3493d94b3bad07b36