Improving documentation

This commit is contained in:
Luca Frosini 2022-09-28 14:45:02 +02:00
parent 7e0c035647
commit e86e9d0581
10 changed files with 42 additions and 8 deletions

View File

@ -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.

View File

@ -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<Response,Response> {
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 + "}")

View File

@ -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<CKANGroup> implements org.gcube.gcat.api.interfaces.Group<Response,Response> {
protected static final String GROUP_ID_PARAMETER = "GROUP_ID";

View File

@ -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<CKANPackage> implements org.gcube.gcat.api.interfaces.Item<Response,Response> {
private final Logger logger = LoggerFactory.getLogger(Item.class);

View File

@ -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<CKANLicense> implements org.gcube.gcat.api.interfaces.License {
public License() {

View File

@ -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

View File

@ -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<Response,Response> {
public static final String PROFILE_NAME_PARAMETER = "PROFILE_NAME";

View File

@ -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<Response,Response> {
protected static final String ITEM_ID_PARAMETER = Item.ITEM_ID_PARAMETER;

View File

@ -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<Response> {

View File

@ -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<CKANUser> implements org.gcube.gcat.api.interfaces.User<Response,Response> {
protected static final String GCUBE_USERNAME_PARAMETER = "GCUBE_USERNAME";