public LinkedHashMap<Long, Funding> fundingMap(String orcid) { List<Funding> fundings = profileFundingManager.getFundingList(orcid); LinkedHashMap<Long, Funding> fundingMap = new LinkedHashMap<>(); if (fundings != null) { for (Funding funding : fundings) { if (funding.getVisibility().equals(Visibility.PUBLIC)) fundingMap.put(Long.valueOf(funding.getPutCode()), funding); } } return fundingMap; }
public LinkedHashMap<Long, Affiliation> affiliationMap(String orcid) { LinkedHashMap<Long, Affiliation> affiliationMap = new LinkedHashMap<>(); List<Affiliation> affiliations = affiliationsManager.getAffiliations(orcid); for(Affiliation affiliation : affiliations) { if(Visibility.PUBLIC.equals(affiliation.getVisibility())) { affiliationMap.put(affiliation.getPutCode(), affiliation); } } return affiliationMap; }
private static void validateVisibilityDoesntChange(Visibility updatedVisibility, Visibility originalVisibility) { if (updatedVisibility != null) { if (originalVisibility == null) { throw new VisibilityMismatchException(); } if (!updatedVisibility.equals(originalVisibility)) { throw new VisibilityMismatchException(); } } }
@Override public Biography getPublicBiography(String orcid) { Biography bio = getBiography(orcid); if(bio != null && org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.equals(bio.getVisibility())) { return bio; } return null; }
public LinkedHashMap<Long, PeerReview> pubPeerReviewsMap(String orcid) { List<PeerReview> peerReviews = peerReviewManager.findPeerReviews(orcid); LinkedHashMap<Long, PeerReview> peerReviewMap = new LinkedHashMap<>(); if (peerReviews != null) { if (!peerReviews.isEmpty()) { for(PeerReview peerReview : peerReviews) { if(peerReview.getVisibility().equals(Visibility.PUBLIC)) { peerReviewMap.put(peerReview.getPutCode(), peerReview); } } } } return peerReviewMap; }
private int declaredPosition() { for (int i = 0; i < Visibility.values().length; i++) { if (this.equals(Visibility.values()[i])) { return i; } } return -1; }
@Override public boolean updateDefaultVisibility(String orcid, Visibility newValue) { if (newValue == null) { throw new IllegalArgumentException(); } boolean updated = profileDao.updateDefaultVisibility(orcid, newValue.name()); if (updated) { if (Visibility.LIMITED.equals(newValue)) { profileHistoryEventManager.recordEvent(ProfileHistoryEventType.SET_DEFAULT_VIS_TO_LIMITED, orcid); } if (Visibility.PRIVATE.equals(newValue)) { profileHistoryEventManager.recordEvent(ProfileHistoryEventType.SET_DEFAULT_VIS_TO_PRIVATE, orcid); } if (Visibility.PUBLIC.equals(newValue)) { profileHistoryEventManager.recordEvent(ProfileHistoryEventType.SET_DEFAULT_VIS_TO_PUBLIC, orcid); } } return updated; }
private void checkVisibility(VisibilityType element, ScopePathType requiredScope) { if (requiredScope.isReadOnlyScope()) { if (Visibility.PRIVATE.equals(element.getVisibility())) { throw new OrcidVisibilityException(); } } else { throw new IllegalArgumentException("Only 'read-only' scopes are allowed"); } }
if (Visibility.PUBLIC.equals(work.getVisibility())) { filteredElements.add(element); continue;
if (justPublic && !work.getVisibility().equals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC)) {
Fundings result = new Fundings(); for (FundingSummary funding : fundings) { if (justPublic && !funding.getVisibility().equals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC)) {
private String getMemberDisplayName(ProfileEntity member) { RecordNameEntity recordName = member.getRecordNameEntity(); if (recordName == null) { return StringUtils.EMPTY; } // If it is a member, return the credit name if (OrcidType.GROUP.equals(member.getOrcidType())) { return recordName.getCreditName(); } Visibility namesVisibilty = Visibility.valueOf(recordName.getVisibility()); if (Visibility.PUBLIC.equals(namesVisibilty)) { if (!PojoUtil.isEmpty(recordName.getCreditName())) { return recordName.getCreditName(); } else { String displayName = recordName.getGivenNames(); String familyName = recordName.getFamilyName(); if (StringUtils.isNotBlank(familyName)) { displayName += " " + familyName; } return displayName; } } return StringUtils.EMPTY; }
if (Visibility.PUBLIC.equals(element.getVisibility())) { try { checkScopes(ScopePathType.READ_PUBLIC);
for (EducationSummary summary : educationsList) { if (justPublic) { if (Visibility.PUBLIC.equals(summary.getVisibility())) { educations.getSummaries().add(summary); for (EmploymentSummary summary : employmentList) { if (justPublic) { if (Visibility.PUBLIC.equals(summary.getVisibility())) { employments.getSummaries().add(summary);
PeerReviews result = new PeerReviews(); for (PeerReviewSummary peerReview : peerReviews) { if (justPublic && !peerReview.getVisibility().equals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC)) {
if (name != null && !Visibility.PUBLIC.equals(name.getVisibility())) { personalDetails.setName(null); } else {
if (Visibility.PUBLIC.equals(name.getVisibility())) { person.setName(name);
@Override public String retrivePublicDisplayName(String orcid) { String publicName = ""; ProfileEntity profile = profileEntityCacheManager.retrieve(orcid); if (profile != null) { RecordNameEntity recordName = profile.getRecordNameEntity(); if (recordName != null) { Visibility namesVisibility = (recordName.getVisibility() != null) ? Visibility.valueOf(recordName.getVisibility()) : Visibility.fromValue(OrcidVisibilityDefaults.NAMES_DEFAULT.getVisibility().value()); if (Visibility.PUBLIC.equals(namesVisibility)) { if (!PojoUtil.isEmpty(recordName.getCreditName())) { publicName = recordName.getCreditName(); } else { publicName = PojoUtil.isEmpty(recordName.getGivenNames()) ? "" : recordName.getGivenNames(); publicName += PojoUtil.isEmpty(recordName.getFamilyName()) ? "" : " " + recordName.getFamilyName(); } } } } return publicName; }