2

I need to implement a curation task that checks the group of every eperson. I understand that every eperson is a dspace object so they have an ID, given an ID I can check that eperson's group. My question is then, how to iterate over the Epersons.

Inthemist
  • 21
  • 2

2 Answers2

2

Your question's title refers to the anonymous group - every user is in the anonymous group, so I'm not quite sure why you would want a curation task for this. Furthermore, curation tasks are generally designed to run over DSpace content objects (communities/collections/items) not users.

If you do really want a curation task, your method depends on your DSpace version. In DSpace 5, use Eperson.findAll. In DSpace 6, use EPersonService.findAll. In current master, you should use the paginated version of the findAll method in the EPersonService class.

schweerelos
  • 2,189
  • 2
  • 17
  • 25
  • Thanks your for answer, I had a misunderstanding. What I want is a task that check if any user is **only** in the anonymous group so that they can be assigned to the registered users group. Is there a better way (other than curation tasks) to implement this type of tasks and run them from the website? – Inthemist Nov 09 '18 at 22:06
  • Thanks for clarifying (you might like to edit your question to help others if they ever want to know the same thing). If you want to be able to run it through the user interface then the curation task does sound like the best option. – schweerelos Nov 11 '18 at 20:12
2

First, to make it clear: the curation system only operates on the content hierarchy. It has no code to enumerate EPersons or Groups.

The answer above gives the best starting point for enumerating EPersons. findAll will return a List of EPerson. There is nothing in place to fit this into the web UIs. The easiest approach will be to make a console application that you run while logged in on the server.

The Anonymous group has no members; membership is implicit for all existing EPerson. Being a registered user is implicit in the fact that an EPerson exists. We may be able to give more help if you will more fully describe the problem that you are trying to solve.

Mark Wood
  • 356
  • 1
  • 9
  • I had a misunderstanding, what I want to know is which users are only in the Anonymous group (so that they are not "floating" around). If I decided to make a console application where should I program it? – Inthemist Nov 15 '18 at 21:35