Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4186

Using "StartsWith" on Browse Title/Author endpoints breaks some pagination features

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Volunteer Needed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.0
    • Fix Version/s: 7.0
    • Component/s: REST API v7
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      1
    • Documentation Status:
      Needed

      Description

      When using the REST API "/browses" endpoints with with "startsWith" parameter, pagination within a specific index is limited in its features.

      More specifically:

      • For Browse indices that act like a "jump to" (Browse by Title & Date), page properties in the responses never update/change when using the "startsWith" parameter.  For example, when attempting to use the Browse by Title endpoint, starting with "T" (i.e. "/browse/title/items?startsWith=T"), you'd expect that page properties would update to show what page you have "jumped to" within the results.  Instead, "page.number" is always zero (0).  Here's an example from the demo site:  https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4science.it/dspace-spring-rest/api/discover/browses/title/items?startsWith=T 
      • Because Page number is always zero, paging backwards does not work if you use the "startsWith" parameter.  This is because the REST API always assumes you are still on the first page. Therefore you can only page forward to later entries.  Again, see the link above as an example

      The above issues do NOT occur on Browse by Author/Subject, as those endpoints act as a "filter" (so Browse by Subject beginning with "T" only shows subjects beginning with "T").  When the Browse endpoint acts as a Filter, the page properties are updated properly.  For example, here's a normal "Browse by Subject": https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4science.it/dspace-spring-rest/api/discover/browses/subject/entries 

      And, here's Browse by Subject beginning with "C": https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4science.it/dspace-spring-rest/api/discover/browses/subject/entries?startsWith=C (notice that the page's totalElements and totalPages are updated properly).

      This was discovered in testing of this Angular UI PR: https://github.com/DSpace/dspace-angular/pull/364  The related usability problem is also detailed here: https://github.com/DSpace/dspace-angular/issues/370 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tdonohue Tim Donohue
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: