Search in sources :

Example 91 with OrcidMessage

use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.

the class NotificationManagerTest method getProfile.

private OrcidProfile getProfile(Locale locale) throws JAXBException {
    OrcidMessage orcidMessage = (OrcidMessage) unmarshaller.unmarshal(getClass().getResourceAsStream(ORCID_INTERNAL_FULL_XML));
    OrcidProfile orcidProfile = orcidMessage.getOrcidProfile();
    orcidProfile.getOrcidPreferences().setLocale(locale);
    orcidProfile.getOrcidIdentifier().setPath("0000-0000-0000-0003");
    return orcidProfile;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage)

Example 92 with OrcidMessage

use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.

the class OrcidIndexManagerImplTest method fullyPopulatedSolrDocumentForPersistence.

private OrcidSolrDocument fullyPopulatedSolrDocumentForPersistence() {
    OrcidSolrDocument orcidSolrDocument = new OrcidSolrDocument();
    orcidSolrDocument.setOrcid("1234");
    orcidSolrDocument.setCreditName("credit name");
    orcidSolrDocument.setArxiv(new ArrayList<String>());
    orcidSolrDocument.setAsin(new ArrayList<String>());
    orcidSolrDocument.setAsintld(new ArrayList<String>());
    orcidSolrDocument.setBibcode(new ArrayList<String>());
    orcidSolrDocument.setDigitalObjectIds(new ArrayList<String>());
    orcidSolrDocument.setEid(new ArrayList<String>());
    orcidSolrDocument.setIsbn(new ArrayList<String>());
    orcidSolrDocument.setIssn(new ArrayList<String>());
    orcidSolrDocument.setJfm(new ArrayList<String>());
    orcidSolrDocument.setJstor(new ArrayList<String>());
    orcidSolrDocument.setLccn(new ArrayList<String>());
    orcidSolrDocument.setMr(new ArrayList<String>());
    orcidSolrDocument.setOclc(new ArrayList<String>());
    orcidSolrDocument.setOl(new ArrayList<String>());
    orcidSolrDocument.setOsti(new ArrayList<String>());
    orcidSolrDocument.setOtherIdentifierType(new ArrayList<String>());
    orcidSolrDocument.setPmc(new ArrayList<String>());
    orcidSolrDocument.setRfc(new ArrayList<String>());
    orcidSolrDocument.setSsrn(new ArrayList<String>());
    orcidSolrDocument.setZbl(new ArrayList<String>());
    orcidSolrDocument.setFamilyName("familyName");
    orcidSolrDocument.setGivenNames("givenNames");
    orcidSolrDocument.addEmailAddress("email");
    // orcidSolrDocument.setAffiliatePrimaryInstitutionNames(Arrays.asList(new
    // String[] { "Primary Inst1" }));
    // orcidSolrDocument.setAffiliateInstitutionNames(Arrays.asList(new
    // String[] { "Current Inst2" }));
    orcidSolrDocument.setOtherNames(Arrays.asList(new String[] { "Other 1", "Other 2" }));
    orcidSolrDocument.setPmid(Arrays.asList(new String[] { "work1-pmid" }));
    orcidSolrDocument.setExternalIdSources(Arrays.asList(new String[] { "45678", "54321" }));
    orcidSolrDocument.setExternalIdReferences(Arrays.asList(new String[] { "defghi", "abc123" }));
    orcidSolrDocument.setExternalIdSourcesAndReferences(Arrays.asList(new String[] { "45678=defghi", "54321=abc123" }));
    // orcidSolrDocument.setPastInstitutionNames(Arrays.asList(new String[]
    // { "Past Inst 1", "Past Inst 2" }));
    orcidSolrDocument.setWorkTitles(Arrays.asList(new String[] { "Work title 1", "Work title 2" }));
    orcidSolrDocument.setKeywords(Arrays.asList(new String[] { "Pavement Studies", "Advanced Tea Making" }));
    OrcidProfile orcidProfile = getStandardOrcid();
    OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
    orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
    return orcidSolrDocument;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) OrcidSolrDocument(org.orcid.utils.solr.entities.OrcidSolrDocument) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage)

