/** * Throws an exception if the updatedVisibility is different than the original visibility * * @param updatedVisibility * @param originalVisibility * */ private static void validateVisibilityDoesntChange(Visibility updatedVisibility, Visibility originalVisibility) { if(updatedVisibility != null) { if(originalVisibility == null) { throw new VisibilityMismatchException(); } if(!updatedVisibility.value().equals(originalVisibility.value())) { throw new VisibilityMismatchException(); } } }
public static Visibility valueOf(org.orcid.jaxb.model.v3.rc2.common.Visibility visibility) { Visibility v = new Visibility(); v.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.value())); return v; }
public PersonExternalIdentifier toPersonExternalIdentifier() { PersonExternalIdentifier result = new PersonExternalIdentifier(); if(putCode != null) { result.setPutCode(Long.valueOf(putCode)); } result.setDisplayIndex(displayIndex); if(visibility != null && visibility.getVisibility() != null) { result.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } if(url != null) { result.setUrl(new Url(url)); } result.setType(commonName); result.setValue(reference); return result; }
public OtherName toOtherName() { OtherName otherName = new OtherName(); if (!PojoUtil.isEmpty(this.getContent())) { otherName.setContent(this.getContent()); } if (this.visibility != null && this.visibility.getVisibility() != null) { otherName.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { otherName.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { otherName.setDisplayIndex(displayIndex); } else { otherName.setDisplayIndex(0L); } otherName.setSource(new Source(source)); return otherName; }
public Address toAddress() { Address address = new Address(); if (this.iso2Country != null && this.iso2Country.getValue() != null) { Country country = new Country(); country.setValue(Iso3166Country.fromValue(this.iso2Country.getValue().value())); address.setCountry(country); } if (this.visibility != null && this.visibility.getVisibility() != null) { address.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { address.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { address.setDisplayIndex(displayIndex); } else { address.setDisplayIndex(0L); } address.setSource(new Source(source)); return address; }
public ResearcherUrl toResearcherUrl() { ResearcherUrl researcherUrl = new ResearcherUrl(); if (!PojoUtil.isEmpty(this.getUrl())) { researcherUrl.setUrl(new Url(this.getUrl().getValue())); } if (!PojoUtil.isEmpty(this.getUrlName())) { researcherUrl.setUrlName(this.getUrlName()); } if (this.visibility != null && this.visibility.getVisibility() != null) { researcherUrl.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { researcherUrl.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { researcherUrl.setDisplayIndex(displayIndex); } else { researcherUrl.setDisplayIndex(0L); } researcherUrl.setSource(new Source(source)); return researcherUrl; }
public Keyword toKeyword() { Keyword keyword = new Keyword(); if (!PojoUtil.isEmpty(putCode)) { keyword.setPutCode(Long.valueOf(putCode)); } if (!PojoUtil.isEmpty(content)) { keyword.setContent(content); } if (visibility != null && visibility.getVisibility() != null) { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } else { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(OrcidVisibilityDefaults.KEYWORD_DEFAULT.getVisibility().value())); } if (createdDate != null) { keyword.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(createdDate.toCalendar()))); } if (lastModified != null) { keyword.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified.toCalendar()))); } if (displayIndex != null) { keyword.setDisplayIndex(displayIndex); } else { keyword.setDisplayIndex(0L); } keyword.setSource(new Source(source)); return keyword; }
public Name toName() { Name name = new Name(); if(!PojoUtil.isEmpty(givenNames)) { name.setGivenNames(new GivenNames(givenNames.getValue())); } if(!PojoUtil.isEmpty(familyName)) { name.setFamilyName(new FamilyName(familyName.getValue())); } if(!PojoUtil.isEmpty(creditName)) { name.setCreditName(new CreditName(creditName.getValue())); } if(visibility != null && visibility.getVisibility() != null) { name.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } else { name.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(OrcidVisibilityDefaults.NAMES_DEFAULT.getVisibility().value())); } return name; }
.fromValue(claim.getActivitiesVisibilityDefault().getVisibility().value()); if (profile.getBiographyEntity() != null) { profile.getBiographyEntity().setVisibility(defaultVisibility.name());
affiliation.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value()));
.fromValue(claim.getActivitiesVisibilityDefault().getVisibility().value()); if (profile.getBiographyEntity() != null) { profile.getBiographyEntity().setVisibility(defaultVisibility.name());
result.setUrl(new Url()); if (visibility != null) result.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value()));
work.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value()));