Search in sources :

Example 1 with OrgDisambiguated

use of org.orcid.pojo.OrgDisambiguated in project ORCID-Source by ORCID.

the class OrgDisambiguatedManagerImpl method findInDB.

@Override
public OrgDisambiguated findInDB(Long id) {
    OrgDisambiguatedEntity orgDisambiguatedEntity = orgDisambiguatedDao.find(id);
    OrgDisambiguated org = new OrgDisambiguated();
    org.setValue(orgDisambiguatedEntity.getName());
    org.setCity(orgDisambiguatedEntity.getCity());
    org.setRegion(orgDisambiguatedEntity.getRegion());
    org.setCountry(orgDisambiguatedEntity.getCountry().value());
    org.setOrgType(orgDisambiguatedEntity.getOrgType());
    org.setSourceId(orgDisambiguatedEntity.getSourceId());
    org.setSourceType(orgDisambiguatedEntity.getSourceType());
    return org;
}
Also used : OrgDisambiguatedEntity(org.orcid.persistence.jpa.entities.OrgDisambiguatedEntity) OrgDisambiguated(org.orcid.pojo.OrgDisambiguated)

Example 2 with OrgDisambiguated

use of org.orcid.pojo.OrgDisambiguated in project ORCID-Source by ORCID.

the class OrgDisambiguatedManagerImpl method searchOrgsFromSolr.

@Override
public List<OrgDisambiguated> searchOrgsFromSolr(String searchTerm, int firstResult, int maxResult, boolean fundersOnly) {
    List<OrgDisambiguatedSolrDocument> docs = orgDisambiguatedSolrDao.getOrgs(searchTerm, firstResult, maxResult, fundersOnly);
    List<OrgDisambiguated> ret = new ArrayList<OrgDisambiguated>();
    for (OrgDisambiguatedSolrDocument doc : docs) {
        OrgDisambiguated org = new OrgDisambiguated();
        org.setValue(doc.getOrgDisambiguatedName());
        org.setCity(doc.getOrgDisambiguatedCity());
        org.setRegion(doc.getOrgDisambiguatedRegion());
        org.setCountry(doc.getOrgDisambiguatedCountry());
        org.setOrgType(doc.getOrgDisambiguatedType());
        org.setDisambiguatedAffiliationIdentifier(Long.toString(doc.getOrgDisambiguatedId()));
        ret.add(org);
    }
    return ret;
}
Also used : ArrayList(java.util.ArrayList) OrgDisambiguatedSolrDocument(org.orcid.utils.solr.entities.OrgDisambiguatedSolrDocument) OrgDisambiguated(org.orcid.pojo.OrgDisambiguated)

Aggregations

OrgDisambiguated (org.orcid.pojo.OrgDisambiguated)2 ArrayList (java.util.ArrayList)1 OrgDisambiguatedEntity (org.orcid.persistence.jpa.entities.OrgDisambiguatedEntity)1 OrgDisambiguatedSolrDocument (org.orcid.utils.solr.entities.OrgDisambiguatedSolrDocument)1