use of org.orcid.jaxb.model.record_rc4.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);
}
}
use of org.orcid.jaxb.model.record_rc4.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;
}
use of org.orcid.jaxb.model.record_rc4.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();
}
use of org.orcid.jaxb.model.record_rc4.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;
}
use of org.orcid.jaxb.model.record_rc4.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);
}
}
Aggregations