From 2c519130a160b5606ab211ac518085ffaf72b3a2 Mon Sep 17 00:00:00 2001 From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:58:55 +0100 Subject: [PATCH] Remove duplicate solr entities code (#7047) * Remove duplicate solr entities code * Fixed setting the names for locations json --- .../impl/OrgDisambiguatedManagerImpl.java | 2 +- .../solr/entities/OrcidSolrDocument.java | 1172 ----------------- .../entities/OrcidSolrDocumentLegacy.java | 1035 --------------- .../OrgDisambiguatedSolrDocument.java | 291 ---- .../utils/solr/entities/SolrConstants.java | 114 -- .../OrgDisambiguatedSolrDocument.java | 35 + .../utils/solr/entities/SolrConstants.java | 2 + 7 files changed, 38 insertions(+), 2613 deletions(-) delete mode 100644 orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocument.java delete mode 100644 orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocumentLegacy.java delete mode 100644 orcid-core/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java delete mode 100644 orcid-core/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgDisambiguatedManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgDisambiguatedManagerImpl.java index f9120a548b2..0d25b443b34 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgDisambiguatedManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgDisambiguatedManagerImpl.java @@ -159,7 +159,7 @@ private OrgDisambiguatedSolrDocument convertEntityToDocument(OrgDisambiguatedEnt } if(entity.getNamesJson() != null) { - document.setOrgLocationsJson(entity.getNamesJson()); + document.setOrgNamesJson(entity.getNamesJson()); } List orgs = orgDao.findByOrgDisambiguatedId(entity.getId()); diff --git a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocument.java b/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocument.java deleted file mode 100644 index 0489cf0a641..00000000000 --- a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocument.java +++ /dev/null @@ -1,1172 +0,0 @@ -package org.orcid.utils.solr.entities; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.solr.client.solrj.beans.Field; - -/** - * Class representing public information that can be returned from the Solr - * persistence level. Used by OrcidSearchManager as an abstraction of the - * results from Solr. - * - * @see - * @author jamesb - * - */ - -public class OrcidSolrDocument { - - @Field - private String orcid; - - @Field(SolrConstants.EMAIL_ADDRESS) - private List emailAddresses; - - @Field(SolrConstants.FAMILY_NAME) - private String familyName; - - @Field(SolrConstants.GIVEN_NAMES) - private String givenNames; - - @Field(SolrConstants.CREDIT_NAME) - private String creditName; - - @Field(SolrConstants.BIOGRAPHY) - private String biography; - - @Field(SolrConstants.OTHER_NAMES) - private List otherNames; - - @Field(SolrConstants.EXTERNAL_ID_SOURCE) - private List externalIdSources; - - @Field(SolrConstants.EXTERNAL_ID_REFERENCES) - private List externalIdReferences; - - @Field(SolrConstants.EXTERNAL_ID_SOURCE_AND_REFERENCE) - private List externalIdSourceReferences; - - @Field(SolrConstants.EXTERNAL_ID_TYPE_AND_VALUE) - private List externalIdTypeAndValue; - - @Field(SolrConstants.DIGITAL_OBJECT_IDS) - private List digitalObjectIds = new ArrayList();; - - @Field(SolrConstants.AGR) - private List agr = new ArrayList(); - - @Field(SolrConstants.ARXIV) - private List arxiv = new ArrayList(); - - @Field(SolrConstants.ASIN) - private List asin = new ArrayList(); - - @Field(SolrConstants.ASIN_TLD) - private List asintld = new ArrayList(); - - @Field(SolrConstants.BIBCODE) - private List bibcode = new ArrayList(); - - @Field(SolrConstants.CBA) - private List cba = new ArrayList(); - - @Field(SolrConstants.CIT) - private List cit = new ArrayList(); - - @Field(SolrConstants.CTX) - private List ctx = new ArrayList(); - - @Field(SolrConstants.EID) - private List eid = new ArrayList(); - - @Field(SolrConstants.ETHOS) - private List ethos = new ArrayList(); - - @Field(SolrConstants.HANDLE) - private List handle = new ArrayList(); - - @Field(SolrConstants.HIR) - private List hir = new ArrayList(); - - @Field(SolrConstants.ISBN) - private List isbn = new ArrayList(); - - @Field(SolrConstants.ISSN) - private List issn = new ArrayList(); - - @Field(SolrConstants.JFM) - private List jfm = new ArrayList(); - - @Field(SolrConstants.JSTOR) - private List jstor = new ArrayList(); - - @Field(SolrConstants.LCCN) - private List lccn = new ArrayList(); - - @Field(SolrConstants.MR) - private List mr = new ArrayList(); - - @Field(SolrConstants.OCLC) - private List oclc = new ArrayList(); - - @Field(SolrConstants.OL) - private List ol = new ArrayList(); - - @Field(SolrConstants.OSTI) - private List osti = new ArrayList(); - - @Field(SolrConstants.PAT) - private List pat = new ArrayList(); - - @Field(SolrConstants.PMC) - private List pmc = new ArrayList(); - - @Field(SolrConstants.PMID) - private List pmid = new ArrayList(); - - @Field(SolrConstants.RFC) - private List rfc = new ArrayList(); - - @Field(SolrConstants.SOURCE_WORK_ID) - private List sourceWorkId = new ArrayList(); - - @Field(SolrConstants.SSRN) - private List ssrn = new ArrayList(); - - @Field(SolrConstants.URI) - private List uri = new ArrayList(); - - @Field(SolrConstants.URN) - private List urn = new ArrayList(); - - @Field(SolrConstants.WOSUID) - private List wosuid = new ArrayList(); - - @Field(SolrConstants.ZBL) - private List zbl = new ArrayList(); - - @Field(SolrConstants.OTHER_IDENTIFIER_TYPE) - private List otherIdentifierType = new ArrayList(); - - @Field(SolrConstants.WORK_TITLES) - private List workTitles; - - @Field(SolrConstants.KEYWORDS) - private List keywords; - - @Field(SolrConstants.GRANT_NUMBERS) - private List grantNumbers; - - @Field(SolrConstants.FUNDING_TITLES) - private List fundingTitles; - - @Field(SolrConstants.PROFILE_SUBMISSION_DATE) - private Date profileSubmissionDate; - - @Field(SolrConstants.PROFILE_LAST_MODIFIED_DATE) - private Date profileLastModifiedDate; - - @Field(SolrConstants.PUBLIC_PROFILE) - private String publicProfileMessage; - - @Field(SolrConstants.GIVEN_AND_FAMILY_NAMES) - private String givenAndFamilyNames; - - @Field(SolrConstants.PRIMARY_RECORD) - private String primaryRecord; - - @Field(SolrConstants.PEER_REVIEW_GROUP_ID) - private Set peerReviewGroupId; - - @Field(SolrConstants.PEER_REVIEW_ROLE) - private Set peerReviewRole; - - @Field(SolrConstants.PEER_REVIEW_TYPE) - private Set peerReviewType; - - // e.g. doi-self - @Field("*" + SolrConstants.DYNAMIC_SELF) - private Map> selfIds; - - // e.g. arxiv-part-of - @Field("*" + SolrConstants.DYNAMIC_PART_OF) - private Map> partOfIds; - - // e.g. doi-version-of - @Field("*" + SolrConstants.DYNAMIC_VERSION_OF) - private Map> versionOfIds; - - // e.g. ringgold-org-id - @Field("*" + SolrConstants.DYNAMIC_ORGANISATION_ID) - private Map> organisationIds; - - // e.g. education-org-name - @Field("*" + SolrConstants.DYNAMIC_ORGANISATION_NAME) - private Map> organisationNames; - - @Field(SolrConstants.RESEARCH_RESOURCE_ITEM_NAME) - private List researchResourceItemNames; - - @Field(SolrConstants.RESEARCH_RESOURCE_PROPOSAL_TITLES) - private List researchResourceProposalTitles; - - @Field(SolrConstants.AFFILIATE_PAST_INSTITUTION_NAMES) - private List pastInstitutionAffiliationNames; - - @Field(SolrConstants.AFFILIATE_CURRENT_INSTITUTION_NAME) - private List currentInstitutionAffiliationNames; - - public String getOrcid() { - return orcid; - } - - public void setOrcid(String orcid) { - this.orcid = orcid; - } - - public String getFamilyName() { - return familyName; - } - - public void setFamilyName(String familyName) { - this.familyName = familyName; - generateCombinedGivenAndFamilyNames(); - } - - public String getGivenNames() { - return givenNames; - } - - public void setGivenNames(String givenNames) { - this.givenNames = givenNames; - generateCombinedGivenAndFamilyNames(); - } - - public String getGivenAndFamilyNames() { - return givenAndFamilyNames; - } - - public void setGivenAndFamilyNames(String givenAndFamilyNames) { - this.givenAndFamilyNames = givenAndFamilyNames; - } - - public String getCreditName() { - return creditName; - } - - public void setCreditName(String creditName) { - this.creditName = creditName; - } - - public List getOtherNames() { - return otherNames; - } - - public void setOtherNames(List otherNames) { - this.otherNames = otherNames; - } - - public List getExternalIdReferences() { - return externalIdReferences; - } - - public void setExternalIdReferences(List externalIdReferences) { - this.externalIdReferences = externalIdReferences; - } - - public List getDigitalObjectIds() { - return digitalObjectIds; - } - - public void setDigitalObjectIds(List digitalObjectIds) { - this.digitalObjectIds = digitalObjectIds; - } - - public List getWorkTitles() { - return workTitles; - } - - public void setWorkTitles(List workTitles) { - this.workTitles = workTitles; - } - - public List getKeywords() { - return keywords; - } - - public void setKeywords(List keywords) { - this.keywords = keywords; - } - - public List getEmailAddresses() { - return emailAddresses; - } - - public void setEmailAddresses(List emailAddresses) { - this.emailAddresses = emailAddresses; - } - - public void addEmailAddress(String emailAddress) { - if (emailAddresses == null) { - emailAddresses = new ArrayList<>(); - } - emailAddresses.add(emailAddress); - } - - public List getGrantNumbers() { - return grantNumbers; - } - - public void setGrantNumbers(List grantNumbers) { - this.grantNumbers = grantNumbers; - } - - public List getFundingTitles() { - return fundingTitles; - } - - public void setFundingTitles(List fundingTitles) { - this.fundingTitles = fundingTitles; - } - - public Date getProfileSubmissionDate() { - return profileSubmissionDate; - } - - public void setProfileSubmissionDate(Date profileSubmissionDate) { - this.profileSubmissionDate = profileSubmissionDate; - } - - public Date getProfileLastModifiedDate() { - return profileLastModifiedDate; - } - - public void setProfileLastModifiedDate(Date profileLastModifiedDate) { - this.profileLastModifiedDate = profileLastModifiedDate; - } - - public String getPublicProfileMessage() { - return publicProfileMessage; - } - - public void setPublicProfileMessage(String publicProfileMessage) { - this.publicProfileMessage = publicProfileMessage; - } - - public String getPrimaryRecord() { - return primaryRecord; - } - - public void setPrimaryRecord(String primaryRecord) { - this.primaryRecord = primaryRecord; - } - - public List getResearchResourceProposalTitles() { - return researchResourceProposalTitles; - } - - public void setResearchResourceProposalTitles(List researchResourceProposalTitles) { - this.researchResourceProposalTitles = researchResourceProposalTitles; - } - - public List getArxiv() { - return arxiv; - } - - public void setArxiv(List arxiv) { - this.arxiv = arxiv; - } - - public List getAsin() { - return asin; - } - - public void setAsin(List asin) { - this.asin = asin; - } - - public List getAsintld() { - return asintld; - } - - public void setAsintld(List asintld) { - this.asintld = asintld; - } - - public List getBibcode() { - return bibcode; - } - - public void setBibcode(List bibcode) { - this.bibcode = bibcode; - } - - public List getEid() { - return eid; - } - - public void setEid(List eid) { - this.eid = eid; - } - - public List getIsbn() { - return isbn; - } - - public void setIsbn(List isbn) { - this.isbn = isbn; - } - - public List getIssn() { - return issn; - } - - public void setIssn(List issn) { - this.issn = issn; - } - - public List getJfm() { - return jfm; - } - - public void setJfm(List jfm) { - this.jfm = jfm; - } - - public List getJstor() { - return jstor; - } - - public void setJstor(List jstor) { - this.jstor = jstor; - } - - public List getLccn() { - return lccn; - } - - public void setLccn(List lccn) { - this.lccn = lccn; - } - - public List getMr() { - return mr; - } - - public void setMr(List mr) { - this.mr = mr; - } - - public List getOclc() { - return oclc; - } - - public void setOclc(List oclc) { - this.oclc = oclc; - } - - public List getOl() { - return ol; - } - - public void setOl(List ol) { - this.ol = ol; - } - - public List getOsti() { - return osti; - } - - public void setOsti(List osti) { - this.osti = osti; - } - - public List getPmc() { - return pmc; - } - - public void setPmc(List pmc) { - this.pmc = pmc; - } - - public List getPmid() { - return pmid; - } - - public void setPmid(List pmid) { - this.pmid = pmid; - } - - public List getRfc() { - return rfc; - } - - public void setRfc(List rfc) { - this.rfc = rfc; - } - - public List getSsrn() { - return ssrn; - } - - public void setSsrn(List ssrn) { - this.ssrn = ssrn; - } - - public List getZbl() { - return zbl; - } - - public void setZbl(List zbl) { - this.zbl = zbl; - } - - public List getOtherIdentifierType() { - return otherIdentifierType; - } - - public void setOtherIdentifierType(List otherIdentifierType) { - this.otherIdentifierType = otherIdentifierType; - } - - public List getExternalIdSources() { - return externalIdSources; - } - - public void setExternalIdSources(List externalIdSources) { - this.externalIdSources = externalIdSources; - } - - public List getAgr() { - return agr; - } - - public void setAgr(List agr) { - this.agr = agr; - } - - public List getCba() { - return cba; - } - - public void setCba(List cba) { - this.cba = cba; - } - - public List getCit() { - return cit; - } - - public void setCit(List cit) { - this.cit = cit; - } - - public List getCtx() { - return ctx; - } - - public void setCtx(List ctx) { - this.ctx = ctx; - } - - public List getEthos() { - return ethos; - } - - public void setEthos(List ethos) { - this.ethos = ethos; - } - - public List getHandle() { - return handle; - } - - public void setHandle(List handle) { - this.handle = handle; - } - - public List getHir() { - return hir; - } - - public void setHir(List hir) { - this.hir = hir; - } - - public List getPat() { - return pat; - } - - public void setPat(List pat) { - this.pat = pat; - } - - public List getSourceWorkId() { - return sourceWorkId; - } - - public void setSourceWorkId(List sourceWorkId) { - this.sourceWorkId = sourceWorkId; - } - - public List getUri() { - return uri; - } - - public void setUri(List uri) { - this.uri = uri; - } - - public List getUrn() { - return urn; - } - - public void setUrn(List urn) { - this.urn = urn; - } - - public List getWosuid() { - return wosuid; - } - - public void setWosuid(List wosuid) { - this.wosuid = wosuid; - } - - public Map> getSelfIds() { - return selfIds; - } - - public void setSelfIds(Map> selfIds) { - this.selfIds = selfIds; - } - - public Map> getPartOfIds() { - return partOfIds; - } - - public void setPartOfIds(Map> partOfIds) { - this.partOfIds = partOfIds; - } - - public Map> getVersionOfIds() { - return versionOfIds; - } - - public void setVersionOfIds(Map> versionOfIds) { - this.versionOfIds = versionOfIds; - } - - public Map> getOrganisationIds() { - return organisationIds; - } - - public void setOrganisationIds(Map> organisationIds) { - this.organisationIds = organisationIds; - } - - public Map> getOrganisationNames() { - return organisationNames; - } - - public void setOrganisationNames(Map> organisationNames) { - this.organisationNames = organisationNames; - } - - public List getExternalIdTypeAndValue() { - return externalIdTypeAndValue; - } - - public void setExternalIdTypeAndValue(List externalIdTypeAndValue) { - this.externalIdTypeAndValue = externalIdTypeAndValue; - } - - public List getExternalIdSourceReferences() { - return externalIdSourceReferences; - } - - public void setExternalIdSourceReferences(List externalIdSourceReferences) { - this.externalIdSourceReferences = externalIdSourceReferences; - } - - public List getResearchResourceItemNames() { - return researchResourceItemNames; - } - - public void setResearchResourceItemNames(List researchResourceItemNames) { - this.researchResourceItemNames = researchResourceItemNames; - } - - public Set getPeerReviewGroupId() { - return peerReviewGroupId; - } - - public void setPeerReviewGroupId(Set peerReviewGroupId) { - this.peerReviewGroupId = peerReviewGroupId; - } - - public Set getPeerReviewRole() { - return peerReviewRole; - } - - public void setPeerReviewRole(Set peerReviewRole) { - this.peerReviewRole = peerReviewRole; - } - - public Set getPeerReviewType() { - return peerReviewType; - } - - public void setPeerReviewType(Set peerReviewType) { - this.peerReviewType = peerReviewType; - } - - public List getPastInstitutionAffiliationNames() { - return pastInstitutionAffiliationNames; - } - - public void setPastInstitutionAffiliationNames(List pastInstitutionAffiliationNames) { - this.pastInstitutionAffiliationNames = pastInstitutionAffiliationNames; - } - - public List getCurrentInstitutionAffiliationNames() { - return currentInstitutionAffiliationNames; - } - - public void setCurrentInstitutionAffiliationNames(List currentInstitutionAffiliationNames) { - this.currentInstitutionAffiliationNames = currentInstitutionAffiliationNames; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - private void generateCombinedGivenAndFamilyNames() { - String givenAndFamilyNames = (givenNames == null) ? ((familyName == null) ? null : familyName) : (givenNames + ((familyName == null) ? "" : " " + familyName)); - setGivenAndFamilyNames(givenAndFamilyNames); - } - - public String getBiography() { - return biography; - } - - public void setBiography(String biography) { - this.biography = biography; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((agr == null) ? 0 : agr.hashCode()); - result = prime * result + ((arxiv == null) ? 0 : arxiv.hashCode()); - result = prime * result + ((asin == null) ? 0 : asin.hashCode()); - result = prime * result + ((asintld == null) ? 0 : asintld.hashCode()); - result = prime * result + ((bibcode == null) ? 0 : bibcode.hashCode()); - result = prime * result + ((biography == null) ? 0 : biography.hashCode()); - result = prime * result + ((cba == null) ? 0 : cba.hashCode()); - result = prime * result + ((cit == null) ? 0 : cit.hashCode()); - result = prime * result + ((creditName == null) ? 0 : creditName.hashCode()); - result = prime * result + ((ctx == null) ? 0 : ctx.hashCode()); - result = prime * result + ((currentInstitutionAffiliationNames == null) ? 0 : currentInstitutionAffiliationNames.hashCode()); - result = prime * result + ((digitalObjectIds == null) ? 0 : digitalObjectIds.hashCode()); - result = prime * result + ((eid == null) ? 0 : eid.hashCode()); - result = prime * result + ((emailAddresses == null) ? 0 : emailAddresses.hashCode()); - result = prime * result + ((ethos == null) ? 0 : ethos.hashCode()); - result = prime * result + ((externalIdReferences == null) ? 0 : externalIdReferences.hashCode()); - result = prime * result + ((externalIdSourceReferences == null) ? 0 : externalIdSourceReferences.hashCode()); - result = prime * result + ((externalIdSources == null) ? 0 : externalIdSources.hashCode()); - result = prime * result + ((externalIdTypeAndValue == null) ? 0 : externalIdTypeAndValue.hashCode()); - result = prime * result + ((familyName == null) ? 0 : familyName.hashCode()); - result = prime * result + ((fundingTitles == null) ? 0 : fundingTitles.hashCode()); - result = prime * result + ((givenAndFamilyNames == null) ? 0 : givenAndFamilyNames.hashCode()); - result = prime * result + ((givenNames == null) ? 0 : givenNames.hashCode()); - result = prime * result + ((grantNumbers == null) ? 0 : grantNumbers.hashCode()); - result = prime * result + ((handle == null) ? 0 : handle.hashCode()); - result = prime * result + ((hir == null) ? 0 : hir.hashCode()); - result = prime * result + ((isbn == null) ? 0 : isbn.hashCode()); - result = prime * result + ((issn == null) ? 0 : issn.hashCode()); - result = prime * result + ((jfm == null) ? 0 : jfm.hashCode()); - result = prime * result + ((jstor == null) ? 0 : jstor.hashCode()); - result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); - result = prime * result + ((lccn == null) ? 0 : lccn.hashCode()); - result = prime * result + ((mr == null) ? 0 : mr.hashCode()); - result = prime * result + ((oclc == null) ? 0 : oclc.hashCode()); - result = prime * result + ((ol == null) ? 0 : ol.hashCode()); - result = prime * result + ((orcid == null) ? 0 : orcid.hashCode()); - result = prime * result + ((organisationIds == null) ? 0 : organisationIds.hashCode()); - result = prime * result + ((organisationNames == null) ? 0 : organisationNames.hashCode()); - result = prime * result + ((osti == null) ? 0 : osti.hashCode()); - result = prime * result + ((otherIdentifierType == null) ? 0 : otherIdentifierType.hashCode()); - result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); - result = prime * result + ((partOfIds == null) ? 0 : partOfIds.hashCode()); - result = prime * result + ((pastInstitutionAffiliationNames == null) ? 0 : pastInstitutionAffiliationNames.hashCode()); - result = prime * result + ((pat == null) ? 0 : pat.hashCode()); - result = prime * result + ((peerReviewGroupId == null) ? 0 : peerReviewGroupId.hashCode()); - result = prime * result + ((peerReviewRole == null) ? 0 : peerReviewRole.hashCode()); - result = prime * result + ((peerReviewType == null) ? 0 : peerReviewType.hashCode()); - result = prime * result + ((pmc == null) ? 0 : pmc.hashCode()); - result = prime * result + ((pmid == null) ? 0 : pmid.hashCode()); - result = prime * result + ((primaryRecord == null) ? 0 : primaryRecord.hashCode()); - result = prime * result + ((profileLastModifiedDate == null) ? 0 : profileLastModifiedDate.hashCode()); - result = prime * result + ((profileSubmissionDate == null) ? 0 : profileSubmissionDate.hashCode()); - result = prime * result + ((publicProfileMessage == null) ? 0 : publicProfileMessage.hashCode()); - result = prime * result + ((researchResourceItemNames == null) ? 0 : researchResourceItemNames.hashCode()); - result = prime * result + ((researchResourceProposalTitles == null) ? 0 : researchResourceProposalTitles.hashCode()); - result = prime * result + ((rfc == null) ? 0 : rfc.hashCode()); - result = prime * result + ((selfIds == null) ? 0 : selfIds.hashCode()); - result = prime * result + ((sourceWorkId == null) ? 0 : sourceWorkId.hashCode()); - result = prime * result + ((ssrn == null) ? 0 : ssrn.hashCode()); - result = prime * result + ((uri == null) ? 0 : uri.hashCode()); - result = prime * result + ((urn == null) ? 0 : urn.hashCode()); - result = prime * result + ((versionOfIds == null) ? 0 : versionOfIds.hashCode()); - result = prime * result + ((workTitles == null) ? 0 : workTitles.hashCode()); - result = prime * result + ((wosuid == null) ? 0 : wosuid.hashCode()); - result = prime * result + ((zbl == null) ? 0 : zbl.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - OrcidSolrDocument other = (OrcidSolrDocument) obj; - if (agr == null) { - if (other.agr != null) - return false; - } else if (!agr.equals(other.agr)) - return false; - if (arxiv == null) { - if (other.arxiv != null) - return false; - } else if (!arxiv.equals(other.arxiv)) - return false; - if (asin == null) { - if (other.asin != null) - return false; - } else if (!asin.equals(other.asin)) - return false; - if (asintld == null) { - if (other.asintld != null) - return false; - } else if (!asintld.equals(other.asintld)) - return false; - if (bibcode == null) { - if (other.bibcode != null) - return false; - } else if (!bibcode.equals(other.bibcode)) - return false; - if (biography == null) { - if (other.biography != null) - return false; - } else if (!biography.equals(other.biography)) - return false; - if (cba == null) { - if (other.cba != null) - return false; - } else if (!cba.equals(other.cba)) - return false; - if (cit == null) { - if (other.cit != null) - return false; - } else if (!cit.equals(other.cit)) - return false; - if (creditName == null) { - if (other.creditName != null) - return false; - } else if (!creditName.equals(other.creditName)) - return false; - if (ctx == null) { - if (other.ctx != null) - return false; - } else if (!ctx.equals(other.ctx)) - return false; - if (currentInstitutionAffiliationNames == null) { - if (other.currentInstitutionAffiliationNames != null) - return false; - } else if (!currentInstitutionAffiliationNames.equals(other.currentInstitutionAffiliationNames)) - return false; - if (digitalObjectIds == null) { - if (other.digitalObjectIds != null) - return false; - } else if (!digitalObjectIds.equals(other.digitalObjectIds)) - return false; - if (eid == null) { - if (other.eid != null) - return false; - } else if (!eid.equals(other.eid)) - return false; - if (emailAddresses == null) { - if (other.emailAddresses != null) - return false; - } else if (!emailAddresses.equals(other.emailAddresses)) - return false; - if (ethos == null) { - if (other.ethos != null) - return false; - } else if (!ethos.equals(other.ethos)) - return false; - if (externalIdReferences == null) { - if (other.externalIdReferences != null) - return false; - } else if (!externalIdReferences.equals(other.externalIdReferences)) - return false; - if (externalIdSourceReferences == null) { - if (other.externalIdSourceReferences != null) - return false; - } else if (!externalIdSourceReferences.equals(other.externalIdSourceReferences)) - return false; - if (externalIdSources == null) { - if (other.externalIdSources != null) - return false; - } else if (!externalIdSources.equals(other.externalIdSources)) - return false; - if (externalIdTypeAndValue == null) { - if (other.externalIdTypeAndValue != null) - return false; - } else if (!externalIdTypeAndValue.equals(other.externalIdTypeAndValue)) - return false; - if (familyName == null) { - if (other.familyName != null) - return false; - } else if (!familyName.equals(other.familyName)) - return false; - if (fundingTitles == null) { - if (other.fundingTitles != null) - return false; - } else if (!fundingTitles.equals(other.fundingTitles)) - return false; - if (givenAndFamilyNames == null) { - if (other.givenAndFamilyNames != null) - return false; - } else if (!givenAndFamilyNames.equals(other.givenAndFamilyNames)) - return false; - if (givenNames == null) { - if (other.givenNames != null) - return false; - } else if (!givenNames.equals(other.givenNames)) - return false; - if (grantNumbers == null) { - if (other.grantNumbers != null) - return false; - } else if (!grantNumbers.equals(other.grantNumbers)) - return false; - if (handle == null) { - if (other.handle != null) - return false; - } else if (!handle.equals(other.handle)) - return false; - if (hir == null) { - if (other.hir != null) - return false; - } else if (!hir.equals(other.hir)) - return false; - if (isbn == null) { - if (other.isbn != null) - return false; - } else if (!isbn.equals(other.isbn)) - return false; - if (issn == null) { - if (other.issn != null) - return false; - } else if (!issn.equals(other.issn)) - return false; - if (jfm == null) { - if (other.jfm != null) - return false; - } else if (!jfm.equals(other.jfm)) - return false; - if (jstor == null) { - if (other.jstor != null) - return false; - } else if (!jstor.equals(other.jstor)) - return false; - if (keywords == null) { - if (other.keywords != null) - return false; - } else if (!keywords.equals(other.keywords)) - return false; - if (lccn == null) { - if (other.lccn != null) - return false; - } else if (!lccn.equals(other.lccn)) - return false; - if (mr == null) { - if (other.mr != null) - return false; - } else if (!mr.equals(other.mr)) - return false; - if (oclc == null) { - if (other.oclc != null) - return false; - } else if (!oclc.equals(other.oclc)) - return false; - if (ol == null) { - if (other.ol != null) - return false; - } else if (!ol.equals(other.ol)) - return false; - if (orcid == null) { - if (other.orcid != null) - return false; - } else if (!orcid.equals(other.orcid)) - return false; - if (organisationIds == null) { - if (other.organisationIds != null) - return false; - } else if (!organisationIds.equals(other.organisationIds)) - return false; - if (organisationNames == null) { - if (other.organisationNames != null) - return false; - } else if (!organisationNames.equals(other.organisationNames)) - return false; - if (osti == null) { - if (other.osti != null) - return false; - } else if (!osti.equals(other.osti)) - return false; - if (otherIdentifierType == null) { - if (other.otherIdentifierType != null) - return false; - } else if (!otherIdentifierType.equals(other.otherIdentifierType)) - return false; - if (otherNames == null) { - if (other.otherNames != null) - return false; - } else if (!otherNames.equals(other.otherNames)) - return false; - if (partOfIds == null) { - if (other.partOfIds != null) - return false; - } else if (!partOfIds.equals(other.partOfIds)) - return false; - if (pastInstitutionAffiliationNames == null) { - if (other.pastInstitutionAffiliationNames != null) - return false; - } else if (!pastInstitutionAffiliationNames.equals(other.pastInstitutionAffiliationNames)) - return false; - if (pat == null) { - if (other.pat != null) - return false; - } else if (!pat.equals(other.pat)) - return false; - if (peerReviewGroupId == null) { - if (other.peerReviewGroupId != null) - return false; - } else if (!peerReviewGroupId.equals(other.peerReviewGroupId)) - return false; - if (peerReviewRole == null) { - if (other.peerReviewRole != null) - return false; - } else if (!peerReviewRole.equals(other.peerReviewRole)) - return false; - if (peerReviewType == null) { - if (other.peerReviewType != null) - return false; - } else if (!peerReviewType.equals(other.peerReviewType)) - return false; - if (pmc == null) { - if (other.pmc != null) - return false; - } else if (!pmc.equals(other.pmc)) - return false; - if (pmid == null) { - if (other.pmid != null) - return false; - } else if (!pmid.equals(other.pmid)) - return false; - if (primaryRecord == null) { - if (other.primaryRecord != null) - return false; - } else if (!primaryRecord.equals(other.primaryRecord)) - return false; - if (profileLastModifiedDate == null) { - if (other.profileLastModifiedDate != null) - return false; - } else if (!profileLastModifiedDate.equals(other.profileLastModifiedDate)) - return false; - if (profileSubmissionDate == null) { - if (other.profileSubmissionDate != null) - return false; - } else if (!profileSubmissionDate.equals(other.profileSubmissionDate)) - return false; - if (publicProfileMessage == null) { - if (other.publicProfileMessage != null) - return false; - } else if (!publicProfileMessage.equals(other.publicProfileMessage)) - return false; - if (researchResourceItemNames == null) { - if (other.researchResourceItemNames != null) - return false; - } else if (!researchResourceItemNames.equals(other.researchResourceItemNames)) - return false; - if (researchResourceProposalTitles == null) { - if (other.researchResourceProposalTitles != null) - return false; - } else if (!researchResourceProposalTitles.equals(other.researchResourceProposalTitles)) - return false; - if (rfc == null) { - if (other.rfc != null) - return false; - } else if (!rfc.equals(other.rfc)) - return false; - if (selfIds == null) { - if (other.selfIds != null) - return false; - } else if (!selfIds.equals(other.selfIds)) - return false; - if (sourceWorkId == null) { - if (other.sourceWorkId != null) - return false; - } else if (!sourceWorkId.equals(other.sourceWorkId)) - return false; - if (ssrn == null) { - if (other.ssrn != null) - return false; - } else if (!ssrn.equals(other.ssrn)) - return false; - if (uri == null) { - if (other.uri != null) - return false; - } else if (!uri.equals(other.uri)) - return false; - if (urn == null) { - if (other.urn != null) - return false; - } else if (!urn.equals(other.urn)) - return false; - if (versionOfIds == null) { - if (other.versionOfIds != null) - return false; - } else if (!versionOfIds.equals(other.versionOfIds)) - return false; - if (workTitles == null) { - if (other.workTitles != null) - return false; - } else if (!workTitles.equals(other.workTitles)) - return false; - if (wosuid == null) { - if (other.wosuid != null) - return false; - } else if (!wosuid.equals(other.wosuid)) - return false; - if (zbl == null) { - if (other.zbl != null) - return false; - } else if (!zbl.equals(other.zbl)) - return false; - - return true; - } -} \ No newline at end of file diff --git a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocumentLegacy.java b/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocumentLegacy.java deleted file mode 100644 index 5c053c73e6e..00000000000 --- a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrcidSolrDocumentLegacy.java +++ /dev/null @@ -1,1035 +0,0 @@ -package org.orcid.utils.solr.entities; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.solr.client.solrj.beans.Field; - -/** - * Class representing public information that can be returned from the Solr - * persistence level. Used by OrcidSearchManager as an abstraction of the - * results from Solr. - * - * @see - * @author jamesb - * - */ - -public class OrcidSolrDocumentLegacy { - - @Field - private String orcid; - - @Field(SolrConstants.EMAIL_ADDRESS) - private List emailAddresses; - - @Field(SolrConstants.FAMILY_NAME) - private String familyName; - - @Field(SolrConstants.GIVEN_NAMES) - private String givenNames; - - @Field(SolrConstants.CREDIT_NAME) - private String creditName; - - @Field(SolrConstants.OTHER_NAMES) - private List otherNames; - - @Field(SolrConstants.EXTERNAL_ID_SOURCE) - private List externalIdSources; - - @Field(SolrConstants.EXTERNAL_ID_REFERENCES) - private List externalIdReferences; - - @Field(SolrConstants.DIGITAL_OBJECT_IDS) - private List digitalObjectIds = new ArrayList();; - - @Field(SolrConstants.AGR) - private List agr = new ArrayList(); - - @Field(SolrConstants.ARXIV) - private List arxiv = new ArrayList(); - - @Field(SolrConstants.ASIN) - private List asin = new ArrayList(); - - @Field(SolrConstants.ASIN_TLD) - private List asintld = new ArrayList(); - - @Field(SolrConstants.BIBCODE) - private List bibcode = new ArrayList(); - - @Field(SolrConstants.CBA) - private List cba = new ArrayList(); - - @Field(SolrConstants.CIT) - private List cit = new ArrayList(); - - @Field(SolrConstants.CTX) - private List ctx = new ArrayList(); - - @Field(SolrConstants.EID) - private List eid = new ArrayList(); - - @Field(SolrConstants.ETHOS) - private List ethos = new ArrayList(); - - @Field(SolrConstants.HANDLE) - private List handle = new ArrayList(); - - @Field(SolrConstants.HIR) - private List hir = new ArrayList(); - - @Field(SolrConstants.ISBN) - private List isbn = new ArrayList(); - - @Field(SolrConstants.ISSN) - private List issn = new ArrayList(); - - @Field(SolrConstants.JFM) - private List jfm = new ArrayList(); - - @Field(SolrConstants.JSTOR) - private List jstor = new ArrayList(); - - @Field(SolrConstants.LCCN) - private List lccn = new ArrayList(); - - @Field(SolrConstants.MR) - private List mr = new ArrayList(); - - @Field(SolrConstants.OCLC) - private List oclc = new ArrayList(); - - @Field(SolrConstants.OL) - private List ol = new ArrayList(); - - @Field(SolrConstants.OSTI) - private List osti = new ArrayList(); - - @Field(SolrConstants.PAT) - private List pat = new ArrayList(); - - @Field(SolrConstants.PMC) - private List pmc = new ArrayList(); - - @Field(SolrConstants.PMID) - private List pmid = new ArrayList(); - - @Field(SolrConstants.RFC) - private List rfc = new ArrayList(); - - @Field(SolrConstants.SOURCE_WORK_ID) - private List sourceWorkId = new ArrayList(); - - @Field(SolrConstants.SSRN) - private List ssrn = new ArrayList(); - - @Field(SolrConstants.URI) - private List uri = new ArrayList(); - - @Field(SolrConstants.URN) - private List urn = new ArrayList(); - - @Field(SolrConstants.WOSUID) - private List wosuid = new ArrayList(); - - @Field(SolrConstants.ZBL) - private List zbl = new ArrayList(); - - @Field(SolrConstants.OTHER_IDENTIFIER_TYPE) - private List otherIdentifierType = new ArrayList(); - - @Field(SolrConstants.WORK_TITLES) - private List workTitles; - - @Field(SolrConstants.KEYWORDS) - private List keywords; - - @Field(SolrConstants.GRANT_NUMBERS) - private List grantNumbers; - - @Field(SolrConstants.FUNDING_TITLES) - private List fundingTitles; - - @Field(SolrConstants.PROFILE_SUBMISSION_DATE) - private Date profileSubmissionDate; - - @Field(SolrConstants.PROFILE_LAST_MODIFIED_DATE) - private Date profileLastModifiedDate; - - @Field(SolrConstants.PUBLIC_PROFILE) - private String publicProfileMessage; - - @Field(SolrConstants.GIVEN_AND_FAMILY_NAMES) - private String givenAndFamilyNames; - - @Field(SolrConstants.PRIMARY_RECORD) - private String primaryRecord; - - // e.g. doi-self - @Field("*" + SolrConstants.DYNAMIC_SELF) - private Map> selfIds; - - // e.g. arxiv-part-of - @Field("*" + SolrConstants.DYNAMIC_PART_OF) - private Map> partOfIds; - - // e.g. doi-version-of - @Field("*" + SolrConstants.DYNAMIC_VERSION_OF) - private Map> versionOfIds; - - // e.g. ringgold-org-id - @Field("*" + SolrConstants.DYNAMIC_ORGANISATION_ID) - private Map> organisationIds; - - // e.g. education-org-name - @Field("*" + SolrConstants.DYNAMIC_ORGANISATION_NAME) - private Map> organisationNames; - - @Field(SolrConstants.RESEARCH_RESOURCE_ITEM_NAME) - private List researchResourceItemNames; - - @Field(SolrConstants.RESEARCH_RESOURCE_PROPOSAL_TITLES) - private List researchResourceProposalTitles; - - public String getOrcid() { - return orcid; - } - - public void setOrcid(String orcid) { - this.orcid = orcid; - } - - public String getFamilyName() { - return familyName; - } - - public void setFamilyName(String familyName) { - this.familyName = familyName; - generateCombinedGivenAndFamilyNames(); - } - - public String getGivenNames() { - return givenNames; - } - - public void setGivenNames(String givenNames) { - this.givenNames = givenNames; - generateCombinedGivenAndFamilyNames(); - } - - public String getGivenAndFamilyNames() { - return givenAndFamilyNames; - } - - public void setGivenAndFamilyNames(String givenAndFamilyNames) { - this.givenAndFamilyNames = givenAndFamilyNames; - } - - public String getCreditName() { - return creditName; - } - - public void setCreditName(String creditName) { - this.creditName = creditName; - } - - public List getOtherNames() { - return otherNames; - } - - public void setOtherNames(List otherNames) { - this.otherNames = otherNames; - } - - public List getExternalIdReferences() { - return externalIdReferences; - } - - public void setExternalIdReferences(List externalIdReferences) { - this.externalIdReferences = externalIdReferences; - } - - public List getDigitalObjectIds() { - return digitalObjectIds; - } - - public void setDigitalObjectIds(List digitalObjectIds) { - this.digitalObjectIds = digitalObjectIds; - } - - public List getWorkTitles() { - return workTitles; - } - - public void setWorkTitles(List workTitles) { - this.workTitles = workTitles; - } - - public List getKeywords() { - return keywords; - } - - public void setKeywords(List keywords) { - this.keywords = keywords; - } - - public List getEmailAddresses() { - return emailAddresses; - } - - public void setEmailAddresses(List emailAddresses) { - this.emailAddresses = emailAddresses; - } - - public void addEmailAddress(String emailAddress) { - if (emailAddresses == null) { - emailAddresses = new ArrayList<>(); - } - emailAddresses.add(emailAddress); - } - - public List getGrantNumbers() { - return grantNumbers; - } - - public void setGrantNumbers(List grantNumbers) { - this.grantNumbers = grantNumbers; - } - - public List getFundingTitles() { - return fundingTitles; - } - - public void setFundingTitles(List fundingTitles) { - this.fundingTitles = fundingTitles; - } - - public Date getProfileSubmissionDate() { - return profileSubmissionDate; - } - - public void setProfileSubmissionDate(Date profileSubmissionDate) { - this.profileSubmissionDate = profileSubmissionDate; - } - - public Date getProfileLastModifiedDate() { - return profileLastModifiedDate; - } - - public void setProfileLastModifiedDate(Date profileLastModifiedDate) { - this.profileLastModifiedDate = profileLastModifiedDate; - } - - public String getPublicProfileMessage() { - return publicProfileMessage; - } - - public void setPublicProfileMessage(String publicProfileMessage) { - this.publicProfileMessage = publicProfileMessage; - } - - public String getPrimaryRecord() { - return primaryRecord; - } - - public void setPrimaryRecord(String primaryRecord) { - this.primaryRecord = primaryRecord; - } - - public List getResearchResourceItemNames() { - return researchResourceItemNames; - } - - public void setResearchResourceItemNames(List researchResourceItemNames) { - this.researchResourceItemNames = researchResourceItemNames; - } - - public List getResearchResourceProposalTitles() { - return researchResourceProposalTitles; - } - - public void setResearchResourceProposalTitles(List researchResourceProposalTitles) { - this.researchResourceProposalTitles = researchResourceProposalTitles; - } - - public List getArxiv() { - return arxiv; - } - - public void setArxiv(List arxiv) { - this.arxiv = arxiv; - } - - public List getAsin() { - return asin; - } - - public void setAsin(List asin) { - this.asin = asin; - } - - public List getAsintld() { - return asintld; - } - - public void setAsintld(List asintld) { - this.asintld = asintld; - } - - public List getBibcode() { - return bibcode; - } - - public void setBibcode(List bibcode) { - this.bibcode = bibcode; - } - - public List getEid() { - return eid; - } - - public void setEid(List eid) { - this.eid = eid; - } - - public List getIsbn() { - return isbn; - } - - public void setIsbn(List isbn) { - this.isbn = isbn; - } - - public List getIssn() { - return issn; - } - - public void setIssn(List issn) { - this.issn = issn; - } - - public List getJfm() { - return jfm; - } - - public void setJfm(List jfm) { - this.jfm = jfm; - } - - public List getJstor() { - return jstor; - } - - public void setJstor(List jstor) { - this.jstor = jstor; - } - - public List getLccn() { - return lccn; - } - - public void setLccn(List lccn) { - this.lccn = lccn; - } - - public List getMr() { - return mr; - } - - public void setMr(List mr) { - this.mr = mr; - } - - public List getOclc() { - return oclc; - } - - public void setOclc(List oclc) { - this.oclc = oclc; - } - - public List getOl() { - return ol; - } - - public void setOl(List ol) { - this.ol = ol; - } - - public List getOsti() { - return osti; - } - - public void setOsti(List osti) { - this.osti = osti; - } - - public List getPmc() { - return pmc; - } - - public void setPmc(List pmc) { - this.pmc = pmc; - } - - public List getPmid() { - return pmid; - } - - public void setPmid(List pmid) { - this.pmid = pmid; - } - - public List getRfc() { - return rfc; - } - - public void setRfc(List rfc) { - this.rfc = rfc; - } - - public List getSsrn() { - return ssrn; - } - - public void setSsrn(List ssrn) { - this.ssrn = ssrn; - } - - public List getZbl() { - return zbl; - } - - public void setZbl(List zbl) { - this.zbl = zbl; - } - - public List getOtherIdentifierType() { - return otherIdentifierType; - } - - public void setOtherIdentifierType(List otherIdentifierType) { - this.otherIdentifierType = otherIdentifierType; - } - - public List getExternalIdSources() { - return externalIdSources; - } - - public void setExternalIdSources(List externalIdSources) { - this.externalIdSources = externalIdSources; - } - - public List getAgr() { - return agr; - } - - public void setAgr(List agr) { - this.agr = agr; - } - - public List getCba() { - return cba; - } - - public void setCba(List cba) { - this.cba = cba; - } - - public List getCit() { - return cit; - } - - public void setCit(List cit) { - this.cit = cit; - } - - public List getCtx() { - return ctx; - } - - public void setCtx(List ctx) { - this.ctx = ctx; - } - - public List getEthos() { - return ethos; - } - - public void setEthos(List ethos) { - this.ethos = ethos; - } - - public List getHandle() { - return handle; - } - - public void setHandle(List handle) { - this.handle = handle; - } - - public List getHir() { - return hir; - } - - public void setHir(List hir) { - this.hir = hir; - } - - public List getPat() { - return pat; - } - - public void setPat(List pat) { - this.pat = pat; - } - - public List getSourceWorkId() { - return sourceWorkId; - } - - public void setSourceWorkId(List sourceWorkId) { - this.sourceWorkId = sourceWorkId; - } - - public List getUri() { - return uri; - } - - public void setUri(List uri) { - this.uri = uri; - } - - public List getUrn() { - return urn; - } - - public void setUrn(List urn) { - this.urn = urn; - } - - public List getWosuid() { - return wosuid; - } - - public void setWosuid(List wosuid) { - this.wosuid = wosuid; - } - - public Map> getSelfIds() { - return selfIds; - } - - public void setSelfIds(Map> selfIds) { - this.selfIds = selfIds; - } - - public Map> getPartOfIds() { - return partOfIds; - } - - public void setPartOfIds(Map> partOfIds) { - this.partOfIds = partOfIds; - } - - public Map> getVersionOfIds() { - return versionOfIds; - } - - public void setVersionOfIds(Map> versionOfIds) { - this.versionOfIds = versionOfIds; - } - - public Map> getOrganisationIds() { - return organisationIds; - } - - public void setOrganisationIds(Map> organisationIds) { - this.organisationIds = organisationIds; - } - - public Map> getOrganisationNames() { - return organisationNames; - } - - public void setOrganisationNames(Map> organisationNames) { - this.organisationNames = organisationNames; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - private void generateCombinedGivenAndFamilyNames() { - String givenAndFamilyNames = (givenNames == null) ? ((familyName == null) ? null : familyName) : (givenNames + ((familyName == null) ? "" : " " + familyName)); - setGivenAndFamilyNames(givenAndFamilyNames); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((agr == null) ? 0 : agr.hashCode()); - result = prime * result + ((arxiv == null) ? 0 : arxiv.hashCode()); - result = prime * result + ((asin == null) ? 0 : asin.hashCode()); - result = prime * result + ((asintld == null) ? 0 : asintld.hashCode()); - result = prime * result + ((bibcode == null) ? 0 : bibcode.hashCode()); - result = prime * result + ((cba == null) ? 0 : cba.hashCode()); - result = prime * result + ((cit == null) ? 0 : cit.hashCode()); - result = prime * result + ((creditName == null) ? 0 : creditName.hashCode()); - result = prime * result + ((ctx == null) ? 0 : ctx.hashCode()); - result = prime * result + ((digitalObjectIds == null) ? 0 : digitalObjectIds.hashCode()); - result = prime * result + ((eid == null) ? 0 : eid.hashCode()); - result = prime * result + ((emailAddresses == null) ? 0 : emailAddresses.hashCode()); - result = prime * result + ((ethos == null) ? 0 : ethos.hashCode()); - result = prime * result + ((externalIdReferences == null) ? 0 : externalIdReferences.hashCode()); - result = prime * result + ((externalIdSources == null) ? 0 : externalIdSources.hashCode()); - result = prime * result + ((familyName == null) ? 0 : familyName.hashCode()); - result = prime * result + ((fundingTitles == null) ? 0 : fundingTitles.hashCode()); - result = prime * result + ((givenAndFamilyNames == null) ? 0 : givenAndFamilyNames.hashCode()); - result = prime * result + ((givenNames == null) ? 0 : givenNames.hashCode()); - result = prime * result + ((grantNumbers == null) ? 0 : grantNumbers.hashCode()); - result = prime * result + ((handle == null) ? 0 : handle.hashCode()); - result = prime * result + ((hir == null) ? 0 : hir.hashCode()); - result = prime * result + ((isbn == null) ? 0 : isbn.hashCode()); - result = prime * result + ((issn == null) ? 0 : issn.hashCode()); - result = prime * result + ((jfm == null) ? 0 : jfm.hashCode()); - result = prime * result + ((jstor == null) ? 0 : jstor.hashCode()); - result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); - result = prime * result + ((lccn == null) ? 0 : lccn.hashCode()); - result = prime * result + ((mr == null) ? 0 : mr.hashCode()); - result = prime * result + ((oclc == null) ? 0 : oclc.hashCode()); - result = prime * result + ((ol == null) ? 0 : ol.hashCode()); - result = prime * result + ((orcid == null) ? 0 : orcid.hashCode()); - result = prime * result + ((organisationIds == null) ? 0 : organisationIds.hashCode()); - result = prime * result + ((organisationNames == null) ? 0 : organisationNames.hashCode()); - result = prime * result + ((osti == null) ? 0 : osti.hashCode()); - result = prime * result + ((otherIdentifierType == null) ? 0 : otherIdentifierType.hashCode()); - result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); - result = prime * result + ((partOfIds == null) ? 0 : partOfIds.hashCode()); - result = prime * result + ((pat == null) ? 0 : pat.hashCode()); - result = prime * result + ((pmc == null) ? 0 : pmc.hashCode()); - result = prime * result + ((pmid == null) ? 0 : pmid.hashCode()); - result = prime * result + ((primaryRecord == null) ? 0 : primaryRecord.hashCode()); - result = prime * result + ((profileLastModifiedDate == null) ? 0 : profileLastModifiedDate.hashCode()); - result = prime * result + ((profileSubmissionDate == null) ? 0 : profileSubmissionDate.hashCode()); - result = prime * result + ((publicProfileMessage == null) ? 0 : publicProfileMessage.hashCode()); - result = prime * result + ((researchResourceProposalTitles == null) ? 0 : researchResourceProposalTitles.hashCode()); - result = prime * result + ((researchResourceItemNames == null) ? 0 : researchResourceItemNames.hashCode()); - result = prime * result + ((rfc == null) ? 0 : rfc.hashCode()); - result = prime * result + ((selfIds == null) ? 0 : selfIds.hashCode()); - result = prime * result + ((sourceWorkId == null) ? 0 : sourceWorkId.hashCode()); - result = prime * result + ((ssrn == null) ? 0 : ssrn.hashCode()); - result = prime * result + ((uri == null) ? 0 : uri.hashCode()); - result = prime * result + ((urn == null) ? 0 : urn.hashCode()); - result = prime * result + ((versionOfIds == null) ? 0 : versionOfIds.hashCode()); - result = prime * result + ((workTitles == null) ? 0 : workTitles.hashCode()); - result = prime * result + ((wosuid == null) ? 0 : wosuid.hashCode()); - result = prime * result + ((zbl == null) ? 0 : zbl.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - OrcidSolrDocumentLegacy other = (OrcidSolrDocumentLegacy) obj; - if (agr == null) { - if (other.agr != null) - return false; - } else if (!agr.equals(other.agr)) - return false; - if (arxiv == null) { - if (other.arxiv != null) - return false; - } else if (!arxiv.equals(other.arxiv)) - return false; - if (asin == null) { - if (other.asin != null) - return false; - } else if (!asin.equals(other.asin)) - return false; - if (asintld == null) { - if (other.asintld != null) - return false; - } else if (!asintld.equals(other.asintld)) - return false; - if (bibcode == null) { - if (other.bibcode != null) - return false; - } else if (!bibcode.equals(other.bibcode)) - return false; - if (cba == null) { - if (other.cba != null) - return false; - } else if (!cba.equals(other.cba)) - return false; - if (cit == null) { - if (other.cit != null) - return false; - } else if (!cit.equals(other.cit)) - return false; - if (creditName == null) { - if (other.creditName != null) - return false; - } else if (!creditName.equals(other.creditName)) - return false; - if (ctx == null) { - if (other.ctx != null) - return false; - } else if (!ctx.equals(other.ctx)) - return false; - if (digitalObjectIds == null) { - if (other.digitalObjectIds != null) - return false; - } else if (!digitalObjectIds.equals(other.digitalObjectIds)) - return false; - if (eid == null) { - if (other.eid != null) - return false; - } else if (!eid.equals(other.eid)) - return false; - if (emailAddresses == null) { - if (other.emailAddresses != null) - return false; - } else if (!emailAddresses.equals(other.emailAddresses)) - return false; - if (ethos == null) { - if (other.ethos != null) - return false; - } else if (!ethos.equals(other.ethos)) - return false; - if (externalIdReferences == null) { - if (other.externalIdReferences != null) - return false; - } else if (!externalIdReferences.equals(other.externalIdReferences)) - return false; - if (externalIdSources == null) { - if (other.externalIdSources != null) - return false; - } else if (!externalIdSources.equals(other.externalIdSources)) - return false; - if (familyName == null) { - if (other.familyName != null) - return false; - } else if (!familyName.equals(other.familyName)) - return false; - if (fundingTitles == null) { - if (other.fundingTitles != null) - return false; - } else if (!fundingTitles.equals(other.fundingTitles)) - return false; - if (givenAndFamilyNames == null) { - if (other.givenAndFamilyNames != null) - return false; - } else if (!givenAndFamilyNames.equals(other.givenAndFamilyNames)) - return false; - if (givenNames == null) { - if (other.givenNames != null) - return false; - } else if (!givenNames.equals(other.givenNames)) - return false; - if (grantNumbers == null) { - if (other.grantNumbers != null) - return false; - } else if (!grantNumbers.equals(other.grantNumbers)) - return false; - if (handle == null) { - if (other.handle != null) - return false; - } else if (!handle.equals(other.handle)) - return false; - if (hir == null) { - if (other.hir != null) - return false; - } else if (!hir.equals(other.hir)) - return false; - if (isbn == null) { - if (other.isbn != null) - return false; - } else if (!isbn.equals(other.isbn)) - return false; - if (issn == null) { - if (other.issn != null) - return false; - } else if (!issn.equals(other.issn)) - return false; - if (jfm == null) { - if (other.jfm != null) - return false; - } else if (!jfm.equals(other.jfm)) - return false; - if (jstor == null) { - if (other.jstor != null) - return false; - } else if (!jstor.equals(other.jstor)) - return false; - if (keywords == null) { - if (other.keywords != null) - return false; - } else if (!keywords.equals(other.keywords)) - return false; - if (lccn == null) { - if (other.lccn != null) - return false; - } else if (!lccn.equals(other.lccn)) - return false; - if (mr == null) { - if (other.mr != null) - return false; - } else if (!mr.equals(other.mr)) - return false; - if (oclc == null) { - if (other.oclc != null) - return false; - } else if (!oclc.equals(other.oclc)) - return false; - if (ol == null) { - if (other.ol != null) - return false; - } else if (!ol.equals(other.ol)) - return false; - if (orcid == null) { - if (other.orcid != null) - return false; - } else if (!orcid.equals(other.orcid)) - return false; - if (organisationIds == null) { - if (other.organisationIds != null) - return false; - } else if (!organisationIds.equals(other.organisationIds)) - return false; - if (organisationNames == null) { - if (other.organisationNames != null) - return false; - } else if (!organisationNames.equals(other.organisationNames)) - return false; - if (osti == null) { - if (other.osti != null) - return false; - } else if (!osti.equals(other.osti)) - return false; - if (otherIdentifierType == null) { - if (other.otherIdentifierType != null) - return false; - } else if (!otherIdentifierType.equals(other.otherIdentifierType)) - return false; - if (otherNames == null) { - if (other.otherNames != null) - return false; - } else if (!otherNames.equals(other.otherNames)) - return false; - if (partOfIds == null) { - if (other.partOfIds != null) - return false; - } else if (!partOfIds.equals(other.partOfIds)) - return false; - if (pat == null) { - if (other.pat != null) - return false; - } else if (!pat.equals(other.pat)) - return false; - if (pmc == null) { - if (other.pmc != null) - return false; - } else if (!pmc.equals(other.pmc)) - return false; - if (pmid == null) { - if (other.pmid != null) - return false; - } else if (!pmid.equals(other.pmid)) - return false; - if (primaryRecord == null) { - if (other.primaryRecord != null) - return false; - } else if (!primaryRecord.equals(other.primaryRecord)) - return false; - if (profileLastModifiedDate == null) { - if (other.profileLastModifiedDate != null) - return false; - } else if (!profileLastModifiedDate.equals(other.profileLastModifiedDate)) - return false; - if (profileSubmissionDate == null) { - if (other.profileSubmissionDate != null) - return false; - } else if (!profileSubmissionDate.equals(other.profileSubmissionDate)) - return false; - if (publicProfileMessage == null) { - if (other.publicProfileMessage != null) - return false; - } else if (!publicProfileMessage.equals(other.publicProfileMessage)) - return false; - if (researchResourceProposalTitles == null) { - if (other.researchResourceProposalTitles != null) - return false; - } else if (!researchResourceProposalTitles.equals(other.researchResourceProposalTitles)) - return false; - if (researchResourceItemNames == null) { - if (other.researchResourceItemNames != null) - return false; - } else if (!researchResourceItemNames.equals(other.researchResourceItemNames)) - return false; - if (rfc == null) { - if (other.rfc != null) - return false; - } else if (!rfc.equals(other.rfc)) - return false; - if (selfIds == null) { - if (other.selfIds != null) - return false; - } else if (!selfIds.equals(other.selfIds)) - return false; - if (sourceWorkId == null) { - if (other.sourceWorkId != null) - return false; - } else if (!sourceWorkId.equals(other.sourceWorkId)) - return false; - if (ssrn == null) { - if (other.ssrn != null) - return false; - } else if (!ssrn.equals(other.ssrn)) - return false; - if (uri == null) { - if (other.uri != null) - return false; - } else if (!uri.equals(other.uri)) - return false; - if (urn == null) { - if (other.urn != null) - return false; - } else if (!urn.equals(other.urn)) - return false; - if (versionOfIds == null) { - if (other.versionOfIds != null) - return false; - } else if (!versionOfIds.equals(other.versionOfIds)) - return false; - if (workTitles == null) { - if (other.workTitles != null) - return false; - } else if (!workTitles.equals(other.workTitles)) - return false; - if (wosuid == null) { - if (other.wosuid != null) - return false; - } else if (!wosuid.equals(other.wosuid)) - return false; - if (zbl == null) { - if (other.zbl != null) - return false; - } else if (!zbl.equals(other.zbl)) - return false; - return true; - } -} \ No newline at end of file diff --git a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java b/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java deleted file mode 100644 index d837de9a4c2..00000000000 --- a/orcid-core/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java +++ /dev/null @@ -1,291 +0,0 @@ -package org.orcid.utils.solr.entities; - -import java.io.Serializable; -import java.util.List; - -import org.apache.solr.client.solrj.beans.Field; - -/** - * - * @author Will Simpson - * - */ -public class OrgDisambiguatedSolrDocument implements Serializable { - - private static final long serialVersionUID = -3668075852578170180L; - - @Field(SolrConstants.ORG_DISAMBIGUATED_ID) - private String orgDisambiguatedId; - - @Field(SolrConstants.ORG_DISAMBIGUATED_NAME) - private String orgDisambiguatedName; - - @Field(SolrConstants.ORG_DISAMBIGUATED_CITY) - private String orgDisambiguatedCity; - - @Field(SolrConstants.ORG_DISAMBIGUATED_REGION) - private String orgDisambiguatedRegion; - - @Field(SolrConstants.ORG_DISAMBIGUATED_COUNTRY) - private String orgDisambiguatedCountry; - - @Field(SolrConstants.ORG_DISAMBIGUATED_TYPE) - private String orgDisambiguatedType; - - @Field(SolrConstants.ORG_DISAMBIGUATED_POPULARITY) - private Integer orgDisambiguatedPopularity; - - @Field(SolrConstants.ORG_NAMES) - private List orgNames; - - @Field(SolrConstants.ORG_DISAMBIGUATED_ID_FROM_SOURCE) - private String orgDisambiguatedIdFromSource; - - @Field(SolrConstants.ORG_DISAMBIGUATED_STATUS) - private String orgDisambiguatedStatus; - - @Field(SolrConstants.ORG_DISAMBIGUATED_ID_SOURCE_TYPE) - private String orgDisambiguatedIdSourceType; - - @Field(SolrConstants.IS_FUNDING_ORG) - private boolean isFundingOrg; - - @Field(SolrConstants.ORG_CHOSEN_BY_MEMBER) - private boolean isOrgChosenByMember; - - @Field(SolrConstants.ORG_NAMES_JSON) - private String orgNamesJson; - - @Field(SolrConstants.ORG_LOCATIONS_JSON) - private String orgLocationsJson; - - public String getOrgDisambiguatedId() { - return orgDisambiguatedId; - } - - public void setOrgDisambiguatedId(String orgDisambiguatedId) { - this.orgDisambiguatedId = orgDisambiguatedId; - } - - public String getOrgDisambiguatedName() { - return orgDisambiguatedName; - } - - public void setOrgDisambiguatedName(String orgDisambiguatedName) { - this.orgDisambiguatedName = orgDisambiguatedName; - } - - public String getOrgDisambiguatedCity() { - return orgDisambiguatedCity; - } - - public void setOrgDisambiguatedCity(String orgDisambiguatedCity) { - this.orgDisambiguatedCity = orgDisambiguatedCity; - } - - public String getOrgDisambiguatedRegion() { - return orgDisambiguatedRegion; - } - - public void setOrgDisambiguatedRegion(String orgDisambiguatedRegion) { - this.orgDisambiguatedRegion = orgDisambiguatedRegion; - } - - public String getOrgDisambiguatedCountry() { - return orgDisambiguatedCountry; - } - - public void setOrgDisambiguatedCountry(String orgDisambiguatedCountry) { - this.orgDisambiguatedCountry = orgDisambiguatedCountry; - } - - /** - * The type of org, e.g. academic, government. - */ - public String getOrgDisambiguatedType() { - return orgDisambiguatedType; - } - - public void setOrgDisambiguatedType(String orgDisambiguatedType) { - this.orgDisambiguatedType = orgDisambiguatedType; - } - - public Integer getOrgDisambiguatedPopularity() { - return orgDisambiguatedPopularity; - } - - public void setOrgDisambiguatedPopularity(Integer orgDisambiguatedPopularity) { - this.orgDisambiguatedPopularity = orgDisambiguatedPopularity; - } - - public List getOrgNames() { - return orgNames; - } - - public void setOrgNames(List orgNames) { - this.orgNames = orgNames; - } - - public boolean isFundingOrg() { - return isFundingOrg; - } - - public void setFundingOrg(boolean isFundingOrg) { - this.isFundingOrg = isFundingOrg; - } - - public String getOrgDisambiguatedIdFromSource() { - return orgDisambiguatedIdFromSource; - } - - public void setOrgDisambiguatedIdFromSource(String orgDisambiguatedIdFromSource) { - this.orgDisambiguatedIdFromSource = orgDisambiguatedIdFromSource; - } - - /** - * The type of ID, e.g. RINGGOLD, FUNDREF - */ - public String getOrgDisambiguatedIdSourceType() { - return orgDisambiguatedIdSourceType; - } - - public void setOrgDisambiguatedIdSourceType(String orgDisambiguatedIdSourceType) { - this.orgDisambiguatedIdSourceType = orgDisambiguatedIdSourceType; - } - - public boolean isOrgChosenByMember() { - return isOrgChosenByMember; - } - - public void setOrgChosenByMember(boolean isOrgChosenByMember) { - this.isOrgChosenByMember = isOrgChosenByMember; - } - - public String getOrgDisambiguatedStatus() { - return orgDisambiguatedStatus; - } - - public void setOrgDisambiguatedStatus(String orgDisambiguatedStatus) { - this.orgDisambiguatedStatus = orgDisambiguatedStatus; - } - - public String getOrgNamesJson() { - return orgNamesJson; - } - - public void setOrgNamesJson(String orgNamesJson) { - this.orgNamesJson = orgNamesJson; - } - - public String getOrgLocationsJson() { - return orgLocationsJson; - } - - public void setOrgLocationsJson(String orgLocationsJson) { - this.orgLocationsJson = orgLocationsJson; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (isFundingOrg ? 1231 : 1237); - result = prime * result + (isOrgChosenByMember ? 1231 : 1237); - result = prime * result + ((orgDisambiguatedCity == null) ? 0 : orgDisambiguatedCity.hashCode()); - result = prime * result + ((orgDisambiguatedCountry == null) ? 0 : orgDisambiguatedCountry.hashCode()); - result = prime * result + ((orgDisambiguatedId == null) ? 0 : orgDisambiguatedId.hashCode()); - result = prime * result + ((orgDisambiguatedIdFromSource == null) ? 0 : orgDisambiguatedIdFromSource.hashCode()); - result = prime * result + ((orgDisambiguatedIdSourceType == null) ? 0 : orgDisambiguatedIdSourceType.hashCode()); - result = prime * result + ((orgDisambiguatedName == null) ? 0 : orgDisambiguatedName.hashCode()); - result = prime * result + ((orgDisambiguatedPopularity == null) ? 0 : orgDisambiguatedPopularity.hashCode()); - result = prime * result + ((orgDisambiguatedRegion == null) ? 0 : orgDisambiguatedRegion.hashCode()); - result = prime * result + ((orgDisambiguatedStatus == null) ? 0 : orgDisambiguatedStatus.hashCode()); - result = prime * result + ((orgDisambiguatedType == null) ? 0 : orgDisambiguatedType.hashCode()); - result = prime * result + ((orgNames == null) ? 0 : orgNames.hashCode()); - result = prime * result + ((orgNamesJson == null) ? 0 : orgNamesJson.hashCode()); - result = prime * result + ((orgLocationsJson == null) ? 0 : orgLocationsJson.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - OrgDisambiguatedSolrDocument other = (OrgDisambiguatedSolrDocument) obj; - if (isFundingOrg != other.isFundingOrg) - return false; - if (isOrgChosenByMember != other.isOrgChosenByMember) - return false; - if (orgDisambiguatedCity == null) { - if (other.orgDisambiguatedCity != null) - return false; - } else if (!orgDisambiguatedCity.equals(other.orgDisambiguatedCity)) - return false; - if (orgDisambiguatedCountry == null) { - if (other.orgDisambiguatedCountry != null) - return false; - } else if (!orgDisambiguatedCountry.equals(other.orgDisambiguatedCountry)) - return false; - if (orgDisambiguatedId == null) { - if (other.orgDisambiguatedId != null) - return false; - } else if (!orgDisambiguatedId.equals(other.orgDisambiguatedId)) - return false; - if (orgDisambiguatedIdFromSource == null) { - if (other.orgDisambiguatedIdFromSource != null) - return false; - } else if (!orgDisambiguatedIdFromSource.equals(other.orgDisambiguatedIdFromSource)) - return false; - if (orgDisambiguatedIdSourceType == null) { - if (other.orgDisambiguatedIdSourceType != null) - return false; - } else if (!orgDisambiguatedIdSourceType.equals(other.orgDisambiguatedIdSourceType)) - return false; - if (orgDisambiguatedName == null) { - if (other.orgDisambiguatedName != null) - return false; - } else if (!orgDisambiguatedName.equals(other.orgDisambiguatedName)) - return false; - if (orgDisambiguatedPopularity == null) { - if (other.orgDisambiguatedPopularity != null) - return false; - } else if (!orgDisambiguatedPopularity.equals(other.orgDisambiguatedPopularity)) - return false; - if (orgDisambiguatedRegion == null) { - if (other.orgDisambiguatedRegion != null) - return false; - } else if (!orgDisambiguatedRegion.equals(other.orgDisambiguatedRegion)) - return false; - if (orgDisambiguatedStatus == null) { - if (other.orgDisambiguatedStatus != null) - return false; - } else if (!orgDisambiguatedStatus.equals(other.orgDisambiguatedStatus)) - return false; - if (orgDisambiguatedType == null) { - if (other.orgDisambiguatedType != null) - return false; - } else if (!orgDisambiguatedType.equals(other.orgDisambiguatedType)) - return false; - if (orgNames == null) { - if (other.orgNames != null) - return false; - } else if (!orgNames.equals(other.orgNames)) - return false; - if (orgLocationsJson == null) { - if (other.orgLocationsJson != null) - return false; - } else if (!orgLocationsJson.equals(other.orgLocationsJson)) - return false; - if (orgNamesJson == null) { - if (other.orgNamesJson != null) - return false; - } else if (!orgNamesJson.equals(other.orgNamesJson)) - return false; - return true; - } - -} diff --git a/orcid-core/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java b/orcid-core/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java deleted file mode 100644 index a1f73751863..00000000000 --- a/orcid-core/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.orcid.utils.solr.entities; - -import java.util.Arrays; -import java.util.List; - -public class SolrConstants { - public static final String SCORE = "score"; - public static final String ORCID = "orcid"; - public static final String BIOGRAPHY = "biography"; - public static final String GIVEN_NAMES = "given-names"; - public static final String FAMILY_NAME = "family-name"; - public static final String GIVEN_AND_FAMILY_NAMES = "given-and-family-names"; - public static final String EMAIL_ADDRESS = "email"; - public static final String AFFILIATE_PAST_INSTITUTION_NAMES = "past-institution-affiliation-name"; - public static final String AFFILIATE_CURRENT_INSTITUTION_NAME = "current-institution-affiliation-name"; - public static final String CREDIT_NAME = "credit-name"; - public static final String OTHER_NAMES = "other-names"; - public static final String EXTERNAL_ID_TYPE_AND_VALUE = "external-id-type-and-value"; - public static final String EXTERNAL_ID_SOURCE = "external-id-source"; - public static final String EXTERNAL_ID_SOURCE_AND_REFERENCE = "external-id-source-and-reference"; - public static final String EXTERNAL_ID_REFERENCES = "external-id-reference"; - public static final String DIGITAL_OBJECT_IDS = "digital-object-ids"; - public static final String WORK_TITLES = "work-titles"; - public static final String GRANT_NUMBERS = "grant-numbers"; - public static final String FUNDING_TITLES = "funding-titles"; - public static final String KEYWORDS = "keyword"; - public static final String TEXT = "text"; - public static final String PROFILE_SUBMISSION_DATE = "profile-submission-date"; - public static final String PROFILE_LAST_MODIFIED_DATE = "profile-last-modified-date"; - public static final String PUBLIC_PROFILE = "public-profile-message"; - public static final String PRIMARY_RECORD = "primary-record"; - public static final String AGR = "agr"; - public static final String ARXIV = "arxiv"; - public static final String ASIN = "asin"; - public static final String ASIN_TLD = "asin-tld"; - public static final String BIBCODE = "bibcode"; - public static final String CBA = "cba"; - public static final String CIT = "cit"; - public static final String CTX = "ctx"; - public static final String EID = "eid"; - public static final String ETHOS = "ethos"; - public static final String HANDLE = "handle"; - public static final String HIR = "hir"; - public static final String ISBN = "isbn"; - public static final String ISSN = "issn"; - public static final String JFM = "jfm"; - public static final String JSTOR = "jstor"; - public static final String LCCN = "lccn"; - public static final String MR = "mr"; - public static final String OCLC = "oclc"; - public static final String OL = "ol"; - public static final String OSTI = "osti"; - public static final String PAT = "pat"; - public static final String PMC = "pmc"; - public static final String PMID = "pmid"; - public static final String RFC = "rfc"; - public static final String SOURCE_WORK_ID = "source-work-id"; - public static final String SSRN = "ssrn"; - public static final String URI = "uri"; - public static final String URN = "urn"; - public static final String WOSUID = "wosuid"; - public static final String ZBL = "zbl"; - public static final String OTHER_IDENTIFIER_TYPE = "other-identifier-type"; - public static final String ORG_DISAMBIGUATED_ID = "org-disambiguated-id"; - public static final String ORG_DISAMBIGUATED_NAME = "org-disambiguated-name"; - public static final String ORG_DISAMBIGUATED_CITY = "org-disambiguated-city"; - public static final String ORG_DISAMBIGUATED_REGION = "org-disambiguated-region"; - public static final String ORG_DISAMBIGUATED_COUNTRY = "org-disambiguated-country"; - public static final String ORG_DISAMBIGUATED_ID_FROM_SOURCE = "org-disambiguated-id-from-source"; - public static final String ORG_DISAMBIGUATED_ID_SOURCE_TYPE = "org-disambiguated-id-source-type"; - public static final String ORG_DISAMBIGUATED_STATUS = "org-disambiguated-status"; - public static final String ORG_DISAMBIGUATED_TYPE = "org-disambiguated-type"; - public static final String ORG_DISAMBIGUATED_POPULARITY = "org-disambiguated-popularity"; - public static final String ORG_DEFINED_FUNDING_TYPE = "org-defined-funding-type"; - public static final String ORG_CHOSEN_BY_MEMBER = "org-chosen-by-member"; - public static final String ORG_LOCATIONS_JSON = "org-locations-json"; - public static final String ORG_NAMES_JSON = "org-names-json"; - public static final String ORG_NAMES = "org-names"; - public static final String IS_FUNDING_ORG = "is-funding-org"; - public static final String DYNAMIC_SELF = "-self"; - public static final String DYNAMIC_PART_OF = "-part-of"; - public static final String DYNAMIC_VERSION_OF = "-version-of"; - public static final String DYNAMIC_ORGANISATION_ID = "-org-id"; - public static final String RINGGOLD_ORGANISATION_ID = "ringgold-org-id"; - public static final String FUNDREF_ORGANISATION_ID = "fundref-org-id"; - public static final String GRID_ORGANISATION_ID = "grid-org-id"; - public static final String ROR_ORGANISATION_ID = "ror-org-id"; - public static final String DYNAMIC_ORGANISATION_NAME = "-org-name"; - public static final String AFFILIATION_ORGANISATION_NAME = "affiliation-org-name"; - public static final String FUNDING_ORGANISATION_NAME = "funding-org-name"; - public static final String PEER_REVIEW_ORGANISATION_NAME = "peer-review-org-name"; - public static final String PEER_REVIEW_TYPE = "peer-review-type"; - public static final String PEER_REVIEW_ROLE = "peer-review-role"; - public static final String PEER_REVIEW_GROUP_ID = "peer-review-group-id"; - - public static final String RINGGOLD_ORG_TYPE = "RINGGOLD"; - public static final String GRID_ORG_TYPE = "GRID"; - public static final String FUNDREF_ORG_TYPE = "FUNDREF"; - public static final String ROR_ORG_TYPE = "ROR"; - - public static final String RESEARCH_RESOURCE_PROPOSAL_TITLES = "research-resource-proposal-title"; - public static final String RESEARCH_RESOURCE_PROPOSAL_HOSTS_NAME = "research-resource-proposal-org-name"; - public static final String RESEARCH_RESOURCE_ITEM_NAME = "research-resource-item-name"; - public static final String RESEARCH_RESOURCE_ITEM_HOSTS_NAME = "research-resource-item-org-name"; - - /** - * Fields client is allowed to specify - * - **/ - public static final List ALLOWED_FIELDS = Arrays.asList(SolrConstants.ORCID, SolrConstants.EMAIL_ADDRESS, SolrConstants.GIVEN_NAMES, - SolrConstants.FAMILY_NAME, SolrConstants.GIVEN_AND_FAMILY_NAMES, SolrConstants.AFFILIATE_CURRENT_INSTITUTION_NAME, - SolrConstants.AFFILIATE_PAST_INSTITUTION_NAMES, SolrConstants.CREDIT_NAME, SolrConstants.OTHER_NAMES); - -} diff --git a/orcid-utils/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java b/orcid-utils/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java index 5dc61c8058a..d837de9a4c2 100644 --- a/orcid-utils/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java +++ b/orcid-utils/src/main/java/org/orcid/utils/solr/entities/OrgDisambiguatedSolrDocument.java @@ -53,6 +53,12 @@ public class OrgDisambiguatedSolrDocument implements Serializable { @Field(SolrConstants.ORG_CHOSEN_BY_MEMBER) private boolean isOrgChosenByMember; + @Field(SolrConstants.ORG_NAMES_JSON) + private String orgNamesJson; + + @Field(SolrConstants.ORG_LOCATIONS_JSON) + private String orgLocationsJson; + public String getOrgDisambiguatedId() { return orgDisambiguatedId; } @@ -163,6 +169,22 @@ public void setOrgDisambiguatedStatus(String orgDisambiguatedStatus) { this.orgDisambiguatedStatus = orgDisambiguatedStatus; } + public String getOrgNamesJson() { + return orgNamesJson; + } + + public void setOrgNamesJson(String orgNamesJson) { + this.orgNamesJson = orgNamesJson; + } + + public String getOrgLocationsJson() { + return orgLocationsJson; + } + + public void setOrgLocationsJson(String orgLocationsJson) { + this.orgLocationsJson = orgLocationsJson; + } + @Override public int hashCode() { final int prime = 31; @@ -180,6 +202,8 @@ public int hashCode() { result = prime * result + ((orgDisambiguatedStatus == null) ? 0 : orgDisambiguatedStatus.hashCode()); result = prime * result + ((orgDisambiguatedType == null) ? 0 : orgDisambiguatedType.hashCode()); result = prime * result + ((orgNames == null) ? 0 : orgNames.hashCode()); + result = prime * result + ((orgNamesJson == null) ? 0 : orgNamesJson.hashCode()); + result = prime * result + ((orgLocationsJson == null) ? 0 : orgLocationsJson.hashCode()); return result; } @@ -251,6 +275,17 @@ public boolean equals(Object obj) { return false; } else if (!orgNames.equals(other.orgNames)) return false; + if (orgLocationsJson == null) { + if (other.orgLocationsJson != null) + return false; + } else if (!orgLocationsJson.equals(other.orgLocationsJson)) + return false; + if (orgNamesJson == null) { + if (other.orgNamesJson != null) + return false; + } else if (!orgNamesJson.equals(other.orgNamesJson)) + return false; return true; } + } diff --git a/orcid-utils/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java b/orcid-utils/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java index e04ee56c0fa..a1f73751863 100644 --- a/orcid-utils/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java +++ b/orcid-utils/src/main/java/org/orcid/utils/solr/entities/SolrConstants.java @@ -73,6 +73,8 @@ public class SolrConstants { public static final String ORG_DISAMBIGUATED_POPULARITY = "org-disambiguated-popularity"; public static final String ORG_DEFINED_FUNDING_TYPE = "org-defined-funding-type"; public static final String ORG_CHOSEN_BY_MEMBER = "org-chosen-by-member"; + public static final String ORG_LOCATIONS_JSON = "org-locations-json"; + public static final String ORG_NAMES_JSON = "org-names-json"; public static final String ORG_NAMES = "org-names"; public static final String IS_FUNDING_ORG = "is-funding-org"; public static final String DYNAMIC_SELF = "-self";