From f4a77234b8676aac517fb174b4f28d776c6e3089 Mon Sep 17 00:00:00 2001 From: eskander Date: Tue, 8 Aug 2023 18:56:48 +0300 Subject: [PATCH 01/31] [CST-11046] itemfilters and notifyservices endpoints --- itemfilters.md | 206 ++++++++++++++++++++++++++++++++++++++ notifyservices.md | 244 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 450 insertions(+) create mode 100644 itemfilters.md create mode 100644 notifyservices.md diff --git a/itemfilters.md b/itemfilters.md new file mode 100644 index 00000000..211ff950 --- /dev/null +++ b/itemfilters.md @@ -0,0 +1,206 @@ +# Item Filter Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +This endpoint contains the various logical item filters. + +## Main Endpoint +**/api/config/itemfilters** + +List all the available item filters in the system. + +```json +{ + "_embedded" : { + "itemfilters" : [ { + "id" : "a-common-or_statement", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/a-common-or_statement" + } + } + }, { + "id" : "always_true_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/always_true_filter" + } + } + }, { + "id" : "dc-identifier-uri-contains-doi_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/dc-identifier-uri-contains-doi_condition" + } + } + }, { + "id" : "demo_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/demo_filter" + } + } + }, { + "id" : "doi-filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/doi-filter" + } + } + }, { + "id" : "driver-document-type_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/driver-document-type_condition" + } + } + }, { + "id" : "example-doi_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/example-doi_filter" + } + } + }, { + "id" : "has-at-least-one-bitstream_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/has-at-least-one-bitstream_condition" + } + } + }, { + "id" : "has-bitstream_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/has-bitstream_filter" + } + } + }, { + "id" : "has-one-bitstream_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/has-one-bitstream_condition" + } + } + }, { + "id" : "in-outfit-collection_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/in-outfit-collection_condition" + } + } + }, { + "id" : "is-archived_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/is-archived_condition" + } + } + }, { + "id" : "is-withdrawn_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/is-withdrawn_condition" + } + } + }, { + "id" : "item-is-public_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/item-is-public_condition" + } + } + }, { + "id" : "openaire_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/openaire_filter" + } + } + }, { + "id" : "simple-demo_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/simple-demo_filter" + } + } + }, { + "id" : "title-contains-demo_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/title-contains-demo_condition" + } + } + }, { + "id" : "title-starts-with-pattern_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/title-starts-with-pattern_condition" + } + } + }, { + "id" : "type-equals-dataset_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/type-equals-dataset_condition" + } + } + }, { + "id" : "type-equals-journal-article_condition", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/type-equals-journal-article_condition" + } + } + }, { + "id" : "type_filter", + "type" : "itemfilter", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters/type_filter" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/config/itemfilters?size=30" + } + }, + "page" : { + "size" : 30, + "totalElements" : 21, + "totalPages" : 1, + "number" : 0 + } +} +``` + +Status codes: +* 200 OK - if the operation succeed + +## Single Item Filter +**/api/config/itemfilters/<:id>** + +Status codes: +* 405 Method Not Allowed + diff --git a/notifyservices.md b/notifyservices.md new file mode 100644 index 00000000..57f549b4 --- /dev/null +++ b/notifyservices.md @@ -0,0 +1,244 @@ +# Notify Services Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint +**/api/core/notifyservices** + +Provide access to the notifyservices (DBMS based). List all the notify services + +A sample can be found at https://api7.dspace.org/server/#/server/api/core/notifyservices + +Return codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated + +## Single Notify Service +**/api/core/notifyservices/<:id>** + +```json +{ + "id" : 1, + "name" : "service name", + "description" : "service description", + "url" : "service url", + "ldnUrl" : "service ldn url", + "notifyServiceInboundPatterns" : + [ + { + "pattern" : "patternA", + "constraint" : "itemFilterA", + "automatic" : false + }, + { + "pattern" : "patternB", + "constraint" : "itemFilterB", + "automatic" : true + } + ], + "notifyServiceOutboundPatterns" : [ { + "pattern" : "patternC", + "constraint" : "itemFilterC" + } ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/1" + } + } +} +``` + +Status codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 404 Not found - if no notify service exists with such id + +## Creating a new notify service +**POST /api/core/notifyservices** + +Authenticated users can create a notify service. The content-type is JSON. An example JSON can be seen below: + +```json +{ + "name": "service name", + "description": "service description", + "url": "service url", + "ldnUrl": "service ldn url" +} +``` + +Status codes: +* 201 Created - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 404 Not found - if no notify service exists with such id +* 422 Unprocessable Entity - if Error parsing request body + +## PATCH +### To record or update a notify service inbound pattern +PATCH /api/core/notifyservices/<:id> + +This method allow users to create or update a notify service inbound pattern. +The PATCH body must follow the JSON PATCH specification + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns", + "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\",\"automatic\":\"false\"}" + } +] +``` + +### To record or update a notify service outbound pattern +PATCH /api/core/notifyservices/<:id> + +This method allow users to create or update a notify service outbound pattern. +The PATCH body must follow the JSON PATCH specification + +```json +[ + { + "op": "replace", + "path": "notifyservices_outbound_patterns", + "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\"}" + } +] +``` + +Status codes: +* 200 OK - if the operation succeeded +* 401 Unauthorized - if you are not authenticated +* 404 Not found - if the Notify Service doesn't exist (or was already deleted) + +## Deleting a notify service + +**DELETE /api/core/notifyservices/<:id>** + +Delete a notify service. + +* 204 No content - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 404 Not found - if the notify service doesn't exist (or was already deleted) + +## Search methods +### findByLdnUrl +**/api/core/notifyservices/search/byLdnUrl?ldnUrl=<:ldnUrl>** + +Parameters: +* The `ldnUrl` ldnUrl of the notify service + +A sample search would be `/server/api/core/notifyservices/search/byLdnUrl?ldnUrl=service_ldn_url' + +```json +{ + "_embedded" : { + "notifyservices" : [ { + "id" : 1, + "name" : "service name one", + "description" : "service description one", + "url" : "service url one", + "ldnUrl" : "service_ldn_url", + "notifyServiceInboundPatterns" : + [ + { + "pattern" : "patternA", + "constraint" : "itemFilterA", + "automatic" : false + } + ], + "notifyServiceOutboundPatterns" : [ { + "pattern" : "patternB", + "constraint" : "itemFilterB" + } ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/1" + } + } + }, { + "id" : 2, + "name" : "service name two", + "description" : "service description two", + "url" : "service url two", + "ldnUrl" : "service_ldn_url", + "notifyServiceInboundPatterns" : [ ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/2" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/search/byLdnUrl?ldnUrl=service_ldn_url" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the ldnUrl parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated + +### findByPattern +**/api/core/notifyservices/search/byPattern?pattern=<:pattern>** + +Parameters: +* The `pattern` pattern of the notify service inbound + +A sample search would be `/server/api/core/notifyservices/search/byPattern?pattern=patternA' + +```json +{ + "_embedded" : { + "notifyservices" : [ { + "id" : 3, + "name" : "service name one", + "description" : "service description one", + "url" : "service url one", + "ldnUrl" : "service ldn url one", + "notifyServiceInboundPatterns" : [ { + "pattern" : "patternA", + "constraint" : "itemFilterA", + "automatic" : false + } ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/3" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/core/notifyservices/search/byPattern?pattern=patternA" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the pattern parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated + From fd2468867ee75c9fbca61282d7d703341bbc9562 Mon Sep 17 00:00:00 2001 From: eskander Date: Thu, 17 Aug 2023 10:58:40 +0300 Subject: [PATCH 02/31] [CST-11046] refactoring added new response status codes --- itemfilters.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/itemfilters.md b/itemfilters.md index 211ff950..5655ee42 100644 --- a/itemfilters.md +++ b/itemfilters.md @@ -197,10 +197,15 @@ List all the available item filters in the system. Status codes: * 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators ## Single Item Filter **/api/config/itemfilters/<:id>** Status codes: -* 405 Method Not Allowed +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators +* 404 Not found - if the itemfilter doesn't exist From 44f6fbead473fc25836c15a6fea559f2698f94d5 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 23 Aug 2023 17:26:41 +0300 Subject: [PATCH 03/31] [CST-11046] refactoring added new response status codes adding patch operations --- ldnservices.md | 544 ++++++++++++++++++++++++++++++++++++++++++++++ notifyservices.md | 244 --------------------- 2 files changed, 544 insertions(+), 244 deletions(-) create mode 100644 ldnservices.md delete mode 100644 notifyservices.md diff --git a/ldnservices.md b/ldnservices.md new file mode 100644 index 00000000..551da4b5 --- /dev/null +++ b/ldnservices.md @@ -0,0 +1,544 @@ +# LDN Notify Services Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint +**/api/ldn/ldnservices** + +Provide access to the notifyservices (DBMS based). List all the LDN notify services + +A sample can be found at https://api7.dspace.org/server/#/server/api/ldn/ldnservices + +Return codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users + +## Single LDN Notify Service +**/api/ldn/ldnservices/<:id>** + +```json +{ + "id" : 1, + "name" : "service name", + "description" : "service description", + "url" : "service url", + "ldnUrl" : "service ldn url", + "notifyServiceInboundPatterns" : + [ + { + "pattern" : "patternA", + "constraint" : "itemFilterA", + "automatic" : false + }, + { + "pattern" : "patternB", + "constraint" : "itemFilterB", + "automatic" : true + } + ], + "notifyServiceOutboundPatterns" : [ { + "pattern" : "patternC", + "constraint" : "itemFilterC" + } ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/ldnservices/1" + } + } +} +``` + +Status codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if no LDN notify service exists with such id + +## Creating a new LDN notify service +**POST /api/ldn/ldnservices** + +Authenticated users can create LDN notify service. The content-type is JSON. An example JSON can be seen below: + +```json +{ + "name": "service name", + "description": "service description", + "url": "service url", + "ldnUrl": "service ldn url" +} +``` + +Status codes: +* 201 Created - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if no LDN notify service exists with such id +* 422 Unprocessable Entity - if Error parsing request body + +## PATCH + +### Add +PATCH /api/ldn/ldnservices/<:id> + +to add name to ldn notify service + +```json +[ + { + "op": "add", + "path": "/name", + "value": "service name" + } +] +``` + +to add description to ldn notify service + +```json +[ + { + "op": "add", + "path": "/description", + "value": "service description" + } +] +``` + +to add ldnUrl to ldn notify service + +```json +[ + { + "op": "add", + "path": "/ldnurl", + "value": "service ldnUrl" + } +] +``` + +to add url to ldn notify service + +```json +[ + { + "op": "add", + "path": "/url", + "value": "url value" + } +] +``` + +to add inboundPatterns to ldn notify service + +-adding object to the last, this array isn't sorted so, not supported adding to index like "notifyservices_inbound_patterns[index]" + +```json +[ + { + "op": "add", + "path": "notifyservices_inbound_patterns/-", + "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\",\"automatic\":\"false\"}" + } +] +``` + +to add outboundPatterns to ldn notify service + +-adding object to the last, this array isn't sorted so, not supported adding to index like "notifyservices_outbound_patterns[index]" + +```json +[ + { + "op": "add", + "path": "notifyservices_outbound_patterns/-", + "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\"}" + } +] +``` + +to add pattern to specific inboundPattern of ldn notify service + +```json +[ + { + "op": "add", + "path": "notifyservices_inbound_patterns[0]/pattern", + "value": "patternA" + } +] +``` + +to add constraint to specific inboundPattern of ldn notify service + +```json +[ + { + "op": "add", + "path": "notifyservices_inbound_patterns[0]/constraint", + "value": "itemFilterA" + } +] +``` + + +to add pattern to specific outboundPattern of ldn notify service + +```json +[ + { + "op": "add", + "path": "notifyservices_outbound_patterns[0]/pattern", + "value": "patternA" + } +] +``` + +to add constraint to specific outboundPattern of ldn notify service + +```json +[ + { + "op": "add", + "path": "notifyservices_outbound_patterns[0]/constraint", + "value": "itemFilterA" + } +] +``` + +### Replace + +to update the name of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/name", + "value": "service name" + } +] +``` + +to update the description of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/description", + "value": "service description" + } +] +``` + +to update the ldnUrl of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/ldnurl", + "value": "service ldnUrl" + } +] +``` + +to update the url of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/url", + "value": "url value" + } +] +``` + +to replace all inboundPatterns of ldn notify service, +if value contains an empty array all inboundPatterns will be removed + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns", + "value": "[{\"pattern\":\"patternC\",\"constraint\":\"itemFilterC\",\"automatic\":\"false\"}, {\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\",\"automatic\":\"false\"}]" + } +] +``` + +to replace inboundPattern of ldn notify service at specific index + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns[0]", + "value": "{\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\",\"automatic\":\"true\"}" + } +] +``` + +to replace all outboundPatterns of ldn notify service, +if value contains an empty array all outboundPatterns will be removed + +```json +[ + { + "op": "replace", + "path": "notifyservices_outbound_patterns", + "value": "[{\"pattern\":\"patternC\",\"constraint\":\"itemFilterC\"}, {\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\"}]" + } +] +``` + +to replace outboundPattern of ldn notify service at specific index + +```json +[ + { + "op": "replace", + "path": "notifyservices_outbound_patterns[0]", + "value": "{\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\"}" + } +] +``` + +to replace pattern of specific inboundPattern of ldn notify service + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns[1]/pattern", + "value": "patternB" + } +] +``` + +to replace constraint of specific inboundPattern of ldn notify service + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns[1]/constraint", + "value": "itemFilterB" + } +] +``` + +to replace automatic of specific inboundPattern of ldn notify service + +```json +[ + { + "op": "replace", + "path": "notifyservices_inbound_patterns[1]/automatic", + "value": "true" + } +] +``` + +to replace pattern of specific outboundPattern of ldn notify service + +```json +[ + { + "op": "replace", + "path": "notifyservices_outbound_patterns[1]/pattern", + "value": "patternB" + } +] +``` + +to replace constraint of specific outboundPattern of ldn notify service + +```json +[ + { + "op": "replace", + "path": "notifyservices_outbound_patterns[0]/constraint", + "value": "itemFilterA" + } +] +``` + +### Remove + +to remove name or ldnUrl from ldn notify service + +```json +[ + { + "op": "remove", + "path": "/name" + } +] +``` + +```json +[ + { + "op": "remove", + "path": "/ldnurl" + } +] +``` + +status codes: +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if the LDN Notify Service doesn't exist (or was already deleted) +* 422 Unprocessable Entity - name and ldnUrl fields are mandatory and can't be removed + + +to remove description value from ldn notify service + +```json +[ + { + "op": "remove", + "path": "/description" + } +] +``` + +to remove url value from ldn notify service + +```json +[ + { + "op": "remove", + "path": "/url" + } +] +``` + +to remove all inboundPatterns of ldn notify service + +```json +[ + { + "op": "remove", + "path": "notifyservices_inbound_patterns" + } +] +``` + +to remove inboundPattern from ldn notify service at specific index + +```json +[ + { + "op": "remove", + "path": "notifyservices_inbound_patterns[0]" + } +] +``` + +to remove all outboundPatterns of ldn notify service + +```json +[ + { + "op": "remove", + "path": "notifyservices_outbound_patterns" + } +] +``` + +to remove outboundPattern from ldn notify service at specific index + +```json +[ + { + "op": "remove", + "path": "notifyservices_outbound_patterns[1]" + } +] +``` + +to remove constraint from specific inboundPattern of ldn notify service + +```json +[ + { + "op": "remove", + "path": "notifyservices_inbound_patterns[0]/constraint" + } +] +``` + +to remove constraint from specific outboundPattern of ldn notify service + +```json +[ + { + "op": "remove", + "path": "notifyservices_outbound_patterns[0]/constraint" + } +] +``` + +Patch Status codes: +* 200 OK - if the operation succeeded +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if the LDN Notify Service doesn't exist (or was already deleted) + +## Deleting LDN notify service + +**DELETE /api/ldn/ldnservices/<:id>** + +Delete LDN notify service. + +* 204 No content - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if the LDN notify service doesn't exist (or was already deleted) + +## Search methods +### findByLdnUrl +**/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=<:ldnUrl>** + +Parameters: +* The `ldnUrl` ldnUrl of the LDN notify service + +A sample search would be `/server/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=service_ldn_url' + +```json +{ + "id" : 1, + "name" : "service name one", + "description" : "service description one", + "url" : "service url one", + "ldnUrl" : "service_ldn_url", + "notifyServiceInboundPatterns" : + [ + { + "pattern" : "patternA", + "constraint" : "itemFilterA", + "automatic" : false + } + ], + "notifyServiceOutboundPatterns" : [ { + "pattern" : "patternB", + "constraint" : "itemFilterB" + } ], + "type" : "notifyservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/ldnservices/1" + } + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the ldnUrl parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users \ No newline at end of file diff --git a/notifyservices.md b/notifyservices.md deleted file mode 100644 index 57f549b4..00000000 --- a/notifyservices.md +++ /dev/null @@ -1,244 +0,0 @@ -# Notify Services Endpoints -[Back to the list of all defined endpoints](endpoints.md) - -## Main Endpoint -**/api/core/notifyservices** - -Provide access to the notifyservices (DBMS based). List all the notify services - -A sample can be found at https://api7.dspace.org/server/#/server/api/core/notifyservices - -Return codes: -* 200 OK - if the operation succeed -* 401 Unauthorized - if you are not authenticated - -## Single Notify Service -**/api/core/notifyservices/<:id>** - -```json -{ - "id" : 1, - "name" : "service name", - "description" : "service description", - "url" : "service url", - "ldnUrl" : "service ldn url", - "notifyServiceInboundPatterns" : - [ - { - "pattern" : "patternA", - "constraint" : "itemFilterA", - "automatic" : false - }, - { - "pattern" : "patternB", - "constraint" : "itemFilterB", - "automatic" : true - } - ], - "notifyServiceOutboundPatterns" : [ { - "pattern" : "patternC", - "constraint" : "itemFilterC" - } ], - "type" : "notifyservice", - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/1" - } - } -} -``` - -Status codes: -* 200 OK - if the operation succeed -* 401 Unauthorized - if you are not authenticated -* 404 Not found - if no notify service exists with such id - -## Creating a new notify service -**POST /api/core/notifyservices** - -Authenticated users can create a notify service. The content-type is JSON. An example JSON can be seen below: - -```json -{ - "name": "service name", - "description": "service description", - "url": "service url", - "ldnUrl": "service ldn url" -} -``` - -Status codes: -* 201 Created - if the operation succeed -* 401 Unauthorized - if you are not authenticated -* 404 Not found - if no notify service exists with such id -* 422 Unprocessable Entity - if Error parsing request body - -## PATCH -### To record or update a notify service inbound pattern -PATCH /api/core/notifyservices/<:id> - -This method allow users to create or update a notify service inbound pattern. -The PATCH body must follow the JSON PATCH specification - -```json -[ - { - "op": "replace", - "path": "notifyservices_inbound_patterns", - "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\",\"automatic\":\"false\"}" - } -] -``` - -### To record or update a notify service outbound pattern -PATCH /api/core/notifyservices/<:id> - -This method allow users to create or update a notify service outbound pattern. -The PATCH body must follow the JSON PATCH specification - -```json -[ - { - "op": "replace", - "path": "notifyservices_outbound_patterns", - "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\"}" - } -] -``` - -Status codes: -* 200 OK - if the operation succeeded -* 401 Unauthorized - if you are not authenticated -* 404 Not found - if the Notify Service doesn't exist (or was already deleted) - -## Deleting a notify service - -**DELETE /api/core/notifyservices/<:id>** - -Delete a notify service. - -* 204 No content - if the operation succeed -* 401 Unauthorized - if you are not authenticated -* 404 Not found - if the notify service doesn't exist (or was already deleted) - -## Search methods -### findByLdnUrl -**/api/core/notifyservices/search/byLdnUrl?ldnUrl=<:ldnUrl>** - -Parameters: -* The `ldnUrl` ldnUrl of the notify service - -A sample search would be `/server/api/core/notifyservices/search/byLdnUrl?ldnUrl=service_ldn_url' - -```json -{ - "_embedded" : { - "notifyservices" : [ { - "id" : 1, - "name" : "service name one", - "description" : "service description one", - "url" : "service url one", - "ldnUrl" : "service_ldn_url", - "notifyServiceInboundPatterns" : - [ - { - "pattern" : "patternA", - "constraint" : "itemFilterA", - "automatic" : false - } - ], - "notifyServiceOutboundPatterns" : [ { - "pattern" : "patternB", - "constraint" : "itemFilterB" - } ], - "type" : "notifyservice", - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/1" - } - } - }, { - "id" : 2, - "name" : "service name two", - "description" : "service description two", - "url" : "service url two", - "ldnUrl" : "service_ldn_url", - "notifyServiceInboundPatterns" : [ ], - "notifyServiceOutboundPatterns" : [ ], - "type" : "notifyservice", - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/2" - } - } - } ] - }, - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/search/byLdnUrl?ldnUrl=service_ldn_url" - } - }, - "page" : { - "size" : 20, - "totalElements" : 2, - "totalPages" : 1, - "number" : 0 - } -} -``` - -Return codes: -* 200 OK - if the operation succeed -* 400 Bad Request - if the ldnUrl parameter is missing or invalid -* 401 Unauthorized - if you are not authenticated - -### findByPattern -**/api/core/notifyservices/search/byPattern?pattern=<:pattern>** - -Parameters: -* The `pattern` pattern of the notify service inbound - -A sample search would be `/server/api/core/notifyservices/search/byPattern?pattern=patternA' - -```json -{ - "_embedded" : { - "notifyservices" : [ { - "id" : 3, - "name" : "service name one", - "description" : "service description one", - "url" : "service url one", - "ldnUrl" : "service ldn url one", - "notifyServiceInboundPatterns" : [ { - "pattern" : "patternA", - "constraint" : "itemFilterA", - "automatic" : false - } ], - "notifyServiceOutboundPatterns" : [ ], - "type" : "notifyservice", - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/3" - } - } - } ] - }, - "_links" : { - "self" : { - "href" : "http://localhost/api/core/notifyservices/search/byPattern?pattern=patternA" - } - }, - "page" : { - "size" : 20, - "totalElements" : 1, - "totalPages" : 1, - "number" : 0 - } -} -``` - -Return codes: -* 200 OK - if the operation succeed -* 400 Bad Request - if the pattern parameter is missing or invalid -* 401 Unauthorized - if you are not authenticated - From f6eb499ffe27a38924665cdc9a44396d918e92e9 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 6 Sep 2023 12:38:36 +0300 Subject: [PATCH 04/31] [CST-11046] refactoring --- ldnservices.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index 551da4b5..5d7cd889 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -58,7 +58,7 @@ Status codes: ## Creating a new LDN notify service **POST /api/ldn/ldnservices** -Authenticated users can create LDN notify service. The content-type is JSON. An example JSON can be seen below: +Only administrator users can create LDN notify service. The content-type is JSON. An example JSON can be seen below: ```json { @@ -72,7 +72,7 @@ Authenticated users can create LDN notify service. The content-type is JSON. An Status codes: * 201 Created - if the operation succeed * 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators * 404 Not found - if no LDN notify service exists with such id * 422 Unprocessable Entity - if Error parsing request body @@ -390,7 +390,7 @@ to remove name or ldnUrl from ldn notify service status codes: * 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators * 404 Not found - if the LDN Notify Service doesn't exist (or was already deleted) * 422 Unprocessable Entity - name and ldnUrl fields are mandatory and can't be removed @@ -486,7 +486,7 @@ to remove constraint from specific outboundPattern of ldn notify service Patch Status codes: * 200 OK - if the operation succeeded * 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators * 404 Not found - if the LDN Notify Service doesn't exist (or was already deleted) ## Deleting LDN notify service @@ -497,7 +497,7 @@ Delete LDN notify service. * 204 No content - if the operation succeed * 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users +* 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators * 404 Not found - if the LDN notify service doesn't exist (or was already deleted) ## Search methods From 6d021ceee732f4e8563cab3e80ee01fa57f4f344 Mon Sep 17 00:00:00 2001 From: eskander Date: Mon, 18 Sep 2023 14:35:01 +0300 Subject: [PATCH 05/31] [CST-1104] refactoring and adding new properties to post method --- ldnservices.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index 5d7cd889..47557790 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -65,7 +65,16 @@ Only administrator users can create LDN notify service. The content-type is JSON "name": "service name", "description": "service description", "url": "service url", - "ldnUrl": "service ldn url" + "ldnUrl": "service ldn url", + "notifyServiceInboundPatterns": + [ + {"pattern":"patternA","constraint":"itemFilterA","automatic":true}, + {"pattern":"patternB","constraint":null,"automatic":false} + ], + "notifyServiceOutboundPatterns": + [ + {"pattern":"patternC","constraint":"itemFilterC"} + ] } ``` @@ -138,7 +147,7 @@ to add inboundPatterns to ldn notify service { "op": "add", "path": "notifyservices_inbound_patterns/-", - "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\",\"automatic\":\"false\"}" + "value": {"pattern":"patternA","constraint":"itemFilterA","automatic":"false"} } ] ``` @@ -152,7 +161,7 @@ to add outboundPatterns to ldn notify service { "op": "add", "path": "notifyservices_outbound_patterns/-", - "value": "{\"pattern\":\"patternA\",\"constraint\":\"itemFilterA\"}" + "value": {"pattern":"patternA","constraint":"itemFilterA"} } ] ``` @@ -264,7 +273,7 @@ if value contains an empty array all inboundPatterns will be removed { "op": "replace", "path": "notifyservices_inbound_patterns", - "value": "[{\"pattern\":\"patternC\",\"constraint\":\"itemFilterC\",\"automatic\":\"false\"}, {\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\",\"automatic\":\"false\"}]" + "value": [{"pattern":"patternC","constraint":"itemFilterC","automatic":"false"}, {"pattern":"patternD","constraint":"itemFilterD","automatic":"false"}] } ] ``` @@ -276,7 +285,7 @@ to replace inboundPattern of ldn notify service at specific index { "op": "replace", "path": "notifyservices_inbound_patterns[0]", - "value": "{\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\",\"automatic\":\"true\"}" + "value": {"pattern":"patternD","constraint":"itemFilterD","automatic":"true"} } ] ``` @@ -289,7 +298,7 @@ if value contains an empty array all outboundPatterns will be removed { "op": "replace", "path": "notifyservices_outbound_patterns", - "value": "[{\"pattern\":\"patternC\",\"constraint\":\"itemFilterC\"}, {\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\"}]" + "value": [{"pattern":"patternC","constraint":"itemFilterC"}, {"pattern":"patternD","constraint":"itemFilterD"}] } ] ``` @@ -301,7 +310,7 @@ to replace outboundPattern of ldn notify service at specific index { "op": "replace", "path": "notifyservices_outbound_patterns[0]", - "value": "{\"pattern\":\"patternD\",\"constraint\":\"itemFilterD\"}" + "value": {"pattern":"patternD","constraint":"itemFilterD"} } ] ``` From 09d8a2e4cc2622a7827339e394cebe3c4a9cc179 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 20 Sep 2023 12:40:15 +0300 Subject: [PATCH 06/31] [CST-11046] refactoring path value of patch operations --- ldnservices.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index 47557790..b82800a1 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -140,13 +140,13 @@ to add url to ldn notify service to add inboundPatterns to ldn notify service --adding object to the last, this array isn't sorted so, not supported adding to index like "notifyservices_inbound_patterns[index]" +-adding object to the last, this array isn't sorted so, not supported adding to index like "notifyServiceInboundPatterns[index]" ```json [ { "op": "add", - "path": "notifyservices_inbound_patterns/-", + "path": "notifyServiceInboundPatterns/-", "value": {"pattern":"patternA","constraint":"itemFilterA","automatic":"false"} } ] @@ -154,13 +154,13 @@ to add inboundPatterns to ldn notify service to add outboundPatterns to ldn notify service --adding object to the last, this array isn't sorted so, not supported adding to index like "notifyservices_outbound_patterns[index]" +-adding object to the last, this array isn't sorted so, not supported adding to index like "notifyServiceOutboundPatterns[index]" ```json [ { "op": "add", - "path": "notifyservices_outbound_patterns/-", + "path": "notifyServiceOutboundPatterns/-", "value": {"pattern":"patternA","constraint":"itemFilterA"} } ] @@ -172,7 +172,7 @@ to add pattern to specific inboundPattern of ldn notify service [ { "op": "add", - "path": "notifyservices_inbound_patterns[0]/pattern", + "path": "notifyServiceInboundPatterns[0]/pattern", "value": "patternA" } ] @@ -184,7 +184,7 @@ to add constraint to specific inboundPattern of ldn notify service [ { "op": "add", - "path": "notifyservices_inbound_patterns[0]/constraint", + "path": "notifyServiceInboundPatterns[0]/constraint", "value": "itemFilterA" } ] @@ -197,7 +197,7 @@ to add pattern to specific outboundPattern of ldn notify service [ { "op": "add", - "path": "notifyservices_outbound_patterns[0]/pattern", + "path": "notifyServiceOutboundPatterns[0]/pattern", "value": "patternA" } ] @@ -209,7 +209,7 @@ to add constraint to specific outboundPattern of ldn notify service [ { "op": "add", - "path": "notifyservices_outbound_patterns[0]/constraint", + "path": "notifyServiceOutboundPatterns[0]/constraint", "value": "itemFilterA" } ] @@ -272,7 +272,7 @@ if value contains an empty array all inboundPatterns will be removed [ { "op": "replace", - "path": "notifyservices_inbound_patterns", + "path": "notifyServiceInboundPatterns", "value": [{"pattern":"patternC","constraint":"itemFilterC","automatic":"false"}, {"pattern":"patternD","constraint":"itemFilterD","automatic":"false"}] } ] @@ -284,7 +284,7 @@ to replace inboundPattern of ldn notify service at specific index [ { "op": "replace", - "path": "notifyservices_inbound_patterns[0]", + "path": "notifyServiceInboundPatterns[0]", "value": {"pattern":"patternD","constraint":"itemFilterD","automatic":"true"} } ] @@ -297,7 +297,7 @@ if value contains an empty array all outboundPatterns will be removed [ { "op": "replace", - "path": "notifyservices_outbound_patterns", + "path": "notifyServiceOutboundPatterns", "value": [{"pattern":"patternC","constraint":"itemFilterC"}, {"pattern":"patternD","constraint":"itemFilterD"}] } ] @@ -309,7 +309,7 @@ to replace outboundPattern of ldn notify service at specific index [ { "op": "replace", - "path": "notifyservices_outbound_patterns[0]", + "path": "notifyServiceOutboundPatterns[0]", "value": {"pattern":"patternD","constraint":"itemFilterD"} } ] @@ -321,7 +321,7 @@ to replace pattern of specific inboundPattern of ldn notify service [ { "op": "replace", - "path": "notifyservices_inbound_patterns[1]/pattern", + "path": "notifyServiceInboundPatterns[1]/pattern", "value": "patternB" } ] @@ -333,7 +333,7 @@ to replace constraint of specific inboundPattern of ldn notify service [ { "op": "replace", - "path": "notifyservices_inbound_patterns[1]/constraint", + "path": "notifyServiceInboundPatterns[1]/constraint", "value": "itemFilterB" } ] @@ -345,7 +345,7 @@ to replace automatic of specific inboundPattern of ldn notify service [ { "op": "replace", - "path": "notifyservices_inbound_patterns[1]/automatic", + "path": "notifyServiceInboundPatterns[1]/automatic", "value": "true" } ] @@ -357,7 +357,7 @@ to replace pattern of specific outboundPattern of ldn notify service [ { "op": "replace", - "path": "notifyservices_outbound_patterns[1]/pattern", + "path": "notifyServiceOutboundPatterns[1]/pattern", "value": "patternB" } ] @@ -369,7 +369,7 @@ to replace constraint of specific outboundPattern of ldn notify service [ { "op": "replace", - "path": "notifyservices_outbound_patterns[0]/constraint", + "path": "notifyServiceOutboundPatterns[0]/constraint", "value": "itemFilterA" } ] @@ -432,7 +432,7 @@ to remove all inboundPatterns of ldn notify service [ { "op": "remove", - "path": "notifyservices_inbound_patterns" + "path": "notifyServiceInboundPatterns" } ] ``` @@ -443,7 +443,7 @@ to remove inboundPattern from ldn notify service at specific index [ { "op": "remove", - "path": "notifyservices_inbound_patterns[0]" + "path": "notifyServiceInboundPatterns[0]" } ] ``` @@ -454,7 +454,7 @@ to remove all outboundPatterns of ldn notify service [ { "op": "remove", - "path": "notifyservices_outbound_patterns" + "path": "notifyServiceOutboundPatterns" } ] ``` @@ -465,7 +465,7 @@ to remove outboundPattern from ldn notify service at specific index [ { "op": "remove", - "path": "notifyservices_outbound_patterns[1]" + "path": "notifyServiceOutboundPatterns[1]" } ] ``` @@ -476,7 +476,7 @@ to remove constraint from specific inboundPattern of ldn notify service [ { "op": "remove", - "path": "notifyservices_inbound_patterns[0]/constraint" + "path": "notifyServiceInboundPatterns[0]/constraint" } ] ``` @@ -487,7 +487,7 @@ to remove constraint from specific outboundPattern of ldn notify service [ { "op": "remove", - "path": "notifyservices_outbound_patterns[0]/constraint" + "path": "notifyServiceOutboundPatterns[0]/constraint" } ] ``` From 611c795ad1a58eb5cd1169d88dbba5c78c797dc8 Mon Sep 17 00:00:00 2001 From: eskander Date: Fri, 22 Sep 2023 12:38:14 +0300 Subject: [PATCH 07/31] [CST-11046] added new property "enabled" --- ldnservices.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index b82800a1..5aa990d5 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -23,6 +23,7 @@ Return codes: "description" : "service description", "url" : "service url", "ldnUrl" : "service ldn url", + "enabled" : true, "notifyServiceInboundPatterns" : [ { @@ -66,6 +67,7 @@ Only administrator users can create LDN notify service. The content-type is JSON "description": "service description", "url": "service url", "ldnUrl": "service ldn url", + "enabled" : true, "notifyServiceInboundPatterns": [ {"pattern":"patternA","constraint":"itemFilterA","automatic":true}, @@ -265,6 +267,18 @@ to update the url of ldn notify service ] ``` +to update enabled of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/enabled", + "value": false + } +] +``` + to replace all inboundPatterns of ldn notify service, if value contains an empty array all inboundPatterns will be removed @@ -525,6 +539,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=ser "description" : "service description one", "url" : "service url one", "ldnUrl" : "service_ldn_url", + "enabled" : true, "notifyServiceInboundPatterns" : [ { From bb9821bf0ce3ba5211d78c33d5f98cfd9c130665 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 27 Sep 2023 13:33:06 +0300 Subject: [PATCH 08/31] [CST-11043] submission notify panel --- submissioncoarnotifyservices.md | 57 ++++++++++++++++++++++++ workspaceitem-data-coarnotify.md | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 submissioncoarnotifyservices.md create mode 100644 workspaceitem-data-coarnotify.md diff --git a/submissioncoarnotifyservices.md b/submissioncoarnotifyservices.md new file mode 100644 index 00000000..33c77e7b --- /dev/null +++ b/submissioncoarnotifyservices.md @@ -0,0 +1,57 @@ +# Submission COAR Notify Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +The proposed structure is derived from the configuration options already available in DSpace 6 and below. +In the first implementation, a single configuration named *default* is expected as these configurations were set at the site level. +Introducing an endpoint to manage a collection of configurations we open the door to future extension where different setups can be used for different kind of submissions (theses, technical reports, journal articles, etc.) + +## Main Endpoint +**/api/config/submissioncoarnotifyservices** + +Returns the list of configured COAR notify. + +```json +{ + "_embedded": { + "submissioncoarnotifyservices": [ + { + "id": "default", + "name": "default", + "type": "submissioncoarnotifyservices", + "fields": [] + } + ] + }, + "page": { + "size": 20, + "totalElements": 1, + "totalPages": 1, + "number": 0 + } +} +``` + +## Single COAR notify +**/api/config/submissioncoarnotifyservices/<:coarnotify-name>** + +*:coarnotify-name* is initially hard-coded to *default* + +Provide detailed information about a specific COAR notify. +```json +{ + "id": "default", + "name": "default", + "type": "submissioncoarnotifyservices", + "fields": [], + "_links" : { + "self" : { + "href" : "/api/config/submissioncoarnotifyservices/default" + } + } +} +``` + +### Linked entities +#### metadata +**/api/confg/submissioncoarnotifyservices/:coarnotify-name/metadata** +The [submission-form](submissionforms.md) used for the metadata of the COAR notify panel \ No newline at end of file diff --git a/workspaceitem-data-coarnotify.md b/workspaceitem-data-coarnotify.md new file mode 100644 index 00000000..d6a53326 --- /dev/null +++ b/workspaceitem-data-coarnotify.md @@ -0,0 +1,74 @@ +# WorkspaceItem data of COAR Notify sectionType +[Back to the definition of the workspaceitems endpoint](workspaceitems.md) + +The section data represents the data about the COAR Notify + +```json +[ + { + "pattern" : "review", + "services" : [{ + "id" : 1, + "name" : "service name", + "description" : "service description" + }, + { + "id" : 2, + "name" : "service name", + "description" : "service description" + } + ] + }, + { + "pattern" : "endorsement", + "services" : [{ + "id" : 3, + "name" : "service name", + "description" : "service description" + }] + }, + { + "pattern" : "ingest", + "services" : [{ + "id" : 4, + "name" : "service name", + "description" : "service description" + }] + } +] +``` + +## Patch operations +The PATCH method expects a JSON body according to the [JSON Patch specification RFC6902](https://tools.ietf.org/html/rfc6902) + +Each successful Patch operation will return a HTTP 200 CODE with the new workspaceitem as body + +### Add +To add a new service for a specific type of message + +```json +[ + { + "op": "add", + "path": "/sections/<:name-of-the-form>/review-service", + "value": "1" + } +] +``` + +### Replace +To replace a service for a specific type of message + +```json +[ + { + "op": "replace", + "path": "/sections/<:name-of-the-form>/review-service", + "value": "2" + } +] +``` + +### Remove +It is possible to remove a previously service +`curl --data '{[ { "op": "remove", "path": "/sections/<:name-of-the-form>/review-service[0]"}]' -X PATCH ${dspace7-url}/api/submission/workspaceitems/1` From afaac76e2d34d8babf88d416961eb627deec7850 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 11 Oct 2023 18:09:49 +0300 Subject: [PATCH 09/31] [CST-11043] replaced fields with patterns property --- submissioncoarnotifyservices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submissioncoarnotifyservices.md b/submissioncoarnotifyservices.md index 33c77e7b..7fb354a4 100644 --- a/submissioncoarnotifyservices.md +++ b/submissioncoarnotifyservices.md @@ -18,7 +18,7 @@ Returns the list of configured COAR notify. "id": "default", "name": "default", "type": "submissioncoarnotifyservices", - "fields": [] + "patterns": ["review", "endorsement", "ingest"] } ] }, @@ -42,7 +42,7 @@ Provide detailed information about a specific COAR notify. "id": "default", "name": "default", "type": "submissioncoarnotifyservices", - "fields": [], + "patterns": ["review", "endorsement", "ingest"], "_links" : { "self" : { "href" : "/api/config/submissioncoarnotifyservices/default" From 0ebe2af921f69107d4e7e1edc21fc382894d075b Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 11 Oct 2023 18:26:48 +0300 Subject: [PATCH 10/31] [CST-11043] refactoring and handled patch operations --- workspaceitem-data-coarnotify.md | 64 +++++++++++++++++--------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/workspaceitem-data-coarnotify.md b/workspaceitem-data-coarnotify.md index d6a53326..284044f2 100644 --- a/workspaceitem-data-coarnotify.md +++ b/workspaceitem-data-coarnotify.md @@ -5,34 +5,38 @@ The section data represents the data about the COAR Notify ```json [ - { - "pattern" : "review", - "services" : [{ - "id" : 1, - "name" : "service name", - "description" : "service description" - }, - { - "id" : 2, - "name" : "service name", - "description" : "service description" - } - ] - }, { "pattern" : "endorsement", - "services" : [{ - "id" : 3, - "name" : "service name", - "description" : "service description" - }] - }, - { - "pattern" : "ingest", - "services" : [{ + "services" : [ { "id" : 4, - "name" : "service name", - "description" : "service description" + "name" : "service name two", + "description" : null, + "url" : null, + "ldnUrl" : "service ldn url two", + "notifyServiceInboundPatterns" : [ ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "ldnservice" + }, { + "id" : 5, + "name" : "service name three", + "description" : null, + "url" : null, + "ldnUrl" : "service ldn url three", + "notifyServiceInboundPatterns" : [ ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "ldnservice" + }] + }, { + "pattern" : "review", + "services" : [ { + "id" : 3, + "name" : "service name one", + "description" : null, + "url" : null, + "ldnUrl" : "service ldn url one", + "notifyServiceInboundPatterns" : [ ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "ldnservice" }] } ] @@ -44,14 +48,14 @@ The PATCH method expects a JSON body according to the [JSON Patch specification Each successful Patch operation will return a HTTP 200 CODE with the new workspaceitem as body ### Add -To add a new service for a specific type of message +To add a new services for a specific type of message ```json [ { "op": "add", - "path": "/sections/<:name-of-the-form>/review-service", - "value": "1" + "path": "/sections/coarnotify/review/-", + "value": ["1","2","6"] } ] ``` @@ -63,7 +67,7 @@ To replace a service for a specific type of message [ { "op": "replace", - "path": "/sections/<:name-of-the-form>/review-service", + "path": "/sections/coarnotify/endorsement/1", "value": "2" } ] @@ -71,4 +75,4 @@ To replace a service for a specific type of message ### Remove It is possible to remove a previously service -`curl --data '{[ { "op": "remove", "path": "/sections/<:name-of-the-form>/review-service[0]"}]' -X PATCH ${dspace7-url}/api/submission/workspaceitems/1` +`curl --data '{[ { "op": "remove", "path": "/sections/coarnotify/review/0"}]' -X PATCH ${dspace7-url}/api/submission/workspaceitems/1` From c0ef4620a4feb2d08482c2d0461aecf81e94a495 Mon Sep 17 00:00:00 2001 From: eskander Date: Mon, 16 Oct 2023 12:59:18 +0300 Subject: [PATCH 11/31] [CST-11043] refactoring and renamed the endpoint --- submissioncoarnotifyconfigs.md | 69 +++++++++++++++++++++++++++++++++ submissioncoarnotifyservices.md | 57 --------------------------- 2 files changed, 69 insertions(+), 57 deletions(-) create mode 100644 submissioncoarnotifyconfigs.md delete mode 100644 submissioncoarnotifyservices.md diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md new file mode 100644 index 00000000..2048b6ac --- /dev/null +++ b/submissioncoarnotifyconfigs.md @@ -0,0 +1,69 @@ +# Submission COAR Notify Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +The proposed structure is derived from the configuration options already available in DSpace 6 and below. +In the first implementation, a single configuration named *default* is expected as these configurations were set at the site level. +Introducing an endpoint to manage a collection of configurations we open the door to future extension where different setups can be used for different kind of submissions (theses, technical reports, journal articles, etc.) + +## Main Endpoint +**/api/config/submissioncoarnotifyconfigs** + +Returns the list of configured COAR notify. + +```json +{ + "_embedded" : { + "submissioncoarnotifyconfigs" : [ { + "id" : "default", + "patterns" : [ "review", "endorsement", "ingest" ], + "type" : "submissioncoarnotifyconfig", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/default" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/config/submissioncoarnotifyconfigs" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } +} +``` + +Status codes: +* 200 OK - if the operation succeeded +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users + +## Single COAR notify +**/api/config/submissioncoarnotifyconfigs/<:coarnotify-name>** + +*:coarnotify-name* is initially hard-coded to *default* + +Provide detailed information about a specific COAR notify. +```json +{ + "id" : "default", + "patterns" : [ "review", "endorsement", "ingest" ], + "type" : "submissioncoarnotifyconfig", + "_links" : { + "self" : { + "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/default" + } + } +} +``` + +Status codes: +* 200 OK - if the operation succeeded +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users +* 404 Not found - if the submission COAR Notify Config doesn't exist \ No newline at end of file diff --git a/submissioncoarnotifyservices.md b/submissioncoarnotifyservices.md deleted file mode 100644 index 7fb354a4..00000000 --- a/submissioncoarnotifyservices.md +++ /dev/null @@ -1,57 +0,0 @@ -# Submission COAR Notify Endpoints -[Back to the list of all defined endpoints](endpoints.md) - -The proposed structure is derived from the configuration options already available in DSpace 6 and below. -In the first implementation, a single configuration named *default* is expected as these configurations were set at the site level. -Introducing an endpoint to manage a collection of configurations we open the door to future extension where different setups can be used for different kind of submissions (theses, technical reports, journal articles, etc.) - -## Main Endpoint -**/api/config/submissioncoarnotifyservices** - -Returns the list of configured COAR notify. - -```json -{ - "_embedded": { - "submissioncoarnotifyservices": [ - { - "id": "default", - "name": "default", - "type": "submissioncoarnotifyservices", - "patterns": ["review", "endorsement", "ingest"] - } - ] - }, - "page": { - "size": 20, - "totalElements": 1, - "totalPages": 1, - "number": 0 - } -} -``` - -## Single COAR notify -**/api/config/submissioncoarnotifyservices/<:coarnotify-name>** - -*:coarnotify-name* is initially hard-coded to *default* - -Provide detailed information about a specific COAR notify. -```json -{ - "id": "default", - "name": "default", - "type": "submissioncoarnotifyservices", - "patterns": ["review", "endorsement", "ingest"], - "_links" : { - "self" : { - "href" : "/api/config/submissioncoarnotifyservices/default" - } - } -} -``` - -### Linked entities -#### metadata -**/api/confg/submissioncoarnotifyservices/:coarnotify-name/metadata** -The [submission-form](submissionforms.md) used for the metadata of the COAR notify panel \ No newline at end of file From c17e1f77d31cbc91036e040de4c5f1bf9443497f Mon Sep 17 00:00:00 2001 From: eskander Date: Mon, 16 Oct 2023 15:08:19 +0300 Subject: [PATCH 12/31] [CST-11043] replaced services with ids only --- workspaceitem-data-coarnotify.md | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/workspaceitem-data-coarnotify.md b/workspaceitem-data-coarnotify.md index 284044f2..d30b8ff8 100644 --- a/workspaceitem-data-coarnotify.md +++ b/workspaceitem-data-coarnotify.md @@ -7,37 +7,10 @@ The section data represents the data about the COAR Notify [ { "pattern" : "endorsement", - "services" : [ { - "id" : 4, - "name" : "service name two", - "description" : null, - "url" : null, - "ldnUrl" : "service ldn url two", - "notifyServiceInboundPatterns" : [ ], - "notifyServiceOutboundPatterns" : [ ], - "type" : "ldnservice" - }, { - "id" : 5, - "name" : "service name three", - "description" : null, - "url" : null, - "ldnUrl" : "service ldn url three", - "notifyServiceInboundPatterns" : [ ], - "notifyServiceOutboundPatterns" : [ ], - "type" : "ldnservice" - }] + "services" : [ 1, 2, 3 ] }, { "pattern" : "review", - "services" : [ { - "id" : 3, - "name" : "service name one", - "description" : null, - "url" : null, - "ldnUrl" : "service ldn url one", - "notifyServiceInboundPatterns" : [ ], - "notifyServiceOutboundPatterns" : [ ], - "type" : "ldnservice" - }] + "services" : [ 6 ] } ] ``` From 4018387e01dadaa4f53ade4b01c9ce534c3fe820 Mon Sep 17 00:00:00 2001 From: frabacche Date: Tue, 17 Oct 2023 08:32:10 +0200 Subject: [PATCH 13/31] CST-12143 topic by target --- qualityassurancetopics.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qualityassurancetopics.md b/qualityassurancetopics.md index aec80ce5..45d54250 100644 --- a/qualityassurancetopics.md +++ b/qualityassurancetopics.md @@ -48,7 +48,7 @@ Provide detailed information about a specific Quality Assurance Broker topic. Th lastEvent: "2020/10/09 10:11 UTC", totalEvents: 33 } - ``` +``` ​ Return codes: * 200 OK - if the operation succeed @@ -73,3 +73,14 @@ Return codes: * 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access Provide paginated list of the qa topics available. + +### Get qualityassurancetopics by a given source +**GET /api/integration/qualityassurancetopics/search/byTarget?target=:item-uuid[&source=:source-id]** + +It returns the list of qa topics (from a specific source) to a specific targeted item. + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the topic parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access From aaa4377a823f7a1604344de550756747eaeb389e Mon Sep 17 00:00:00 2001 From: frabacche Date: Tue, 17 Oct 2023 08:59:38 +0200 Subject: [PATCH 14/31] CST-12143 QA Events findByTopic add target get parameter as non-required --- qualityassuranceevents.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qualityassuranceevents.md b/qualityassuranceevents.md index b73e67a0..176440eb 100644 --- a/qualityassuranceevents.md +++ b/qualityassuranceevents.md @@ -63,9 +63,9 @@ Status codes: ## Search methods ### Get qualityassuranceevents by a given topic -**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:target-key[&size=10&page=0]** +**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:target-key[&size=10&page=0][&target=:item-uuid]** -It returns the list of qa events from a specific topic +It returns the list of qa events from a specific topic, possibly filtered by the item they refer to The supported parameters are: * page, size [see pagination](README.md#Pagination) From 27916fee3c31e4919ed801642d7e8940be7b0a3d Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Mon, 23 Oct 2023 11:27:20 +0200 Subject: [PATCH 15/31] CST-12143 cleanup wording --- qualityassuranceevents.md | 5 +++-- qualityassurancetopics.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qualityassuranceevents.md b/qualityassuranceevents.md index 176440eb..7de4c758 100644 --- a/qualityassuranceevents.md +++ b/qualityassuranceevents.md @@ -63,13 +63,14 @@ Status codes: ## Search methods ### Get qualityassuranceevents by a given topic -**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:target-key[&size=10&page=0][&target=:item-uuid]** +**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:topic-key[&target=:item-uuid&size=10&page=0]** -It returns the list of qa events from a specific topic, possibly filtered by the item they refer to +It returns the list of qa events from a specific topic, eventually filtered by the target they refer to The supported parameters are: * page, size [see pagination](README.md#Pagination) * topic: mandatory, the key associated with the requested topic +* target: optional, the uuid of the target item to restrict the qa events Return codes: * 200 OK - if the operation succeed diff --git a/qualityassurancetopics.md b/qualityassurancetopics.md index 45d54250..8c9d8f16 100644 --- a/qualityassurancetopics.md +++ b/qualityassurancetopics.md @@ -74,13 +74,13 @@ Return codes: Provide paginated list of the qa topics available. -### Get qualityassurancetopics by a given source +### Get qualityassurancetopics by a given target **GET /api/integration/qualityassurancetopics/search/byTarget?target=:item-uuid[&source=:source-id]** It returns the list of qa topics (from a specific source) to a specific targeted item. Return codes: * 200 OK - if the operation succeed -* 400 Bad Request - if the topic parameter is missing or invalid +* 400 Bad Request - if the target parameter is missing or invalid * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access From de099015d57bbf94e11285bc50d30a88df6fcf5b Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Mon, 23 Oct 2023 18:21:48 +0200 Subject: [PATCH 16/31] CST-11403 finalization of the workspaceitem-data structure --- submissioncoarnotifyconfigs.md | 15 +++++---- workspaceitem-data-coarnotify.md | 58 +++++++++++++++++++++++++------- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md index 2048b6ac..e6995131 100644 --- a/submissioncoarnotifyconfigs.md +++ b/submissioncoarnotifyconfigs.md @@ -1,14 +1,16 @@ # Submission COAR Notify Endpoints [Back to the list of all defined endpoints](endpoints.md) -The proposed structure is derived from the configuration options already available in DSpace 6 and below. +Provide access to the existing configurations for the submission COAR Notify panel. +The SubmissionCOARNotifyConfig list which request patterns can be selected during the submission. + In the first implementation, a single configuration named *default* is expected as these configurations were set at the site level. Introducing an endpoint to manage a collection of configurations we open the door to future extension where different setups can be used for different kind of submissions (theses, technical reports, journal articles, etc.) ## Main Endpoint **/api/config/submissioncoarnotifyconfigs** -Returns the list of configured COAR notify. +Returns the list of configured COAR notify patterns to be offered during the submission. ```json { @@ -40,8 +42,8 @@ Returns the list of configured COAR notify. Status codes: * 200 OK - if the operation succeeded -* 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users +* 401 Unauthorized - if you are not authenticated. The endpoint is restricted to authenticated users + ## Single COAR notify **/api/config/submissioncoarnotifyconfigs/<:coarnotify-name>** @@ -64,6 +66,5 @@ Provide detailed information about a specific COAR notify. Status codes: * 200 OK - if the operation succeeded -* 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users -* 404 Not found - if the submission COAR Notify Config doesn't exist \ No newline at end of file +* 401 Unauthorized - if you are not authenticated. The endpoint is restricted to authenticated users +* 404 Not found - if the requested submission COAR Notify Config doesn't exist \ No newline at end of file diff --git a/workspaceitem-data-coarnotify.md b/workspaceitem-data-coarnotify.md index d30b8ff8..d1ef6cee 100644 --- a/workspaceitem-data-coarnotify.md +++ b/workspaceitem-data-coarnotify.md @@ -1,51 +1,83 @@ # WorkspaceItem data of COAR Notify sectionType [Back to the definition of the workspaceitems endpoint](workspaceitems.md) -The section data represents the data about the COAR Notify +The section data represents the data about the selected COAR Notify patterns to request ```json [ { - "pattern" : "endorsement", - "services" : [ 1, 2, 3 ] - }, { - "pattern" : "review", - "services" : [ 6 ] + "endorsement": [ 1, 2, 3 ], + "review": [ 6 ] } ] ``` +the attributes represent the pattern that will be requested to the selected service(s), the value of each attribute is the array of the id of the selected services. +The above example shows a submission where three services (id 1, 2, 3) were selected to request an endorsement and one service (id 6) has been selected to request a review. + ## Patch operations The PATCH method expects a JSON body according to the [JSON Patch specification RFC6902](https://tools.ietf.org/html/rfc6902) -Each successful Patch operation will return a HTTP 200 CODE with the new workspaceitem as body +Each successful Patch operation will return a HTTP 200 CODE with the updated workspaceitem as body ### Add -To add a new services for a specific type of message +To specify which services request for a specific pattern ```json [ { "op": "add", "path": "/sections/coarnotify/review/-", - "value": ["1","2","6"] + "value": [1, 2, 6] } ] ``` ### Replace -To replace a service for a specific type of message +To replace the 2nd previous selected service for the endorsement pattern ```json [ { "op": "replace", "path": "/sections/coarnotify/endorsement/1", - "value": "2" + "value": 4 + } +] +``` + +Please note that the number in the path (/1) represent the idx of the previous selected services, the number in the value represent the id of the new selected service. The above path applied to the initial sample +```json +[ + { + "endorsement": [ 1, 2, 3 ], + "review": [ 6 ] + } +] +``` + +will modify the section data as follow + +```json +[ + { + "endorsement": [ 1, 4, 3 ], + "review": [ 6 ] } ] ``` ### Remove -It is possible to remove a previously service -`curl --data '{[ { "op": "remove", "path": "/sections/coarnotify/review/0"}]' -X PATCH ${dspace7-url}/api/submission/workspaceitems/1` +It is possible to remove a previously selected service for a specific pattern (review) +`curl --data '{[ { "op": "remove", "path": "/sections/coarnotify/endorsement/0"}]' -X PATCH ${dspace7-url}/api/submission/workspaceitems/1` + +The result applied to the previous example will be + +```json +[ + { + "endorsement": [4, 3 ], + "review": [ 6 ] + } +] +``` \ No newline at end of file From 404ee0b46e28c88d8f56124805765aba477aebc1 Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Mon, 23 Oct 2023 18:38:15 +0200 Subject: [PATCH 17/31] CST-11403 add details about return code for patch operation --- workspaceitem-data-coarnotify.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workspaceitem-data-coarnotify.md b/workspaceitem-data-coarnotify.md index d1ef6cee..e972727b 100644 --- a/workspaceitem-data-coarnotify.md +++ b/workspaceitem-data-coarnotify.md @@ -18,7 +18,9 @@ The above example shows a submission where three services (id 1, 2, 3) were sele ## Patch operations The PATCH method expects a JSON body according to the [JSON Patch specification RFC6902](https://tools.ietf.org/html/rfc6902) -Each successful Patch operation will return a HTTP 200 CODE with the updated workspaceitem as body +Each successful Patch operation will return a HTTP 200 CODE with the updated workspaceitem as body. + +If the requested path doesn't match a valid pattern for the current configuration or a specified service id doesn't exist 422 Unprocessable Entity will be returned. ### Add To specify which services request for a specific pattern From 67ddfeab89f9f97c9682ec3ae0cf749adb783408 Mon Sep 17 00:00:00 2001 From: eskander Date: Fri, 27 Oct 2023 08:45:59 +0200 Subject: [PATCH 18/31] [CST-11043] changed default to coarnotify --- submissioncoarnotifyconfigs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md index e6995131..d3d7dcfb 100644 --- a/submissioncoarnotifyconfigs.md +++ b/submissioncoarnotifyconfigs.md @@ -4,7 +4,7 @@ Provide access to the existing configurations for the submission COAR Notify panel. The SubmissionCOARNotifyConfig list which request patterns can be selected during the submission. -In the first implementation, a single configuration named *default* is expected as these configurations were set at the site level. +In the first implementation, a single configuration named *coarnotify* is expected as these configurations were set at the site level. Introducing an endpoint to manage a collection of configurations we open the door to future extension where different setups can be used for different kind of submissions (theses, technical reports, journal articles, etc.) ## Main Endpoint @@ -16,12 +16,12 @@ Returns the list of configured COAR notify patterns to be offered during the sub { "_embedded" : { "submissioncoarnotifyconfigs" : [ { - "id" : "default", + "id" : "coarnotify", "patterns" : [ "review", "endorsement", "ingest" ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { - "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/default" + "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/coarnotify" } } } ] @@ -48,17 +48,17 @@ Status codes: ## Single COAR notify **/api/config/submissioncoarnotifyconfigs/<:coarnotify-name>** -*:coarnotify-name* is initially hard-coded to *default* +*:coarnotify-name* is initially hard-coded to *coarnotify* Provide detailed information about a specific COAR notify. ```json { - "id" : "default", + "id" : "coarnotify", "patterns" : [ "review", "endorsement", "ingest" ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { - "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/default" + "href" : "http://localhost/api/config/submissioncoarnotifyconfigs/coarnotify" } } } From b653401d85706b484324d2c0352c8f8a6007dd04 Mon Sep 17 00:00:00 2001 From: eskander Date: Fri, 27 Oct 2023 09:47:35 +0200 Subject: [PATCH 19/31] added a new search method --- ldnservices.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index 5aa990d5..ea516a4f 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -565,4 +565,75 @@ Return codes: * 200 OK - if the operation succeed * 400 Bad Request - if the ldnUrl parameter is missing or invalid * 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users + +### findByInboundPattern +**/api/ldn/ldnservices/search/byInboundPattern?pattern=<:pattern>** + +Parameters: +* The `pattern` the inbound pattern of the LDN notify service + +A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pattern=review' + +```json +{ + "_embedded" : { + "ldnservices" : [ { + "id" : 1, + "name" : "service name one", + "description" : "service description one", + "url" : "https://service.ldn.org/about", + "ldnUrl" : "https://service.ldn.org/inbox", + "enabled" : false, + "notifyServiceInboundPatterns" : [ { + "pattern" : "review", + "constraint" : "itemFilterA", + "automatic" : false + } ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "ldnservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/ldnservices/1" + } + } + }, { + "id" : 2, + "name" : "service name two", + "description" : "service description two", + "url" : "https://service2.ldn.org/about", + "ldnUrl" : "https://service2.ldn.org/inbox", + "enabled" : false, + "notifyServiceInboundPatterns" : [ { + "pattern" : "review", + "constraint" : "itemFilterA", + "automatic" : false + } ], + "notifyServiceOutboundPatterns" : [ ], + "type" : "ldnservice", + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/ldnservices/2" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/ldnservices/search/byInboundPattern?pattern=review" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the pattern parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated * 403 Forbidden is not possible because it is restricted to authenticated users \ No newline at end of file From 2ca153dd104d3506e8d188518afb4991ba30aac4 Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Wed, 1 Nov 2023 00:20:52 +0100 Subject: [PATCH 20/31] CST-12467 refactor qatopic to always refer to a qasource --- qualityassuranceevents.md | 11 +++++----- qualityassurancesources.md | 41 +++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/qualityassuranceevents.md b/qualityassuranceevents.md index 7de4c758..6caefc14 100644 --- a/qualityassuranceevents.md +++ b/qualityassuranceevents.md @@ -44,7 +44,7 @@ Attributes * the *trust* attribute is the level of accuracy of the quality assurance event (values from 0.00 to 1.00) * the *status* attribute is one of (ACCEPTED, REJECTED, DISCARDED, PENDING) * the *eventDate* attribute is the timestamp of the event reception -* the *message* attribute is a json object which structure depends on the source and on the topic of the event. When the "topic" type is +* the *message* attribute is a json object which structure depends on the source and on the topic of the event. When the source is "openaire" and the "topic" type is * ENRICH/MISSING/PID and ENRICH/MORE/PID: fills `message.type` with the type of persistent identifier (doi, pmid, etc.) and `message.value` with the corresponding value * ENRICH/MISSING/ABSTRACT: fills `message.abstract` * ENRICH/MISSING/SUBJECT/ACM: fills the `message.value` with the actual keywords, the subject classification is defined by the last part of the topic (ACM, JEL, DDC, etc.) @@ -52,7 +52,7 @@ Attributes Exposed links: * topic: link to the topic to which the event belong to (see [qualityassurancetopics](qualityassurancetopics.md)) -* target: link to the item that represent the targe to whom the quality assurance event apply +* target: link to the item that represent the target to whom the quality assurance event apply * related: link to an optional second item that is involved in the qa events (i.e. the project item for OpenAIRE ENRICH/MISSING/PROJECT event) Status codes: @@ -63,18 +63,17 @@ Status codes: ## Search methods ### Get qualityassuranceevents by a given topic -**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:topic-key[&target=:item-uuid&size=10&page=0]** +**GET /api/integration/qualityassuranceevents/search/findByTopic?topic=:topic-key[&size=10&page=0]** It returns the list of qa events from a specific topic, eventually filtered by the target they refer to The supported parameters are: * page, size [see pagination](README.md#Pagination) -* topic: mandatory, the key associated with the requested topic -* target: optional, the uuid of the target item to restrict the qa events +* topic: mandatory, the key associated with the requested topic. Please note that the topic could contain the uuid of a specific target item to restrict the qa events. See the note about the [qa topic id](qualityassurancetopics.md#get-single-topic) Return codes: * 200 OK - if the operation succeed -* 400 Bad Request - if the topic parameter is missing or invalid +* 400 Bad Request - if the topic parameter is missing Provide paginated list of the qa events available. diff --git a/qualityassurancesources.md b/qualityassurancesources.md index a5f88d6c..946a9824 100644 --- a/qualityassurancesources.md +++ b/qualityassurancesources.md @@ -23,7 +23,7 @@ Provide access to the Quality Assurance sources. It returns the list of the Qual Attributes: * lastEvent: the date of the last update from the specific Quality Assurance source * totalEvents: the total number of quality assurance events provided by the Quality Assurance source -* id: is the identifier to use in GET Single Source +* id: is the identifier to use in GET Single Source. It can be composed of a source alias followed by colon : and the target uuid when the qa source data are focused on a specific item Return codes: * 200 OK - if the operation succeed @@ -48,3 +48,42 @@ Return codes: * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access * 404 Not found - if the source doesn't exist + +## Search methods +### Get qualityassurancesources by a given target +**/api/integration/qualityassurancesources/search/byTarget** + +It returns the list of qa sources that have events related to the specific target. + +```json +... +_embedded: { + qualityassurancesources: + [ + + { + id: "openaire:", + type: "qualityassurancesource", + totalEvents: "3" + }, + { + id: "coar-notify:", + type: "qualityassurancesource", + totalEvents: "2" + }, + ... + ] +} +``` + +The supported parameters are: +* page, size [see pagination](README.md#Pagination) +* source: mandatory, the name associated with a specific source + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the topic parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access + + From e5ea4cf02935fb2d3e3d92440c2d134a28ce566f Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Wed, 1 Nov 2023 18:24:49 +0100 Subject: [PATCH 21/31] CST-12467 implement a search by target method for qa sources --- qualityassurancetopics.md | 57 +++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/qualityassurancetopics.md b/qualityassurancetopics.md index 8c9d8f16..8560d5e5 100644 --- a/qualityassurancetopics.md +++ b/qualityassurancetopics.md @@ -2,33 +2,14 @@ Provide access to the Quality Assurance topics. A topic represents a specific type of event (such as a missing abstract can be). **GET /api/integration/qualityassurancetopics** -It returns the list of the Quality Assurance Broker topics. +This method is not implemented as we haven't a use case that require to iterate over all the qa topics regardless of their source. Please use the search/bySource method instead. -```json -[ - { - id: "ENRICH!MORE!PID", - type: "qualityassurancetopic", - name: "ENRICH/MORE/PID", - lastEvent: "2020/10/09 10:11 UTC", - totalSuggestions: "33" - }, - { - id: "ENRICH!MISSING!ABSTRACT", - type: "qualityassurancetopic", - name: "ENRICH/MISSING/ABSTRACT", - lastEvent: "2020/10/09 10:11 UTC", - totalSuggestions: "21" - }, - ... -] -``` Attributes: * name: the name of the topic to display on the frontend user interface * lastEvent: the date of the last update from Quality Assurance Broker * totalEvents: the total number of quality assurance events provided by Quality Assurance Broker for this topic -* id: is the identifier to use in GET Single Topic +* id: is the identifier to use in GET Single Topic. It is composed of the source, the topic name and optionally the target item uuid to which the data will be restricted Return codes: * 200 OK - if the operation succeed @@ -42,7 +23,7 @@ Provide detailed information about a specific Quality Assurance Broker topic. Th ​ ```json { - id: "ENRICH!MORE!PID", + id: "openaire:ENRICH!MORE!PID", type: "qualityassurancetopic", name: "ENRICH/MORE/PID", lastEvent: "2020/10/09 10:11 UTC", @@ -60,7 +41,32 @@ Return codes: ### Get qualityassurancetopics by a given source **/api/integration/qualityassurancetopics/search/bySource** -It returns the list of qa topics from a specific source +It returns the list of qa topics from a specific source. Provide paginated list of the qa topics available. + +```json +... +_embedded: { + qualityassurancetopics: + [ + + { + id: "openaire:ENRICH!MORE!PID", + type: "qualityassurancetopic", + name: "ENRICH/MORE/PID", + lastEvent: "2020/10/09 10:11 UTC", + totalSuggestions: "33" + }, + { + id: "openaire:ENRICH!MISSING!ABSTRACT", + type: "qualityassurancetopic", + name: "ENRICH/MISSING/ABSTRACT", + lastEvent: "2020/10/09 10:11 UTC", + totalSuggestions: "21" + }, + ... + ] +} +``` The supported parameters are: * page, size [see pagination](README.md#Pagination) @@ -72,15 +78,14 @@ Return codes: * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access -Provide paginated list of the qa topics available. ### Get qualityassurancetopics by a given target -**GET /api/integration/qualityassurancetopics/search/byTarget?target=:item-uuid[&source=:source-id]** +**GET /api/integration/qualityassurancetopics/search/byTarget?target=:item-uuid&source=:source-id** It returns the list of qa topics (from a specific source) to a specific targeted item. Return codes: * 200 OK - if the operation succeed -* 400 Bad Request - if the target parameter is missing or invalid +* 400 Bad Request - if the target or the source parameters are missing or invalid (the target is not an uuid) * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access From 2cebbfcdb096527c8d684b113573e063bd653388 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Thu, 2 Nov 2023 14:33:08 +0100 Subject: [PATCH 22/31] CST-12469 Added score details in the rest contract --- ldnservices.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index ea516a4f..68dc023e 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -24,6 +24,7 @@ Return codes: "url" : "service url", "ldnUrl" : "service ldn url", "enabled" : true, + "score" : "service score between 0 and 1", "notifyServiceInboundPatterns" : [ { @@ -67,6 +68,7 @@ Only administrator users can create LDN notify service. The content-type is JSON "description": "service description", "url": "service url", "ldnUrl": "service ldn url", + "score" : "service score between 0 and 1", "enabled" : true, "notifyServiceInboundPatterns": [ @@ -140,6 +142,18 @@ to add url to ldn notify service ] ``` +to add score to ldn notify service + +```json +[ + { + "op": "add", + "path": "/score", + "value": "score value" + } +] +``` + to add inboundPatterns to ldn notify service -adding object to the last, this array isn't sorted so, not supported adding to index like "notifyServiceInboundPatterns[index]" @@ -255,6 +269,18 @@ to update the ldnUrl of ldn notify service ] ``` +to update the score of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/score", + "value": "service score" + } +] +``` + to update the url of ldn notify service ```json @@ -440,6 +466,17 @@ to remove url value from ldn notify service ] ``` +to remove score value from ldn notify service + +```json +[ + { + "op": "remove", + "path": "/score" + } +] +``` + to remove all inboundPatterns of ldn notify service ```json @@ -539,6 +576,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=ser "description" : "service description one", "url" : "service url one", "ldnUrl" : "service_ldn_url", + "score" : "service score one", "enabled" : true, "notifyServiceInboundPatterns" : [ @@ -584,6 +622,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "description" : "service description one", "url" : "https://service.ldn.org/about", "ldnUrl" : "https://service.ldn.org/inbox", + "score" : "service score one", "enabled" : false, "notifyServiceInboundPatterns" : [ { "pattern" : "review", @@ -603,6 +642,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "description" : "service description two", "url" : "https://service2.ldn.org/about", "ldnUrl" : "https://service2.ldn.org/inbox", + "score" : "service score two", "enabled" : false, "notifyServiceInboundPatterns" : [ { "pattern" : "review", From 18bb177ee64609c4c99db595245614bb7a3ac3b2 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Tue, 7 Nov 2023 11:57:45 +0100 Subject: [PATCH 23/31] CST-12469 addressed required changes on the ldnservices rest contract --- ldnservices.md | 57 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index 68dc023e..d9b55e55 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -21,10 +21,10 @@ Return codes: "id" : 1, "name" : "service name", "description" : "service description", - "url" : "service url", - "ldnUrl" : "service ldn url", + "url" : "https://service-name.org/about", + "ldnUrl" : "https://service-name.org/ldn-inbox", "enabled" : true, - "score" : "service score between 0 and 1", + "score" : "0.375", "notifyServiceInboundPatterns" : [ { @@ -57,6 +57,25 @@ Status codes: * 403 Forbidden is not possible because it is restricted to authenticated users * 404 Not found - if no LDN notify service exists with such id + Attributes +* id: numerical identificator assigned by the rest to the service itself +* name: a short name associated to the service +* description: a description for the service, i.e. the reason for the service +* url: the URL for users to check out more information about the service +* ldnUrl: the URL of the LDN Inbox +* enabled: This proeprty is a simple boolean, it defines if the service is selected as one of the active ones +* score: This property defines to the safety score assigned by the user +* inboundPatterns: an array that contains inbound pattern defined by 3 properties: + * pattern: the defining pattern name for the pattern itself + * constraint: a filter put in place during the pattern creation + * automatic: The automatic property is a boolean property that defines the behaviour during an item archiving operation; + * automatic:TRUE = all the patterns flagged with the true value for the automatic property, for which a positive response is returned, a notification on the corresponding service + * automatic:FALSE = all the patterns flagged with the false value for the automatic property, needs to be explicitly declared from the user during a submission in the related submission section COAR Notify + +* outboundPatterns: an array that contains inbound pattern defined by 3 properties: + * pattern: the defining pattern name for the pattern itself + * constraint: a filter put in place during the pattern creation + ## Creating a new LDN notify service **POST /api/ldn/ldnservices** @@ -66,9 +85,9 @@ Only administrator users can create LDN notify service. The content-type is JSON { "name": "service name", "description": "service description", - "url": "service url", - "ldnUrl": "service ldn url", - "score" : "service score between 0 and 1", + "url": "https://service-name.org/about", + "ldnUrl": "https://service-name.org/ldn-inbox", + "score" : "0.765", "enabled" : true, "notifyServiceInboundPatterns": [ @@ -125,7 +144,7 @@ to add ldnUrl to ldn notify service { "op": "add", "path": "/ldnurl", - "value": "service ldnUrl" + "value": "https://service-name.org/ldn-inbox" } ] ``` @@ -137,7 +156,7 @@ to add url to ldn notify service { "op": "add", "path": "/url", - "value": "url value" + "value": "https://service-name.org/about" } ] ``` @@ -149,7 +168,7 @@ to add score to ldn notify service { "op": "add", "path": "/score", - "value": "score value" + "value": "0.89" } ] ``` @@ -264,7 +283,7 @@ to update the ldnUrl of ldn notify service { "op": "replace", "path": "/ldnurl", - "value": "service ldnUrl" + "value": "https://service-name.org/ldn-inbox" } ] ``` @@ -276,7 +295,7 @@ to update the score of ldn notify service { "op": "replace", "path": "/score", - "value": "service score" + "value": "0.97" } ] ``` @@ -288,7 +307,7 @@ to update the url of ldn notify service { "op": "replace", "path": "/url", - "value": "url value" + "value": "https://service-name.org/about" } ] ``` @@ -574,9 +593,9 @@ A sample search would be `/server/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=ser "id" : 1, "name" : "service name one", "description" : "service description one", - "url" : "service url one", - "ldnUrl" : "service_ldn_url", - "score" : "service score one", + "url" : "https://service-one.org/about", + "ldnUrl" : "https://service-one.org/ldn-inbox", + "score" : "0.57", "enabled" : true, "notifyServiceInboundPatterns" : [ @@ -640,10 +659,10 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "id" : 2, "name" : "service name two", "description" : "service description two", - "url" : "https://service2.ldn.org/about", - "ldnUrl" : "https://service2.ldn.org/inbox", - "score" : "service score two", - "enabled" : false, + "url" : "https://service-two.org/about", + "ldnUrl" : "https://service-two.org/ldn-inbox", + "score" : "0.34", + "enabled" : true, "notifyServiceInboundPatterns" : [ { "pattern" : "review", "constraint" : "itemFilterA", From e0d235401861b71213874534ef91af67d9834778 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Fri, 10 Nov 2023 14:41:20 +0100 Subject: [PATCH 24/31] CST-11045 Updated reference to the services to use the new id --- ldnservices.md | 8 ++++---- submissioncoarnotifyconfigs.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index ea516a4f..580fc424 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -573,7 +573,7 @@ Return codes: Parameters: * The `pattern` the inbound pattern of the LDN notify service -A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pattern=review' +A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pattern=request-review' ```json { @@ -586,7 +586,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "ldnUrl" : "https://service.ldn.org/inbox", "enabled" : false, "notifyServiceInboundPatterns" : [ { - "pattern" : "review", + "pattern" : "request-review", "constraint" : "itemFilterA", "automatic" : false } ], @@ -605,7 +605,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "ldnUrl" : "https://service2.ldn.org/inbox", "enabled" : false, "notifyServiceInboundPatterns" : [ { - "pattern" : "review", + "pattern" : "request-review", "constraint" : "itemFilterA", "automatic" : false } ], @@ -620,7 +620,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa }, "_links" : { "self" : { - "href" : "http://localhost/api/ldn/ldnservices/search/byInboundPattern?pattern=review" + "href" : "http://localhost/api/ldn/ldnservices/search/byInboundPattern?pattern=request-review" } }, "page" : { diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md index d3d7dcfb..907deea3 100644 --- a/submissioncoarnotifyconfigs.md +++ b/submissioncoarnotifyconfigs.md @@ -17,7 +17,7 @@ Returns the list of configured COAR notify patterns to be offered during the sub "_embedded" : { "submissioncoarnotifyconfigs" : [ { "id" : "coarnotify", - "patterns" : [ "review", "endorsement", "ingest" ], + "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { @@ -54,7 +54,7 @@ Provide detailed information about a specific COAR notify. ```json { "id" : "coarnotify", - "patterns" : [ "review", "endorsement", "ingest" ], + "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { From 311c5aa37a6355659540761b473097b4c68eb412 Mon Sep 17 00:00:00 2001 From: Stefano Maffei Date: Thu, 16 Nov 2023 17:14:07 +0100 Subject: [PATCH 25/31] [CST-12469] fixed score number --- ldnservices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldnservices.md b/ldnservices.md index d9b55e55..79960e0c 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -641,7 +641,7 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "description" : "service description one", "url" : "https://service.ldn.org/about", "ldnUrl" : "https://service.ldn.org/inbox", - "score" : "service score one", + "score" : "0.675", "enabled" : false, "notifyServiceInboundPatterns" : [ { "pattern" : "review", @@ -695,4 +695,4 @@ Return codes: * 200 OK - if the operation succeed * 400 Bad Request - if the pattern parameter is missing or invalid * 401 Unauthorized - if you are not authenticated -* 403 Forbidden is not possible because it is restricted to authenticated users \ No newline at end of file +* 403 Forbidden is not possible because it is restricted to authenticated users From 492b816441dc820de03e72669afcad8636cf7825 Mon Sep 17 00:00:00 2001 From: frabacche Date: Wed, 22 Nov 2023 16:53:12 +0100 Subject: [PATCH 26/31] CST-12757 notifyrequests service --- ldnservices.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index fdbeaaf4..3a9b9420 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -696,3 +696,39 @@ Return codes: * 400 Bad Request - if the pattern parameter is missing or invalid * 401 Unauthorized - if you are not authenticated * 403 Forbidden is not possible because it is restricted to authenticated users + + +## Search methods +### notifyrequests +**/api/ldn/notifyrequests/<:itemUUID>** + +Parameters: +* The `itemUUID` is the uuid of the item + +A sample search would be `/server/api/ldn/notifyrequests/_itemuuid_' + +```json +{ + "notifyStatus": [ + { + "serviceName": "NS", + "serviceUrl": "2f4ec582-109e-4952-a94a-b7d7615a8c69", + "status": "REJECTED" + } + ], + "itemuuid": "_itemuuid_", + "type": "notifyrequests", + "_links": { + "self": { + "href": "http://localhost:8080/server/api/ldn/notifyrequests/ldn/org.dspace.app.rest.model.NotifyRequestStatusRest@31a86e42" + } + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the itemuuid parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users + From be59f8f537ca2ce5550fb1278720ef6f164de3b0 Mon Sep 17 00:00:00 2001 From: frabacche Date: Wed, 22 Nov 2023 16:54:36 +0100 Subject: [PATCH 27/31] CST-12757 notifyrequests service --- ldnservices.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index fdbeaaf4..2362ccea 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -696,3 +696,39 @@ Return codes: * 400 Bad Request - if the pattern parameter is missing or invalid * 401 Unauthorized - if you are not authenticated * 403 Forbidden is not possible because it is restricted to authenticated users + + +## Notify Requests for specific item +### notifyrequests +**/api/ldn/notifyrequests/<:itemUUID>** + +Parameters: +* The `itemUUID` is the uuid of the item + +A sample search would be `/server/api/ldn/notifyrequests/_itemuuid_' + +```json +{ + "notifyStatus": [ + { + "serviceName": "NS", + "serviceUrl": "2f4ec582-109e-4952-a94a-b7d7615a8c69", + "status": "REJECTED" + } + ], + "itemuuid": "_itemuuid_", + "type": "notifyrequests", + "_links": { + "self": { + "href": "http://localhost:8080/server/api/ldn/notifyrequests/ldn/org.dspace.app.rest.model.NotifyRequestStatusRest@31a86e42" + } + } +} +``` + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the itemuuid parameter is missing or invalid +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden is not possible because it is restricted to authenticated users + From 22ecdaf656526fef246827f3cca1f0ed97fb5056 Mon Sep 17 00:00:00 2001 From: mohamed eskander Date: Fri, 12 Jan 2024 14:27:52 +0200 Subject: [PATCH 28/31] [CST-13257] added lowerIp and upperIpd --- ldnservices.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/ldnservices.md b/ldnservices.md index 828ab132..8ff14b8f 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -25,6 +25,8 @@ Return codes: "ldnUrl" : "https://service-name.org/ldn-inbox", "enabled" : true, "score" : "0.375", + "lowerIp" : "192.168.0.1", + "upperIp" : "192.168.0.5", "notifyServiceInboundPatterns" : [ { @@ -65,6 +67,8 @@ Status codes: * ldnUrl: the URL of the LDN Inbox * enabled: This proeprty is a simple boolean, it defines if the service is selected as one of the active ones * score: This property defines to the safety score assigned by the user +* lowerIp: This property defines to the lowerIp of the ip range +* upperIp: This property defines to upperIp of the ip range * inboundPatterns: an array that contains inbound pattern defined by 3 properties: * pattern: the defining pattern name for the pattern itself * constraint: a filter put in place during the pattern creation @@ -89,6 +93,8 @@ Only administrator users can create LDN notify service. The content-type is JSON "ldnUrl": "https://service-name.org/ldn-inbox", "score" : "0.765", "enabled" : true, + "lowerIp" : "192.168.0.1", + "upperIp" : "192.168.0.5", "notifyServiceInboundPatterns": [ {"pattern":"patternA","constraint":"itemFilterA","automatic":true}, @@ -324,6 +330,29 @@ to update enabled of ldn notify service ] ``` +to update the lowerIp of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/lowerIp", + "value": "192.168.0.1" + } +] +``` +to update the upperIp of ldn notify service + +```json +[ + { + "op": "replace", + "path": "/upperIp", + "value": "192.168.0.5" + } +] +``` + to replace all inboundPatterns of ldn notify service, if value contains an empty array all inboundPatterns will be removed @@ -436,7 +465,7 @@ to replace constraint of specific outboundPattern of ldn notify service ### Remove -to remove name or ldnUrl from ldn notify service +to remove name or ldnUrl or lowerIp or upperIp from ldn notify service ```json [ @@ -456,6 +485,24 @@ to remove name or ldnUrl from ldn notify service ] ``` +```json +[ + { + "op": "remove", + "path": "/lowerIp" + } +] +``` + +```json +[ + { + "op": "remove", + "path": "/upperIp" + } +] +``` + status codes: * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions. Only administrators @@ -597,6 +644,8 @@ A sample search would be `/server/api/ldn/ldnservices/search/byLdnUrl?ldnUrl=ser "ldnUrl" : "https://service-one.org/ldn-inbox", "score" : "0.57", "enabled" : true, + "lowerIp" : "192.168.0.1", + "upperIp" : "192.168.0.5", "notifyServiceInboundPatterns" : [ { @@ -643,6 +692,8 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "ldnUrl" : "https://service.ldn.org/inbox", "score" : "0.675", "enabled" : false, + "lowerIp" : "192.168.0.1", + "upperIp" : "192.168.0.5", "notifyServiceInboundPatterns" : [ { "pattern" : "request-review", "constraint" : "itemFilterA", @@ -663,6 +714,8 @@ A sample search would be `/server/api/ldn/ldnservices/search/byInboundPattern?pa "ldnUrl" : "https://service-two.org/ldn-inbox", "score" : "0.34", "enabled" : true, + "lowerIp" : "192.168.0.1", + "upperIp" : "192.168.0.5", "notifyServiceInboundPatterns" : [ { "pattern" : "request-review", "constraint" : "itemFilterA", From d5ebffbe7abed5337cf958a34d39e66712468114 Mon Sep 17 00:00:00 2001 From: mohamed eskander Date: Wed, 3 Jan 2024 14:59:29 +0200 Subject: [PATCH 29/31] refactoring --- submissioncoarnotifyconfigs.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md index 907deea3..ed995652 100644 --- a/submissioncoarnotifyconfigs.md +++ b/submissioncoarnotifyconfigs.md @@ -17,7 +17,16 @@ Returns the list of configured COAR notify patterns to be offered during the sub "_embedded" : { "submissioncoarnotifyconfigs" : [ { "id" : "coarnotify", - "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], + "patterns" : [ { + "pattern" : "request-review", + "multipleRequest" : true + }, { + "pattern" : "request-endorsement", + "multipleRequest" : true + }, { + "pattern" : "request-ingest", + "multipleRequest" : false + } ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { @@ -54,7 +63,16 @@ Provide detailed information about a specific COAR notify. ```json { "id" : "coarnotify", - "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], + "patterns" : [ { + "pattern" : "request-review", + "multipleRequest" : true + }, { + "pattern" : "request-endorsement", + "multipleRequest" : true + }, { + "pattern" : "request-ingest", + "multipleRequest" : false + } ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { From 90828313728135248031c31f19e81a6cbc284ffb Mon Sep 17 00:00:00 2001 From: frabacche Date: Wed, 17 Jan 2024 14:19:14 +0100 Subject: [PATCH 30/31] COAR qualityassuranceevents add endpoint findByCurrentUser --- qualityassuranceevents.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qualityassuranceevents.md b/qualityassuranceevents.md index df9e1fb5..0798ee56 100644 --- a/qualityassuranceevents.md +++ b/qualityassuranceevents.md @@ -123,3 +123,19 @@ Return codes: ### To replace a related item Replacing a related item will require deleting the related association and creating a new association hereafter + +### Get qualityassuranceevents created by the current user +**GET /api/integration/qualityassuranceevents/search/findByCurrentUser?target=<:item-uuid>[&size=10&page=0]** + +It returns the list of qa events created from the current user + +The supported parameters are: +* target: mandatory. The uuid of the item target of the returned quality assurance events +* page, size [see pagination](README.md#Pagination) + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the target parameter is missing or is not a UUID +* 422 Unprocessable Entity - it the target parameter doesn't resolve to a valid item + +Provide paginated list of the qa events for the specified target item created by the current user. An empty page is returned for unauthenticated users From 1fe3ecec240cc981ae814b3c36d22a7405b1a20e Mon Sep 17 00:00:00 2001 From: frabacche Date: Wed, 14 Feb 2024 11:50:13 +0100 Subject: [PATCH 31/31] coar-notify-7 add /ldn/inbox endpoint description --- ldnservices.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/ldnservices.md b/ldnservices.md index 8ff14b8f..303940d6 100644 --- a/ldnservices.md +++ b/ldnservices.md @@ -1,6 +1,68 @@ # LDN Notify Services Endpoints [Back to the list of all defined endpoints](endpoints.md) +## Inbox Endpoint +**/api/ldn/inbox** + +Active only if config ldn.enabled is true. This is the inbox of Notification json +(see org.dspace.app.ldn.model.Notification model): when accepted an instance +of LdnMessageEntity is created and stored. See documentation at: +https://wiki.lyrasis.org/pages/viewpage.action?pageId=319815713 +where json Notification examples are shared into a ready-to-use PostMan collection. + +```json +{ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://purl.org/coar/notify" + ], + "actor": { + "id": "https://research-organisation.org", + "name": "Research Organisation", + "type": "Organization" + }, + "context": { + "id": "http://localhost:4000/handle/123456789/1119", + "ietf:cite-as": "https://doi.org/10.5555/12345680", + "type": "sorg:AboutPage", + "url": { + "id": "https://another-research-organisation.org/repository/datasets/item/201203421/data_archive.zip", + "mediaType": "application/zip", + "type": [ + "Article", + "sorg:Dataset" + ] + } + }, + "id": "urn:uuid:2f4ec582-109e-4952-a94a-b7d7615a8c69", + "object": { + "as:object": "newValue", + "as:relationship": "somethingElse", + "as:subject": "https://research-organisation.org/repository/item/201203/421/", + "id": "http://localhost:4000/handle:123456789/1119", + "type": "Relationship" + }, + "origin": { + "id": "https://research-organisation.org/repository", + "inbox": "2f4ec582-109e-4952-a94a-b7d7615a8c69", + "type": "Service" + }, + "target": { + "id": "https://another-research-organisation.org/repository", + "inbox": "https://another-research-organisation.org/inbox/", + "type": "Service" + }, + "type": [ + "Announce", + "coar-notify:RelationshipAction" + ] +} +``` +Return codes: +* 200 OK - if the operation succeed, respose echoes the same id in the request +* 422 Unprocessable Entity - if Error parsing request body +* 500 Forbidden is not possible because it is restricted to authenticated users + ## Main Endpoint **/api/ldn/ldnservices**