public static void setPathToResearcherUrl(ResearcherUrl researcherUrl, String orcid) { if(researcherUrl != null) { researcherUrl.setPath(RESEARCHER_URLS.replace("{orcid}", orcid) + '/' + researcherUrl.getPutCode()); } }
private boolean isDuplicated(ResearcherUrlEntity existing, ResearcherUrl newResearcherUrl, Source activeSource) { if (!existing.getId().equals(newResearcherUrl.getPutCode())) { //If they have the same source String existingSourceId = existing.getElementSourceId(); // If they have the same source if (!PojoUtil.isEmpty(existingSourceId) && SourceEntityUtils.isTheSameForDuplicateChecking(activeSource,existing)) { // If the url is the same if (existing.getUrl() != null && existing.getUrl().equals(newResearcherUrl.getUrl().getValue())) { return true; } } } return false; }
if(researcherUrl.getPutCode() != null) { throw InvalidPutCodeException.forSource(activeSource); if(researcherUrl.getPutCode() == null) { Map<String, String> params = new HashMap<String, String>(); throw new PutCodeRequiredException(params);
@Override @Transactional public ResearcherUrl updateResearcherUrl(String orcid, ResearcherUrl researcherUrl, boolean isApiRequest) { ResearcherUrlEntity updatedResearcherUrlEntity = researcherUrlDao.getResearcherUrl(orcid, researcherUrl.getPutCode()); Visibility originalVisibility = Visibility.valueOf(updatedResearcherUrlEntity.getVisibility()); Source activeSource = sourceManager.retrieveActiveSource();
if(researcherUrls.getResearcherUrls() != null) { for(ResearcherUrl updatedOrNew : researcherUrls.getResearcherUrls()) { if(existingEntity.getId().equals(updatedOrNew.getPutCode())) { deleteMe = false; break; if(updatedOrNew.getPutCode() != null) { if(existingEntity.getId().equals(updatedOrNew.getPutCode())) { existingEntity.setLastModified(new Date()); existingEntity.setVisibility(updatedOrNew.getVisibility().name());
if (researcherUrl.getPutCode() != null) { form.setPutCode(String.valueOf(researcherUrl.getPutCode()));