Package org.dspace.app.rest
Class RestResourceController
- java.lang.Object
-
- org.dspace.app.rest.RestResourceController
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@RestController @RequestMapping("/api/{apiCategory}/{model}") public class RestResourceController extends Object implements org.springframework.beans.factory.InitializingBeanThis is the main entry point of the new REST API. Its responsibility is to provide a consistent behaviors for all the exposed resources in terms of returned HTTP codes, endpoint URLs, HTTP verbs to methods translation, etc. It delegates to the repository the business logic- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description RestResourceController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>action(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id)Called in POST, with a x-www-form-urlencoded, execute an action on a resource Note that the regular expression in the request mapping accept a number as identifier;voidafterPropertiesSet()org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>delete(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id)org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>delete(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid)<T extends RestAddressableModel>
org.springframework.hateoas.RepresentationModelexecuteSearchMethods(String apiCategory, String model, String searchMethodName, javax.servlet.http.HttpServletResponse response, org.springframework.data.domain.Pageable pageable, org.springframework.data.domain.Sort sort, org.springframework.data.web.PagedResourcesAssembler assembler, org.springframework.util.MultiValueMap<String,Object> parameters)<T extends RestAddressableModel>
org.springframework.hateoas.PagedModel<DSpaceResource<T>>findAll(String apiCategory, String model, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler, javax.servlet.http.HttpServletResponse response, org.springframework.util.MultiValueMap<String,Object> parameters)Find allHALResource<RestAddressableModel>findOne(String apiCategory, String model, Integer id)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a number as identifier; Please seefindOne(String, String, String)for findOne with string as identifier and seefindOne(String, String, UUID)for uuid as identifierHALResource<RestAddressableModel>findOne(String apiCategory, String model, String id)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a string as identifier but not the other kind of identifier; http:///api/{apiCategory}/{model}/{id} Example: HALResource<RestAddressableModel>findOne(String apiCategory, String model, UUID uuid)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a UUID as identifier; Please seefindOne(String, String, Integer)for findOne with number as identifier and seefindOne(String, String, String)for string as identifierorg.springframework.hateoas.RepresentationModelfindRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiCategory, String model, Integer id, String rel, String relid, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)org.springframework.hateoas.RepresentationModelfindRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiCategory, String model, Integer id, String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a number;org.springframework.hateoas.RepresentationModelfindRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiCategory, String model, String id, String rel, String relid, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET, try to retrieve the requested linked resource.org.springframework.hateoas.RepresentationModelfindRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiCategory, String model, String id, String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a string as identifier but not the other kind of identifier;org.springframework.hateoas.RepresentationModelfindRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiCategory, String model, UUID uuid, String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a UUID as identifier;org.springframework.hateoas.RepresentationModellistSearchMethods(String apiCategory, String model)org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>patch(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, com.fasterxml.jackson.databind.JsonNode jsonNode)PATCH method, using operation on the resources following (JSON) Patch notation (https://tools.ietf .org/html/rfc6902) Note that the regular expression in the request mapping accept a number as identifier;org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>patch(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID id, com.fasterxml.jackson.databind.JsonNode jsonNode)PATCH method, using operation on the resources following (JSON) Patch notation (https://tools.ietf .org/html/rfc6902) Note that the regular expression in the request mapping accept a UUID as identifier;<ID extends Serializable>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>patchInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, ID id, com.fasterxml.jackson.databind.JsonNode jsonNode)Internal patch methodorg.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>post(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, String parent)Execute a POST request; curl -X POST -H "Content-Type:application/json" http:///api/{apiCategory}/{model} Example: <ID extends Serializable>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>postJsonInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, String parent)Internal method to execute POST with application/json MediaType;<ID extends Serializable>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>postUriListInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model)Internal method to execute POST with text/uri-list MediaType;org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>postWithUriListContentType(javax.servlet.http.HttpServletRequest request, String apiCategory, String model)Execute a POST request; curl -X POST -H "Content-Type:text/uri-list" http:///api/{apiCategory}/{model} Example: DSpaceResource<RestAddressableModel>put(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id)Execute a PUT request for an entity with id of type Integer; curl -X PUT -H "Content-Type:text/uri-list" http:///api/{apiCategory}/{model}/{id} Example: DSpaceResource<RestAddressableModel>put(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, com.fasterxml.jackson.databind.JsonNode jsonNode)Execute a PUT request for an entity with id of type Integer; curl -X PUT -H "Content-Type:application/json" http:///api/{apiCategory}/{model}/{id} Example: DSpaceResource<RestAddressableModel>put(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, com.fasterxml.jackson.databind.JsonNode jsonNode)Execute a PUT request for an entity with id of type UUID; curl -X PUT http:///api/{apiCategory}/{model}/{uuid} Example: <ID extends Serializable>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>upload(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, org.springframework.web.multipart.MultipartFile uploadfile)Called in POST, multipart, upload to a specific rest resource the file passed as "file" request parameter Note that the regular expression in the request mapping accept a number as identifier;<T extends RestAddressableModel>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>upload(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, List<org.springframework.web.multipart.MultipartFile> uploadfile)Upload a file against the collection resource endpoint.<ID extends Serializable>
org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>upload(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, org.springframework.web.multipart.MultipartFile uploadfile)Called in POST, multipart, upload to a specific rest resource the file passed as "file" request parameter Note that the regular expression in the request mapping accept a UUID as identifier;
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
findOne
@RequestMapping(method=GET, value="/{id:\\d+}") public HALResource<RestAddressableModel> findOne(@PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a number as identifier; Please seefindOne(String, String, String)for findOne with string as identifier and seefindOne(String, String, UUID)for uuid as identifier- Parameters:
apiCategory- category from requestmodel- model from requestid- Identifier from request- Returns:
- single DSpaceResource
-
findOne
@RequestMapping(method=GET, value="/{id:^(?!^\\d+$)(?!^[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}$)[\\w+\\-\\.:]+$+}") public HALResource<RestAddressableModel> findOne(@PathVariable String apiCategory, @PathVariable String model, @PathVariable String id)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a string as identifier but not the other kind of identifier; http:///api/{apiCategory}/{model}/{id} Example:
Please seehttp://<dspace.server.url>/api/config/submissionsections/collectionfindOne(String, String, Integer)for findOne with number as identifier and seefindOne(String, String, UUID)for uuid as identifier- Parameters:
apiCategory- category from requestmodel- model from requestid- Identifier from request- Returns:
- single DSpaceResource
-
findOne
@RequestMapping(method=GET, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}") public HALResource<RestAddressableModel> findOne(@PathVariable String apiCategory, @PathVariable String model, @PathVariable UUID uuid)Called in GET is used to retrieve the single resource by identifier; Note that the regular expression in the request mapping accept a UUID as identifier; Please seefindOne(String, String, Integer)for findOne with number as identifier and seefindOne(String, String, String)for string as identifier- Parameters:
apiCategory- category from requestmodel- model from requestuuid- Identifier from request- Returns:
- single DSpaceResource
-
findRel
@RequestMapping(method=GET, value="/{id:\\d+}/{rel}") public org.springframework.hateoas.RepresentationModel findRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id, @PathVariable String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a number;- Parameters:
request- current HTTPServletRequestapiCategory- category from requestmodel- model from requestid- identifier from requestrel- relation from requestpage- pagination informationassembler- PagedResourcesAssembler- Returns:
- single RepresentationModel
-
findRel
@RequestMapping(method=GET, value="/{id:^(?!^\\d+$)(?!^[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}$)[\\w+\\-\\.:]+$+}/{rel}") public org.springframework.hateoas.RepresentationModel findRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @PathVariable String apiCategory, @PathVariable String model, @PathVariable String id, @PathVariable String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a string as identifier but not the other kind of identifier;- Parameters:
request- current HTTPServletRequestresponse- HTTPServletResponseapiCategory- category from requestmodel- model from requestid- identifier from requestrel- relation from requestpage- pagination informationassembler- PagedResourcesAssembler- Returns:
- single RepresentationModel
-
findRel
@RequestMapping(method=GET, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}/{rel}") public org.springframework.hateoas.RepresentationModel findRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @PathVariable String apiCategory, @PathVariable String model, @PathVariable UUID uuid, @PathVariable String rel, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler)Called in GET is used to retrieve the relation resources; Note that the regular expression in the request mapping accept a UUID as identifier;- Parameters:
request-apiCategory-model-uuid-rel-page-assembler-- Returns:
-
findRel
@RequestMapping(method=GET, value="/{id:^(?!^\\d+$)(?!^[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}$)[\\w+\\-\\.:]+$+}/{rel}/{relid}") public org.springframework.hateoas.RepresentationModel findRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @PathVariable String apiCategory, @PathVariable String model, @PathVariable String id, @PathVariable String rel, @PathVariable String relid, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler) throws ThrowableCalled in GET, try to retrieve the requested linked resource. Note that the regular expression in the request mapping accept a string as identifier but not the other kind of identifier; http:///api/{apiCategory}/{model}/{id}/{rel}/{relid} Example:
Example:http://<dspace.server.url>/api/integration/authorities/SRJournalTitle/entryValues/1479-9995http://<dspace.server.url>/api/integration/authorities/srsc/entries/VR110111- Parameters:
request-apiCategory-model-id-rel-relid-page-assembler-- Returns:
- Throws:
Throwable
-
findRel
@RequestMapping(method=GET, value="/{id:\\d+}/{rel}/{relid}") public org.springframework.hateoas.RepresentationModel findRel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id, @PathVariable String rel, @PathVariable String relid, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler) throws Throwable- Throws:
Throwable
-
post
@RequestMapping(method=POST, consumes={"application/json","application/hal+json"}) public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> post(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @RequestParam(required=false) String parent) throws org.springframework.web.HttpRequestMethodNotSupportedExceptionExecute a POST request; curl -X POST -H "Content-Type:application/json" http:///api/{apiCategory}/{model} Example: curl -X POST -H "Content-Type:application/json" http://<dspace.server.url>/api/submission/workspaceitems- Parameters:
request- The relevant requestapiCategory- The apiCategory to be usedmodel- The model to be usedparent- Optional parent identifier- Returns:
- The relevant ResponseEntity for this request
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException- If something goes wrong
-
postWithUriListContentType
@RequestMapping(method=POST, consumes="text/uri-list") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> postWithUriListContentType(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model) throws org.springframework.web.HttpRequestMethodNotSupportedExceptionExecute a POST request; curl -X POST -H "Content-Type:text/uri-list" http:///api/{apiCategory}/{model} Example: curl -X POST -H "Content-Type:text/uri-list" http://<dspace.server.url>/api/submission/workspaceitems- Parameters:
request- The relevant requestapiCategory- The apiCategory to be usedmodel- The model to be used- Returns:
- The relevant ResponseEntity for this request
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException- If something goes wrong
-
postJsonInternal
public <ID extends Serializable> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> postJsonInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, String parent) throws org.springframework.web.HttpRequestMethodNotSupportedException
Internal method to execute POST with application/json MediaType;- Parameters:
request- The relevant requestapiCategory- The apiCategory to be usedmodel- The model to be usedparent- The parent object id (optional)- Returns:
- The relevant ResponseEntity for this request
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException- If something goes wrong
-
postUriListInternal
public <ID extends Serializable> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> postUriListInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model) throws org.springframework.web.HttpRequestMethodNotSupportedException
Internal method to execute POST with text/uri-list MediaType;- Parameters:
request- The relevant requestapiCategory- The apiCategory to be usedmodel- The model to be used- Returns:
- The relevant ResponseEntity for this request
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException- If something goes wrong
-
action
@RequestMapping(method=POST, value="/{id:\\d+}", headers="content-type=application/x-www-form-urlencoded") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> action(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id) throws org.springframework.web.HttpRequestMethodNotSupportedException, SQLException, IOExceptionCalled in POST, with a x-www-form-urlencoded, execute an action on a resource Note that the regular expression in the request mapping accept a number as identifier;- Parameters:
request-apiCategory-model-id-- Returns:
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedExceptionIOExceptionSQLException
-
upload
@RequestMapping(method=POST, value="/{id:\\d+}", headers="content-type=multipart/form-data") public <ID extends Serializable> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> upload(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id, @RequestParam("file") org.springframework.web.multipart.MultipartFile uploadfile) throws org.springframework.web.HttpRequestMethodNotSupportedExceptionCalled in POST, multipart, upload to a specific rest resource the file passed as "file" request parameter Note that the regular expression in the request mapping accept a number as identifier;- Parameters:
request- the http requestapiCategory- the api categorymodel- the rest model that identify the REST resource collectionid- the id of the specific rest resourceuploadfile- the file to upload- Returns:
- the created resource
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
upload
@RequestMapping(method=POST, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}", headers="content-type=multipart/form-data") public <ID extends Serializable> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> upload(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable UUID uuid, @RequestParam("file") org.springframework.web.multipart.MultipartFile uploadfile) throws org.springframework.web.HttpRequestMethodNotSupportedExceptionCalled in POST, multipart, upload to a specific rest resource the file passed as "file" request parameter Note that the regular expression in the request mapping accept a UUID as identifier;- Parameters:
request- the http requestapiCategory- the api categorymodel- the rest model that identify the REST resource collectionuuid- the uuid of the specific rest resourceuploadfile- the file to upload- Returns:
- the created resource
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
upload
@RequestMapping(method=POST, headers="content-type=multipart/form-data") public <T extends RestAddressableModel> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> upload(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @RequestParam("file") List<org.springframework.web.multipart.MultipartFile> uploadfile) throws SQLException, FileNotFoundException, IOException, org.dspace.authorize.AuthorizeExceptionUpload a file against the collection resource endpoint. This is typically used for bulk creation of resources such for instance multiple workspaceitems from a CSV or bibliographic file- Parameters:
request- the http requestapiCategory- the api categorymodel- the rest model that identify the REST resource collectionuploadfile- the bulk file- Returns:
- the list of generated resources
- Throws:
SQLExceptionFileNotFoundExceptionIOExceptionorg.dspace.authorize.AuthorizeException
-
patch
@RequestMapping(method=PATCH, value="/{id:\\d+}") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> patch(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id, @RequestBody(required=true) com.fasterxml.jackson.databind.JsonNode jsonNode)PATCH method, using operation on the resources following (JSON) Patch notation (https://tools.ietf .org/html/rfc6902) Note that the regular expression in the request mapping accept a number as identifier;- Parameters:
request-apiCategory-model-id-jsonNode-- Returns:
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
patch
@RequestMapping(method=PATCH, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> patch(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable(name="uuid") UUID id, @RequestBody(required=true) com.fasterxml.jackson.databind.JsonNode jsonNode)PATCH method, using operation on the resources following (JSON) Patch notation (https://tools.ietf .org/html/rfc6902) Note that the regular expression in the request mapping accept a UUID as identifier;- Parameters:
request-apiCategory-model-id-jsonNode-- Returns:
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
patchInternal
public <ID extends Serializable> org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> patchInternal(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, ID id, com.fasterxml.jackson.databind.JsonNode jsonNode)
Internal patch method- Parameters:
request-apiCategory-model-id-jsonNode-- Returns:
- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
findAll
@RequestMapping(method=GET) public <T extends RestAddressableModel> org.springframework.hateoas.PagedModel<DSpaceResource<T>> findAll(@PathVariable String apiCategory, @PathVariable String model, org.springframework.data.domain.Pageable page, org.springframework.data.web.PagedResourcesAssembler assembler, javax.servlet.http.HttpServletResponse response, @RequestParam org.springframework.util.MultiValueMap<String,Object> parameters)
Find all- Parameters:
apiCategory-model-page-assembler-- Returns:
-
listSearchMethods
@RequestMapping(method=GET, value="/search") public org.springframework.hateoas.RepresentationModel listSearchMethods(@PathVariable String apiCategory, @PathVariable String model)
-
executeSearchMethods
@RequestMapping(method=GET, value="/search/{searchMethodName}") public <T extends RestAddressableModel> org.springframework.hateoas.RepresentationModel executeSearchMethods(@PathVariable String apiCategory, @PathVariable String model, @PathVariable String searchMethodName, javax.servlet.http.HttpServletResponse response, org.springframework.data.domain.Pageable pageable, org.springframework.data.domain.Sort sort, org.springframework.data.web.PagedResourcesAssembler assembler, @RequestParam org.springframework.util.MultiValueMap<String,Object> parameters) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
-
delete
@RequestMapping(method=DELETE, value="/{id:\\d+}") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> delete(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id) throws org.springframework.web.HttpRequestMethodNotSupportedException- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
delete
@RequestMapping(method=DELETE, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> delete(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable UUID uuid) throws org.springframework.web.HttpRequestMethodNotSupportedException- Throws:
org.springframework.web.HttpRequestMethodNotSupportedException
-
put
@RequestMapping(method=PUT, value="/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}") public DSpaceResource<RestAddressableModel> put(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable UUID uuid, @RequestBody com.fasterxml.jackson.databind.JsonNode jsonNode)Execute a PUT request for an entity with id of type UUID; curl -X PUT http:///api/{apiCategory}/{model}/{uuid} Example: curl -X PUT http://<dspace.server.url>/api/core/collection/8b632938-77c2-487c-81f0-e804f63e68e6- Parameters:
request- the http requestapiCategory- the API category e.g. "core"model- the DSpace model e.g. "collection"uuid- the ID of the target REST objectjsonNode- the part of the request body representing the updated rest object- Returns:
- the relevant REST resource
-
put
@RequestMapping(method=PUT, value="/{id:\\d+}", consumes={"application/json","application/hal+json"}) public DSpaceResource<RestAddressableModel> put(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id, @RequestBody(required=true) com.fasterxml.jackson.databind.JsonNode jsonNode)Execute a PUT request for an entity with id of type Integer; curl -X PUT -H "Content-Type:application/json" http:///api/{apiCategory}/{model}/{id} Example: curl -X PUT -H "Content-Type:application/json" http://<dspace.server.url>/api/core/metadatafield/1- Parameters:
request- the http requestapiCategory- the API category e.g. "api"model- the DSpace model e.g. "collection"id- the ID of the target REST objectjsonNode- the part of the request body representing the updated rest object- Returns:
- the relevant REST resource
-
put
@RequestMapping(method=PUT, value="/{id:\\d+}", consumes="text/uri-list") public DSpaceResource<RestAddressableModel> put(javax.servlet.http.HttpServletRequest request, @PathVariable String apiCategory, @PathVariable String model, @PathVariable Integer id) throws IOExceptionExecute a PUT request for an entity with id of type Integer; curl -X PUT -H "Content-Type:text/uri-list" http:///api/{apiCategory}/{model}/{id} Example: curl -X PUT -H "Content-Type:text/uri-list" http://<dspace.server.url>/api/core/metadatafield/1- Parameters:
request- the http requestapiCategory- the API category e.g. "api"model- the DSpace model e.g. "collection"id- the ID of the target REST object- Returns:
- the relevant REST resource
- Throws:
IOException
-
-