Package org.dspace.app.rest.repository
Class BundleRestRepository
java.lang.Object
org.dspace.app.rest.repository.AbstractDSpaceRestRepository
org.dspace.app.rest.repository.DSpaceRestRepository<R,UUID>
org.dspace.app.rest.repository.DSpaceObjectRestRepository<Bundle,BundleRest>
org.dspace.app.rest.repository.BundleRestRepository
- All Implemented Interfaces:
ReloadableEntityObjectRepository<Bundle,,UUID> Aware,BeanNameAware,org.springframework.data.repository.CrudRepository<BundleRest,,UUID> org.springframework.data.repository.PagingAndSortingRepository<BundleRest,,UUID> org.springframework.data.repository.Repository<BundleRest,UUID>
@Component("core.bundles")
public class BundleRestRepository
extends DSpaceObjectRestRepository<Bundle,BundleRest>
This is the repository responsible for managing the Bundle Rest object
- Author:
- Jelle Pelgrims (jelle.pelgrims at atmire.com)
-
Field Summary
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeletes a bundle whose uuid is given and deletes all the bitstreams it contains in BundleService.deleteorg.springframework.data.domain.Page<BundleRest>Method to implement to support scroll of entity instances from the collection resource endpointMethod to implement to support retrieval of a specific REST object instanceThe REST model supported by the repositoryprotected voidpatch(Context context, jakarta.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, Patch patch) Apply a patch operation to a bundleuploadBitstream(Context context, Bundle bundle, String fileName, InputStream fileInputStream, String properties) Method to upload a bitstream to a bundle.Methods inherited from class org.dspace.app.rest.repository.DSpaceObjectRestRepository
findDomainObjectByPk, getPKClass, patchDSpaceObjectMethods inherited from class org.dspace.app.rest.repository.DSpaceRestRepository
action, action, count, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAll, findAll, findAllById, findById, patch, put, put, put, put, save, save, saveAll, setBeanName, upload, upload, uploadMethods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContext
-
Constructor Details
-
BundleRestRepository
-
-
Method Details
-
findOne
@PreAuthorize("hasPermission(#id, \'BUNDLE\', \'READ\')") public BundleRest findOne(Context context, UUID id) Description copied from class:DSpaceRestRepositoryMethod to implement to support retrieval of a specific REST object instance- Specified by:
findOnein classDSpaceRestRepository<BundleRest,UUID> - Parameters:
context- the dspace contextid- the rest object id- Returns:
- the REST object identified by its ID
-
findAll
public org.springframework.data.domain.Page<BundleRest> findAll(Context context, org.springframework.data.domain.Pageable pageable) Description copied from class:DSpaceRestRepositoryMethod to implement to support scroll of entity instances from the collection resource endpoint- Specified by:
findAllin classDSpaceRestRepository<BundleRest,UUID> - Parameters:
context- the dspace contextpageable- object embedding the requested pagination info- Returns:
-
patch
@PreAuthorize("hasPermission(#uuid, \'BUNDLE\', \'WRITE\')") protected void patch(Context context, jakarta.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, Patch patch) throws AuthorizeException, SQLException Apply a patch operation to a bundle- Overrides:
patchin classDSpaceRestRepository<BundleRest,UUID> - Parameters:
context- The contextrequest- The http requestapiCategory- The API category e.g. "api"model- The DSpace model e.g. "metadatafield"uuid- The UUID of the bundle to perform patch operations onpatch- The JSON Patch (https://tools.ietf.org/html/rfc6902) operation- Throws:
AuthorizeExceptionSQLException
-
uploadBitstream
public BitstreamRest uploadBitstream(Context context, Bundle bundle, String fileName, InputStream fileInputStream, String properties) Method to upload a bitstream to a bundle.- Parameters:
context- The contextbundle- The bundle where the bitstream should be storedfileName- The filename as it was uploadedfileInputStream- The input stream used to create the bitstreamproperties- The properties to be assigned to the bitstream- Returns:
- The uploaded bitstream
-
getDomainClass
Description copied from class:DSpaceRestRepositoryThe REST model supported by the repository- Specified by:
getDomainClassin classDSpaceRestRepository<BundleRest,UUID>
-
delete
@PreAuthorize("hasPermission(#id, \'BUNDLE\', \'DELETE\')") protected void delete(Context context, UUID id) throws AuthorizeException Deletes a bundle whose uuid is given and deletes all the bitstreams it contains in BundleService.delete- Overrides:
deletein classDSpaceRestRepository<BundleRest,UUID> - Parameters:
context- the dspace contextid- the id of the bundle to delete- Throws:
AuthorizeException
-