Class PersonController
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.identifiable.entity.agent.PersonController
-
@RestController @Api(description="The Person controller", name="Person controller") public class PersonController extends Object
-
-
Constructor Summary
Constructors Constructor Description PersonController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person>findAll(int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy, String language, String initial, de.digitalcollections.model.api.filter.FilterCriterion<UUID> previewImageFilter)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.agent.Person>get(UUID uuid, Locale pLocale)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.agent.Person>getByIdentifier(String namespace, String id)de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person>getByPlaceOfBirth(UUID uuid, int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy)de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person>getByPlaceOfDeath(UUID uuid, int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy)Set<de.digitalcollections.model.api.identifiable.entity.DigitalObject>getDigitalObjects(UUID uuid)Set<de.digitalcollections.model.api.identifiable.entity.work.Work>getWorks(UUID uuid)de.digitalcollections.model.api.identifiable.entity.agent.Personsave(de.digitalcollections.model.api.identifiable.entity.agent.Person person, org.springframework.validation.BindingResult errors)de.digitalcollections.model.api.identifiable.entity.agent.Personupdate(UUID uuid, de.digitalcollections.model.api.identifiable.entity.agent.Person person, org.springframework.validation.BindingResult errors)
-
-
-
Method Detail
-
count
@ApiMethod(description="count all persons") @GetMapping(value={"/latest/persons/count","/v2/persons/count"}, produces="application/json") @ApiResponseObject public long count()
-
findAll
@ApiMethod(description="get all persons") @GetMapping(value={"/latest/persons","/v2/persons"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person> findAll(@RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortBy",required=false) List<de.digitalcollections.model.api.paging.Order> sortBy, @RequestParam(name="language",required=false,defaultValue="de") String language, @RequestParam(name="initial",required=false) String initial, @RequestParam(name="previewImage",required=false) de.digitalcollections.model.api.filter.FilterCriterion<UUID> previewImageFilter)
-
getByPlaceOfBirth
@ApiMethod(description="get all persons born at given geo location") @GetMapping(value={"/latest/persons/placeofbirth/{uuid}","/v2/persons/placeofbirth/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person> getByPlaceOfBirth(@ApiPathParam(description="UUID of the geo location of birth, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid") UUID uuid, @RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortBy",required=false) List<de.digitalcollections.model.api.paging.Order> sortBy)
-
getByPlaceOfDeath
@ApiMethod(description="get all persons died at given geo location") @GetMapping(value={"/latest/persons/placeofdeath/{uuid}","/v2/persons/placeofdeath/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.agent.Person> getByPlaceOfDeath(@ApiPathParam(description="UUID of the geo location of death, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid") UUID uuid, @RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortBy",required=false) List<de.digitalcollections.model.api.paging.Order> sortBy)
-
get
@ApiMethod(description="get a person as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/persons/{uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}}","/v2/persons/{uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}}"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.agent.Person> get(@ApiPathParam(description="UUID of the person, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid") UUID uuid, @ApiQueryParam(name="pLocale",description="Desired locale, e.g. <tt>de_DE</tt>. If unset, contents in all languages will be returned") @RequestParam(name="pLocale",required=false) Locale pLocale) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getByIdentifier
@ApiMethod(description="get a person as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/persons/identifier","/v2/persons/identifier"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.agent.Person> getByIdentifier(@RequestParam(name="namespace",required=true) String namespace, @RequestParam(name="id",required=true) String id) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getDigitalObjects
@ApiMethod(description="get a person\'s digital objects as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/persons/{uuid}/digitalobjects","/v2/persons/{uuid}/digitalobjects"}, produces="application/json") @ApiResponseObject public Set<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects(@PathVariable("uuid") UUID uuid) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getWorks
@ApiMethod(description="get a person\'s works as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/persons/{uuid}/works","/v2/persons/{uuid}/works"}, produces="application/json") @ApiResponseObject public Set<de.digitalcollections.model.api.identifiable.entity.work.Work> getWorks(@PathVariable("uuid") UUID uuid) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
save
@ApiMethod(description="save a newly created person") @PostMapping(value={"/latest/persons","/v2/persons"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.agent.Person save(@RequestBody de.digitalcollections.model.api.identifiable.entity.agent.Person person, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
update
@ApiMethod(description="update a person") @PutMapping(value={"/latest/persons/{uuid}","/v2/persons/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.agent.Person update(@PathVariable("uuid") UUID uuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.agent.Person person, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
-