use of org.orcid.jaxb.model.message.SalesforceId in project ORCID-Source by ORCID.
the class OrcidClientGroupManagerImpl method createGroupProfile.
private OrcidProfile createGroupProfile(OrcidClientGroup orcidClientGroup) {
OrcidProfile orcidProfile = new OrcidProfile();
orcidProfile.setType(OrcidType.GROUP);
orcidProfile.setGroupType(orcidClientGroup.getType());
OrcidHistory orcidHistory = new OrcidHistory();
orcidProfile.setOrcidHistory(orcidHistory);
orcidHistory.setClaimed(new Claimed(true));
orcidHistory.setSubmissionDate(new SubmissionDate(DateUtils.convertToXMLGregorianCalendar(new Date())));
OrcidBio orcidBio = new OrcidBio();
orcidProfile.setOrcidBio(orcidBio);
PersonalDetails personalDetails = new PersonalDetails();
orcidBio.setPersonalDetails(personalDetails);
personalDetails.setCreditName(new CreditName(orcidClientGroup.getGroupName()));
ContactDetails contactDetails = new ContactDetails();
orcidBio.setContactDetails(contactDetails);
Email primaryEmail = new Email(orcidClientGroup.getEmail());
primaryEmail.setVisibility(Visibility.PRIVATE);
primaryEmail.setVerified(true);
contactDetails.addOrReplacePrimaryEmail(primaryEmail);
if (!PojoUtil.isEmpty(orcidClientGroup.getSalesforceId())) {
OrcidInternal orcidInternal = new OrcidInternal();
orcidInternal.setSalesforceId(new SalesforceId(orcidClientGroup.getSalesforceId()));
orcidProfile.setOrcidInternal(orcidInternal);
}
return orcidProfile;
}
use of org.orcid.jaxb.model.message.SalesforceId in project ORCID-Source by ORCID.
the class OrcidMessageVersionConverterImplV1_2_rc4ToV1_2_rc5 method upgradeProfile.
private void upgradeProfile(OrcidProfile orcidProfile) {
if (orcidProfile != null) {
if (orcidProfile.getOrcidBio() != null)
if (orcidProfile.getOrcidBio().getExternalIdentifiers() != null)
for (ExternalIdentifier externalIdentifier : orcidProfile.getOrcidBio().getExternalIdentifiers().getExternalIdentifier()) {
externalIdentifier.setExternalIdSource(externalIdentifier.getExternalIdOrcid());
externalIdentifier.setExternalIdOrcid(null);
}
if (orcidProfile.getOrcidInternal() != null)
orcidProfile.getOrcidInternal().setSalesforceId(new SalesforceId());
}
}
Aggregations