Class WorkController
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.identifiable.entity.work.WorkController
-
@RestController @Api(description="The Work controller", name="Work controller") public class WorkController extends Object
-
-
Constructor Summary
Constructors Constructor Description WorkController()
-
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.work.Work>findAll(int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy, String language, String initial)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Work>get(UUID uuid, Locale pLocale)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Work>getByIdentifier(String namespace, String id)List<de.digitalcollections.model.api.identifiable.entity.agent.Agent>getCreators(UUID uuid)List<de.digitalcollections.model.api.identifiable.entity.work.Item>getItems(UUID uuid)de.digitalcollections.model.api.identifiable.entity.work.Worksave(de.digitalcollections.model.api.identifiable.entity.work.Work work, org.springframework.validation.BindingResult errors)de.digitalcollections.model.api.identifiable.entity.work.Workupdate(UUID uuid, de.digitalcollections.model.api.identifiable.entity.work.Work work, org.springframework.validation.BindingResult errors)
-
-
-
Method Detail
-
count
@ApiMethod(description="count all works") @GetMapping(value={"/latest/works/count","/v2/works/count"}, produces="application/json") @ApiResponseObject public long count()
-
findAll
@ApiMethod(description="get all works") @GetMapping(value={"/latest/works","/v2/works"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.work.Work> 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)
-
get
@ApiMethod(description="get a work as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/works/{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/works/{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.work.Work> get(@ApiPathParam(description="UUID of the work, 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 work as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/works/identifier","/v2/works/identifier"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Work> getByIdentifier(@RequestParam(name="namespace",required=true) String namespace, @RequestParam(name="id",required=true) String id) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
save
@ApiMethod(description="save a newly created work") @PostMapping(value={"/latest/works","/v2/works"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.work.Work save(@RequestBody de.digitalcollections.model.api.identifiable.entity.work.Work work, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
update
@ApiMethod(description="update a work") @PutMapping(value={"/latest/works/{uuid}","/v2/works/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.work.Work update(@PathVariable("uuid") UUID uuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.work.Work work, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getCreators
@ApiMethod(description="Get creators of a work") @GetMapping(value={"/latest/works/{uuid}/creators","/v2/works/{uuid}/creators"}, produces="application/json") @ApiResponseObject public List<de.digitalcollections.model.api.identifiable.entity.agent.Agent> getCreators(@PathVariable UUID uuid)
-
-