Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Privacy
    • Imprint
    • Contact
    • Login methods
  • Sign in
  • ARSnova Backend ARSnova Backend
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ARSnovaARSnova
  • ARSnova BackendARSnova Backend
  • Merge requests
  • !3
The source project of this merge request has been removed.

Pagination

Merged Daniel Gerhardt requested to merge (removed):pagination into master Jun 03, 2015
  • Overview 2
  • Pipelines 0
  • Changes

This PR 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.

TODOs

  • Testing
  • Review
  • Javadoc
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: pagination