existingActivities.setOrcidWorks(existingOrcidWorks); checkUserCanHoldMoreElement(existingProfile.retrieveOrcidWorks(), updatedOrcidProfile.retrieveOrcidWorks()); orcidJaxbCopyManager.copyUpdatedWorksPreservingVisbility(existingProfile.retrieveOrcidWorks(), updatedOrcidProfile.retrieveOrcidWorks()); OrcidProfile profileToReturn = updateOrcidProfile(existingProfile); notificationManager.sendAmendEmail(updatedOrcidProfile.getOrcidIdentifier().getPath(), AmendedSection.WORK, 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(); }
throw new IllegalArgumentException("No record found for " + orcid); OrcidWorks existingOrcidWorks = existingProfile.retrieveOrcidWorks(); OrcidWorks updatedOrcidWorks = updatedOrcidProfile.retrieveOrcidWorks(); Visibility workVisibilityDefault = existingProfile.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue(); Boolean claimed = existingProfile.getOrcidHistory().isClaimed(); updatedOrcidWorksList = updatedOrcidWorks.getOrcidWork(); checkUserCanHoldMoreElement(existingProfile.retrieveOrcidWorks(), updatedOrcidProfile.retrieveOrcidWorks());
@Override protected void doInTransactionWithoutResult(TransactionStatus status) { OrcidProfile orcidProfile = orcidProfileManager.retrieveOrcidProfile(orcid); OrcidWorks orcidWorks = orcidProfile.retrieveOrcidWorks(); if (orcidWorks != null) { for (OrcidWork orcidWork : orcidWorks.getOrcidWork()) { WorkContributors workContributors = orcidWork.getWorkContributors(); if (workContributors != null) { for (Contributor contributor : workContributors.getContributor()) { ContributorOrcid contributorOrcid = contributor.getContributorOrcid(); if (contributorOrcid != null) { String orcid = contributorOrcid.getPath(); ProfileEntity contributorProfile = profileDao.find(orcid); if(contributorProfile.getRecordNameEntity() != null && contributorProfile.getRecordNameEntity().getVisibility() != null) { if (!Visibility.PUBLIC.name().equals(contributorProfile.getRecordNameEntity().getVisibility())) { contributor.setCreditName(null); } } } } } } } orcidProfileManager.updateOrcidProfile(orcidProfile); } });
List<OrcidWork> orcidWorks = filteredProfile.retrieveOrcidWorks() != null ? filteredProfile.retrieveOrcidWorks().getOrcidWork() : null; if (orcidWorks != null) { List<String> workTitles = new ArrayList<String>();
OrcidWorks fullOrcidWorks = orcidProfile.retrieveOrcidWorks(); if (fullOrcidWorks != null && !fullOrcidWorks.getOrcidWork().isEmpty()) {
OrcidWorks fullOrcidWorks = orcidProfile.retrieveOrcidWorks(); if (fullOrcidWorks != null && !fullOrcidWorks.getOrcidWork().isEmpty()) {