Class CollectionController


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long count()  
      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)  
      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)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Collection> findByUuid​(UUID uuid, Locale pLocale)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation> getBreadcrumb​(UUID uuid, Locale pLocale)  
      de.digitalcollections.model.api.identifiable.entity.Collection save​(de.digitalcollections.model.api.identifiable.entity.Collection collection, org.springframework.validation.BindingResult errors)  
      de.digitalcollections.model.api.identifiable.entity.Collection saveWithParentCollection​(UUID parentUuid, de.digitalcollections.model.api.identifiable.entity.Collection collection)  
      de.digitalcollections.model.api.identifiable.entity.Collection update​(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

      • 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="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)
      • 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)
      • 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)
                                                                                                                           throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • 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
      • 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
      • count

        @ApiMethod(description="Get count of collections")
        @GetMapping(value={"/latest/collections/count","/v2/collections/count"},
                    produces="application/json")
        @ApiResponseObject
        public long count()
      • 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)