use of org.orcid.jaxb.model.record_rc3.Record in project neo4j by neo4j.
the class BoltCausalClusteringIT method executeReadQuery.
private void executeReadQuery(String bookmark, Session session) {
try (Transaction tx = session.beginTransaction(bookmark)) {
Record record = tx.run("MATCH (n:Person) RETURN COUNT(*) AS count").next();
assertEquals(1, record.get("count").asInt());
}
}
use of org.orcid.jaxb.model.record_rc3.Record in project ORCID-Source by ORCID.
the class RecordManagerTest method testGetRecord.
@Test
public void testGetRecord() {
Record record = RecordManager.getRecord(ORCID);
assertNotNull(record);
assertNotNull(record.getActivitiesSummary());
assertNotNull(record.getPerson());
Person person = record.getPerson();
assertNotNull(person.getExternalIdentifiers());
assertNotNull(person.getExternalIdentifiers().getExternalIdentifiers());
assertEquals(5, person.getExternalIdentifiers().getExternalIdentifiers().size());
assertNotNull(person.getResearcherUrls());
assertNotNull(person.getResearcherUrls().getResearcherUrls());
assertEquals(5, person.getResearcherUrls().getResearcherUrls().size());
assertNotNull(person.getOtherNames());
assertNotNull(person.getOtherNames().getOtherNames());
assertEquals(5, person.getOtherNames().getOtherNames().size());
assertNotNull(person.getAddresses());
assertNotNull(person.getAddresses().getAddress());
assertEquals(5, person.getAddresses().getAddress().size());
assertNotNull(person.getKeywords());
assertNotNull(person.getKeywords().getKeywords());
assertEquals(5, person.getKeywords().getKeywords().size());
assertNotNull(person.getEmails());
assertNotNull(person.getEmails().getEmails());
assertEquals(5, person.getEmails().getEmails().size());
assertNotNull(person.getBiography());
assertEquals(Visibility.PUBLIC, person.getBiography().getVisibility());
assertEquals("Biography for 0000-0000-0000-0003", person.getBiography().getContent());
assertNotNull(person.getName());
assertNotNull(person.getName().getCreditName());
assertEquals("Credit Name", person.getName().getCreditName().getContent());
assertNotNull(person.getName().getFamilyName());
assertEquals("Family Name", person.getName().getFamilyName().getContent());
assertNotNull(person.getName().getGivenNames());
assertEquals("Given Names", person.getName().getGivenNames().getContent());
assertEquals(Visibility.PUBLIC, person.getName().getVisibility());
ActivitiesSummary activities = record.getActivitiesSummary();
assertNotNull(activities);
assertNotNull(activities.getEducations());
assertNotNull(activities.getEducations().getSummaries());
assertEquals(5, activities.getEducations().getSummaries().size());
assertNotNull(activities.getEmployments());
assertNotNull(activities.getEmployments().getSummaries());
assertEquals(5, activities.getEmployments().getSummaries().size());
assertNotNull(activities.getFundings());
assertNotNull(activities.getFundings().getFundingGroup());
assertEquals(5, activities.getFundings().getFundingGroup().size());
assertNotNull(activities.getPeerReviews());
assertNotNull(activities.getPeerReviews().getPeerReviewGroup());
assertEquals(5, activities.getPeerReviews().getPeerReviewGroup().size());
assertNotNull(activities.getWorks());
assertNotNull(activities.getWorks().getWorkGroup());
assertEquals(5, activities.getWorks().getWorkGroup().size());
}
use of org.orcid.jaxb.model.record_rc3.Record in project ORCID-Source by ORCID.
the class RecordManagerTest method testGetPublicRecord.
@Test
public void testGetPublicRecord() {
Record record = RecordManager.getPublicRecord(ORCID);
assertNotNull(record);
assertNotNull(record.getActivitiesSummary());
assertNotNull(record.getPerson());
Person person = record.getPerson();
assertNotNull(person);
assertNotNull(person.getExternalIdentifiers());
assertNotNull(person.getExternalIdentifiers().getExternalIdentifiers());
assertEquals(1, person.getExternalIdentifiers().getExternalIdentifiers().size());
assertEquals(Long.valueOf(13), person.getExternalIdentifiers().getExternalIdentifiers().get(0).getPutCode());
assertNotNull(person.getResearcherUrls());
assertNotNull(person.getResearcherUrls().getResearcherUrls());
assertEquals(1, person.getResearcherUrls().getResearcherUrls().size());
assertEquals(Long.valueOf(13), person.getResearcherUrls().getResearcherUrls().get(0).getPutCode());
assertNotNull(person.getOtherNames());
assertNotNull(person.getOtherNames().getOtherNames());
assertEquals(1, person.getOtherNames().getOtherNames().size());
assertEquals(Long.valueOf(13), person.getOtherNames().getOtherNames().get(0).getPutCode());
assertNotNull(person.getAddresses());
assertNotNull(person.getAddresses().getAddress());
assertEquals(1, person.getAddresses().getAddress().size());
assertEquals(Long.valueOf(9), person.getAddresses().getAddress().get(0).getPutCode());
assertNotNull(person.getKeywords());
assertNotNull(person.getKeywords().getKeywords());
assertEquals(1, person.getKeywords().getKeywords().size());
assertEquals(Long.valueOf(9), person.getKeywords().getKeywords().get(0).getPutCode());
assertNotNull(person.getEmails());
assertNotNull(person.getEmails().getEmails());
assertEquals(1, person.getEmails().getEmails().size());
assertEquals("public_0000-0000-0000-0003@test.orcid.org", person.getEmails().getEmails().get(0).getEmail());
assertNotNull(person.getBiography());
assertEquals(Visibility.PUBLIC, person.getBiography().getVisibility());
assertEquals("Biography for 0000-0000-0000-0003", person.getBiography().getContent());
assertNotNull(person.getName());
assertNotNull(person.getName().getCreditName());
assertEquals("Credit Name", person.getName().getCreditName().getContent());
assertNotNull(person.getName().getFamilyName());
assertEquals("Family Name", person.getName().getFamilyName().getContent());
assertNotNull(person.getName().getGivenNames());
assertEquals("Given Names", person.getName().getGivenNames().getContent());
assertEquals(Visibility.PUBLIC, person.getName().getVisibility());
ActivitiesSummary activities = record.getActivitiesSummary();
assertNotNull(activities.getEducations());
assertNotNull(activities.getEducations().getSummaries());
assertEquals(1, activities.getEducations().getSummaries().size());
assertEquals(Long.valueOf(20), activities.getEducations().getSummaries().get(0).getPutCode());
assertNotNull(activities.getEmployments());
assertNotNull(activities.getEmployments().getSummaries());
assertEquals(1, activities.getEmployments().getSummaries().size());
assertEquals(Long.valueOf(17), activities.getEmployments().getSummaries().get(0).getPutCode());
assertNotNull(activities.getFundings());
assertNotNull(activities.getFundings().getFundingGroup());
assertEquals(1, activities.getFundings().getFundingGroup().size());
assertEquals(Long.valueOf(10), activities.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getPutCode());
assertNotNull(activities.getPeerReviews());
assertNotNull(activities.getPeerReviews().getPeerReviewGroup());
assertEquals(1, activities.getPeerReviews().getPeerReviewGroup().size());
assertEquals(Long.valueOf(9), activities.getPeerReviews().getPeerReviewGroup().get(0).getPeerReviewSummary().get(0).getPutCode());
assertNotNull(activities.getWorks());
assertNotNull(activities.getWorks().getWorkGroup());
assertEquals(1, activities.getWorks().getWorkGroup().size());
assertEquals(Long.valueOf(11), activities.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getPutCode());
}
use of org.orcid.jaxb.model.record_rc3.Record in project nikita-noark5-core by HiOA-ABI.
the class DocumentDescriptionHateoasController method deleteDocumentDescriptionBySystemId.
// Delete a DocumentDescription identified by systemID
// DELETE [contextPath][api]/arkivstruktur/dokumentobjekt/{systemId}/
@ApiOperation(value = "Deletes a single DocumentDescription entity identified by systemID", response = RecordHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Parent Fonds returned", response = RecordHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@RequestMapping(value = SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.DELETE)
public ResponseEntity<RecordHateoas> deleteDocumentDescriptionBySystemId(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemID of the documentDescription to delete", required = true) @PathVariable("systemID") final String systemID) {
DocumentDescription documentDescription = documentDescriptionService.findBySystemId(systemID);
List<Record> record = new ArrayList<>();
record.addAll(documentDescription.getReferenceRecord());
documentDescriptionService.deleteEntity(systemID);
RecordHateoas recordHateoas = new RecordHateoas((List) record);
/*RecordHateoas recordHateoas = new RecordHateoas(
(List<INikitaEntity>)
(List)record); */
// RecordHateoas recordHateoas = new RecordHateoas(
// (List<INikitaEntity>) (List)record);
recordHateoasHandler.addLinks(recordHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityDeletedEvent(this, documentDescription));
return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(recordHateoas);
}
use of org.orcid.jaxb.model.record_rc3.Record in project nikita-noark5-core by HiOA-ABI.
the class RecordService method deleteEntity.
// All DELETE operations
@Override
public void deleteEntity(@NotNull String systemID) {
Record record = getRecordOrThrow(systemID);
// See issue for a description of why this code was written this way
// https://github.com/HiOA-ABI/nikita-noark5-core/issues/82
// Query q = entityManager.createNativeQuery("DELETE FROM fonds_fonds_creator WHERE pk_fonds_creator_id = :id ;");
// q.setParameter("id", record.getId());
// q.executeUpdate();
entityManager.remove(record);
entityManager.flush();
entityManager.clear();
}
Aggregations