Search in sources :

Example 1 with SalesforceId

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;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) Email(org.orcid.jaxb.model.message.Email) OrcidBio(org.orcid.jaxb.model.message.OrcidBio) ContactDetails(org.orcid.jaxb.model.message.ContactDetails) OrcidHistory(org.orcid.jaxb.model.message.OrcidHistory) SalesforceId(org.orcid.jaxb.model.message.SalesforceId) CreditName(org.orcid.jaxb.model.message.CreditName) OrcidInternal(org.orcid.jaxb.model.message.OrcidInternal) SubmissionDate(org.orcid.jaxb.model.message.SubmissionDate) PersonalDetails(org.orcid.jaxb.model.message.PersonalDetails) Claimed(org.orcid.jaxb.model.message.Claimed) Date(java.util.Date) SubmissionDate(org.orcid.jaxb.model.message.SubmissionDate)

Example 2 with SalesforceId

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());
    }
}
Also used : ExternalIdentifier(org.orcid.jaxb.model.message.ExternalIdentifier) SalesforceId(org.orcid.jaxb.model.message.SalesforceId)

Aggregations

SalesforceId (org.orcid.jaxb.model.message.SalesforceId)2 Date (java.util.Date)1 Claimed (org.orcid.jaxb.model.message.Claimed)1 ContactDetails (org.orcid.jaxb.model.message.ContactDetails)1 CreditName (org.orcid.jaxb.model.message.CreditName)1 Email (org.orcid.jaxb.model.message.Email)1 ExternalIdentifier (org.orcid.jaxb.model.message.ExternalIdentifier)1 OrcidBio (org.orcid.jaxb.model.message.OrcidBio)1 OrcidHistory (org.orcid.jaxb.model.message.OrcidHistory)1 OrcidInternal (org.orcid.jaxb.model.message.OrcidInternal)1 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)1 PersonalDetails (org.orcid.jaxb.model.message.PersonalDetails)1 SubmissionDate (org.orcid.jaxb.model.message.SubmissionDate)1