Class CollectionLogoController


  • @RestController
    @RequestMapping("/api/core/collections/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}/logo")
    public class CollectionLogoController
    extends Object
    This RestController takes care of the creation and deletion of Collection's nested objects This class will typically receive the UUID of a Collection and it'll perform logic on its nested objects
    • Field Detail

      • REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID

        protected static final String REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID
        Regular expression in the request mapping to accept UUID as identifier
        See Also:
        Constant Field Values
      • utils

        @Autowired
        protected Utils utils
    • Constructor Detail

      • CollectionLogoController

        public CollectionLogoController()
    • Method Detail

      • createLogo

        @PreAuthorize("hasPermission(#uuid, \'COLLECTION\', \'WRITE\')")
        @RequestMapping(method=POST,
                        headers="content-type=multipart/form-data")
        public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> createLogo​(javax.servlet.http.HttpServletRequest request,
                                                                                                                      @PathVariable
                                                                                                                      UUID uuid,
                                                                                                                      @RequestParam(value="file",required=false)
                                                                                                                      org.springframework.web.multipart.MultipartFile uploadfile)
                                                                                                               throws SQLException,
                                                                                                                      IOException,
                                                                                                                      org.dspace.authorize.AuthorizeException
        This method will add a logo to the collection. curl -X POST http:///api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' \ -XPOST -H 'Content-Type: multipart/form-data' \ -H 'Authorization: Bearer eyJhbGciOiJI...' \ -F "file=@Downloads/test.png" Example:
         
         curl -X POST http://<dspace.server.url>/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' \
          -XPOST -H 'Content-Type: multipart/form-data' \
          -H 'Authorization: Bearer eyJhbGciOiJI...' \
          -F "file=@Downloads/test.png"
         
         
        Parameters:
        request - The StandardMultipartHttpServletRequest that will contain the logo in its body
        uuid - The UUID of the collection
        Returns:
        The created bitstream
        Throws:
        SQLException - If something goes wrong
        IOException - If something goes wrong
        org.dspace.authorize.AuthorizeException - If the user doesn't have the correct rights