Class CommunityLogoController

java.lang.Object
org.dspace.app.rest.CommunityLogoController

@RestController @RequestMapping("/api/core/communities/{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 CommunityLogoController extends Object
This RestController takes care of the creation and deletion of Communities' nested objects This class will typically receive the UUID of a Community and it'll perform logic on its nested objects
  • Field Details

  • Constructor Details

    • CommunityLogoController

      public CommunityLogoController()
  • Method Details

    • createLogo

      @PreAuthorize("hasPermission(#uuid, \'COMMUNITY\', \'WRITE\')") @RequestMapping(method=POST, headers="content-type=multipart/form-data") public ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> createLogo(jakarta.servlet.http.HttpServletRequest request, @PathVariable UUID uuid, @RequestParam(value="file",required=false) MultipartFile uploadfile) throws SQLException, IOException, AuthorizeException
      This method will add a logo to the community. curl -X POST http://<dspace.server.url>/api/core/communities/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/communities/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 community
      Returns:
      The created bitstream
      Throws:
      SQLException - If something goes wrong
      IOException - If something goes wrong
      AuthorizeException - If the user doesn't have the correct rights