java.lang.Object
de.digitalcollections.cudami.server.controller.identifiable.entity.CollectionController

@RestController
@Api(description="The collection controller",
     name="Collection controller")
public class CollectionController
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    CollectionController​(CollectionService collectionService)  
  • Method Summary

    Modifier and Type Method Description
    org.springframework.http.ResponseEntity addDigitalObject​(java.util.UUID collectionUuid, java.util.UUID digitalObjectUuid)  
    org.springframework.http.ResponseEntity addDigitalObjects​(java.util.UUID collectionUuid, java.util.List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)  
    org.springframework.http.ResponseEntity addSubcollection​(java.util.UUID uuid, java.util.UUID subcollectionUuid)  
    org.springframework.http.ResponseEntity addSubcollections​(java.util.UUID uuid, java.util.List<de.digitalcollections.model.api.identifiable.entity.Collection> subcollections)  
    long count()  
    de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findAll​(int pageNumber, int pageSize, java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, java.lang.String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, java.lang.String active)  
    de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findAllTop​(int pageNumber, int pageSize, java.lang.String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling)  
    de.digitalcollections.model.api.identifiable.entity.Collection findByIdentifier​(java.lang.String namespace, java.lang.String id)  
    org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Collection> findByUuid​(java.util.UUID uuid, java.util.Locale pLocale, java.lang.String active)  
    de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findCollections​(int pageNumber, int pageSize, java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, java.lang.String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, java.lang.String searchTerm, java.lang.String active)  
    org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation> getBreadcrumb​(java.util.UUID uuid, java.util.Locale pLocale)  
    de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects​(java.util.UUID collectionUuid, int pageNumber, int pageSize)  
    de.digitalcollections.model.api.identifiable.entity.Collection getParent​(java.util.UUID uuid)  
    java.util.List<de.digitalcollections.model.api.identifiable.entity.Collection> getParents​(java.util.UUID collectionUuid)  
    java.util.List<de.digitalcollections.model.api.identifiable.entity.agent.CorporateBody> getRelatedCorporateBodies​(java.util.UUID uuid, de.digitalcollections.model.api.filter.FilterCriterion<java.lang.String> predicate)  
    de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> getSubcollections​(java.util.UUID collectionUuid, int pageNumber, int pageSize, java.lang.String active)  
    org.springframework.http.ResponseEntity removeDigitalObject​(java.util.UUID collectionUuid, java.util.UUID digitalObjectUuid)  
    org.springframework.http.ResponseEntity removeSubcollection​(java.util.UUID uuid, java.util.UUID subcollectionUuid)  
    de.digitalcollections.model.api.identifiable.entity.Collection save​(de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors)  
    org.springframework.http.ResponseEntity saveDigitalObjects​(java.util.UUID collectionUuid, java.util.List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)  
    de.digitalcollections.model.api.identifiable.entity.Collection saveWithParentCollection​(java.util.UUID parentUuid, de.digitalcollections.model.api.identifiable.entity.Collection collection)  
    de.digitalcollections.model.api.identifiable.entity.Collection update​(java.util.UUID uuid, de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CollectionController

      @Autowired public CollectionController​(CollectionService collectionService)
  • Method Details

    • 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") java.util.UUID collectionUuid, @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid") java.util.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") java.util.UUID collectionUuid, @ApiPathParam(description="List of the digital objects") @RequestBody java.util.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") java.util.UUID uuid, @ApiPathParam(description="UUID of the subcollection") @PathVariable("subcollectionUuid") java.util.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") java.util.UUID uuid, @ApiPathParam(description="List of the subcollections") @RequestBody java.util.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="sortBy",required=false) java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, @RequestParam(name="sortField",required=false,defaultValue="lastModified") java.lang.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) java.lang.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") java.lang.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 java.lang.String namespace, @PathVariable java.lang.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") 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, @ApiQueryParam(name="active",description="If set, object will only be returned if active") @RequestParam(name="active",required=false) java.lang.String active) throws IdentifiableServiceException
      Throws:
      IdentifiableServiceException
    • findCollections

      @ApiMethod(description="Find limited amount of (active or all) 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="sortBy",required=false) java.util.List<de.digitalcollections.model.api.paging.Order> sortBy, @RequestParam(name="sortField",required=false,defaultValue="uuid") java.lang.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) java.lang.String searchTerm, @RequestParam(name="active",required=false) java.lang.String active)
    • 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") 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)
    • 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") java.util.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 java.util.UUID uuid)
    • getParents

      @ApiMethod(description="Get parent collections") @GetMapping(value={"/latest/collections/{uuid}/parents","/v3/collections/{uuid}/parents"}, produces="application/json") @ApiResponseObject public java.util.List<de.digitalcollections.model.api.identifiable.entity.Collection> getParents​(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") java.util.UUID collectionUuid)
    • getRelatedCorporateBodies

      @ApiMethod(description="Get all related - by the given predicate - corporate bodies of a collection") @GetMapping(value={"/latest/collections/{uuid}/related/corporatebodies","/v3/collections/{uuid}/related/corporatebodies"}, produces="application/json") @ApiResponseObject public java.util.List<de.digitalcollections.model.api.identifiable.entity.agent.CorporateBody> getRelatedCorporateBodies​(@ApiPathParam(description="UUID of the collection") @PathVariable("uuid") java.util.UUID uuid, @RequestParam(name="predicate",required=true) de.digitalcollections.model.api.filter.FilterCriterion<java.lang.String> predicate)
    • 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") java.util.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) java.lang.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") java.util.UUID collectionUuid, @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid") java.util.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") java.util.UUID uuid, @ApiPathParam(description="UUID of the subcollection") @PathVariable("subcollectionUuid") java.util.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") java.util.UUID collectionUuid, @ApiPathParam(description="List of the digital objects") @RequestBody java.util.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 java.util.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 java.util.UUID uuid, @RequestBody de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors) throws IdentifiableServiceException
      Throws:
      IdentifiableServiceException