Search in sources :

Example 71 with Visibility

use of org.orcid.jaxb.model.common_rc2.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test 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.record_v2.Addresses) Address(org.orcid.jaxb.model.record_v2.Address) Visibility(org.orcid.jaxb.model.common_v2.Visibility)

Example 72 with Visibility

use of org.orcid.jaxb.model.common_rc2.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method getPersonElement.

private Person getPersonElement() {
    Visibility[] vs = { Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC };
    Person p = new Person();
    p.setAddresses(getAddressesElement(vs));
    p.setEmails(getEmailsElement(vs));
    p.setExternalIdentifiers(getPersonExternalIdentifiersElement(vs));
    p.setKeywords(getKeywordsElement(vs));
    p.setOtherNames(getOtherNamesElement(vs));
    p.setResearcherUrls(getResearcherUrlsElement(vs));
    Name name = new Name();
    name.setVisibility(Visibility.PUBLIC);
    p.setName(name);
    Biography b = new Biography();
    b.setVisibility(Visibility.PUBLIC);
    b.setContent("Biography test");
    p.setBiography(b);
    return p;
}
Also used : Biography(org.orcid.jaxb.model.record_v2.Biography) Visibility(org.orcid.jaxb.model.common_v2.Visibility) Person(org.orcid.jaxb.model.record_v2.Person) OtherName(org.orcid.jaxb.model.record_v2.OtherName) Name(org.orcid.jaxb.model.record_v2.Name)

Example 73 with Visibility

use of org.orcid.jaxb.model.common_rc2.Visibility 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 74 with Visibility

use of org.orcid.jaxb.model.common_rc2.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method getEmailsElement.

private Emails getEmailsElement(Visibility... vs) {
    Emails elements = new Emails();
    for (Visibility v : vs) {
        Email element = new Email();
        element.setVisibility(v);
        if (elements.getEmails() == null) {
            elements.setEmails(new ArrayList<Email>());
        }
        elements.getEmails().add(element);
    }
    return elements;
}
Also used : Email(org.orcid.jaxb.model.record_v2.Email) Visibility(org.orcid.jaxb.model.common_v2.Visibility) Emails(org.orcid.jaxb.model.record_v2.Emails)

Example 75 with Visibility

use of org.orcid.jaxb.model.common_rc2.Visibility in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method getFundings.

private Fundings getFundings(Visibility... vs) {
    Fundings fundings = new Fundings();
    for (Visibility v : vs) {
        FundingGroup g = new FundingGroup();
        FundingSummary s = new FundingSummary();
        s.setVisibility(v);
        g.getFundingSummary().add(s);
        fundings.getFundingGroup().add(g);
    }
    return fundings;
}
Also used : Fundings(org.orcid.jaxb.model.record.summary_v2.Fundings) FundingSummary(org.orcid.jaxb.model.record.summary_v2.FundingSummary) Visibility(org.orcid.jaxb.model.common_v2.Visibility) FundingGroup(org.orcid.jaxb.model.record.summary_v2.FundingGroup)

Aggregations

Visibility (org.orcid.jaxb.model.common_v2.Visibility)55 ClientResponse (com.sun.jersey.api.client.ClientResponse)35 Test (org.junit.Test)35 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)12 HashMap (java.util.HashMap)10 OrcidError (org.orcid.jaxb.model.error_v2.OrcidError)10 OrcidError (org.orcid.jaxb.model.error_rc1.OrcidError)9 Visibility (org.orcid.jaxb.model.common_rc2.Visibility)8 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)8 Date (java.util.Date)7 Visibility (org.orcid.jaxb.model.common_rc1.Visibility)7 Visibility (org.orcid.jaxb.model.common_rc3.Visibility)6 OrcidDuplicatedElementException (org.orcid.core.exception.OrcidDuplicatedElementException)5 Funding (org.orcid.jaxb.model.record_v2.Funding)5 PeerReview (org.orcid.jaxb.model.record_v2.PeerReview)5 Work (org.orcid.jaxb.model.record_v2.Work)5 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)5 Visibility (org.orcid.jaxb.model.common_rc4.Visibility)4 OrcidError (org.orcid.jaxb.model.error_rc3.OrcidError)4 OrgEntity (org.orcid.persistence.jpa.entities.OrgEntity)4