Class CollectionController
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.identifiable.entity.CollectionController
-
@RestController @Api(description="The collection controller", name="Collection controller") public class CollectionController extends Object
-
-
Constructor Summary
Constructors Constructor Description CollectionController(CollectionService collectionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntityaddDigitalObject(UUID collectionUuid, UUID digitalObjectUuid)org.springframework.http.ResponseEntityaddDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)org.springframework.http.ResponseEntityaddSubcollection(UUID uuid, UUID subcollectionUuid)org.springframework.http.ResponseEntityaddSubcollections(UUID uuid, List<de.digitalcollections.model.api.identifiable.entity.Collection> subcollections)longcount()de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection>findAll(int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, String active)de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection>findAllTop(int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling)de.digitalcollections.model.api.identifiable.entity.CollectionfindByIdentifier(String namespace, String id)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Collection>findByUuid(UUID uuid, Locale pLocale, String active)de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.entity.Collection>findCollections(int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, String searchTerm)org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation>getBreadcrumb(UUID uuid, Locale pLocale)de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject>getDigitalObjects(UUID collectionUuid, int pageNumber, int pageSize)de.digitalcollections.model.api.identifiable.entity.CollectiongetParent(UUID uuid)List<de.digitalcollections.model.api.identifiable.entity.Collection>getParents(UUID collectionUuid)de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection>getSubcollections(UUID collectionUuid, int pageNumber, int pageSize, String active)org.springframework.http.ResponseEntityremoveDigitalObject(UUID collectionUuid, UUID digitalObjectUuid)org.springframework.http.ResponseEntityremoveSubcollection(UUID uuid, UUID subcollectionUuid)de.digitalcollections.model.api.identifiable.entity.Collectionsave(de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors)org.springframework.http.ResponseEntitysaveDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)de.digitalcollections.model.api.identifiable.entity.CollectionsaveWithParentCollection(UUID parentUuid, de.digitalcollections.model.api.identifiable.entity.Collection collection)de.digitalcollections.model.api.identifiable.entity.Collectionupdate(UUID uuid, de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors)
-
-
-
Constructor Detail
-
CollectionController
@Autowired public CollectionController(CollectionService collectionService)
-
-
Method Detail
-
addDigitalObject
@ApiMethod(description="Add an existing digital object to an existing collection") @PostMapping(value={"/latest/collections/{uuid}/digitalobjects/{digitalObjectUuid}","/v3/collections/{uuid}/digitalobjects/{digitalObjectUuid}"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity addDigitalObject(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid") UUID digitalObjectUuid)
-
addDigitalObjects
@ApiMethod(description="Add existing digital objects to an existing collection") @PostMapping(value={"/latest/collections/{uuid}/digitalobjects","/v3/collections/{uuid}/digitalobjects"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity addDigitalObjects(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @ApiPathParam(description="List of the digital objects") @RequestBody List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)
-
addSubcollection
@ApiMethod(description="Add an existing collection to an existing collection") @PostMapping(value={"/latest/collections/{uuid}/subcollections/{subcollectionUuid}","/v3/collections/{uuid}/subcollections/{subcollectionUuid}"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity addSubcollection(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID uuid, @ApiPathParam(description="UUID of the subcollection") @PathVariable("subcollectionUuid") UUID subcollectionUuid)
-
addSubcollections
@ApiMethod(description="Add existing collections to an existing collection") @PostMapping(value={"/latest/collections/{uuid}/subcollections","/v3/collections/{uuid}/subcollections"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity addSubcollections(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID uuid, @ApiPathParam(description="List of the subcollections") @RequestBody List<de.digitalcollections.model.api.identifiable.entity.Collection> subcollections)
-
count
@ApiMethod(description="Get count of collections") @GetMapping(value={"/latest/collections/count","/v2/collections/count"}, produces="application/json") @ApiResponseObject public long count()
-
findAll
@ApiMethod(description="Get all collections") @GetMapping(value={"/latest/collections","/v2/collections"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findAll(@RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="25") int pageSize, @RequestParam(name="sortField",required=false,defaultValue="lastModified") String sortField, @RequestParam(name="sortDirection",required=false,defaultValue="DESC") de.digitalcollections.model.api.paging.enums.Direction sortDirection, @RequestParam(name="nullHandling",required=false,defaultValue="NATIVE") de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, @RequestParam(name="active",required=false) String active)
-
findAllTop
@ApiMethod(description="Get all top collections") @GetMapping(value={"/latest/collections/top","/v2/collections/top"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findAllTop(@RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortField",required=false,defaultValue="uuid") String sortField, @RequestParam(name="sortDirection",required=false,defaultValue="ASC") de.digitalcollections.model.api.paging.enums.Direction sortDirection, @RequestParam(name="nullHandling",required=false,defaultValue="NATIVE") de.digitalcollections.model.api.paging.enums.NullHandling nullHandling)
-
findByIdentifier
@ApiMethod(description="Get collection by namespace and id") @GetMapping(value={"/latest/collections/identifier/{namespace}:{id}","/v2/collections/identifier/{namespace}:{id}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.Collection findByIdentifier(@PathVariable String namespace, @PathVariable String id) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
findByUuid
@ApiMethod(description="Get an collection as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header") @GetMapping(value={"/latest/collections/{uuid}","/v2/collections/{uuid}"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Collection> findByUuid(@ApiPathParam(description="UUID of the collection, 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, @ApiQueryParam(name="active",description="If set, object will only be returned if active") @RequestParam(name="active",required=false) String active) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
findCollections
@ApiMethod(description="Find limited amount of collections containing searchTerm in label or description") @GetMapping(value={"/latest/collections/search","/v3/collections/search"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findCollections(@RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="5") int pageSize, @RequestParam(name="sortField",required=false,defaultValue="uuid") String sortField, @RequestParam(name="sortDirection",required=false,defaultValue="ASC") de.digitalcollections.model.api.paging.enums.Direction sortDirection, @RequestParam(name="nullHandling",required=false,defaultValue="NATIVE") de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, @RequestParam(name="searchTerm",required=false) String searchTerm)
-
getBreadcrumb
@ApiMethod(description="Get the breadcrumb for a collection") @GetMapping(value={"/latest/collections/{uuid}/breadcrumb","/v3/collections/{uuid}/breadcrumb"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation> getBreadcrumb(@ApiPathParam(description="UUID of the collection, e.g. <tt>6119d8e9-9c92-4091-8dcb-bc4053385406</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)
-
getDigitalObjects
@ApiMethod(description="Get paged digital objects of a collection") @GetMapping(value={"/latest/collections/{uuid}/digitalobjects","/v3/collections/{uuid}/digitalobjects"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="25") int pageSize)
-
getParent
@ApiMethod(description="Get the first created parent of a collection") @GetMapping(value={"/latest/collections/{uuid}/parent","/v3/collections/{uuid}/parent"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.Collection getParent(@PathVariable UUID uuid)
-
getParents
@ApiMethod(description="Get parent collections") @GetMapping(value={"/latest/collections/{uuid}/parents","/v3/collections/{uuid}/parents"}, produces="application/json") @ApiResponseObject public List<de.digitalcollections.model.api.identifiable.entity.Collection> getParents(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid)
-
getSubcollections
@ApiMethod(description="Get (active or all) paged subcollections of a collection") @GetMapping(value={"/latest/collections/{uuid}/subcollections","/v3/collections/{uuid}/subcollections"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> getSubcollections(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @RequestParam(name="pageNumber",required=false,defaultValue="0") int pageNumber, @RequestParam(name="pageSize",required=false,defaultValue="25") int pageSize, @RequestParam(name="active",required=false) String active)
-
removeDigitalObject
@ApiMethod(description="Remove an existing digital object from an existing collection") @DeleteMapping(value={"/latest/collections/{uuid}/digitalobjects/{digitalObjectUuid}","/v3/collections/{uuid}/digitalobjects/{digitalObjectUuid}"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity removeDigitalObject(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid") UUID digitalObjectUuid)
-
removeSubcollection
@ApiMethod(description="Remove an existing collection from an existing collection") @DeleteMapping(value={"/latest/collections/{uuid}/subcollections/{subcollectionUuid}","/v3/collections/{uuid}/subcollections/{subcollectionUuid}"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity removeSubcollection(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID uuid, @ApiPathParam(description="UUID of the subcollection") @PathVariable("subcollectionUuid") UUID subcollectionUuid)
-
save
@ApiMethod(description="Save a newly created collection") @PostMapping(value={"/latest/collections","/v2/collections"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.Collection save(@RequestBody de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
saveDigitalObjects
@ApiMethod(description="Save existing digital objects into an existing collection") @PutMapping(value={"/latest/collections/{uuid}/digitalobjects","/v3/collections/{uuid}/digitalobjects"}, produces="application/json") @ApiResponseObject public org.springframework.http.ResponseEntity saveDigitalObjects(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") UUID collectionUuid, @ApiPathParam(description="List of the digital objects") @RequestBody List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)
-
saveWithParentCollection
@ApiMethod(description="Save a newly created collection with parent collection") @PostMapping(value={"/latest/collections/{parentUuid}/collection","/v2/collections/{parentUuid}/collection"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.Collection saveWithParentCollection(@ApiPathParam(name="parentUuid",description="The uuid of the parent collection") @PathVariable UUID parentUuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.Collection collection) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
update
@ApiMethod(description="Update an collection") @PutMapping(value={"/latest/collections/{uuid}","/v2/collections/{uuid}"}, produces="application/json") @ApiResponseObject public de.digitalcollections.model.api.identifiable.entity.Collection update(@PathVariable UUID uuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException- Throws:
IdentifiableServiceException
-
-