use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class ActivityValidator method validateEducation.
public void validateEducation(Education education, SourceEntity sourceEntity, boolean createFlag, boolean isApiRequest, Visibility originalVisibility) {
if (education.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 = education.getVisibility();
validateVisibilityDoesntChange(updatedVisibility, originalVisibility);
}
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getAddressesElement.
private Addresses getAddressesElement(Visibility... vs) {
Addresses elements = new Addresses();
for (Visibility v : vs) {
Address element = new Address();
element.setVisibility(v);
if (elements.getAddress() == null) {
elements.setAddress(new ArrayList<Address>());
}
elements.getAddress().add(element);
}
return elements;
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getPersonElement.
private Person getPersonElement() {
Visibility[] vs = { Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC };
Person p = new Person();
p.setAddresses(getAddressesElement(vs));
p.setEmails(getEmailsElement(vs));
p.setExternalIdentifiers(getPersonExternalIdentifiersElement(vs));
p.setKeywords(getKeywordsElement(vs));
p.setOtherNames(getOtherNamesElement(vs));
p.setResearcherUrls(getResearcherUrlsElement(vs));
Name name = new Name();
name.setVisibility(Visibility.PUBLIC);
p.setName(name);
Biography b = new Biography();
b.setVisibility(Visibility.PUBLIC);
b.setContent("Biography test");
p.setBiography(b);
return p;
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getEmployments.
private Employments getEmployments(Visibility... vs) {
Employments e = new Employments();
for (Visibility v : vs) {
EmploymentSummary s = new EmploymentSummary();
s.setVisibility(v);
e.getSummaries().add(s);
}
return e;
}
use of org.orcid.jaxb.model.common_rc1.Visibility in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getEmailsElement.
private Emails getEmailsElement(Visibility... vs) {
Emails elements = new Emails();
for (Visibility v : vs) {
Email element = new Email();
element.setVisibility(v);
if (elements.getEmails() == null) {
elements.setEmails(new ArrayList<Email>());
}
elements.getEmails().add(element);
}
return elements;
}
Aggregations