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 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResponseEntity<org.springframework.hateoas.RepresentationModel<?>>addBundleToItem(UUID uuid, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Method to add a Bundle to an Item with the given UUID in the URL.
-
Constructor Details
-
ItemAddBundleController
public ItemAddBundleController()
-
-
Method Details
-
addBundleToItem
@RequestMapping(method=POST) @PreAuthorize("hasPermission(#uuid, \'ITEM\', \'ADD\')") public ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> addBundleToItem(@PathVariable UUID uuid, jakarta.servlet.http.HttpServletRequest request, jakarta.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:
SQLExceptionAuthorizeException
-