Search in sources :

Example 71 with OtherName

use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.

the class PersonDetailsManagerReadOnlyImpl method getPersonDetails.

@Override
public Person getPersonDetails(String orcid) {
    long lastModifiedTime = getLastModified(orcid);
    Person person = new Person();
    person.setName(recordNameManager.getRecordName(orcid));
    person.setBiography(biographyManager.getBiography(orcid));
    Addresses addresses = addressManager.getAddresses(orcid);
    if (addresses.getAddress() != null) {
        Addresses filteredAddresses = new Addresses();
        filteredAddresses.setAddress(new ArrayList<Address>(addresses.getAddress()));
        person.setAddresses(filteredAddresses);
    }
    PersonExternalIdentifiers extIds = externalIdentifierManager.getExternalIdentifiers(orcid);
    if (extIds.getExternalIdentifiers() != null) {
        PersonExternalIdentifiers filteredExtIds = new PersonExternalIdentifiers();
        filteredExtIds.setExternalIdentifiers(new ArrayList<PersonExternalIdentifier>(extIds.getExternalIdentifiers()));
        person.setExternalIdentifiers(filteredExtIds);
    }
    Keywords keywords = profileKeywordManager.getKeywords(orcid);
    if (keywords.getKeywords() != null) {
        Keywords filteredKeywords = new Keywords();
        filteredKeywords.setKeywords(new ArrayList<Keyword>(keywords.getKeywords()));
        person.setKeywords(filteredKeywords);
    }
    OtherNames otherNames = otherNameManager.getOtherNames(orcid);
    if (otherNames.getOtherNames() != null) {
        OtherNames filteredOtherNames = new OtherNames();
        filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames()));
        person.setOtherNames(filteredOtherNames);
    }
    ResearcherUrls rUrls = researcherUrlManager.getResearcherUrls(orcid);
    if (rUrls.getResearcherUrls() != null) {
        ResearcherUrls filteredRUrls = new ResearcherUrls();
        filteredRUrls.setResearcherUrls(new ArrayList<ResearcherUrl>(rUrls.getResearcherUrls()));
        person.setResearcherUrls(filteredRUrls);
    }
    Emails emails = emailManager.getEmails(orcid);
    if (emails.getEmails() != null) {
        Emails filteredEmails = new Emails();
        filteredEmails.setEmails(new ArrayList<Email>(emails.getEmails()));
        person.setEmails(filteredEmails);
    }
    return person;
}
Also used : Keywords(org.orcid.jaxb.model.v3.dev1.record.Keywords) Email(org.orcid.jaxb.model.v3.dev1.record.Email) Address(org.orcid.jaxb.model.v3.dev1.record.Address) Keyword(org.orcid.jaxb.model.v3.dev1.record.Keyword) OtherNames(org.orcid.jaxb.model.v3.dev1.record.OtherNames) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) PersonExternalIdentifier(org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier) Addresses(org.orcid.jaxb.model.v3.dev1.record.Addresses) PersonExternalIdentifiers(org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifiers) ResearcherUrls(org.orcid.jaxb.model.v3.dev1.record.ResearcherUrls) ResearcherUrl(org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl) Emails(org.orcid.jaxb.model.v3.dev1.record.Emails) Person(org.orcid.jaxb.model.v3.dev1.record.Person)

Example 72 with OtherName

use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.

the class JpaJaxbOtherNameAdapterImpl method toOtherNameList.

@Override
public OtherNames toOtherNameList(Collection<OtherNameEntity> entities) {
    if (entities == null) {
        return null;
    }
    List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class);
    OtherNames otherNames = new OtherNames();
    otherNames.setOtherNames(otherNameList);
    return otherNames;
}
Also used : OtherNames(org.orcid.jaxb.model.v3.dev1.record.OtherNames) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName)

Example 73 with OtherName

use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.

the class JpaJaxbOtherNameAdapterImpl method toMinimizedOtherNameList.

@Override
public OtherNames toMinimizedOtherNameList(Collection<OtherNameEntity> entities) {
    if (entities == null) {
        return null;
    }
    List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class);
    for (OtherName otherName : otherNameList) {
        otherName.setCreatedDate(null);
        otherName.setSource(null);
    }
    OtherNames otherNames = new OtherNames();
    otherNames.setOtherNames(otherNameList);
    return otherNames;
}
Also used : OtherNames(org.orcid.jaxb.model.v3.dev1.record.OtherNames) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName)

Example 74 with OtherName

use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.

the class MapperFacadeFactory method getOtherNameMapperFacade.

public MapperFacade getOtherNameMapperFacade() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    ClassMapBuilder<OtherName, OtherNameEntity> otherNameClassMap = mapperFactory.classMap(OtherName.class, OtherNameEntity.class);
    addV3DateFields(otherNameClassMap);
    registerSourceConverters(mapperFactory, otherNameClassMap);
    otherNameClassMap.field("putCode", "id");
    otherNameClassMap.field("content", "displayName");
    otherNameClassMap.field("path", "profile.orcid");
    otherNameClassMap.fieldBToA("displayIndex", "displayIndex");
    otherNameClassMap.byDefault();
    otherNameClassMap.register();
    return mapperFactory.getMapperFacade();
}
Also used : DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) MapperFactory(ma.glasnost.orika.MapperFactory) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) OtherNameEntity(org.orcid.persistence.jpa.entities.OtherNameEntity)

Example 75 with OtherName

use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createOtherName.

protected OtherName createOtherName(Visibility v, String sourceId) {
    OtherName otherName = new OtherName();
    otherName.setContent("other-name-" + System.currentTimeMillis());
    otherName.setVisibility(v);
    setSource(otherName, sourceId);
    return otherName;
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName)

Aggregations

OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)104 Test (org.junit.Test)82 OtherNames (org.orcid.jaxb.model.v3.dev1.record.OtherNames)53 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)43 Address (org.orcid.jaxb.model.v3.dev1.record.Address)39 Name (org.orcid.jaxb.model.v3.dev1.record.Name)39 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)39 Keyword (org.orcid.jaxb.model.v3.dev1.record.Keyword)38 PersonExternalIdentifier (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier)38 Email (org.orcid.jaxb.model.v3.dev1.record.Email)36 Addresses (org.orcid.jaxb.model.v3.dev1.record.Addresses)30 Emails (org.orcid.jaxb.model.v3.dev1.record.Emails)30 Keywords (org.orcid.jaxb.model.v3.dev1.record.Keywords)30 PersonExternalIdentifiers (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifiers)30 ResearcherUrls (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrls)30 Person (org.orcid.jaxb.model.v3.dev1.record.Person)28 DBUnitTest (org.orcid.test.DBUnitTest)22 Response (javax.ws.rs.core.Response)20 PersonalDetails (org.orcid.jaxb.model.v3.dev1.record.PersonalDetails)17 ArrayList (java.util.ArrayList)16