Class ItemController
java.lang.Object
de.digitalcollections.cudami.server.controller.identifiable.entity.work.ItemController
@RestController
@Api(description="The Item controller",
name="Item controller")
public class ItemController
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description ItemController() -
Method Summary
Modifier and Type Method Description booleanaddDigitalObject(java.util.UUID uuid, java.util.UUID digitalObjectUuid)booleanaddWork(java.util.UUID uuid, java.util.UUID workUuid)longcount()de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.work.Item>findAll(int pageNumber, int pageSize, java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, java.lang.String language, java.lang.String initial)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Item>get(java.util.UUID uuid, java.util.Locale pLocale)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Item>getByIdentifier(java.lang.String namespace, java.lang.String id)java.util.Set<de.digitalcollections.model.api.identifiable.entity.DigitalObject>getDigitalObjects(java.util.UUID uuid)java.util.Set<de.digitalcollections.model.api.identifiable.entity.work.Work>getWorks(java.util.UUID uuid)de.digitalcollections.model.api.identifiable.entity.work.Itemsave(de.digitalcollections.model.api.identifiable.entity.work.Item item, org.springframework.validation.BindingResult errors)de.digitalcollections.model.api.identifiable.entity.work.Itemupdate(java.util.UUID uuid, de.digitalcollections.model.api.identifiable.entity.work.Item item, org.springframework.validation.BindingResult errors)
-
Constructor Details
-
ItemController
public ItemController()
-
-
Method Details
-
count
@ApiMethod(description="count all items") @GetMapping(value={"/latest/items/count","/v2/items/count"}, produces="application/json") @ApiResponseObject public long count() -
findAll
@ApiMethod(description="get all items") @GetMapping(value={"/latest/items","/v2/items"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.work.Item> findAll(@RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortBy",required=false) java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, @RequestParam(name="language",required=false,defaultValue="de") java.lang.String language, @RequestParam(name="initial",required=false) java.lang.String initial) -
get
@ApiMethod(description="get an item as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/items/{uuid}","/v2/items/{uuid}"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Item> get(@ApiPathParam(name="uuid",description="UUID of the item, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid") java.util.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) java.util.Locale pLocale) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getByIdentifier
@ApiMethod(description="get an item as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/items/identifier","/v2/items/identifier"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.work.Item> getByIdentifier(@RequestParam(name="namespace",required=true) java.lang.String namespace, @RequestParam(name="id",required=true) java.lang.String id) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
save
@ApiMethod(description="save a newly created item") @PostMapping(value={"/latest/items","/v2/items"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.work.Item save(@RequestBody de.digitalcollections.model.api.identifiable.entity.work.Item item, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
update
@ApiMethod(description="update an item") @PutMapping(value={"/latest/items/{uuid}","/v2/items/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.work.Item update(@PathVariable("uuid") java.util.UUID uuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.work.Item item, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
getDigitalObjects
@ApiMethod(description="Get digital objects of this item") @GetMapping(value={"/latest/items/{uuid}/digitalobjects","/v2/items/{uuid}/digitalobjects"}, produces="application/json") @ApiResponseObject public java.util.Set<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects(@ApiPathParam(name="uuid",description="UUID of the item") @PathVariable java.util.UUID uuid) -
getWorks
@ApiMethod(description="Get works embodied in an item") @GetMapping(value={"/latest/items/{uuid}/works","/v2/items/{uuid}/works"}, produces="application/json") @ApiResponseObject public java.util.Set<de.digitalcollections.model.api.identifiable.entity.work.Work> getWorks(@ApiPathParam(name="uuid",description="UUID of the item") @PathVariable java.util.UUID uuid) -
addWork
@ApiMethod(description="Add work to an item") @PostMapping(value={"/latest/items/{uuid}/works/{workUuid}","/v2/items/{uuid}/works/{workUuid}"}, produces="application/json") @ApiResponseObject public boolean addWork(@ApiPathParam(name="uuid",description="UUID of the item") @PathVariable java.util.UUID uuid, @ApiPathParam(name="workUuid",description="UUID of the work") @PathVariable java.util.UUID workUuid) -
addDigitalObject
@ApiMethod(description="Add digital object to an item") @PostMapping(value={"/latest/items/{uuid}/digitalobjects/{digitalObjectUuid}","/v2/items/{uuid}/digitalobjects/{digitalObjectUuid}"}, produces="application/json") @ApiResponseObject public boolean addDigitalObject(@ApiPathParam(name="uuid",description="UUID of the item") @PathVariable java.util.UUID uuid, @ApiPathParam(name="digitalObjectUuid",description="UUID of the digital object") @PathVariable java.util.UUID digitalObjectUuid)
-