use of org.orcid.jaxb.model.record_rc3.Keywords in project ORCID-Source by ORCID.
the class ProfileKeywordManagerTest method getPublicTest.
@Test
public void getPublicTest() {
String orcid = "0000-0000-0000-0003";
Keywords elements = profileKeywordManager.getPublicKeywords(orcid, System.currentTimeMillis());
assertNotNull(elements);
assertNotNull(elements.getKeywords());
assertEquals(1, elements.getKeywords().size());
assertEquals(Long.valueOf(9), elements.getKeywords().get(0).getPutCode());
}
use of org.orcid.jaxb.model.record_rc3.Keywords in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl method viewKeywords.
@Override
public Response viewKeywords(String orcid) {
Keywords keywords = profileKeywordManagerReadOnly.getKeywords(orcid, getLastModifiedTime(orcid));
// Lets copy the list so we don't modify the cached collection
if (keywords.getKeywords() != null) {
List<Keyword> filteredList = new ArrayList<Keyword>(keywords.getKeywords());
keywords = new Keywords();
keywords.setKeywords(filteredList);
}
orcidSecurityManager.checkAndFilter(orcid, keywords.getKeywords(), ScopePathType.ORCID_BIO_READ_LIMITED);
ElementUtils.setPathToKeywords(keywords, orcid);
Api2_0_LastModifiedDatesHelper.calculateLastModified(keywords);
sourceUtils.setSourceName(keywords);
return Response.ok(keywords).build();
}
use of org.orcid.jaxb.model.record_rc3.Keywords in project ORCID-Source by ORCID.
the class KeywordsForm method toKeywords.
public Keywords toKeywords() {
Keywords keywords = new Keywords();
List<Keyword> kList = new ArrayList<Keyword>();
for (KeywordForm form : this.keywords) {
kList.add(form.toKeyword());
}
keywords.setKeywords(kList);
return keywords;
}
use of org.orcid.jaxb.model.record_rc3.Keywords in project ORCID-Source by ORCID.
the class ValidateV2_1SamplesTest method testMarshallKeyword.
@Test
public void testMarshallKeyword() throws JAXBException, SAXException, URISyntaxException {
Keywords object = (Keywords) unmarshallFromPath("/record_2.1/samples/read_samples/keywords-2.1.xml", Keywords.class);
marshall(object, "/record_2.1/keyword-2.1.xsd");
}
use of org.orcid.jaxb.model.record_rc3.Keywords in project ORCID-Source by ORCID.
the class PersonDetailsManagerReadOnlyImpl method getPublicPersonDetails.
@Override
public Person getPublicPersonDetails(String orcid) {
long lastModifiedTime = getLastModified(orcid);
Person person = new Person();
Name name = recordNameManager.getRecordName(orcid, lastModifiedTime);
if (Visibility.PUBLIC.equals(name.getVisibility())) {
person.setName(name);
}
Biography bio = biographyManager.getPublicBiography(orcid, lastModifiedTime);
if (bio != null) {
person.setBiography(bio);
}
Addresses addresses = addressManager.getPublicAddresses(orcid, lastModifiedTime);
if (addresses.getAddress() != null) {
Addresses filteredAddresses = new Addresses();
filteredAddresses.setAddress(new ArrayList<Address>(addresses.getAddress()));
person.setAddresses(filteredAddresses);
}
PersonExternalIdentifiers extIds = externalIdentifierManager.getPublicExternalIdentifiers(orcid, lastModifiedTime);
if (extIds.getExternalIdentifiers() != null) {
PersonExternalIdentifiers filteredExtIds = new PersonExternalIdentifiers();
filteredExtIds.setExternalIdentifiers(new ArrayList<PersonExternalIdentifier>(extIds.getExternalIdentifiers()));
person.setExternalIdentifiers(filteredExtIds);
}
Keywords keywords = profileKeywordManager.getPublicKeywords(orcid, lastModifiedTime);
if (keywords.getKeywords() != null) {
Keywords filteredKeywords = new Keywords();
filteredKeywords.setKeywords(new ArrayList<Keyword>(keywords.getKeywords()));
person.setKeywords(filteredKeywords);
}
OtherNames otherNames = otherNameManager.getPublicOtherNames(orcid, lastModifiedTime);
if (otherNames.getOtherNames() != null) {
OtherNames filteredOtherNames = new OtherNames();
filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames()));
person.setOtherNames(filteredOtherNames);
}
ResearcherUrls rUrls = researcherUrlManager.getPublicResearcherUrls(orcid, lastModifiedTime);
if (rUrls.getResearcherUrls() != null) {
ResearcherUrls filteredRUrls = new ResearcherUrls();
filteredRUrls.setResearcherUrls(new ArrayList<ResearcherUrl>(rUrls.getResearcherUrls()));
person.setResearcherUrls(filteredRUrls);
}
Emails emails = emailManager.getPublicEmails(orcid, lastModifiedTime);
if (emails.getEmails() != null) {
Emails filteredEmails = new Emails();
filteredEmails.setEmails(new ArrayList<Email>(emails.getEmails()));
person.setEmails(filteredEmails);
}
return person;
}
Aggregations