|
| 1 | +# EditItem Endpoints |
| 2 | +[Back to the list of all defined endpoints](endpoints.md) |
| 3 | + |
| 4 | +## Single EditItem |
| 5 | +**/api/core/edititems/<:id>:<:MODE>** |
| 6 | + |
| 7 | +Provide detailed information about a specific edititem. The JSON response document is as follow |
| 8 | +```json |
| 9 | +{ |
| 10 | + "id":"7a356e11-f719-4dae-ae44-fa93f21ee6a0:FIRST", |
| 11 | + "lastModified":"2020-10-12T16:06:39.021+0000", |
| 12 | + "sections":{ |
| 13 | + "titleAndIssuedDate":{ |
| 14 | + "dc.title":[ |
| 15 | + { |
| 16 | + "value":"Title item", |
| 17 | + "language":null, |
| 18 | + "authority":null, |
| 19 | + "confidence":-1, |
| 20 | + "place":0 |
| 21 | + } |
| 22 | + ], |
| 23 | + "dc.date.issued":[ |
| 24 | + { |
| 25 | + "value":"2010-06-18", |
| 26 | + "language":null, |
| 27 | + "authority":null, |
| 28 | + "confidence":-1, |
| 29 | + "place":0 |
| 30 | + } |
| 31 | + ] |
| 32 | + } |
| 33 | + }, |
| 34 | + "type":"edititem", |
| 35 | + "uniqueType": "core.edititem" |
| 36 | +} |
| 37 | +``` |
| 38 | +Return codes: |
| 39 | +* 200 OK - if the operation succeed |
| 40 | +* 401 Unauthorized - if you are not authenticated |
| 41 | +* 403 if you are not logged in with sufficient permissions to view the edititem |
| 42 | +* 404 Not found - if the edititem or MODE doesn't exist |
| 43 | + |
| 44 | + |
| 45 | +## Patch operations |
| 46 | +The PATCH method expects a JSON body according to the [JSON Patch specification RFC6902](https://tools.ietf.org/html/rfc6902) |
| 47 | + |
| 48 | +### Add |
| 49 | +To add a new value to an **existent metadata** and the metadata must be defined in the submissionDefinition of current MODE ,the client must send a JSON Patch ADD operation as follow |
| 50 | + |
| 51 | +`curl -X PATCH '{dspace7-url}/api/core/edititems/<:id>:<:MODE>' -H "Authorization: Bearer ..." -H 'Content-Type: application/json' --data '[{"op":"add","path":"/sections/<:name-of-the-form>/<:metadata>/-","value":{"value":"...","language":"...","authority":"...","confidence":-1}}]' |
| 52 | + |
| 53 | +### Remove |
| 54 | +It is possible to remove a specific metadatavalue if the metadata is defined in the submissionDefinition of current MODE |
| 55 | +`curl --data '[{ "op": "remove", "path": "/sections/traditionalpageone/dc.subject/0"}]' -X PATCH ${dspace7-url}/api/core/edititems/<:id>:<:MODE>` |
| 56 | + |
| 57 | +## Find available modes |
| 58 | +**/api/core/edititems/search/findModesById?uuid=<:id>** |
| 59 | + |
| 60 | +Provide detailed information about edit item modes available to current user for Item having uuid passed as input parameter. |
| 61 | +The JSON response document is as follow |
| 62 | +```json |
| 63 | +{ |
| 64 | + "_embedded": { |
| 65 | + "edititemmodes": [ |
| 66 | + { |
| 67 | + "id": "FULL", |
| 68 | + "name": "FULL", |
| 69 | + "label": null, |
| 70 | + "submissionDefinition": "publication-edit", |
| 71 | + "type": "edititemmode", |
| 72 | + "uniqueType": "core.edititemmode", |
| 73 | + "_links": { |
| 74 | + "self": { |
| 75 | + "href": "https://{dspace-cris-backend-url}/server/api/core/edititemmodes/FULL" |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + ] |
| 80 | + }, |
| 81 | + "_links": { |
| 82 | + "self": { |
| 83 | + "href": "http://{dspace-cris-backend-url}/server/api/core/edititems/search/findModesById?uuid=9880d9e1-5441-4e14-a6e8-6cf453bc25f9" |
| 84 | + } |
| 85 | + }, |
| 86 | + "page": { |
| 87 | + "size": 20, |
| 88 | + "totalElements": 1, |
| 89 | + "totalPages": 1, |
| 90 | + "number": 0 |
| 91 | + } |
| 92 | +} |
| 93 | +``` |
| 94 | +Return codes: |
| 95 | +* 200 OK - if the operation succeed |
| 96 | +* 400 Bad request - if the id parameter is missing or invalid |
| 97 | +* 401 Unauthorized - if you are not authenticated |
| 98 | + |
| 99 | +## Find edit items by submitter |
| 100 | +**/api/core/edititems/search/findBySubmitter?uuid=<:submitter-uuid>** |
| 101 | + |
| 102 | +Returns a paginated list of edit items submitted by the specified user (EPerson). Each EditItem is returned **without a specific mode**, using the mode identifier `"none"` in the composite ID. This means the returned EditItems have minimal information and no populated sections, as they are not bound to any particular edit mode configuration. |
| 103 | + |
| 104 | +To work with a specific edit mode for an item, use the `/api/core/edititems/search/findModesById` endpoint to discover available modes, then access the item via `/api/core/edititems/{uuid}:{mode}`. |
| 105 | + |
| 106 | +**Note:** This endpoint requires READ permission on the specified EPerson. It retrieves all archived items where the submitter field matches the provided UUID. |
| 107 | + |
| 108 | +The JSON response document is as follows: |
| 109 | +```json |
| 110 | +{ |
| 111 | + "_embedded": { |
| 112 | + "edititems": [ |
| 113 | + { |
| 114 | + "id": "7a356e11-f719-4dae-ae44-fa93f21ee6a0:none", |
| 115 | + "lastModified": "2020-10-12T16:06:39.021+0000", |
| 116 | + "sections": {}, |
| 117 | + "type": "edititem", |
| 118 | + "uniqueType": "core.edititem", |
| 119 | + "_links": { |
| 120 | + "self": { |
| 121 | + "href": "http://{dspace-url}/server/api/core/edititems/7a356e11-f719-4dae-ae44-fa93f21ee6a0:none" |
| 122 | + }, |
| 123 | + "item": { |
| 124 | + "href": "http://{dspace-url}/server/api/core/edititems/7a356e11-f719-4dae-ae44-fa93f21ee6a0:none/item" |
| 125 | + }, |
| 126 | + "collection": { |
| 127 | + "href": "http://{dspace-url}/server/api/core/edititems/7a356e11-f719-4dae-ae44-fa93f21ee6a0:none/collection" |
| 128 | + }, |
| 129 | + "modes": { |
| 130 | + "href": "http://{dspace-url}/server/api/core/edititems/7a356e11-f719-4dae-ae44-fa93f21ee6a0:none/modes" |
| 131 | + } |
| 132 | + } |
| 133 | + } |
| 134 | + ] |
| 135 | + }, |
| 136 | + "_links": { |
| 137 | + "self": { |
| 138 | + "href": "http://{dspace-url}/server/api/core/edititems/search/findBySubmitter?uuid=a1b2c3d4-5678-90ab-cdef-1234567890ab" |
| 139 | + } |
| 140 | + }, |
| 141 | + "page": { |
| 142 | + "size": 20, |
| 143 | + "totalElements": 1, |
| 144 | + "totalPages": 1, |
| 145 | + "number": 0 |
| 146 | + } |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +Parameters: |
| 151 | +* `uuid` (required): The UUID of the EPerson (submitter) whose edit items should be retrieved |
| 152 | + |
| 153 | +Return codes: |
| 154 | +* 200 OK - if the operation succeeds |
| 155 | +* 400 Bad request - if the uuid parameter is missing or invalid |
| 156 | +* 401 Unauthorized - if you are not authenticated |
| 157 | +* 403 Forbidden - if you don't have READ permission on the specified EPerson |
| 158 | + |
| 159 | + |
0 commit comments