try { if (command.hasOption(OPT_NETID.getOpt())) { eperson = ePersonService.findByNetid(context, command.getOptionValue(OPT_NETID.getOpt())); } else if (command.hasOption(OPT_EMAIL.getOpt())) { eperson = ePersonService.findByEmail(context, command.getOptionValue(OPT_EMAIL.getOpt())); } else { System.err.println("No EPerson selected"); ePersonService.setMetadata(context, eperson, "phone", command.getOptionValue(OPT_PHONE.getOpt())); modified = true; ePersonService.update(context, eperson); context.complete(); System.out.printf("Modified EPerson %s\n", eperson.getID().toString());
eperson = ePersonService.findByEmail(context, username.toLowerCase()); " requires a certificate to authenticate.."); return CERT_REQUIRED; } else if (ePersonService.checkPassword(context, eperson, password)) {
public String getObjectSizesInfo(Context context) throws SQLException { StringBuilder sb = new StringBuilder(); sb.append(String.format("Count %-14s: %s\n", "Bitstream", String.valueOf(bitstreamService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Bundle", String.valueOf(bundleService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Collection", String.valueOf(collectionService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Community", String.valueOf(communityService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "MetadataValue", String.valueOf(metadataValueService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "EPerson", String.valueOf(ePersonService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Item", String.valueOf(itemService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Handle", String.valueOf(handleService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "Group", String.valueOf(groupService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "BasicWorkflowItem", String.valueOf(basicWorkflowItemService.countTotal(context)))); sb.append(String.format("Count %-14s: %s\n", "WorkspaceItem", String.valueOf(workspaceItemService.countTotal(context)))); return sb.toString(); }
/** * Attempt to find an EPerson based on string ID * * @param context DSpace context * @param strID string identifier * @return EPerson object (if found) * @throws SQLException if database error */ protected EPerson getEPersonFromString(Context context, String strID) throws SQLException { EPerson eperson; try { UUID ePersonId = UUID.fromString(strID); eperson = ePersonService.find(context, ePersonId); } catch (Exception e) { eperson = ePersonService.findByLegacyId(context, Integer.parseInt(strID)); } return eperson; }
/** * Set EPerson doing import * * @param context DSpace Context * @param eperson EPerson obj * @throws Exception if error */ protected void setEPerson(Context context, String eperson) throws Exception { if (eperson == null) { pr("Error - an eperson to do the importing must be specified"); pr(" (run with -h flag for details)"); throw new Exception("EPerson not specified."); } EPerson myEPerson = null; if (eperson.indexOf('@') != -1) { // @ sign, must be an email myEPerson = epersonService.findByEmail(context, eperson); } else { myEPerson = epersonService.find(context, UUID.fromString(eperson)); } if (myEPerson == null) { pr("Error, eperson cannot be found: " + eperson); throw new Exception("Invalid EPerson"); } context.setCurrentUser(myEPerson); }
EPerson person = ePersonService.findByEmail(context, email); checkSelectCollectionForUser(person); peopleChecked++; List<EPerson> people = ePersonService.findAll(context, EPerson.EMAIL); for (EPerson person : people) { checkSelectCollectionForUser(person);
eperson = ePersonService.findByNetid(context, netid); foundEmail = true; email = email.toLowerCase(); eperson = ePersonService.findByEmail(context, email); foundRemoteUser = true; email = email.toLowerCase(); eperson = ePersonService.findByEmail(context, email);
/** * <p> * Return the EPerson corresponding to token, where token was emailed to the * person by either the sendRegistrationInfo or sendForgotPasswordInfo * methods. * </p> * * <p> * If the token is not found return null. * </p> * * @param context DSpace context * @param token Account token * @return The EPerson corresponding to token, or null. * @throws SQLException If the token or eperson cannot be retrieved from the * database. */ @Override public EPerson getEPerson(Context context, String token) throws SQLException, AuthorizeException { String email = getEmail(context, token); if (email == null) { return null; } return ePersonService.findByEmail(context, email); }
collider = ePersonService.findByEmail(context, identity); collider = ePersonService.findByNetid(context, identity); } else { throw new PackageException("EPerson has neither email nor netid."); eperson = ePersonService.create(context); log.info("Created EPerson {}.", identity); throw new PackageValidationException("Unable to decode hexadecimal password hash or salt", ex); ePersonService.setPasswordHash(eperson, password); } else { ePersonService.setPasswordHash(eperson, null); ePersonService.update(context, eperson); Element member = (Element) members.item(memberx); String memberName = member.getAttribute(RoleDisseminator.NAME); EPerson memberEPerson = ePersonService.findByEmail(context, memberName); if (null != memberEPerson) { groupService.addMember(context, groupObj, memberEPerson);
try { if (command.hasOption(OPT_NETID.getOpt())) { eperson = ePersonService.findByNetid(context, command.getOptionValue(OPT_NETID.getOpt())); } else if (command.hasOption(OPT_EMAIL.getOpt())) { eperson = ePersonService.findByEmail(context, command.getOptionValue(OPT_EMAIL.getOpt())); } else { System.err.println("You must specify the user's email address or netid."); ePersonService.delete(context, eperson); context.complete(); System.out.printf("Deleted EPerson %s\n", eperson.getID().toString());
Date date = (Date) stamp.getValue(); EPerson ePerson; ePerson = ePersonService.findByEmail(ctx, name); if (null == ePerson) { ePerson = ePersonService.findByNetid(ctx, name); } else { ePerson.setLastActive(date); ePersonService.update(ctx, ePerson);
EPerson sub = ePersonService.findByEmail(context, value); sub = ePersonService.create(context); sub.setEmail(value); sub.setCanLogIn(false); ePersonService.update(context, sub); } else { log.warn(
EPerson eperson = ePersonService.findByEmail(context, email); eperson = ePersonService.create(context); eperson.setEmail(email); eperson.setCanLogIn(true); eperson.setFirstName(context, first); eperson.setLanguage(context, language); ePersonService.setPassword(eperson, pw); ePersonService.update(context, eperson);
eperson = ePersonService.create(context); } catch (SQLException ex) { context.abort(); eperson.setLanguage(context, command.getOptionValue(OPT_LANGUAGE.getOpt(), Locale.getDefault().getLanguage())); ePersonService.setMetadata(context, eperson, "phone", command.getOptionValue(OPT_PHONE.getOpt())); eperson.setNetid(command.getOptionValue(OPT_NETID.getOpt())); ePersonService.setPassword(eperson, command.getOptionValue('p')); if (command.hasOption(OPT_REQUIRE_CERTIFICATE.getOpt())) { eperson.setRequireCertificate(Boolean.valueOf(command.getOptionValue( ePersonService.update(context, eperson); context.complete(); System.out.printf("Created EPerson %s\n", eperson.getID().toString());
List<EPerson> epeople = ePersonService.findNotActiveSince(myContext, before); List<String> whyNot = ePersonService.getDeleteConstraints(myContext, account); if (!whyNot.isEmpty()) { System.out.print("\tCannot be deleted; referenced in"); } else { try { ePersonService.delete(myContext, account); } catch (AuthorizeException | IOException ex) { System.err.println(ex.getMessage());
int resultCount = ePersonService.searchResultCount(c, query); List<EPerson> epeople = ePersonService.search(c, query, page * RESULTS_PER_PAGE, RESULTS_PER_PAGE); EPerson reviewer = ePersonService.find(c, reviewerId);
eperson = ePersonService.find(context, oldEPerson.getID()); context.setCurrentUser(eperson); context.turnOffAuthorisationSystem();
EPerson person = ePersonService.findByEmail(context, personEmail); person = ePersonService.findByNetid(context, personEmail);
EPerson eperson = ePersonService.findByEmail(context, email); System.out.println("Harvest started... "); context.setCurrentUser(eperson);