@Component(value="core.collection") public class CollectionRestRepository extends DSpaceObjectRestRepository<Collection,CollectionRest>
requestService, utils| Constructor and Description |
|---|
CollectionRestRepository(CollectionService dsoService,
CollectionConverter dsoConverter) |
| Modifier and Type | Method and Description |
|---|---|
protected CollectionRest |
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<CollectionRest> |
findAll(Context context,
org.springframework.data.domain.Pageable pageable)
Method to implement to support scroll of entity instances from the collection resource endpoin
|
org.springframework.data.domain.Page<CollectionRest> |
findAuthorized(org.springframework.data.domain.Pageable pageable) |
org.springframework.data.domain.Page<CollectionRest> |
findAuthorizedByCommunity(UUID communityUuid,
org.springframework.data.domain.Pageable pageable) |
CollectionRest |
findOne(Context context,
UUID id)
Method to implement to support retrieval of a specific REST object instance
|
Class<CollectionRest> |
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 CollectionRest |
put(Context context,
javax.servlet.http.HttpServletRequest request,
String apiCategory,
String model,
UUID id,
com.fasterxml.jackson.databind.JsonNode jsonNode)
Implement this method in the subclass to support updating a REST object.
|
CollectionResource |
wrapResource(CollectionRest collection,
String... rels)
Wrap the REST model in a REST HAL Resource
|
patchDSpaceObject, updateDSpaceObjectaction, 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 CollectionRestRepository(CollectionService dsoService, CollectionConverter dsoConverter)
@PreAuthorize(value="hasPermission(#id, \'COLLECTION\', \'READ\')") public CollectionRest findOne(Context context, UUID id)
DSpaceRestRepositoryfindOne in class DSpaceRestRepository<CollectionRest,UUID>context - the dspace contextid - the rest object idpublic org.springframework.data.domain.Page<CollectionRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)
DSpaceRestRepositoryfindAll in class DSpaceRestRepository<CollectionRest,UUID>context - the dspace contextpageable - object embedding the requested pagination infopublic org.springframework.data.domain.Page<CollectionRest> findAuthorizedByCommunity(UUID communityUuid, org.springframework.data.domain.Pageable pageable)
public org.springframework.data.domain.Page<CollectionRest> findAuthorized(org.springframework.data.domain.Pageable pageable)
@PreAuthorize(value="hasPermission(#id, \'COLLECTION\', \'WRITE\')") 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<CollectionRest,UUID>request - the http requestid - the ID of the target REST objectpatch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operationAuthorizeExceptionSQLExceptionpublic Class<CollectionRest> getDomainClass()
DSpaceRestRepositorygetDomainClass in class DSpaceRestRepository<CollectionRest,UUID>public CollectionResource wrapResource(CollectionRest collection, String... rels)
DSpaceRestRepositorywrapResource in class DSpaceRestRepository<CollectionRest,UUID>collection - the rest model instancerels - the HAL links@PreAuthorize(value="hasAuthority(\'ADMIN\')") protected CollectionRest createAndReturn(Context context) throws AuthorizeException
DSpaceRestRepositorycreateAndReturn in class DSpaceRestRepository<CollectionRest,UUID>context - the dspace contextAuthorizeException@PreAuthorize(value="hasPermission(#id, \'COLLECTION\', \'WRITE\')") protected CollectionRest put(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID id, com.fasterxml.jackson.databind.JsonNode jsonNode) throws RepositoryMethodNotImplementedException, SQLException, AuthorizeException
DSpaceRestRepositoryput in class DSpaceRestRepository<CollectionRest,UUID>context - the dspace contextapiCategory - the API category e.g. "api"model - the DSpace model e.g. "metadatafield"id - 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 operation@PreAuthorize(value="hasPermission(#id, \'COLLECTION\', \'DELETE\')") protected void delete(Context context, UUID id) throws AuthorizeException
DSpaceRestRepositorydelete in class DSpaceRestRepository<CollectionRest,UUID>context - the dspace contextid - the id of the rest object to deleteAuthorizeExceptionCopyright © 2019 DuraSpace. All rights reserved.