Search in sources :

Example 66 with ResearcherUrl

use of org.orcid.jaxb.model.record_rc3.ResearcherUrl in project ORCID-Source by ORCID.

the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.

public static void calculateLastModified(ResearcherUrls researcherUrls) {
    if (researcherUrls != null && researcherUrls.getResearcherUrls() != null && !researcherUrls.getResearcherUrls().isEmpty()) {
        LastModifiedDate latest = null;
        for (ResearcherUrl researcherUrl : researcherUrls.getResearcherUrls()) {
            if (researcherUrl.getLastModifiedDate() != null && researcherUrl.getLastModifiedDate().after(latest)) {
                latest = researcherUrl.getLastModifiedDate();
            }
        }
        researcherUrls.setLastModifiedDate(latest);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.common_rc3.LastModifiedDate) ResearcherUrl(org.orcid.jaxb.model.record_rc3.ResearcherUrl)

Example 67 with ResearcherUrl

use of org.orcid.jaxb.model.record_rc3.ResearcherUrl in project ORCID-Source by ORCID.

the class ResearcherUrlManagerTest method getResearcherUrl.

private ResearcherUrl getResearcherUrl() {
    ResearcherUrl rUrl = new ResearcherUrl();
    rUrl.setUrl(new Url("http://orcid.org"));
    rUrl.setUrlName("ORCID Site");
    rUrl.setVisibility(Visibility.PUBLIC);
    return rUrl;
}
Also used : ResearcherUrl(org.orcid.jaxb.model.record_v2.ResearcherUrl) Url(org.orcid.jaxb.model.common_v2.Url) ResearcherUrl(org.orcid.jaxb.model.record_v2.ResearcherUrl)

Example 68 with ResearcherUrl

use of org.orcid.jaxb.model.record_rc3.ResearcherUrl in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegatorImpl method viewResearcherUrls.

/**
     * BIOGRAPHY ELEMENTS
     */
@Override
public Response viewResearcherUrls(String orcid) {
    ResearcherUrls researcherUrls = researcherUrlManagerReadOnly.getResearcherUrls(orcid, getLastModifiedTime(orcid));
    // Lets copy the list so we don't modify the cached collection
    if (researcherUrls.getResearcherUrls() != null) {
        List<ResearcherUrl> filteredList = new ArrayList<ResearcherUrl>(researcherUrls.getResearcherUrls());
        researcherUrls = new ResearcherUrls();
        researcherUrls.setResearcherUrls(filteredList);
    }
    orcidSecurityManager.checkAndFilter(orcid, researcherUrls.getResearcherUrls(), ScopePathType.ORCID_BIO_READ_LIMITED);
    ElementUtils.setPathToResearcherUrls(researcherUrls, orcid);
    Api2_0_LastModifiedDatesHelper.calculateLastModified(researcherUrls);
    sourceUtils.setSourceName(researcherUrls);
    return Response.ok(researcherUrls).build();
}
Also used : ArrayList(java.util.ArrayList) ResearcherUrls(org.orcid.jaxb.model.record_v2.ResearcherUrls) ResearcherUrl(org.orcid.jaxb.model.record_v2.ResearcherUrl)

Example 69 with ResearcherUrl

use of org.orcid.jaxb.model.record_rc3.ResearcherUrl in project ORCID-Source by ORCID.

the class WebsitesForm method toResearcherUrls.

public ResearcherUrls toResearcherUrls() {
    ResearcherUrls researcherUrls = new ResearcherUrls();
    List<ResearcherUrl> ruList = new ArrayList<ResearcherUrl>();
    for (WebsiteForm website : websites) {
        ruList.add(website.toResearcherUrl());
    }
    researcherUrls.setResearcherUrls(ruList);
    return researcherUrls;
}
Also used : ArrayList(java.util.ArrayList) ResearcherUrls(org.orcid.jaxb.model.record_v2.ResearcherUrls) ResearcherUrl(org.orcid.jaxb.model.record_v2.ResearcherUrl)

Example 70 with ResearcherUrl

use of org.orcid.jaxb.model.record_rc3.ResearcherUrl in project ORCID-Source by ORCID.

the class BlackBoxBaseRC3 method unmarshallFromPath.

public Object unmarshallFromPath(String path, Class<?> type) {
    try (Reader reader = new InputStreamReader(getClass().getResourceAsStream(path))) {
        Object obj = unmarshall(reader, type);
        Object result = null;
        if (Address.class.equals(type)) {
            result = (Address) obj;
        } else if (Education.class.equals(type)) {
            result = (Education) obj;
        } else if (Employment.class.equals(type)) {
            result = (Employment) obj;
        } else if (Funding.class.equals(type)) {
            result = (Funding) obj;
        } else if (Keyword.class.equals(type)) {
            result = (Keyword) obj;
        } else if (Work.class.equals(type)) {
            result = (Work) obj;
        } else if (PeerReview.class.equals(type)) {
            result = (PeerReview) obj;
        } else if (ResearcherUrl.class.equals(type)) {
            result = (ResearcherUrl) obj;
        } else if (PersonalDetails.class.equals(type)) {
            result = (PersonalDetails) obj;
        } else if (OtherName.class.equals(type)) {
            result = (OtherName) obj;
        } else if (PersonExternalIdentifier.class.equals(type)) {
            result = (PersonExternalIdentifier) obj;
        }
        return result;
    } catch (IOException e) {
        throw new RuntimeException("Error reading notification from classpath", e);
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) Education(org.orcid.jaxb.model.record_rc3.Education) Funding(org.orcid.jaxb.model.record_rc3.Funding) Work(org.orcid.jaxb.model.record_rc3.Work) OtherName(org.orcid.jaxb.model.record_rc3.OtherName) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) ResearcherUrl(org.orcid.jaxb.model.record_rc3.ResearcherUrl) IOException(java.io.IOException)

Aggregations

ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)86 Test (org.junit.Test)76 OtherName (org.orcid.jaxb.model.record_v2.OtherName)45 Address (org.orcid.jaxb.model.record_v2.Address)44 Keyword (org.orcid.jaxb.model.record_v2.Keyword)44 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)44 ResearcherUrls (org.orcid.jaxb.model.record_v2.ResearcherUrls)43 Email (org.orcid.jaxb.model.record_v2.Email)41 Biography (org.orcid.jaxb.model.record_v2.Biography)33 OtherNames (org.orcid.jaxb.model.record_v2.OtherNames)33 Addresses (org.orcid.jaxb.model.record_v2.Addresses)31 Emails (org.orcid.jaxb.model.record_v2.Emails)31 Keywords (org.orcid.jaxb.model.record_v2.Keywords)31 PersonExternalIdentifiers (org.orcid.jaxb.model.record_v2.PersonExternalIdentifiers)31 Person (org.orcid.jaxb.model.record_v2.Person)30 Name (org.orcid.jaxb.model.record_v2.Name)29 DBUnitTest (org.orcid.test.DBUnitTest)22 Response (javax.ws.rs.core.Response)20 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)18 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)18