use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class ProfileEntityManagerImpl method retrivePublicDisplayName.
@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.fromValue(recordName.getVisibility().value()) : 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;
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class ProfileKeywordManagerImpl method setIncomingPrivacy.
private void setIncomingPrivacy(ProfileKeywordEntity entity, ProfileEntity profile) {
org.orcid.jaxb.model.common_v2.Visibility incomingKeywordVisibility = entity.getVisibility();
org.orcid.jaxb.model.common_v2.Visibility defaultKeywordVisibility = (profile.getActivitiesVisibilityDefault() == null) ? org.orcid.jaxb.model.common_v2.Visibility.PRIVATE : org.orcid.jaxb.model.common_v2.Visibility.fromValue(profile.getActivitiesVisibilityDefault().value());
if (profile.getClaimed() != null && profile.getClaimed()) {
entity.setVisibility(defaultKeywordVisibility);
} else if (incomingKeywordVisibility == null) {
entity.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class AddressManagerImpl method setIncomingPrivacy.
private void setIncomingPrivacy(AddressEntity entity, ProfileEntity profile) {
org.orcid.jaxb.model.common_v2.Visibility incomingCountryVisibility = entity.getVisibility();
org.orcid.jaxb.model.common_v2.Visibility defaultCountryVisibility = (profile.getActivitiesVisibilityDefault() == null) ? org.orcid.jaxb.model.common_v2.Visibility.PRIVATE : org.orcid.jaxb.model.common_v2.Visibility.fromValue(profile.getActivitiesVisibilityDefault().value());
if (profile.getClaimed() != null && profile.getClaimed()) {
entity.setVisibility(defaultCountryVisibility);
} else if (incomingCountryVisibility == null) {
entity.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class ExternalIdentifierManagerImpl method setIncomingPrivacy.
private void setIncomingPrivacy(ExternalIdentifierEntity entity, ProfileEntity profile) {
org.orcid.jaxb.model.common_v2.Visibility incomingExternalIdentifierVisibility = entity.getVisibility();
org.orcid.jaxb.model.common_v2.Visibility defaultExternalIdentifierVisibility = (profile.getActivitiesVisibilityDefault() == null) ? org.orcid.jaxb.model.common_v2.Visibility.PRIVATE : org.orcid.jaxb.model.common_v2.Visibility.fromValue(profile.getActivitiesVisibilityDefault().value());
if (profile.getClaimed() != null && profile.getClaimed()) {
entity.setVisibility(defaultExternalIdentifierVisibility);
} else if (incomingExternalIdentifierVisibility == null) {
entity.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class AffiliationsManagerImpl method setIncomingWorkPrivacy.
private void setIncomingWorkPrivacy(OrgAffiliationRelationEntity orgAffiliationRelationEntity, ProfileEntity profile) {
Visibility incomingElementVisibility = orgAffiliationRelationEntity.getVisibility();
Visibility defaultElementVisibility = profile.getActivitiesVisibilityDefault();
if (profile.getClaimed()) {
orgAffiliationRelationEntity.setVisibility(defaultElementVisibility);
} else if (incomingElementVisibility == null) {
orgAffiliationRelationEntity.setVisibility(Visibility.PRIVATE);
}
}
Aggregations