Example 93 with OrcidMessage

use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.

the class OrcidIndexManagerImplTest method solrDocumentLimitedtoVisibleDoi.

private OrcidSolrDocument solrDocumentLimitedtoVisibleDoi() {
    OrcidSolrDocument orcidSolrDocument = fullyPopulatedSolrDocumentForPersistence();
    orcidSolrDocument.setDigitalObjectIds((Arrays.asList(new String[] { "work1-doi1", "work2-doi1", "work2-doi2" })));
    OrcidProfile orcidProfile = getStandardOrcidWithDoiInformation();
    OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
    orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
    return orcidSolrDocument;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) OrcidSolrDocument(org.orcid.utils.solr.entities.OrcidSolrDocument) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage)

Example 94 with OrcidMessage

use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.

the class OrcidIndexManagerImplTest method solrDocWithAdditionalSubtitles.

private OrcidSolrDocument solrDocWithAdditionalSubtitles() {
    OrcidSolrDocument orcidSolrDocument = fullyPopulatedSolrDocumentForPersistence();
    orcidSolrDocument.setWorkTitles(Arrays.asList(new String[] { "Work title 1", "Subtitle 1", "Work title 2", "Subtitle 2" }));
    OrcidProfile orcidProfile = getOrcidWithSubtitledWork();
    OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
    orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
    return orcidSolrDocument;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) OrcidSolrDocument(org.orcid.utils.solr.entities.OrcidSolrDocument) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage)

Example 95 with OrcidMessage

use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.

the class OrcidIndexManagerImplTest method mandatoryDBFieldsSolrDocumentForPersistence.

/**
     * According to the current schema - these fields are required by the DB -
     * they may or may not make it into SOLR due to visibility restrictions
     * 
     * @return
     */
private OrcidSolrDocument mandatoryDBFieldsSolrDocumentForPersistence() {
    OrcidSolrDocument orcidSolrDocument = new OrcidSolrDocument();
    orcidSolrDocument.setOrcid("5678");
    orcidSolrDocument.setFamilyName("Logan");
    orcidSolrDocument.setGivenNames("Donald Edward");
    // orcidSolrDocument.setAffiliatePrimaryInstitutionNames(Arrays.asList(new
    // String[] { "University of Portsmouth" }));
    OrcidProfile orcidProfile = getOrcidProfileMandatoryOnly();
    OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
    orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
    return orcidSolrDocument;
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) OrcidSolrDocument(org.orcid.utils.solr.entities.OrcidSolrDocument) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage)

Aggregations

OrcidMessage (org.orcid.jaxb.model.message.OrcidMessage)173 Test (org.junit.Test)108 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)64 DBUnitTest (org.orcid.test.DBUnitTest)49 ClientResponse (com.sun.jersey.api.client.ClientResponse)36 Response (javax.ws.rs.core.Response)26 OrcidWork (org.orcid.jaxb.model.message.OrcidWork)22 Transactional (org.springframework.transaction.annotation.Transactional)22 OrcidActivities (org.orcid.jaxb.model.message.OrcidActivities)20 OrcidBio (org.orcid.jaxb.model.message.OrcidBio)19 Email (org.orcid.jaxb.model.message.Email)18 BaseTest (org.orcid.core.BaseTest)17 OrcidIdentifier (org.orcid.jaxb.model.message.OrcidIdentifier)16 Affiliation (org.orcid.jaxb.model.message.Affiliation)13 OrcidSearchResult (org.orcid.jaxb.model.message.OrcidSearchResult)12 WorkExternalIdentifier (org.orcid.jaxb.model.message.WorkExternalIdentifier)12 JAXBContext (javax.xml.bind.JAXBContext)11 Unmarshaller (javax.xml.bind.Unmarshaller)11 Organization (org.orcid.jaxb.model.message.Organization)11 OrganizationAddress (org.orcid.jaxb.model.message.OrganizationAddress)11