Package org.dspace.app.rest
Class ItemOwningCollectionUpdateRestController
java.lang.Object
org.dspace.app.rest.ItemOwningCollectionUpdateRestController
@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}}/owningCollection")
public class ItemOwningCollectionUpdateRestController
extends Object
This controller will handle all the incoming calls on the api/core/items/{uuid}/owningCollection endpoint
where the uuid corresponds to the item of which you want to edit the owning collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmove(UUID uuid, Boolean inheritCollectionPolicies, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) This method will update the owning collection of the item that correspond to the provided item uuid, effectively moving the item to the new collection.
-
Constructor Details
-
ItemOwningCollectionUpdateRestController
public ItemOwningCollectionUpdateRestController()
-
-
Method Details
-
move
@RequestMapping(method=PUT, consumes="text/uri-list") @PreAuthorize("hasPermission(#uuid, \'ITEM\',\'WRITE\')") @PostAuthorize("returnObject != null") public CollectionRest move(@PathVariable UUID uuid, @RequestParam(name="inheritPolicies",defaultValue="false") Boolean inheritCollectionPolicies, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws SQLException, IOException, AuthorizeException This method will update the owning collection of the item that correspond to the provided item uuid, effectively moving the item to the new collection.- Parameters:
uuid- The UUID of the item that will be movedinheritCollectionPolicies- Boolean flag whether to inherit the target collection policies when moving the itemresponse- The response objectrequest- The request object- Returns:
- The wrapped resource containing the new owning collection or null when the item was not moved
- Throws:
SQLException- If something goes wrongIOException- If something goes wrongAuthorizeException- If the user is not authorized to perform the move action
-