@Component(value="core.community") public class CommunityRestRepository extends DSpaceObjectRestRepository<Community,CommunityRest>
requestService, utils| Constructor and Description |
|---|
CommunityRestRepository(CommunityService dsoService,
CommunityConverter dsoConverter) |
| Modifier and Type | Method and Description |
|---|---|
protected CommunityRest |
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<CommunityRest> |
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<CommunityRest> |
findAllTop(org.springframework.data.domain.Pageable pageable) |
CommunityRest |
findOne(Context context,
UUID id)
Method to implement to support retrieval of a specific REST object instance
|
org.springframework.data.domain.Page<CommunityRest> |
findSubCommunities(UUID parentCommunity,
org.springframework.data.domain.Pageable pageable) |
Class<CommunityRest> |
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 CommunityRest |
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.
|
CommunityResource |
wrapResource(CommunityRest community,
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 CommunityRestRepository(CommunityService dsoService, CommunityConverter dsoConverter)
@PreAuthorize(value="hasAuthority(\'ADMIN\')") protected CommunityRest createAndReturn(Context context) throws AuthorizeException
DSpaceRestRepositorycreateAndReturn in class DSpaceRestRepository<CommunityRest,UUID>context - the dspace contextAuthorizeException@PreAuthorize(value="hasPermission(#id, \'COMMUNITY\', \'READ\')") public CommunityRest findOne(Context context, UUID id)
DSpaceRestRepositoryfindOne in class DSpaceRestRepository<CommunityRest,UUID>context - the dspace contextid - the rest object idpublic org.springframework.data.domain.Page<CommunityRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)
DSpaceRestRepositoryfindAll in class DSpaceRestRepository<CommunityRest,UUID>context - the dspace contextpageable - object embedding the requested pagination infopublic org.springframework.data.domain.Page<CommunityRest> findAllTop(org.springframework.data.domain.Pageable pageable)
public org.springframework.data.domain.Page<CommunityRest> findSubCommunities(UUID parentCommunity, org.springframework.data.domain.Pageable pageable)
@PreAuthorize(value="hasPermission(#id, \'COMMUNITY\', \'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<CommunityRest,UUID>request - the http requestid - the ID of the target REST objectpatch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operationAuthorizeExceptionSQLExceptionpublic Class<CommunityRest> getDomainClass()
DSpaceRestRepositorygetDomainClass in class DSpaceRestRepository<CommunityRest,UUID>public CommunityResource wrapResource(CommunityRest community, String... rels)
DSpaceRestRepositorywrapResource in class DSpaceRestRepository<CommunityRest,UUID>community - the rest model instancerels - the HAL links@PreAuthorize(value="hasPermission(#id, \'COMMUNITY\', \'WRITE\')") protected CommunityRest 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<CommunityRest,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, \'COMMUNITY\', \'DELETE\')") protected void delete(Context context, UUID id) throws AuthorizeException
DSpaceRestRepositorydelete in class DSpaceRestRepository<CommunityRest,UUID>context - the dspace contextid - the id of the rest object to deleteAuthorizeExceptionCopyright © 2019 DuraSpace. All rights reserved.