Skip to content
Snippets Groups Projects
Commit d89102ea authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Merge branch 'pagination'

This merge introduces pagination for lists of sessions (user specific:
owned and visited), interposed questions and free text answers and skill
questions. While the first three are paginated through the database,
skill questions are paginated in memory so caching is still possible.

Frontend usage

To enable pagination, new HTTP headers based on RFC 7233 have been
introduced:

Request: Range: items=<start>-<end>, e.g. Range: items=0-9
Response: Content-Range: items <start>-<end>/<total>, e.g. Content-Range: items 0-9/42

Since it is not possible to determine the total count of items via
CouchDB w/o performance losses, it is currently only set accurately for
skill questions. In other cases total is set to -1.

Backend usage

Pagination support can be added to controllers by extending the newly
introduced PaginationController. Additionally, applicable methods have
to be marked with the @Pagination annotation so the Range header is
parsed and the Content-Range header is set for responses. Pagination
parameters are accessible in the controller through the offset and limit
fields. If pagination on the DBAL is not possible, lists can be wrapped
with PaginationListDecorator<T> to enable in memory pagination.

See merge request !3
parents 542b3316 cc0fd7a3
No related merge requests found
Showing
with 641 additions and 75 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment