Class ItemAddBundleController


  • @RestController
    @RequestMapping("/api/core/items/{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}}/bundles")
    public class ItemAddBundleController
    extends Object
    Controller to add bundles to a certain item, indicated by a uuid in the request Usage: POST /api/core/items/<:uuid>/bundles (with name and metadata of bundle in request json) Example:
     
     curl -X POST https://<dspace.server.url>/api/core/items/1911e8a4-6939-490c-b58b-a5d70f8d91fb/bundles
      -H 'Authorization: Bearer eyJhbGciOiJI...'
      -H 'Content-Type: application/json
      -d {
          "name": "ORIGINAL",
          "metadata": {...}
         }
     
     
    • Constructor Detail

      • ItemAddBundleController

        public ItemAddBundleController()
    • Method Detail

      • addBundleToItem

        @RequestMapping(method=POST)
        @PreAuthorize("hasPermission(#uuid, \'ITEM\', \'ADD\')")
        public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> addBundleToItem​(@PathVariable
                                                                                                                           UUID uuid,
                                                                                                                           javax.servlet.http.HttpServletRequest request,
                                                                                                                           javax.servlet.http.HttpServletResponse response)
                                                                                                                    throws SQLException,
                                                                                                                           AuthorizeException
        Method to add a Bundle to an Item with the given UUID in the URL. This will create a Bundle with the name provided in the request and attach this to the Item that matches the UUID in the URL.
        Returns:
        The created BundleResource
        Throws:
        SQLException
        AuthorizeException