diff --git a/docs/index.rst b/docs/index.rst
index cadf564..3058778 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,9 +1,3 @@
-.. Social Service Client documentation master file, created by
- sphinx-quickstart on Tue Aug 2 16:11:12 2022.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-
Welcome to gCat documentation!
=================================================
@@ -70,8 +64,8 @@ To be RESTful compliant, gCat uses standard HTTP Methods to perform a listing of
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
| Operation | HTTP Method | URL | Success HTTP Status | Safe | Idempotent |
+==============+=============+========================================+=====================+========+============+
- | Supported | OPTIONS | /{COLLECTION} | 204 No Content ‡ | Y | Y |
- | HTTP Methods | | | | | |
+ | Supported | OPTIONS | /{COLLECTION} | 204 No Content | Y | Y |
+ | HTTP Methods | | | [#allow]_ | | |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
| List | GET | /{COLLECTION} | 200 OK | Y | Y |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
@@ -81,8 +75,8 @@ To be RESTful compliant, gCat uses standard HTTP Methods to perform a listing of
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
| Create | POST | /{COLLECTION} | 201 Created | N | N |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
- | Supported | OPTIONS | /{COLLECTION}/{INSTANCE_ID} | 204 No Content ‡ | Y | Y |
- | HTTP Methods | | | | | |
+ | Supported | OPTIONS | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | Y | Y |
+ | HTTP Methods | | | [#allow]_ | | |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
| Exist | HEAD | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | Y | Y |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
@@ -92,33 +86,37 @@ To be RESTful compliant, gCat uses standard HTTP Methods to perform a listing of
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
| Patch | PATCH | /{COLLECTION}/{INSTANCE_ID} | 200 OK | N | Y |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
- | Delete | DELETE | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | N | N ‡‡ |
+ | Delete | DELETE | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | N | N [#del]_ |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
- | Purge | DELETE | /{COLLECTION}/{INSTANCE_ID}?purge=true | 204 No Content | N | N ‡‡ |
+ | Purge | DELETE | /{COLLECTION}/{INSTANCE_ID}?purge=true | 204 No Content | N | N [#del]_ |
+ +-------------+----------------------------------------+---------------------+--------+------------+
- | | PURGE | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | N | N ‡‡ |
+ | | PURGE | /{COLLECTION}/{INSTANCE_ID} | 204 No Content | N | N [#del]_ |
+--------------+-------------+----------------------------------------+---------------------+--------+------------+
+
+.. [#allow] Supported HTTP Methods in **Allow** HTTP Header
-‡ Supported HTTP Methods in **Allow** HTTP Header
+.. [#del] DELETE has been defined as idempotent.
+
+ *Allamaraju* [#Allamaraju]_ argues that DELETE idempotency should be accomplished client-side.
+ The server should inform the client if a delete succeeded because the resource was really deleted or it was not found i.e., **404 Not Found** error is suggested instead of **204 No Content**.
+ The latter situation should be treated as idempotent by the client.
+
+ We share the same vision. For this reason, gCat does not provide server-side idempotency for DELETE and PURGE operations.
-‡‡ DELETE has been defined as idempotent.
-
-*Allamaraju* argues that DELETE idempotency should be accomplished client-side.
-The server should inform the client if a delete succeeded because the resource was really deleted or it was not found i.e., *404 Not Found* error is suggested instead of *204 No Content*.
-The latter situation should be treated as idempotent by the client.
-
-We share the same vision.
-For this reason, gCat does not provide server-side idempotency for DELETE and PURGE operations.
-
-:Allamaraju: Allamaraju S. RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity . O’Reilly. first ed. 2010
+.. [#Allamaraju] Allamaraju S. RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity . O’Reilly. first ed. 2010
-About URL:
+About URL
+'''''''''
-* {COLLECTION} is the plural name of the entity type;
-* {INSTANCE_ID} is an identification which enables to univocally identify the instance in the collection.
+The presented URL uses the following convention:
-About Safety and Idempotency properties:
+* **{COLLECTION}** is the plural name of the entity type;
+* **{INSTANCE_ID}** is an identification which enables to univocally identify the instance in the collection.
+
+
+About Safety and Idempotency properties
+'''''''''
* A method is *Safe* if it does not produce any side effects.
"This does not prevent an implementation from including behaviour that is potentially harmful, that is not entirely read-only, or that causes side effects while invoking a safe method"
@@ -131,12 +129,14 @@ You can find more information about HTTP Methods at `
* The listing API provides paginated results by using the query parameters limit and offset.
* The listing method offers options to filter the results, thus enacting to search for items including spatial search (see ext_bbox below).
* It returns an array list of string containing the ids (i.e. names) of the items.
- * Each name can be used as {ITEM_ID_PARAMETER}
path parameter to manage such item.
+ * Each name can be used as {ITEM_ID}
path parameter to manage such item.
* Filtering options
+ * Filtering options
*
* Basic Filtering options
*
*
*
- *
* If True, private datasets will be included in the results.
- * Only private datasets from the user’s organizations will be returned. For the sysadmins will be returned all private datasets.
- * Optional, the default is False.
+ * Only private datasets from the user’s organizations will be returned. For the sysadmins will be returned all private datasets.
* E.g. /items?include_private=true
*
* The coordinates of the upper-right and bottom-left angle of a rectangular to query for.
@@ -72,34 +74,15 @@ public class Item extends REST
* If True, only the items of the requester user will be included in the result.
- * E.g. /items?limit=10&offset=0&own_only=true>
- *
/items?limit=10&offset=0&all_fields=true
+ * E.g. /items?limit=10&offset=0&own_only=true
* Moderated Catalog filtering options
- *
- *
- *
- * It has sense only for moderated catalogs.
- * It can assume the following values: pending
; rejected
; approved
.
- * If null return both approved items and items which have been published before the activation of the moderation.
- *
* It accepts the following query parameters (a subset of Solr search query parameters, see Solr Query Syntax): *
@@ -112,21 +95,21 @@ public class Item extends REST/items?q=extras_systemtype:MyProfile
returns the items having the profile MyProfile
*
*
- * /items?q=title:foo&fq=notes:bar
returns with word "foo" in the 'title' and the word "bar" in the 'notes'.
* /items?q=title:foo&fq_list=...
returns the items with word "foo" in the 'title'.
* approved
after the moderation activation.
+ *
+ * It can assume the following values:
+ * pending
: it returns only the pending items, i.e. the item published by any allowed users and still not moderated;rejected
: it returns only the rejected items, i.e. the item published by any allowed users and rejected by a moderator;approved
: it returns only the approved items, i.e. the item published by any allowed users and approved by a moderated.
+ * Please note that only Catalogue-Moderators can filter items by status.
+ * Other users using this query parameter will get only its own items with such a status in the results.
+ *
+ * The result is by default an array list of string containing the ids (i.e. names) of the items. + * Anyway, there are two options to get a different results. + *
+ */items?limit=10&offset=0&count=true
+ * /items?limit=10&offset=0&all_fields=true
+ *
+ * Please note that, count
query parameter has priority over all_fields
query parameter.
+ * In other words, all_fields
query parameter is not considered is count
query parameter is true.
+ *
["item0","items1",...,"item10"]* * In the case the query parameter
count=true
it returns the total number of items of the query.
* E.g. {"count":148}+ * + * In the case the query parameter
all_fields=true
each element of the resulting array contains the item representation:
+ * E.g.
+ * + * [ + * { + * "name"="item0", + * ..., + * "private": false, + * "license_url": "http://www.opensource.org/licenses/AFL-3.0" + * }, + * { + * "name"="item1", + * ..., + * "private": true, + * "license_url": "http://www.opensource.org/licenses/AFL-3.0" + * }, + * ..., + * { + * "name"="itemN", + * ..., + * "private": false, + * "license_url": "http://www.opensource.org/licenses/AFL-3.0" + * } + * + * ]*/ @GET @Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8) /* Catalogue-Member is not added to VRE members and is assumed as the default role in the catalogue for the VRE members. So we can't enforce * @AuthorizationControl(allowedRoles={Role.CATALOGUE_MEMBER, Role.CATALOGUE_EDITOR, Role.CATALOGUE_ADMIN, Role.CATALOGUE_MANAGER}, exception=NotAuthorizedException.class) */ + @Override public String list(@QueryParam(GCatConstants.LIMIT_QUERY_PARAMETER) @DefaultValue("10") int limit, - @QueryParam(GCatConstants.OFFSET_QUERY_PARAMETER) @DefaultValue("0") int offset, - @QueryParam(GCatConstants.COUNT_QUERY_PARAMETER) @DefaultValue("false") Boolean count) { - if(count) { + @QueryParam(GCatConstants.OFFSET_QUERY_PARAMETER) @DefaultValue("0") int offset) { + + Boolean countOnly = false; + MultivaluedMap