@Component(value="core.item") public class ItemRestRepository extends DSpaceObjectRestRepository<Item,ItemRest>
requestService, utils| Constructor and Description |
|---|
ItemRestRepository(ItemService dsoService,
ItemConverter dsoConverter,
ItemPatch dsoPatch) |
| Modifier and Type | Method and Description |
|---|---|
protected ItemRest |
createAndReturn(Context context)
Method to implement to support the creation of a new instance.
|
protected void |
delete(Context context,
UUID id)
Method to implement to support delete of a single object instance
|
org.springframework.data.domain.Page<ItemRest> |
findAll(Context context,
org.springframework.data.domain.Pageable pageable)
Method to implement to support scroll of entity instances from the collection resource endpoin
|
ItemRest |
findOne(Context context,
UUID id)
Method to implement to support retrieval of a specific REST object instance
|
Class<ItemRest> |
getDomainClass()
The REST model supported by the repository
|
protected void |
patch(Context context,
javax.servlet.http.HttpServletRequest request,
String apiCategory,
String model,
UUID id,
Patch patch)
Method to implement to allow partial update of the REST object via JSON Patch
|
protected ItemRest |
put(Context context,
javax.servlet.http.HttpServletRequest request,
String apiCategory,
String model,
UUID uuid,
com.fasterxml.jackson.databind.JsonNode jsonNode)
Implement this method in the subclass to support updating a REST object.
|
protected void |
updateDSpaceObject(Item item,
ItemRest itemRest)
Applies the changes in the given rest DSpace object to the model DSpace object.
|
ItemResource |
wrapResource(ItemRest item,
String... rels)
Wrap the REST model in a REST HAL Resource
|
patchDSpaceObjectaction, action, count, createAndReturn, createAndReturn, createAndReturn, delete, delete, delete, deleteAll, exists, findAll, findAll, findAll, findAll, findOne, patch, put, put, put, save, save, save, upload, upload, uploadgetRequestService, obtainContextpublic ItemRestRepository(ItemService dsoService, ItemConverter dsoConverter, ItemPatch dsoPatch)
@PreAuthorize(value="hasPermission(#id, \'ITEM\', \'READ\')") public ItemRest findOne(Context context, UUID id)
DSpaceRestRepositoryfindOne in class DSpaceRestRepository<ItemRest,UUID>context - the dspace contextid - the rest object id@PreAuthorize(value="hasAuthority(\'ADMIN\')") public org.springframework.data.domain.Page<ItemRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)
DSpaceRestRepositoryfindAll in class DSpaceRestRepository<ItemRest,UUID>context - the dspace contextpageable - object embedding the requested pagination info@PreAuthorize(value="hasPermission(#id, \'ITEM\', #patch)") protected void patch(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID id, Patch patch) throws AuthorizeException, SQLException
DSpaceRestRepositorypatch in class DSpaceRestRepository<ItemRest,UUID>request - the http requestid - the ID of the target REST objectpatch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operationAuthorizeExceptionSQLExceptionprotected void updateDSpaceObject(Item item, ItemRest itemRest) throws AuthorizeException, SQLException
DSpaceObjectRestRepositoryupdateDSpaceObject in class DSpaceObjectRestRepository<Item,ItemRest>item - the dso to apply changes to.itemRest - the rest representation of the new desired state.AuthorizeExceptionSQLExceptionpublic Class<ItemRest> getDomainClass()
DSpaceRestRepositorygetDomainClass in class DSpaceRestRepository<ItemRest,UUID>public ItemResource wrapResource(ItemRest item, String... rels)
DSpaceRestRepositorywrapResource in class DSpaceRestRepository<ItemRest,UUID>item - the rest model instancerels - the HAL links@PreAuthorize(value="hasAuthority(\'ADMIN\')") protected void delete(Context context, UUID id) throws AuthorizeException
DSpaceRestRepositorydelete in class DSpaceRestRepository<ItemRest,UUID>context - the dspace contextid - the id of the rest object to deleteAuthorizeException@PreAuthorize(value="hasAuthority(\'ADMIN\')") protected ItemRest createAndReturn(Context context) throws AuthorizeException, SQLException
DSpaceRestRepositorycreateAndReturn in class DSpaceRestRepository<ItemRest,UUID>context - the dspace contextAuthorizeExceptionSQLException@PreAuthorize(value="hasPermission(#id, \'ITEM\', \'WRITE\')") protected ItemRest put(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, com.fasterxml.jackson.databind.JsonNode jsonNode) throws RepositoryMethodNotImplementedException, SQLException, AuthorizeException
DSpaceRestRepositoryput in class DSpaceRestRepository<ItemRest,UUID>context - the dspace contextapiCategory - the API category e.g. "api"model - the DSpace model e.g. "metadatafield"uuid - the ID of the target REST objectjsonNode - the part of the request body representing the updated rest objectRepositoryMethodNotImplementedException - returned by the default implementation when the operation is not supported for the entitySQLException - when the database returns an errorAuthorizeException - if the context user is not authorized to perform this operationCopyright © 2019 DuraSpace. All rights reserved.