Search in sources :

Example 71 with EmploymentSummary

use of org.orcid.jaxb.model.record.summary_rc3.EmploymentSummary in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method getEmployments.

private Employments getEmployments(Visibility... vs) {
    Employments e = new Employments();
    for (Visibility v : vs) {
        EmploymentSummary s = new EmploymentSummary();
        s.setVisibility(v);
        e.getSummaries().add(s);
    }
    return e;
}
Also used : Employments(org.orcid.jaxb.model.record.summary_v2.Employments) EmploymentSummary(org.orcid.jaxb.model.record.summary_v2.EmploymentSummary) Visibility(org.orcid.jaxb.model.common_v2.Visibility)

Example 72 with EmploymentSummary

use of org.orcid.jaxb.model.record.summary_rc3.EmploymentSummary in project ORCID-Source by ORCID.

the class PublicV2ApiServiceDelegatorImpl method viewEmploymentSummary.

@Override
public Response viewEmploymentSummary(String orcid, Long putCode) {
    EmploymentSummary es = affiliationsManagerReadOnly.getEmploymentSummary(orcid, putCode);
    publicAPISecurityManagerV2.checkIsPublic(es);
    ActivityUtils.setPathToActivity(es, orcid);
    sourceUtilsReadOnly.setSourceName(es);
    return Response.ok(es).build();
}
Also used : EmploymentSummary(org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)

Example 73 with EmploymentSummary

use of org.orcid.jaxb.model.record.summary_rc3.EmploymentSummary in project ORCID-Source by ORCID.

the class PublicV2ApiServiceDelegatorImpl method viewEmployments.

@Override
public Response viewEmployments(String orcid) {
    List<EmploymentSummary> employments = affiliationsManagerReadOnly.getEmploymentSummaryList(orcid, getLastModifiedTime(orcid));
    Employments publicEmployments = new Employments();
    for (EmploymentSummary summary : employments) {
        if (Visibility.PUBLIC.equals(summary.getVisibility())) {
            ActivityUtils.setPathToActivity(summary, orcid);
            sourceUtilsReadOnly.setSourceName(summary);
            publicEmployments.getSummaries().add(summary);
        }
    }
    Api2_0_LastModifiedDatesHelper.calculateLastModified(publicEmployments);
    ActivityUtils.setPathToEmployments(publicEmployments, orcid);
    return Response.ok(publicEmployments).build();
}
Also used : Employments(org.orcid.jaxb.model.record.summary_v2.Employments) EmploymentSummary(org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)

Example 74 with EmploymentSummary

use of org.orcid.jaxb.model.record.summary_rc3.EmploymentSummary in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegatorImpl method viewEmploymentSummary.

@Override
public Response viewEmploymentSummary(String orcid, Long putCode) {
    EmploymentSummary es = affiliationsManagerReadOnly.getEmploymentSummary(orcid, putCode);
    orcidSecurityManager.checkAndFilter(orcid, es, ScopePathType.AFFILIATIONS_READ_LIMITED);
    ActivityUtils.setPathToActivity(es, orcid);
    sourceUtils.setSourceName(es);
    return Response.ok(es).build();
}
Also used : EmploymentSummary(org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)

Example 75 with EmploymentSummary

use of org.orcid.jaxb.model.record.summary_rc3.EmploymentSummary in project ORCID-Source by ORCID.

the class AffiliationsManagerTest method testGetAllEmployments.

@Test
public void testGetAllEmployments() {
    String orcid = "0000-0000-0000-0003";
    List<EmploymentSummary> elements = affiliationsManager.getEmploymentSummaryList(orcid, System.currentTimeMillis());
    assertNotNull(elements);
    assertEquals(5, elements.size());
    boolean found1 = false, found2 = false, found3 = false, found4 = false, found5 = false;
    for (EmploymentSummary element : elements) {
        if (17 == element.getPutCode()) {
            found1 = true;
        } else if (18 == element.getPutCode()) {
            found2 = true;
        } else if (19 == element.getPutCode()) {
            found3 = true;
        } else if (23 == element.getPutCode()) {
            found4 = true;
        } else if (24 == element.getPutCode()) {
            found5 = true;
        } else {
            fail("Invalid element found: " + element.getPutCode());
        }
    }
    assertTrue(found1);
    assertTrue(found2);
    assertTrue(found3);
    assertTrue(found4);
    assertTrue(found5);
}
Also used : EmploymentSummary(org.orcid.jaxb.model.record.summary_v2.EmploymentSummary) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Aggregations

Test (org.junit.Test)60 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)60 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)47 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)46 FundingSummary (org.orcid.jaxb.model.record.summary_v2.FundingSummary)45 PeerReviewSummary (org.orcid.jaxb.model.record.summary_v2.PeerReviewSummary)43 ActivitiesSummary (org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary)40 ClientResponse (com.sun.jersey.api.client.ClientResponse)20 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)19 Address (org.orcid.jaxb.model.record_v2.Address)18 Email (org.orcid.jaxb.model.record_v2.Email)18 Keyword (org.orcid.jaxb.model.record_v2.Keyword)18 OtherName (org.orcid.jaxb.model.record_v2.OtherName)18 Record (org.orcid.jaxb.model.record_v2.Record)18 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)18 Name (org.orcid.jaxb.model.record_v2.Name)17 Addresses (org.orcid.jaxb.model.record_v2.Addresses)15 Biography (org.orcid.jaxb.model.record_v2.Biography)15 Emails (org.orcid.jaxb.model.record_v2.Emails)15 Keywords (org.orcid.jaxb.model.record_v2.Keywords)15