use of org.orcid.jaxb.model.message.OrcidActivities in project ORCID-Source by ORCID.
the class OrcidProfileManagerImpl method dedupeAffiliations.
private void dedupeAffiliations(OrcidProfile orcidProfile) {
OrcidActivities orcidActivities = orcidProfile.getOrcidActivities();
if (orcidActivities != null) {
Affiliations affiliations = orcidActivities.getAffiliations();
if (affiliations != null) {
Affiliations dedupedAffiliations = dedupeAffiliations(affiliations);
orcidActivities.setAffiliations(dedupedAffiliations);
}
}
}
use of org.orcid.jaxb.model.message.OrcidActivities in project ORCID-Source by ORCID.
the class OrcidProfileManagerImpl method dedupeFundings.
private void dedupeFundings(OrcidProfile orcidProfile) {
OrcidActivities orcidActivities = orcidProfile.getOrcidActivities();
if (orcidActivities != null) {
FundingList fungins = orcidActivities.getFundings();
if (fungins != null) {
FundingList dedupedFundings = dedupeFundings(fungins);
orcidActivities.setFundings(dedupedFundings);
}
}
}
use of org.orcid.jaxb.model.message.OrcidActivities in project ORCID-Source by ORCID.
the class OrcidProfileManagerImpl method updateFundings.
@Override
@Transactional
public OrcidProfile updateFundings(OrcidProfile updatedOrcidProfile) {
OrcidProfile existingProfile = retrieveOrcidProfile(updatedOrcidProfile.getOrcidIdentifier().getPath());
if (existingProfile == null) {
return null;
}
FundingList updatedFundingList = updatedOrcidProfile.retrieveFundings();
if (updatedFundingList == null) {
return null;
} else {
// Parse the amount in the new funding
setFundingAmountsWithTheCorrectFormat(updatedOrcidProfile);
// Update the funding list with the new values
updatedFundingList = updatedOrcidProfile.retrieveFundings();
}
OrcidActivities existingActivities = existingProfile.getOrcidActivities();
if (existingActivities == null) {
existingActivities = new OrcidActivities();
existingProfile.setOrcidActivities(existingActivities);
}
FundingList existingFundingList = existingActivities.getFundings();
if (existingFundingList == null) {
existingFundingList = new FundingList();
existingActivities.setFundings(existingFundingList);
}
orcidJaxbCopyManager.copyFundingListToExistingPreservingVisibility(existingFundingList, updatedFundingList);
OrcidProfile profileToReturn = updateOrcidProfile(existingProfile, UpdateOptions.FUNDINGS_ONLY);
notificationManager.sendAmendEmail(profileToReturn, AmendedSection.FUNDING);
return profileToReturn;
}
use of org.orcid.jaxb.model.message.OrcidActivities in project ORCID-Source by ORCID.
the class OrcidProfileManagerImpl method dedupeWorks.
private void dedupeWorks(OrcidProfile orcidProfile) {
OrcidActivities orcidActivities = orcidProfile.getOrcidActivities();
if (orcidActivities != null) {
OrcidWorks orcidWorks = orcidActivities.getOrcidWorks();
if (orcidWorks != null) {
OrcidWorks dedupedOrcidWorks = dedupeWorks(orcidWorks);
orcidActivities.setOrcidWorks(dedupedOrcidWorks);
}
}
}
use of org.orcid.jaxb.model.message.OrcidActivities in project ORCID-Source by ORCID.
the class OrcidMessageUtil method setSourceName.
public void setSourceName(OrcidProfile orcidProfile) {
if (orcidProfile != null) {
if (orcidProfile.getOrcidActivities() != null) {
OrcidActivities orcidActivities = orcidProfile.getOrcidActivities();
if (orcidActivities.getAffiliations() != null) {
Affiliations affs = orcidActivities.getAffiliations();
List<Affiliation> affList = affs.getAffiliation();
if (affList != null) {
for (Affiliation aff : affList) {
setSourceName(aff);
}
}
}
if (orcidActivities.getFundings() != null) {
FundingList fundingList = orcidActivities.getFundings();
List<Funding> fundings = fundingList.getFundings();
if (fundings != null) {
for (Funding funding : fundings) {
setSourceName(funding);
}
}
}
if (orcidActivities.getOrcidWorks() != null) {
OrcidWorks orcidWorks = orcidActivities.getOrcidWorks();
List<OrcidWork> works = orcidWorks.getOrcidWork();
if (works != null) {
for (OrcidWork work : works) {
setSourceName(work);
}
}
}
}
if (orcidProfile.getOrcidBio() != null) {
OrcidBio orcidBio = orcidProfile.getOrcidBio();
if (orcidBio.getContactDetails() != null) {
Address address = orcidBio.getContactDetails().getAddress();
if (address != null) {
setSourceName(address);
}
}
if (orcidBio.getExternalIdentifiers() != null) {
ExternalIdentifiers extIds = orcidBio.getExternalIdentifiers();
List<ExternalIdentifier> extIdsList = extIds.getExternalIdentifier();
if (extIdsList != null) {
for (ExternalIdentifier extId : extIdsList) {
setSourceName(extId);
}
}
}
if (orcidBio.getKeywords() != null) {
Keywords keywords = orcidBio.getKeywords();
List<Keyword> keywordList = keywords.getKeyword();
if (keywordList != null) {
for (Keyword keyword : keywordList) {
setSourceName(keyword);
}
}
}
if (orcidBio.getPersonalDetails() != null) {
OtherNames otherNames = orcidBio.getPersonalDetails().getOtherNames();
if (otherNames != null) {
List<OtherName> otherNameList = otherNames.getOtherName();
if (otherNameList != null) {
for (OtherName otherName : otherNameList) {
setSourceName(otherName);
}
}
}
}
if (orcidBio.getResearcherUrls() != null) {
ResearcherUrls rUrls = orcidBio.getResearcherUrls();
List<ResearcherUrl> rUrlList = rUrls.getResearcherUrl();
if (rUrlList != null) {
for (ResearcherUrl rUrl : rUrlList) {
setSourceName(rUrl);
}
}
}
}
}
}
Aggregations