/** * Find all EPeople associated with this DSpace Object. * <P> * If object is SITE, all people are returned. * <P> * For all other objects, null is returned. * * @param context The DSpace context * @param object the DSpace object * @return array of all associated EPerson objects * @throws SQLException if database error */ protected List<EPerson> findAssociatedPeople(Context context, DSpaceObject object) throws SQLException { if (object.getType() == Constants.SITE) { return ePersonService.findAll(context, EPerson.EMAIL); } //by default, return nothing return null; }
List<EPerson> people = ePersonService.findAll(context, EPerson.EMAIL); for (EPerson person : people) { checkSelectCollectionForUser(person);
/** * Command to list known EPersons. */ private static int cmdList(Context context, String[] argv) { // XXX ideas: // specific user/netid // wild or regex match user/netid // select details (pseudo-format string) try { for (EPerson person : ePersonService.findAll(context, EPerson.EMAIL)) { System.out.printf("%s\t%s/%s\t%s, %s\n", person.getID().toString(), person.getEmail(), person.getNetid(), person.getLastName(), person.getFirstName()); // TODO more user details } } catch (SQLException ex) { System.err.println(ex.getMessage()); return 1; } return 0; } }
Map<String, Integer> info = new HashMap<String, Integer>(); try { List<EPerson> epersons = ePersonService.findAll(context, EPerson.LASTNAME); info.put("Count", epersons.size()); info.put("Can log in (password)", 0);