Package org.dspace.app.rest
Class ItemAddBundleController
- java.lang.Object
-
- org.dspace.app.rest.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 ObjectController 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 Summary
Constructors Constructor Description ItemAddBundleController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>addBundleToItem(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Method to add a Bundle to an Item with the given UUID in the URL.
-
-
-
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, AuthorizeExceptionMethod 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:
SQLExceptionAuthorizeException
-
-