Class FileResourceMetadataController


  • @RestController
    @Api(description="The fileresource controller",
         name="Fileresource controller")
    public class FileResourceMetadataController
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findAll​(int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy)  
      de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findFileResourcesByType​(String type, int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy, String searchTerm)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> get​(UUID uuid, Locale pLocale)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> getByIdentifier​(String namespace, String id)  
      de.digitalcollections.model.api.identifiable.resource.FileResource save​(de.digitalcollections.model.api.identifiable.resource.FileResource fileResource)  
      de.digitalcollections.model.api.identifiable.resource.FileResource update​(UUID uuid, de.digitalcollections.model.api.identifiable.resource.FileResource fileResource, org.springframework.validation.BindingResult errors)  
    • Constructor Detail

      • FileResourceMetadataController

        public FileResourceMetadataController()
    • Method Detail

      • findAll

        @ApiMethod(description="Get all fileresources")
        @GetMapping(value={"/latest/fileresources","/v2/fileresources"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findAll​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                               int pageNumber,
                                                                                                                                               @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                               int pageSize,
                                                                                                                                               @RequestParam(name="sortBy",required=false)
                                                                                                                                               List<de.digitalcollections.model.api.paging.Order> sortBy)
      • findFileResourcesByType

        @ApiMethod(description="Find limited amount of fileresources of given type containing searchTerm in label or description")
        @GetMapping(value={"/latest/fileresources/type/{type}","/v2/fileresources/type/{type}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findFileResourcesByType​(@ApiPathParam(description="Type of the fileresource, e.g. <tt>image</tt>") @PathVariable("type")
                                                                                                                                                                     String type,
                                                                                                                                                                     @RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                                                     int pageNumber,
                                                                                                                                                                     @RequestParam(name="pageSize",required=false,defaultValue="5")
                                                                                                                                                                     int pageSize,
                                                                                                                                                                     @RequestParam(name="sortBy",required=false)
                                                                                                                                                                     List<de.digitalcollections.model.api.paging.Order> sortBy,
                                                                                                                                                                     @RequestParam(name="searchTerm",required=false)
                                                                                                                                                                     String searchTerm)
      • get

        @ApiMethod(description="Get a fileresource as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @GetMapping(value={"/latest/fileresources/{uuid}","/v2/fileresources/{uuid}"},
                    produces={"application/json","application/xml"})
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> get​(@ApiPathParam(description="UUID of the fileresource, 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
      • getByIdentifier

        @ApiMethod(description="Get a fileresource as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @GetMapping(value={"/latest/fileresources/identifier/{namespace}:{id}","/v2/fileresources/identifier/{namespace}:{id}"},
                    produces={"application/json","application/xml"})
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> getByIdentifier​(@PathVariable
                                                                                                                                           String namespace,
                                                                                                                                           @PathVariable
                                                                                                                                           String id)
                                                                                                                                    throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • save

        @ApiMethod(description="Save a newly created fileresource")
        @PostMapping(value={"/latest/fileresources","/v2/fileresources"},
                     produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.resource.FileResource save​(@RequestBody
                                                                                       de.digitalcollections.model.api.identifiable.resource.FileResource fileResource)
                                                                                throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • update

        @ApiMethod(description="Update a fileresource")
        @PutMapping(value={"/latest/fileresources/{uuid}","/v2/fileresources/{uuid}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.resource.FileResource update​(@PathVariable
                                                                                         UUID uuid,
                                                                                         @RequestBody
                                                                                         de.digitalcollections.model.api.identifiable.resource.FileResource fileResource,
                                                                                         org.springframework.validation.BindingResult errors)
                                                                                  throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException