private String getWorkExternalIdsJson(OrcidWork work) { if (work == null || work.getWorkExternalIdentifiers() == null) { return null; } JSONWorkExternalIdentifiersConverterV1 converter = new JSONWorkExternalIdentifiersConverterV1(); return converter.convertTo(work.getWorkExternalIdentifiers(), work.getWorkType()); }
return false; if (this.getWorkType() == null) { if (other.getWorkType() != null) return false; } else if (!this.getWorkType().equals(other.getWorkType())) return false;
@Override public int hashCode() { int result = this.orcidWork.getWorkTitle() != null ? this.orcidWork.getWorkTitle().hashCode() : 0; result = 31 * result + (this.orcidWork.getShortDescription() != null ? this.orcidWork.getShortDescription().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkCitation() != null ? this.orcidWork.getWorkCitation().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkType() != null ? this.orcidWork.getWorkType().hashCode() : 0); result = 31 * result + (this.orcidWork.getPublicationDate() != null ? this.orcidWork.getPublicationDate().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkExternalIdentifiers() != null ? this.orcidWork.getWorkExternalIdentifiers().hashCode() : 0); result = 31 * result + (this.orcidWork.getUrl() != null ? this.orcidWork.getUrl().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkContributors() != null ? this.orcidWork.getWorkContributors().hashCode() : 0); result = 31 * result + (this.orcidWork.getWorkSource() != null ? this.orcidWork.getWorkSource().hashCode() : 0); return result; }
if(orcidWork.getWorkType() != null) { if(WorkType.DISSERTATION.equals(orcidWork.getWorkType())) { workEntity.setWorkType(org.orcid.jaxb.model.common.WorkType.DISSERTATION_THESIS.name()); } else { workEntity.setWorkType(orcidWork.getWorkType().name());
Title titleToCompare = (newWorkToCompare.getWorkTitle() == null || newWorkToCompare.getWorkTitle().getTitle() == null) ? null : newWorkToCompare.getWorkTitle().getTitle(); if (!isTheSameTitle(title, titleToCompare) && !areBothExtIdsPartOf(newWork.getWorkType(), workExtId, workExtIdToCompare)) { String extIdContent = (workExtId.getWorkExternalIdentifierId() == null || PojoUtil.isEmpty(workExtId.getWorkExternalIdentifierId().getContent())) ? "" : existingWork.getWorkTitle().getTitle(); if (!isTheSameTitle(title, titleToCompare) && !areBothExtIdsPartOf(orcidWork.getWorkType(), existingExternalIdentifier, newExternalIdentifier)) { String extIdContent = (existingExternalIdentifier.getWorkExternalIdentifierId() == null || PojoUtil.isEmpty(existingExternalIdentifier.getWorkExternalIdentifierId().getContent())) ? ""
private void doWorkTypeValidation(OrcidMessage orcidMessage) { if (orcidMessage == null || orcidMessage.getOrcidProfile() == null || orcidMessage.getOrcidProfile().getOrcidActivities() == null || orcidMessage.getOrcidProfile().getOrcidActivities().getOrcidWorks() == null || orcidMessage.getOrcidProfile().getOrcidActivities().getOrcidWorks().getOrcidWork() == null || orcidMessage.getOrcidProfile().getOrcidActivities().getOrcidWorks().getOrcidWork().isEmpty()) return; List<OrcidWork> works = orcidMessage.getOrcidProfile().getOrcidActivities().getOrcidWorks().getOrcidWork(); for (OrcidWork work : works) { if (work.getWorkType() == null) if (work.getWorkTitle() != null && work.getWorkTitle().getTitle() != null && !PojoUtil.isEmpty(work.getWorkTitle().getTitle().getContent())) handleError("work-type is missing or invalid for work: '" + work.getWorkTitle().getTitle().getContent() + "'"); else handleError("work-type is missing or invalid"); } }
return false; if (this.orcidWork.getWorkType() != orcidWork.getWorkType()) { return false;