-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DSpace:main' into main
- Loading branch information
Showing
2 changed files
with
194 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Correction Type Endpoints | ||
[Back to the list of all defined endpoints](endpoints.md) | ||
|
||
This endpoint contains the various types of corrections that authorized DSpace Users can suggest via the Quality Assurance Framework. The DSpace Users Corrections are indeed one of the possible [Quality Assurence Source](qualityassurancesources.md). | ||
|
||
## Main Endpoint | ||
**/api/config/correctiontypes** | ||
|
||
```json | ||
{ | ||
"_embedded": { | ||
"correctiontypes": [ | ||
{ | ||
"id" : "request-withdrawn", | ||
"topic" : "WITHDRAWN", | ||
"creationForm" : "provideReason", | ||
"type" : "correctiontype", | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/config/correctiontypes/request-withdrawn" | ||
} | ||
} | ||
}, | ||
{ | ||
"id" : "request-reinstate", | ||
"topic" : "REINSTATE", | ||
"creationForm" : "provideReason", | ||
"type" : "correctiontype", | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/config/correctiontypes/request-reinstate" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"_links": { | ||
"self": { | ||
"href": "https://api7.dspace.org/server/api/config/correctiontypes" | ||
} | ||
}, | ||
"page": { | ||
"size": 20, | ||
"totalElements": 2, | ||
"totalPages": 1, | ||
"number": 0 | ||
} | ||
``` | ||
List all the available correction types in the system. The correction types are defined via the spring file `config/spring/api/correction-types.xml` | ||
|
||
A sample can be found at https://demo.dspace.org/server/#/server/api/config/correctiontypes | ||
|
||
Attributes | ||
* the *id* attribute is the correction type primary key | ||
* the *topic* attribute is the id of the [quality assurance topic](qualityassurancetopics.md) that would be created from such correction type | ||
* the *creationForm* attribute is used to specify the type of inputs eventually requested to create a [quality assurance event](qualityassuranceevents.md) from this correction type. If null no input is needed. The *provideReason* sample expect a textual description to be provided to create the quality assurance event. | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
|
||
## Single Correction Type | ||
**/api/config/correctiontypes/<:id>** | ||
|
||
```json | ||
{ | ||
"id" : "request-withdrawn", | ||
"topic" : "/REQUEST/WITHDRAWN", | ||
"creationForm" : "requestWithdrawn", | ||
"type" : "correctiontype", | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/config/correctiontypes/request-withdrawn" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Status codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 404 Not found - if no correction type exists with such id | ||
|
||
## Search methods | ||
### findByItem | ||
**/api/config/correctiontypes/search/findByItem?uuid=<:itemUUID>** | ||
|
||
This search method will return only the correction types that can be used by the current user on the specified item. So it would provide a subset of the correction types filtering out both correction types that make no sense for the specified item than correction types that are not allowed to the current user. | ||
Out of box a | ||
|
||
Parameters: | ||
* The `uuid` uuid of the item | ||
|
||
A sample search would be `/server/api/config/correctiontypes/search/findByItem?uuid=f1ba2a86-2f67-4e36-b572-c7956cb0fa32' | ||
|
||
Assuming that the sample `config/spring/api/correction-types.xml` data model has been loaded, it would respond with | ||
|
||
```json | ||
{ | ||
"_embedded" : { | ||
"correctiontypes" : [ | ||
{ | ||
"id" : "request-withdrawn", | ||
"topic" : "/REQUEST/WITHDRAWN", | ||
"creationForm" : "requestWithdrawn", | ||
"type" : "correctiontype", | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/config/correctiontypes/request-withdrawn" | ||
} | ||
} | ||
] | ||
}, | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/config/correctiontypes/search/findByItem?uuid=3825e2b4-8791-4bf6-b1ea-a56d74c5a54f" | ||
} | ||
}, | ||
"page" : { | ||
"size" : 20, | ||
"totalElements" : 1, | ||
"totalPages" : 1, | ||
"number" : 0 | ||
} | ||
} | ||
``` | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 400 Bad Request - if the uuid parameter is missing or is not an UUID | ||
* 401 Unauthorized - if you are not authenticated or if there are insufficient permissions on provided item | ||
* 422 Unprocessable Entity - if the Item of provided uuid not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters