Search in sources :

Example 86 with Record

use of org.orcid.jaxb.model.record_rc4.Record in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method testMarshallRecord.

@Test
public void testMarshallRecord() throws JAXBException, SAXException, URISyntaxException {
    Record object = (Record) unmarshallFromPath("/record_2.0_rc3/samples/record-2.0_rc3.xml", Record.class);
    marshall(object, "/record_2.0_rc3/record-2.0_rc3.xsd");
}
Also used : Record(org.orcid.jaxb.model.record_rc3.Record) Test(org.junit.Test)

Example 87 with Record

use of org.orcid.jaxb.model.record_rc4.Record in project ORCID-Source by ORCID.

the class ValidateV2RC4Identifiers method testRecord.

@Test
public void testRecord() {
    Record record = unmarshallFromPath("/record_2.0_rc4/samples/record-2.0_rc4.xml", Record.class);
    ActivitiesSummary as = record.getActivitiesSummary();
    ExternalIDs fundingIDs = as.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getExternalIdentifiers();
    ExternalIDs fundingIDs2 = as.getFundings().getFundingGroup().get(0).getIdentifiers();
    assertEquals("grant_number", fundingIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", fundingIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), fundingIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, fundingIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getType(), fundingIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getValue(), fundingIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs workIDs = as.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getExternalIdentifiers();
    ExternalIDs workIDs2 = as.getWorks().getWorkGroup().get(0).getIdentifiers();
    assertEquals("agr", workIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", workIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), workIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, workIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(workIDs.getExternalIdentifier().get(0).getType(), workIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(workIDs.getExternalIdentifier().get(0).getValue(), workIDs2.getExternalIdentifier().get(0).getValue());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_rc4.ExternalIDs) Record(org.orcid.jaxb.model.record_rc4.Record) Url(org.orcid.jaxb.model.common_rc4.Url) ActivitiesSummary(org.orcid.jaxb.model.record.summary_rc4.ActivitiesSummary) MarshallingTest(org.orcid.jaxb.model.notification.custom.MarshallingTest) Test(org.junit.Test)

Example 88 with Record

use of org.orcid.jaxb.model.record_rc4.Record in project ORCID-Source by ORCID.

the class ValidateV2IdentifiersTest method testRecord.

@Test
public void testRecord() {
    Record record = unmarshallFromPath("/record_2.0/samples/read_samples/record-2.0.xml", Record.class);
    ActivitiesSummary as = record.getActivitiesSummary();
    ExternalIDs fundingIDs = as.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getExternalIdentifiers();
    ExternalIDs fundingIDs2 = as.getFundings().getFundingGroup().get(0).getIdentifiers();
    assertEquals("grant_number", fundingIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", fundingIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), fundingIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, fundingIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getType(), fundingIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getValue(), fundingIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs workIDs = as.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getExternalIdentifiers();
    ExternalIDs workIDs2 = as.getWorks().getWorkGroup().get(0).getIdentifiers();
    assertEquals("agr", workIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", workIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), workIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, workIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(workIDs.getExternalIdentifier().get(0).getType(), workIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(workIDs.getExternalIdentifier().get(0).getValue(), workIDs2.getExternalIdentifier().get(0).getValue());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) Record(org.orcid.jaxb.model.record_v2.Record) Url(org.orcid.jaxb.model.common_v2.Url) ActivitiesSummary(org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary) MarshallingTest(org.orcid.jaxb.model.notification.custom.MarshallingTest) Test(org.junit.Test)

Example 89 with Record

use of org.orcid.jaxb.model.record_rc4.Record in project ORCID-Source by ORCID.

the class ValidateV2RC2SamplesTest method testMarshallRecord.

@Test
public void testMarshallRecord() throws JAXBException, SAXException, URISyntaxException {
    Record object = (Record) unmarshallFromPath("/record_2.0_rc2/samples/record-2.0_rc2.xml", Record.class);
    marshall(object, "/record_2.0_rc2/record-2.0_rc2.xsd");
}
Also used : Record(org.orcid.jaxb.model.record_rc2.Record) Test(org.junit.Test)

Example 90 with Record

use of org.orcid.jaxb.model.record_rc4.Record in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegatorImpl method viewRecord.

@Override
public Response viewRecord(String orcid) {
    Record record = recordManagerReadOnly.getRecord(orcid);
    orcidSecurityManager.checkAndFilter(orcid, record);
    if (record.getPerson() != null) {
        sourceUtils.setSourceName(record.getPerson());
    }
    if (record.getActivitiesSummary() != null) {
        ActivityUtils.cleanEmptyFields(record.getActivitiesSummary());
        sourceUtils.setSourceName(record.getActivitiesSummary());
    }
    ElementUtils.setPathToRecord(record, orcid);
    Api2_0_LastModifiedDatesHelper.calculateLastModified(record);
    return Response.ok(record).build();
}
Also used : GroupIdRecord(org.orcid.jaxb.model.groupid_v2.GroupIdRecord) Record(org.orcid.jaxb.model.record_v2.Record)

Aggregations

Test (org.junit.Test)73 Record (org.orcid.jaxb.model.record_v2.Record)62 ActivitiesSummary (org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary)25 Person (org.orcid.jaxb.model.record_v2.Person)22 Email (org.orcid.jaxb.model.record_v2.Email)20 Record (nikita.model.noark5.v4.Record)19 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)19 Address (org.orcid.jaxb.model.record_v2.Address)19 Name (org.orcid.jaxb.model.record_v2.Name)19 OtherName (org.orcid.jaxb.model.record_v2.OtherName)19 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)19 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)18 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)18 FundingSummary (org.orcid.jaxb.model.record.summary_v2.FundingSummary)18 Keyword (org.orcid.jaxb.model.record_v2.Keyword)18 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)18 Emails (org.orcid.jaxb.model.record_v2.Emails)17 Record (org.neo4j.driver.v1.Record)16 PeerReviewSummary (org.orcid.jaxb.model.record.summary_v2.PeerReviewSummary)16 Addresses (org.orcid.jaxb.model.record_v2.Addresses)16