Class CollectionController


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

      Constructors 
      Constructor Description
      CollectionController​(de.digitalcollections.cudami.server.business.api.service.identifiable.entity.CollectionService collectionService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> findAll​(int pageNumber, int pageSize, java.lang.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> getWebpage​(java.util.UUID uuid, java.util.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 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 Detail

      • CollectionController

        @Autowired
        public CollectionController​(de.digitalcollections.cudami.server.business.api.service.identifiable.entity.CollectionService collectionService)
    • Method Detail

      • findAll

        @ApiMethod(description="Get all collections")
        @RequestMapping(value={"/latest/collections","/v2/collections"},
                        produces="application/json",
                        method=GET)
        @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")
                                                                                                                                           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)
      • getWebpage

        @ApiMethod(description="Get an collection as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @RequestMapping(value={"/latest/collections/{uuid}","/v2/collections/{uuid}"},
                        produces={"application/json","application/xml"},
                        method=GET)
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Collection> getWebpage​(@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)
                                                                                                                           throws de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
        Throws:
        de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
      • save

        @ApiMethod(description="Save a newly created collection")
        @RequestMapping(value={"/latest/collections","/v2/collections"},
                        produces="application/json",
                        method=POST)
        @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 de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
        Throws:
        de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
      • update

        @ApiMethod(description="Update an collection")
        @RequestMapping(value={"/latest/collections/{uuid}","/v2/collections/{uuid}"},
                        produces="application/json",
                        method=PUT)
        @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 de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
        Throws:
        de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException