use of org.orcid.jaxb.model.v3.dev1.record.Record in project ORCID-Source by ORCID.
the class MemberV3ApiServiceDelegatorImpl method viewRecord.
@Override
public Response viewRecord(String orcid) {
Record record = recordManagerReadOnly.getRecord(orcid);
orcidSecurityManager.checkAndFilter(orcid, record);
if (record.getPerson() != null) {
sourceUtils.setSourceName(record.getPerson());
}
if (record.getActivitiesSummary() != null) {
ActivityUtils.cleanEmptyFields(record.getActivitiesSummary());
sourceUtils.setSourceName(record.getActivitiesSummary());
}
ElementUtils.setPathToRecord(record, orcid);
Api3_0_Dev1LastModifiedDatesHelper.calculateLastModified(record);
return Response.ok(record).build();
}
use of org.orcid.jaxb.model.v3.dev1.record.Record in project ORCID-Source by ORCID.
the class PublicV3ApiServiceDelegatorTest method validateRecord.
private void validateRecord(Record record) {
assertNotNull(record);
assertEquals("/" + ORCID, record.getPath());
validatePerson(record.getPerson());
validateActivities(record.getActivitiesSummary());
assertNotNull(record.getHistory());
assertEquals(OrcidType.USER, record.getOrcidType());
assertNotNull(record.getPreferences());
assertEquals(Locale.EN, record.getPreferences().getLocale());
History history = record.getHistory();
assertTrue(history.getClaimed());
assertNotNull(history.getCompletionDate());
assertEquals(CreationMethod.INTEGRATION_TEST, history.getCreationMethod());
assertNull(history.getDeactivationDate());
assertNotNull(history.getLastModifiedDate());
assertNotNull(history.getLastModifiedDate().getValue());
assertNotNull(history.getSource());
assertEquals("APP-5555555555555555", history.getSource().retrieveSourcePath());
assertNotNull(history.getSubmissionDate());
assertNotNull(record.getOrcidIdentifier());
OrcidIdentifier id = record.getOrcidIdentifier();
assertEquals("0000-0000-0000-0003", id.getPath());
}
use of org.orcid.jaxb.model.v3.dev1.record.Record in project ORCID-Source by ORCID.
the class PublicV3ApiServiceDelegatorTest method testFindRecord.
@Test
public void testFindRecord() {
Response response = serviceDelegator.viewRecord(ORCID);
assertNotNull(response);
Record record = (Record) response.getEntity();
validateRecord(record);
}
use of org.orcid.jaxb.model.v3.dev1.record.Record in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV3Test method getRecordElement.
private Record getRecordElement() {
Record r = new Record();
r.setActivitiesSummary(getActivitiesSummaryElement());
r.setPerson(getPersonElement());
return r;
}
use of org.orcid.jaxb.model.v3.dev1.record.Record in project ORCID-Source by ORCID.
the class RecordManagerReadOnlyImpl method getPublicRecord.
@Override
public Record getPublicRecord(String orcid) {
Record record = new Record();
record.setOrcidType(getOrcidType(orcid));
record.setHistory(getHistory(orcid));
record.setOrcidIdentifier(getOrcidIdentifier(orcid));
record.setPreferences(getPreferences(orcid));
record.setActivitiesSummary(activitiesSummaryManager.getPublicActivitiesSummary(orcid));
record.setPerson(personDetailsManager.getPublicPersonDetails(orcid));
return record;
}
Aggregations