Search in sources :

Example 6 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV3Test method setVisibility.

private void setVisibility(GroupsContainer container, Visibility... vs) {
    assertEquals(container.retrieveGroups().size(), vs.length);
    int idx = 0;
    for (Group g : container.retrieveGroups()) {
        // Every group have just one element
        assertEquals(1, g.getActivities().size());
        for (Filterable f : g.getActivities()) {
            f.setVisibility(vs[idx++]);
        }
    }
}
Also used : FundingGroup(org.orcid.jaxb.model.v3.dev1.record.summary.FundingGroup) Group(org.orcid.jaxb.model.v3.dev1.record.Group) PeerReviewGroup(org.orcid.jaxb.model.v3.dev1.record.summary.PeerReviewGroup) WorkGroup(org.orcid.jaxb.model.v3.dev1.record.summary.WorkGroup) Filterable(org.orcid.jaxb.model.v3.dev1.common.Filterable)

Example 7 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV3Test method getActivitiesSummaryElement.

private ActivitiesSummary getActivitiesSummaryElement() {
    Visibility[] vs = { Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC };
    ActivitiesSummary s = new ActivitiesSummary();
    s.setDistinctions(getDistinctions(vs));
    s.setEducations(getEducations(vs));
    s.setEmployments(getEmployments(vs));
    s.setInvitedPositions(getInvitedPositions(vs));
    s.setMemberships(getMemberships(vs));
    s.setQualifications(getQualifications(vs));
    s.setServices(getServices(vs));
    s.setFundings(getFundings(vs));
    s.setPeerReviews(getPeerReviews(vs));
    s.setWorks(getWorks(vs));
    return s;
}
Also used : Visibility(org.orcid.jaxb.model.v3.dev1.common.Visibility) ActivitiesSummary(org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)

Example 8 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV3Test method getOtherNamesElement.

private OtherNames getOtherNamesElement(Visibility... vs) {
    OtherNames otherNames = new OtherNames();
    for (Visibility v : vs) {
        OtherName o = new OtherName();
        o.setVisibility(v);
        if (otherNames.getOtherNames() == null) {
            otherNames.setOtherNames(new ArrayList<OtherName>());
        }
        otherNames.getOtherNames().add(o);
    }
    return otherNames;
}
Also used : OtherNames(org.orcid.jaxb.model.v3.dev1.record.OtherNames) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Visibility(org.orcid.jaxb.model.v3.dev1.common.Visibility)

Example 9 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV3Test method getAddressesElement.

private Addresses getAddressesElement(Visibility... vs) {
    Addresses elements = new Addresses();
    for (Visibility v : vs) {
        Address element = new Address();
        element.setVisibility(v);
        if (elements.getAddress() == null) {
            elements.setAddress(new ArrayList<Address>());
        }
        elements.getAddress().add(element);
    }
    return elements;
}
Also used : Addresses(org.orcid.jaxb.model.v3.dev1.record.Addresses) Address(org.orcid.jaxb.model.v3.dev1.record.Address) Visibility(org.orcid.jaxb.model.v3.dev1.common.Visibility)

Example 10 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV3Test method getFilterableElement.

/**
 * Utilities
 */
private Filterable getFilterableElement(Visibility v) {
    EducationSummary s = new EducationSummary();
    s.setVisibility(v);
    return s;
}
Also used : EducationSummary(org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)

Aggregations

Visibility (org.orcid.jaxb.model.v3.dev1.common.Visibility)44 ClientResponse (com.sun.jersey.api.client.ClientResponse)17 Test (org.junit.Test)17 ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)12 Url (org.orcid.jaxb.model.v3.dev1.common.Url)11 OrcidError (org.orcid.jaxb.model.v3.dev1.error.OrcidError)11 ExternalIDs (org.orcid.jaxb.model.v3.dev1.record.ExternalIDs)11 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)11 HashMap (java.util.HashMap)10 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)10 Name (org.orcid.jaxb.model.v3.dev1.record.Name)7 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)7 Organization (org.orcid.jaxb.model.v3.dev1.common.Organization)6 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)6 Work (org.orcid.jaxb.model.v3.dev1.record.Work)6 EducationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)6 Date (java.util.Date)5 OrcidDuplicatedElementException (org.orcid.core.exception.OrcidDuplicatedElementException)5