Search in sources :

Example 1 with Record

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

the class MemberV3ApiServiceDelegatorImpl 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);
    Api3_0_Dev1LastModifiedDatesHelper.calculateLastModified(record);
    return Response.ok(record).build();
}
Also used : Record(org.orcid.jaxb.model.v3.dev1.record.Record) GroupIdRecord(org.orcid.jaxb.model.v3.dev1.groupid.GroupIdRecord)

Example 2 with Record

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

the class PublicV3ApiServiceDelegatorTest method validateRecord.

private void validateRecord(Record record) {
    assertNotNull(record);
    assertEquals("/" + ORCID, record.getPath());
    validatePerson(record.getPerson());
    validateActivities(record.getActivitiesSummary());
    assertNotNull(record.getHistory());
    assertEquals(OrcidType.USER, record.getOrcidType());
    assertNotNull(record.getPreferences());
    assertEquals(Locale.EN, record.getPreferences().getLocale());
    History history = record.getHistory();
    assertTrue(history.getClaimed());
    assertNotNull(history.getCompletionDate());
    assertEquals(CreationMethod.INTEGRATION_TEST, history.getCreationMethod());
    assertNull(history.getDeactivationDate());
    assertNotNull(history.getLastModifiedDate());
    assertNotNull(history.getLastModifiedDate().getValue());
    assertNotNull(history.getSource());
    assertEquals("APP-5555555555555555", history.getSource().retrieveSourcePath());
    assertNotNull(history.getSubmissionDate());
    assertNotNull(record.getOrcidIdentifier());
    OrcidIdentifier id = record.getOrcidIdentifier();
    assertEquals("0000-0000-0000-0003", id.getPath());
}
Also used : OrcidIdentifier(org.orcid.jaxb.model.v3.dev1.common.OrcidIdentifier) History(org.orcid.jaxb.model.v3.dev1.record.History)

Example 3 with Record

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

the class PublicV3ApiServiceDelegatorTest method testFindRecord.

@Test
public void testFindRecord() {
    Response response = serviceDelegator.viewRecord(ORCID);
    assertNotNull(response);
    Record record = (Record) response.getEntity();
    validateRecord(record);
}
Also used : Response(javax.ws.rs.core.Response) Record(org.orcid.jaxb.model.v3.dev1.record.Record) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 4 with Record

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

the class PublicAPISecurityManagerV3Test method getRecordElement.

private Record getRecordElement() {
    Record r = new Record();
    r.setActivitiesSummary(getActivitiesSummaryElement());
    r.setPerson(getPersonElement());
    return r;
}
Also used : Record(org.orcid.jaxb.model.v3.dev1.record.Record)

Example 5 with Record

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

the class RecordManagerReadOnlyImpl method getPublicRecord.

@Override
public Record getPublicRecord(String orcid) {
    Record record = new Record();
    record.setOrcidType(getOrcidType(orcid));
    record.setHistory(getHistory(orcid));
    record.setOrcidIdentifier(getOrcidIdentifier(orcid));
    record.setPreferences(getPreferences(orcid));
    record.setActivitiesSummary(activitiesSummaryManager.getPublicActivitiesSummary(orcid));
    record.setPerson(personDetailsManager.getPublicPersonDetails(orcid));
    return record;
}
Also used : Record(org.orcid.jaxb.model.v3.dev1.record.Record)

Aggregations

Test (org.junit.Test)34 Record (org.orcid.jaxb.model.v3.dev1.record.Record)33 Email (org.orcid.jaxb.model.v3.dev1.record.Email)18 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)18 Person (org.orcid.jaxb.model.v3.dev1.record.Person)17 Address (org.orcid.jaxb.model.v3.dev1.record.Address)16 Keyword (org.orcid.jaxb.model.v3.dev1.record.Keyword)16 PersonExternalIdentifier (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier)16 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)16 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)15 Emails (org.orcid.jaxb.model.v3.dev1.record.Emails)15 Name (org.orcid.jaxb.model.v3.dev1.record.Name)15 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)15 EducationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)15 EmploymentSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EmploymentSummary)15 FundingSummary (org.orcid.jaxb.model.v3.dev1.record.summary.FundingSummary)15 WorkSummary (org.orcid.jaxb.model.v3.dev1.record.summary.WorkSummary)15 OtherNames (org.orcid.jaxb.model.v3.dev1.record.OtherNames)14 DistinctionSummary (org.orcid.jaxb.model.v3.dev1.record.summary.DistinctionSummary)14 InvitedPositionSummary (org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositionSummary)14