@Override public int compareTo(ResearcherUrl o) { if(o == null || o.getUrlName() == null) { return 1; } if(getUrlName() == null) { return -1; } int urlNameComp = this.getUrlName().compareTo(o.getUrlName()); if(urlNameComp == 0) { if(o.getUrl() == null) { return 1; } if(this.getUrl() == null) { return -1; } return this.getUrl().compareTo(o.getUrl()); } return 0; } }
private boolean isDuplicated(ResearcherUrlEntity existing, ResearcherUrl newResearcherUrl, SourceEntity source) { 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) && existingSourceId.equals(SourceEntityUtils.getSourceId(source))) { // If the url is the same if (existing.getUrl() != null && existing.getUrl().equals(newResearcherUrl.getUrl().getValue())) { return true; } } } return false; }
return; if(PojoUtil.isEmpty(researcherUrl.getUrl().getValue())) { String message = "Url field must not be empty"; LOGGER.error(message); throw new OrcidValidationException(message); } else { if(SiteConstants.URL_MAX_LENGTH < researcherUrl.getUrl().getValue().length()) { String message = "Url field must not be longer than " + SiteConstants.URL_MAX_LENGTH + " characters"; LOGGER.error(message);
doc.url.add(u.getUrl().getValue());
Individual page = m.createIndividual(url.getUrl().getValue(), null); String urlName = url.getUrlName(); if (isHomePage(urlName)) {
existingEntity.setLastModified(new Date()); existingEntity.setVisibility(updatedOrNew.getVisibility().name()); existingEntity.setUrl(updatedOrNew.getUrl().getValue()); existingEntity.setUrlName(updatedOrNew.getUrlName()); existingEntity.setDisplayIndex(updatedOrNew.getDisplayIndex());