public void downGradeToExternalIdentifiersOnly() { setContactDetails(null); setKeywords(null); setPersonalDetails(null); setScope(null); setBiography(null); }
private void assignPersistenceFields(OrcidProfile profile) { // set the transient fields that the encrypters need profile.setPassword("password"); // profile.setOrcidIdentifier(); profile.setSecurityQuestionAnswer("securityQuestionAnswer"); profile.setVerificationCode("1111"); // randomise any fields that are uniquely constrained so that we can // re-use the test data profile.getOrcidBio().getContactDetails().addOrReplacePrimaryEmail(new Email(RandomStringUtils.randomAlphabetic(150))); Keywords keywords = new Keywords(); keywords.getKeyword().add(new Keyword(RandomStringUtils.randomAlphabetic(255), Visibility.PUBLIC)); profile.getOrcidBio().setKeywords(keywords); profile.retrieveOrcidWorks().getOrcidWork(); }
@Override public void copyUpdatedKeywordsToExistingPreservingVisibility(OrcidBio existing, OrcidBio updated) { if (updated.getKeywords() == null) { return; } Visibility existingKeywordsVisibility = existing.getKeywords() != null && existing.getKeywords().getVisibility() != null ? existing.getKeywords().getVisibility() : OrcidVisibilityDefaults.KEYWORD_DEFAULT.getVisibility(); Visibility updatedKeywordsVisibility = updated.getKeywords().getVisibility() != null ? updated.getKeywords().getVisibility() : existingKeywordsVisibility; Keywords updatedKeywords = updated.getKeywords(); updatedKeywords.setVisibility(updatedKeywordsVisibility); existing.setKeywords(updatedKeywords); }
private OrcidBio getOrcidBio(ProfileEntity profileEntity) { OrcidBio orcidBio = new OrcidBio(); orcidBio.setContactDetails(getContactDetails(profileEntity)); orcidBio.setExternalIdentifiers(getExternalIdentifiers(profileEntity)); orcidBio.setDelegation(getDelegation(profileEntity)); orcidBio.setPersonalDetails(getPersonalDetails(profileEntity)); orcidBio.setKeywords(getKeywords(profileEntity)); orcidBio.setBiography(getBiography(profileEntity)); orcidBio.setResearcherUrls(getResearcherUrls(profileEntity)); return orcidBio; }