public void setSourceName(Emails emails) { List<Email> list = emails.getEmails(); if (list != null) { for (SourceAware element : list) { setSourceName(element); } } }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { LastModifiedDate theLastModifiedDate; theLastModifiedDate = this.getLastModifiedDate(); strategy.appendField(locator, this, "lastModifiedDate", buffer, theLastModifiedDate); } { List<EmailType> theEmail; theEmail = (((this.email!= null)&&(!this.email.isEmpty()))?this.getEmail():null); strategy.appendField(locator, this, "email", buffer, theEmail); } { String thePath; thePath = this.getPath(); strategy.appendField(locator, this, "path", buffer, thePath); } return buffer; }
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); } }
/** * Create an instance of {@link Emails } * */ public Emails createEmails() { return new Emails(); }
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); } }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public void setEmail(List<EmailType> value) { this.email = null; if (value!= null) { List<EmailType> draftl = this.getEmail(); draftl.addAll(value); } }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
@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 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; } });
private void createOpportunityContact(Contact contact, String opportunityId) { String accountId = contact.getAccountId(); String contactOrcid = contact.getOrcid(); if (StringUtils.isBlank(contact.getEmail())) { Email primaryEmail = emailManager.getEmails(contactOrcid).getEmails().stream().filter(e -> e.isPrimary()).findFirst().get(); contact.setEmail(primaryEmail.getEmail()); } List<Contact> existingContacts = salesForceDao.retrieveAllContactsByAccountId(accountId); Optional<Contact> existingContact = existingContacts.stream().filter(c -> { if ((contact.getOrcid() != null && contact.getOrcid().equals(c.getOrcid())) || (contact.getEmail() != null && contact.getEmail().equals(c.getEmail()))) { return true; } return false; }).findFirst(); String contactId = existingContact.isPresent() ? existingContact.get().getId() : salesForceDao.createContact(contact); OpportunityContactRole contactRole = new OpportunityContactRole(); contactRole.setContactId(contactId); contactRole.setRoleType(ContactRoleType.MAIN_CONTACT); contactRole.setOpportunityId(opportunityId); salesForceDao.createOpportunityContactRole(contactRole); addSalesForceConnection(accountId, contact); }
if (StringUtils.isBlank(contact.getEmail())) { String contactOrcid = contact.getOrcid(); Email primaryEmail = emailManager.getEmails(contactOrcid).getEmails().stream().filter(e -> e.isPrimary()).findFirst().get(); contact.setEmail(primaryEmail.getEmail());
for (Email email : emails.getEmails()) { if (email.isCurrent()) {
checkAndFilter(orcid, person.getEmails().getEmails(), READ_BIO_REQUIRED_SCOPE, true);
for (Email email : emails.getEmails()) { if (email.isVerified()) { verfiedEmail = true;