@Component(value="eperson.eperson") public class EPersonRestRepository extends DSpaceObjectRestRepository<EPerson,EPersonRest>
requestService, utils| Constructor and Description |
|---|
EPersonRestRepository(EPersonService dsoService,
EPersonConverter dsoConverter,
EPersonPatch dsoPatch) |
| Modifier and Type | Method and Description |
|---|---|
protected EPersonRest |
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<EPersonRest> |
findAll(Context context,
org.springframework.data.domain.Pageable pageable)
Method to implement to support scroll of entity instances from the collection resource endpoin
|
EPersonRest |
findByEmail(String email)
Find the eperson with the provided email address if any.
|
org.springframework.data.domain.Page<EPersonRest> |
findByName(String q,
org.springframework.data.domain.Pageable pageable)
Find the epersons matching the query q parameter.
|
EPersonRest |
findOne(Context context,
UUID id)
Method to implement to support retrieval of a specific REST object instance
|
Class<EPersonRest> |
getDomainClass()
The REST model supported by the repository
|
protected void |
patch(Context context,
javax.servlet.http.HttpServletRequest request,
String apiCategory,
String model,
UUID uuid,
Patch patch)
Method to implement to allow partial update of the REST object via JSON Patch
|
protected void |
updateDSpaceObject(EPerson ePerson,
EPersonRest ePersonRest)
Applies the changes in the given rest DSpace object to the model DSpace object.
|
EPersonResource |
wrapResource(EPersonRest eperson,
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, put, save, save, save, upload, upload, uploadgetRequestService, obtainContextpublic EPersonRestRepository(EPersonService dsoService, EPersonConverter dsoConverter, EPersonPatch dsoPatch)
protected EPersonRest createAndReturn(Context context) throws AuthorizeException
DSpaceRestRepositorycreateAndReturn in class DSpaceRestRepository<EPersonRest,UUID>context - the dspace contextAuthorizeException@PreAuthorize(value="hasPermission(#id, \'EPERSON\', \'READ\')") public EPersonRest findOne(Context context, UUID id)
DSpaceRestRepositoryfindOne in class DSpaceRestRepository<EPersonRest,UUID>context - the dspace contextid - the rest object id@PreAuthorize(value="hasAuthority(\'ADMIN\')") public org.springframework.data.domain.Page<EPersonRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)
DSpaceRestRepositoryfindAll in class DSpaceRestRepository<EPersonRest,UUID>context - the dspace contextpageable - object embedding the requested pagination infopublic org.springframework.data.domain.Page<EPersonRest> findByName(String q, org.springframework.data.domain.Pageable pageable)
EPersonService.search(Context, String, int, int) methodq - is the *required* query stringpageable - contains the pagination informationpublic EPersonRest findByEmail(String email)
EPersonService.findByEmail(Context, String) methodemail - is the *required* email addresspageable - contains the pagination information@PreAuthorize(value="hasPermission(#uuid, \'EPERSON\', #patch)") protected void patch(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, Patch patch) throws AuthorizeException, SQLException
DSpaceRestRepositorypatch in class DSpaceRestRepository<EPersonRest,UUID>request - the http requestuuid - the ID of the target REST objectpatch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operationAuthorizeExceptionSQLExceptionprotected void updateDSpaceObject(EPerson ePerson, EPersonRest ePersonRest) throws AuthorizeException, SQLException
DSpaceObjectRestRepositoryupdateDSpaceObject in class DSpaceObjectRestRepository<EPerson,EPersonRest>ePerson - the dso to apply changes to.ePersonRest - the rest representation of the new desired state.AuthorizeExceptionSQLExceptionprotected void delete(Context context, UUID id) throws AuthorizeException
DSpaceRestRepositorydelete in class DSpaceRestRepository<EPersonRest,UUID>context - the dspace contextid - the id of the rest object to deleteAuthorizeExceptionpublic Class<EPersonRest> getDomainClass()
DSpaceRestRepositorygetDomainClass in class DSpaceRestRepository<EPersonRest,UUID>public EPersonResource wrapResource(EPersonRest eperson, String... rels)
DSpaceRestRepositorywrapResource in class DSpaceRestRepository<EPersonRest,UUID>eperson - the rest model instancerels - the HAL linksCopyright © 2019 DuraSpace. All rights reserved.