DSpace / RestContract

REST Contract for DSpace 7-8
https://wiki.lyrasis.org/display/DSDOC8x/
37 stars 46 forks source link

Contract for `isNotMemberOf` searches for Groups and EPersons #241

Closed tdonohue closed 8 months ago

tdonohue commented 9 months ago

(Replaces #237)

Required by https://github.com/DSpace/DSpace/issues/9052 and https://github.com/DSpace/dspace-angular/issues/2512

Description

In order to fix the performance issues described in the above tickets, we need a way to search across all Groups and all EPersons which are not yet a member of a specific Group in the system.

Therefore, this PR suggests two new REST API endpoints:

  1. GET /api/eperson/groups/search/isNotMemberOf?group=<:uuid>&query=<:string>
    • Will search across all Groups which are not yet a member of the Group specified by group=<:uuid>.
    • This is the same as searching all Groups which are NOT listed under the /api/eperson/groups/<:uuid>/subgroups endpoint for that Group specified by group=<:uuid>
  2. GET /api/eperson/epersons/search/isNotMemberOf?group=<:uuid>&query=<:string>
    • Will search across all EPersons which are not yet a member of the Group specified by group=<:uuid>.
    • This is the same as searching all EPersons which are NOT listed under the /api/eperson/groups/<:uuid>/epersons endpoint for that Group specified by group=<:uuid>

Additional Details on Performance Issue

These new endpoints are required to fix the behavior issues in the Angular UI code. Currently, our Angular UI includes code which requests every EPerson in a Group or every Subgroup in a Group in order to determine whether a given EPerson or Group is already included in a given parent Group.

For example:

This UI behavior will cause performance issues when a Group has a large number of members (either EPerson or Subgroup).

This performance issue will be fixed by now creating performance-friendly endpoints to find non-members.

tdonohue commented 9 months ago

Implementation PR for this REST Contract now exists at DSpace/DSpace#9125