use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class PeerReviewManagerImpl method setIncomingPrivacy.
private void setIncomingPrivacy(PeerReviewEntity entity, ProfileEntity profile) {
Visibility incomingVisibility = entity.getVisibility();
Visibility defaultVisibility = profile.getActivitiesVisibilityDefault();
if (profile.getClaimed()) {
entity.setVisibility(defaultVisibility);
} else if (incomingVisibility == null) {
entity.setVisibility(Visibility.PRIVATE);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class OtherNameManagerImpl method setIncomingPrivacy.
private void setIncomingPrivacy(OtherNameEntity entity, ProfileEntity profile) {
org.orcid.jaxb.model.common_v2.Visibility incomingOtherNameVisibility = entity.getVisibility();
org.orcid.jaxb.model.common_v2.Visibility defaultOtherNamesVisibility = (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()) {
entity.setVisibility(defaultOtherNamesVisibility);
} else if (incomingOtherNameVisibility == 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 ProfileFundingManagerImpl method setIncomingWorkPrivacy.
private void setIncomingWorkPrivacy(ProfileFundingEntity profileFundingEntity, ProfileEntity profile) {
Visibility incomingWorkVisibility = profileFundingEntity.getVisibility();
Visibility defaultWorkVisibility = profile.getActivitiesVisibilityDefault();
if (profile.getClaimed()) {
profileFundingEntity.setVisibility(defaultWorkVisibility);
} else if (incomingWorkVisibility == null) {
profileFundingEntity.setVisibility(Visibility.PRIVATE);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class WorkManagerImpl method setIncomingWorkPrivacy.
private void setIncomingWorkPrivacy(WorkEntity workEntity, ProfileEntity profile) {
Visibility incomingWorkVisibility = workEntity.getVisibility();
Visibility defaultWorkVisibility = profile.getActivitiesVisibilityDefault();
if (profile.getClaimed()) {
workEntity.setVisibility(defaultWorkVisibility);
} else if (incomingWorkVisibility == null) {
workEntity.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 ActivityValidator method validateEmployment.
public void validateEmployment(Employment employment, SourceEntity sourceEntity, boolean createFlag, boolean isApiRequest, Visibility originalVisibility) {
if (employment.getPutCode() != null && createFlag) {
Map<String, String> params = new HashMap<String, String>();
if (sourceEntity != null) {
params.put("clientName", sourceEntity.getSourceName());
}
throw new InvalidPutCodeException(params);
}
// Check that we are not changing the visibility
if (isApiRequest && !createFlag) {
Visibility updatedVisibility = employment.getVisibility();
validateVisibilityDoesntChange(updatedVisibility, originalVisibility);
}
}
Aggregations