-
Notifications
You must be signed in to change notification settings - Fork 49
Add support for a DSpace internal quality assurance source #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tdonohue
merged 3 commits into
DSpace:main
from
4Science:CST-12107_cdl_request_withdrawal
Feb 27, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.