diff --git a/docs/index.rst b/docs/index.rst index a7dec56..9bb4ca0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -198,16 +198,16 @@ The VRE Manager can only assign roles. The catalogue uses the following hierarchic roles: -Catalogue-Member: +**Catalogue-Member**: A user with such a role is mainly capable of listing and reading items; -Catalogue-Editor: +**Catalogue-Editor**: A user with such a role is capable of managing the items he/she creates and capable of using other safe APIs; -Catalogue-Admin: +**Catalogue-Admin**: A user with such a role is capable of administrating many aspects of the catalogue; -Catalogue-Manager: +**Catalogue-Manager**: A user with such a role can use all the APIs exposed by the service except item moderation APIs (e.g. approve, reject, ...). @@ -225,18 +225,18 @@ Moderated Catalogues Any catalogues can be declared as moderated. -This means that, a Catalogue-Moderator must approve any submitted items to make them available to the other users of the catalogue. +This means that, a **Catalogue-Moderator** must approve any submitted items to make them available to the other users of the catalogue. In a moderated catalogue, an item can be in the following states: -pending: +**pending**: The item published by any allowed author (a Catalogue-Editor or above) but not available to the other users of the catalogue. A Catalogue-Moderator has to approve or reject it; -approved: +**approved**: A Catalogue-Moderator has approved the item published by any allowed users; -rejected: +**rejected**: A Catalogue-Moderator has rejected the item published by any allowed users. diff --git a/src/main/java/org/gcube/gcat/rest/Configuration.java b/src/main/java/org/gcube/gcat/rest/Configuration.java index 46c9dbe..c300ef6 100644 --- a/src/main/java/org/gcube/gcat/rest/Configuration.java +++ b/src/main/java/org/gcube/gcat/rest/Configuration.java @@ -37,13 +37,16 @@ import org.gcube.gcat.persistence.ckan.CKANUserCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; import com.webcohesion.enunciate.metadata.rs.ResponseCode; import com.webcohesion.enunciate.metadata.rs.StatusCodes; +import com.webcohesion.enunciate.metadata.swagger.OperationId; /** * @author Luca Frosini (ISTI - CNR) */ @Path(Configuration.CONFIGURATIONS) +@ResourceLabel("Configuration APIs") public class Configuration extends BaseREST implements org.gcube.gcat.api.interfaces.Configuration { private static Logger logger = LoggerFactory.getLogger(Configuration.class); @@ -423,6 +426,7 @@ public class Configuration extends BaseREST implements org.gcube.gcat.api.interf @ResponseCode(code = 401, condition = "Only Catalogue-Managers can create/update catalogue configuration."), @ResponseCode(code = 500, condition = "Error while creating/updating catalogue configuration."), }) + @OperationId("Create or Update") public String createOrUpdate(@PathParam(CONTEXT_FULLNAME_PARAMETER) String context, String json) throws WebServiceException { try { ServiceCatalogueConfiguration catalogueConfiguration = ServiceCatalogueConfiguration.getServiceCatalogueConfiguration(json); @@ -614,6 +618,7 @@ public class Configuration extends BaseREST implements org.gcube.gcat.api.interf * @throws WebServiceException * * @pathExample /configurations/CURRENT_CONTEXT + * */ @PURGE @Path("/{" + CONTEXT_FULLNAME_PARAMETER + "}") diff --git a/src/main/java/org/gcube/gcat/rest/Group.java b/src/main/java/org/gcube/gcat/rest/Group.java index 7434ad4..902b323 100644 --- a/src/main/java/org/gcube/gcat/rest/Group.java +++ b/src/main/java/org/gcube/gcat/rest/Group.java @@ -21,10 +21,13 @@ import org.gcube.gcat.api.GCatConstants; //import org.gcube.gcat.api.roles.Role; import org.gcube.gcat.persistence.ckan.CKANGroup; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(Group.GROUPS) +@ResourceLabel("Group APIs") public class Group extends REST implements org.gcube.gcat.api.interfaces.Group { protected static final String GROUP_ID_PARAMETER = "GROUP_ID"; diff --git a/src/main/java/org/gcube/gcat/rest/Item.java b/src/main/java/org/gcube/gcat/rest/Item.java index 21edf18..b1a3d02 100644 --- a/src/main/java/org/gcube/gcat/rest/Item.java +++ b/src/main/java/org/gcube/gcat/rest/Item.java @@ -27,6 +27,8 @@ import org.gcube.gcat.persistence.ckan.CKANPackage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.webcohesion.enunciate.metadata.rs.ResourceGroup; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; import com.webcohesion.enunciate.metadata.rs.ResponseCode; import com.webcohesion.enunciate.metadata.rs.StatusCodes; @@ -34,6 +36,8 @@ import com.webcohesion.enunciate.metadata.rs.StatusCodes; * @author Luca Frosini (ISTI - CNR) */ @Path(Item.ITEMS) +@ResourceGroup("Item APIs") +@ResourceLabel("Item APIs") public class Item extends REST implements org.gcube.gcat.api.interfaces.Item { private final Logger logger = LoggerFactory.getLogger(Item.class); diff --git a/src/main/java/org/gcube/gcat/rest/License.java b/src/main/java/org/gcube/gcat/rest/License.java index 1c33254..e82bbe0 100644 --- a/src/main/java/org/gcube/gcat/rest/License.java +++ b/src/main/java/org/gcube/gcat/rest/License.java @@ -7,10 +7,13 @@ import javax.ws.rs.Produces; import org.gcube.gcat.api.GCatConstants; import org.gcube.gcat.persistence.ckan.CKANLicense; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(License.LICENSES) +@ResourceLabel("License APIs") public class License extends REST implements org.gcube.gcat.api.interfaces.License { public License() { diff --git a/src/main/java/org/gcube/gcat/rest/Namespace.java b/src/main/java/org/gcube/gcat/rest/Namespace.java index 5efb49f..25494e1 100644 --- a/src/main/java/org/gcube/gcat/rest/Namespace.java +++ b/src/main/java/org/gcube/gcat/rest/Namespace.java @@ -14,10 +14,13 @@ import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.NamespaceCategory; import org.gcube.gcat.api.GCatConstants; import org.gcube.gcat.profile.MetadataUtility; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(Namespace.NAMESPACES) +@ResourceLabel("Namespace APIs") public class Namespace extends BaseREST implements org.gcube.gcat.api.interfaces.Namespace { @GET diff --git a/src/main/java/org/gcube/gcat/rest/Profile.java b/src/main/java/org/gcube/gcat/rest/Profile.java index 739f9b3..e31c256 100644 --- a/src/main/java/org/gcube/gcat/rest/Profile.java +++ b/src/main/java/org/gcube/gcat/rest/Profile.java @@ -31,10 +31,13 @@ import org.gcube.gcat.api.GCatConstants; import org.gcube.gcat.profile.ISProfile; import org.xml.sax.SAXException; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(Profile.PROFILES) +@ResourceLabel("Profile APIs") public class Profile extends BaseREST implements org.gcube.gcat.api.interfaces.Profile { public static final String PROFILE_NAME_PARAMETER = "PROFILE_NAME"; diff --git a/src/main/java/org/gcube/gcat/rest/Resource.java b/src/main/java/org/gcube/gcat/rest/Resource.java index 97e3966..428a918 100644 --- a/src/main/java/org/gcube/gcat/rest/Resource.java +++ b/src/main/java/org/gcube/gcat/rest/Resource.java @@ -19,10 +19,15 @@ import org.gcube.gcat.api.GCatConstants; //import org.gcube.gcat.api.roles.Role; import org.gcube.gcat.persistence.ckan.CKANResource; +import com.webcohesion.enunciate.metadata.rs.ResourceGroup; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(Resource.COLLECTION) +@ResourceGroup("Item APIs") +@ResourceLabel("Item's Resource APIs") public class Resource extends BaseREST implements org.gcube.gcat.api.interfaces.Resource { protected static final String ITEM_ID_PARAMETER = Item.ITEM_ID_PARAMETER; diff --git a/src/main/java/org/gcube/gcat/rest/Trash.java b/src/main/java/org/gcube/gcat/rest/Trash.java index b3b1cfe..1e8d6ef 100644 --- a/src/main/java/org/gcube/gcat/rest/Trash.java +++ b/src/main/java/org/gcube/gcat/rest/Trash.java @@ -17,10 +17,15 @@ import org.gcube.gcat.api.GCatConstants; //import org.gcube.gcat.api.roles.Role; import org.gcube.gcat.persistence.ckan.CKANPackageTrash; +import com.webcohesion.enunciate.metadata.rs.ResourceGroup; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(Trash.TRASH) +@ResourceGroup("Item APIs") +@ResourceLabel("Item's Trash APIs") public class Trash extends BaseREST implements org.gcube.gcat.api.interfaces.Trash { diff --git a/src/main/java/org/gcube/gcat/rest/User.java b/src/main/java/org/gcube/gcat/rest/User.java index 919ba49..1d10980 100644 --- a/src/main/java/org/gcube/gcat/rest/User.java +++ b/src/main/java/org/gcube/gcat/rest/User.java @@ -23,10 +23,13 @@ import org.gcube.gcat.api.roles.Role; import org.gcube.gcat.persistence.ckan.CKANUser; import org.gcube.gcat.persistence.ckan.CKANUserCache; +import com.webcohesion.enunciate.metadata.rs.ResourceLabel; + /** * @author Luca Frosini (ISTI - CNR) */ @Path(User.USERS) +@ResourceLabel("User APIs") public class User extends REST implements org.gcube.gcat.api.interfaces.User { protected static final String GCUBE_USERNAME_PARAMETER = "GCUBE_USERNAME";