public org.orcid.jaxb.model.v3.rc2.record.Emails toV3Emails() { org.orcid.jaxb.model.v3.rc2.record.Emails v3Emails = new org.orcid.jaxb.model.v3.rc2.record.Emails(); if(emails != null && !emails.isEmpty()) { for(Email email : emails) { v3Emails.getEmails().add(email.toV3Email()); } } return v3Emails; }
public static void calculateLastModified(Emails emails) { if (emails != null && emails.getEmails() != null && !emails.getEmails().isEmpty()) { LastModifiedDate latest = null; for (Email email : emails.getEmails()) { if (email.getLastModifiedDate() != null && email.getLastModifiedDate().after(latest)) { latest = email.getLastModifiedDate(); } } emails.setLastModifiedDate(latest); } }
public void setSourceName(Emails emails) { List<Email> list = emails.getEmails(); if (list != null) { for (SourceAware element : list) { setSourceName(element); } } }
public static void setPathToEmail(Emails emails, String orcid) { if(emails != null) { emails.setPath(EMAIL.replace("{orcid}", orcid) ); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addresses == null) ? 0 : addresses.hashCode()); result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((emails == null) ? 0 : emails.hashCode()); result = prime * result + ((externalIdentifiers == null) ? 0 : externalIdentifiers.hashCode()); result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((researcherUrls == null) ? 0 : researcherUrls.hashCode()); return result; }
if (other.emails != null) return false; } else if (!emails.equals(other.emails)) return false; if (externalIdentifiers == null) {
public static void calculateLastModified(Person person) { if (person != null) { calculateLastModified(person.getAddresses()); calculateLastModified(person.getEmails()); calculateLastModified(person.getExternalIdentifiers()); calculateLastModified(person.getKeywords()); calculateLastModified(person.getOtherNames()); calculateLastModified(person.getResearcherUrls()); LastModifiedDate l1 = person.getAddresses() == null ? null : person.getAddresses().getLastModifiedDate(); LastModifiedDate l2 = person.getEmails() == null ? null : person.getEmails().getLastModifiedDate(); LastModifiedDate l3 = person.getExternalIdentifiers() == null ? null : person.getExternalIdentifiers().getLastModifiedDate(); LastModifiedDate l4 = person.getKeywords() == null ? null : person.getKeywords().getLastModifiedDate(); LastModifiedDate l5 = person.getOtherNames() == null ? null : person.getOtherNames().getLastModifiedDate(); LastModifiedDate l6 = person.getResearcherUrls() == null ? null : person.getResearcherUrls().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5, l6); person.setLastModifiedDate(globalLatest); } }
public static Emails valueOf(org.orcid.jaxb.model.v3.rc2.record.Emails e) { Emails emails = new Emails(); if (e != null && !e.getEmails().isEmpty()) { emails.setEmails(new ArrayList<Email>()); for (org.orcid.jaxb.model.v3.rc2.record.Email v3Email : e.getEmails()) { emails.getEmails().add(Email.valueOf(v3Email)); } } return emails; }
@Override public void sendVerificationEmailToNonPrimaryEmails(String userOrcid) { emailManager.getEmails(userOrcid).getEmails().stream().filter(e -> !e.isPrimary()).map(e -> e.getEmail()).forEach(e -> { sendVerificationEmail(userOrcid, e); }); }
public Boolean doInTransaction(TransactionStatus status) { boolean wasDeprecated = profileDao.deprecateProfile(deprecatedOrcid, primaryOrcid, deprecatedMethod, adminUser); // If it was successfully deprecated if (wasDeprecated) { LOGGER.info("Account {} was deprecated to primary account: {}", deprecatedOrcid, primaryOrcid); clearRecord(deprecatedOrcid, false); // Move all email's to the primary record Emails deprecatedAccountEmails = emailManager.getEmails(deprecatedOrcid); if (deprecatedAccountEmails != null) { // For each email in the deprecated profile for (Email email : deprecatedAccountEmails.getEmails()) { // Delete each email from the deprecated // profile LOGGER.info("About to move email {} from profile {} to profile {}", new Object[] { email.getEmail(), deprecatedOrcid, primaryOrcid }); emailManager.moveEmailToOtherAccount(email.getEmail(), deprecatedOrcid, primaryOrcid); } } profileDao.updateLastModifiedDateAndIndexingStatus(deprecatedOrcid, IndexingStatus.REINDEX); return true; } return false; } });
checkAndFilter(orcid, person.getEmails().getEmails(), READ_BIO_REQUIRED_SCOPE, true);
for (Email email : emails.getEmails()) { if (email.isVerified()) { verfiedEmail = true;