Improving documentation
This commit is contained in:
parent
3b2f91a9ee
commit
2253c4445a
|
@ -95,48 +95,84 @@ public class Configuration extends BaseREST implements org.gcube.gcat.api.interf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the catalogue configuration for the current context using the json
|
||||||
|
* provided as request body.
|
||||||
|
*
|
||||||
|
* Let consider the following example:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* "context": "/gcube/devsec/devVRE",
|
||||||
|
* "defaultOrganization": "devvre",
|
||||||
|
* "supportedOrganizations": [ "devvre" "nextnext" ],
|
||||||
|
* "sysAdminToken": "SYS_ADMIN_TOKEN_HERE",
|
||||||
|
* "ckanURL": "https://ckan-d-d4s.d4science.org",
|
||||||
|
* "solrURL": "https://ckan-d-d4s.d4science.org/solr/",
|
||||||
|
* "socialPostEnabled": false,
|
||||||
|
* "notificationToUsersEnabled": true,
|
||||||
|
* "moderationEnabled": true,
|
||||||
|
* "ckanDB": {
|
||||||
|
* "url": "jdbc:postgresql://ckan-d-d4s.d4science.org:5432/ckan_dev",
|
||||||
|
* "username": "ckan",
|
||||||
|
* "password": "PWD_HERE"
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* We have the following properties:
|
||||||
|
*
|
||||||
|
* <dl>
|
||||||
|
* <dt>context (string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">defaultOrganization (string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">supportedOrganizations (array of string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">sysAdminToken (string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">ckanURL (string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">solrURL (string)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">socialPostEnabled (bool)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">notificationToUsersEnabled (bool)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">moderationEnabled (bool)</dt>
|
||||||
|
* <dd>;</dd>
|
||||||
|
*
|
||||||
|
* <dt style="margin-top: 5px;">ckanDB (object)</dt>
|
||||||
|
* <dd>
|
||||||
|
* </dd>
|
||||||
|
*
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @param json the configuration representation
|
||||||
|
* @return the created configuration
|
||||||
|
* @throws WebServiceException when the request fails
|
||||||
|
*
|
||||||
|
* @requestExample application/json;charset=UTF-8 classpath:/api-docs-examples/configuration/create-configuration-request.json
|
||||||
|
* @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/configuration/create-configuration-response.json
|
||||||
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Consumes(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8)
|
@Consumes(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8)
|
||||||
@Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8)
|
@Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8)
|
||||||
@Override
|
|
||||||
// @AuthorizationControl(allowedRoles={Role.CATALOGUE_MANAGER}, exception=NotAuthorizedException.class)
|
|
||||||
@StatusCodes ({
|
@StatusCodes ({
|
||||||
@ResponseCode(code = 201, condition = "Catalogue configuration successfully created."),
|
@ResponseCode(code = 201, condition = "Catalogue configuration successfully created."),
|
||||||
@ResponseCode(code = 401, condition = "Only Catalogue-Managers can create catalogue configuration."),
|
@ResponseCode(code = 401, condition = "Only Catalogue-Managers can create catalogue configuration."),
|
||||||
@ResponseCode(code = 500, condition = "Error while persisting catalogue configuration."),
|
@ResponseCode(code = 500, condition = "Error while persisting catalogue configuration."),
|
||||||
})
|
})
|
||||||
/**
|
@Override
|
||||||
* Creates the catalogue configuration for the current context using the json provided as parameter
|
// @AuthorizationControl(allowedRoles={Role.CATALOGUE_MANAGER}, exception=NotAuthorizedException.class)
|
||||||
* @param json the configuration representation
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* "id": "584b8503-a490-4a89-8372-e21830fa716c",
|
|
||||||
* "context": "/gcube/devsec/devVRE",
|
|
||||||
* "defaultOrganization": "devvre",
|
|
||||||
* "supportedOrganizations": [ "devvre" ],
|
|
||||||
* "ckanURL": "https://ckan-d-d4s.d4science.org",
|
|
||||||
* "solrURL": "https://ckan-d-d4s.d4science.org/solr/",
|
|
||||||
* "socialPostEnabled": false,
|
|
||||||
* "notificationToUsersEnabled": true,
|
|
||||||
* "moderationEnabled": true
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* @return the created configuration
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* "id": "584b8503-a490-4a89-8372-e21830fa716c",
|
|
||||||
* "context": "/gcube/devsec/devVRE",
|
|
||||||
* "defaultOrganization": "devvre",
|
|
||||||
* "supportedOrganizations": [ "devvre" ],
|
|
||||||
* "ckanURL": "https://ckan-d-d4s.d4science.org",
|
|
||||||
* "solrURL": "https://ckan-d-d4s.d4science.org/solr/",
|
|
||||||
* "socialPostEnabled": false,
|
|
||||||
* "notificationToUsersEnabled": true,
|
|
||||||
* "moderationEnabled": true
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* @throws WebServiceException
|
|
||||||
*/
|
|
||||||
public Response create(String json) throws WebServiceException {
|
public Response create(String json) throws WebServiceException {
|
||||||
try {
|
try {
|
||||||
ServiceCatalogueConfiguration catalogueConfiguration = ServiceCatalogueConfiguration.getServiceCatalogueConfiguration(json);
|
ServiceCatalogueConfiguration catalogueConfiguration = ServiceCatalogueConfiguration.getServiceCatalogueConfiguration(json);
|
||||||
|
|
|
@ -321,7 +321,7 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
* <h3>Parameter automatically managed:</h3>
|
* <h3>Parameter automatically managed:</h3>
|
||||||
* <dl>
|
* <dl>
|
||||||
*
|
*
|
||||||
* <dt style="margin-top: 5px;">author (string)</dt>
|
* <dt>author (string)</dt>
|
||||||
* <dd>the name of the item’s author (the owner of the gcube-token);</dd>
|
* <dd>the name of the item’s author (the owner of the gcube-token);</dd>
|
||||||
*
|
*
|
||||||
* <dt style="margin-top: 5px;">author_email (string)</dt>
|
* <dt style="margin-top: 5px;">author_email (string)</dt>
|
||||||
|
@ -389,8 +389,8 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
* Some operation could continue in background such as the social post creation.
|
* Some operation could continue in background such as the social post creation.
|
||||||
*
|
*
|
||||||
* @pathExample /items?social_post=true
|
* @pathExample /items?social_post=true
|
||||||
* @requestExample application/json;charset=UTF-8 classpath:/create-item-request.json
|
* @requestExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/create-item-request.json
|
||||||
* @responseExample application/json;charset=UTF-8 classpath:/create-item-response.json
|
* @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/create-item-response.json
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
|
@ -407,7 +407,7 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pathExample /items/my_test_item
|
* @pathExample /items/my_test_item
|
||||||
* @responseExample application/json;charset=UTF-8 classpath:/read-item-response.json
|
* @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/read-item-response.json
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
||||||
|
@ -425,8 +425,8 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pathExample /items/my_test_item
|
* @pathExample /items/my_test_item
|
||||||
* @requestExample application/json;charset=UTF-8 classpath:/update-item-request.json
|
* @requestExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/update-item-request.json
|
||||||
* @responseExample application/json;charset=UTF-8 classpath:/update-item-response.json
|
* @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/update-item-response.json
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
||||||
|
@ -443,8 +443,8 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pathExample /items/my_test_item
|
* @pathExample /items/my_test_item
|
||||||
* @requestExample application/json;charset=UTF-8 classpath:/patch-item-request.json
|
* @requestExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/patch-item-request.json
|
||||||
* @responseExample application/json;charset=UTF-8 classpath:/patch-item-response.json
|
* @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/patch-item-response.json
|
||||||
*/
|
*/
|
||||||
@PATCH
|
@PATCH
|
||||||
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
||||||
|
@ -643,7 +643,7 @@ public class Item extends REST<CKANPackage> implements org.gcube.gcat.api.interf
|
||||||
* The operation will continue in background.
|
* The operation will continue in background.
|
||||||
*
|
*
|
||||||
* @pathExample /items/my_test_item
|
* @pathExample /items/my_test_item
|
||||||
* @requestExample application/json;charset=UTF-8 classpath:/reject.json
|
* @requestExample application/json;charset=UTF-8 classpath:/api-docs-examples/item/reject.json
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
@Path("/{" + ITEM_ID_PARAMETER + "}")
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"context": "/gcube/devsec/devVRE",
|
||||||
|
"defaultOrganization": "devvre",
|
||||||
|
"supportedOrganizations": [
|
||||||
|
"nextnext",
|
||||||
|
"devvre"
|
||||||
|
],
|
||||||
|
"sysAdminToken": "SYS_ADMIN_TOKEN_HERE",
|
||||||
|
"ckanURL": "https://ckan-d-d4s.d4science.org",
|
||||||
|
"solrURL": "https://ckan-d-d4s.d4science.org/solr/",
|
||||||
|
"socialPostEnabled": false,
|
||||||
|
"notificationToUsersEnabled": true,
|
||||||
|
"moderationEnabled": false,
|
||||||
|
"ckanDB": {
|
||||||
|
"url": "jdbc:postgresql://ckan-d-d4s.d4science.org:5432/ckan_dev",
|
||||||
|
"username": "ckan",
|
||||||
|
"password": "PWD_HERE"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"id": "584b8503-a490-4a89-8372-e21830fa716c",
|
||||||
|
"context": "/gcube/devsec/devVRE",
|
||||||
|
"defaultOrganization": "devvre",
|
||||||
|
"supportedOrganizations": [
|
||||||
|
"nextnext",
|
||||||
|
"devvre"
|
||||||
|
],
|
||||||
|
"sysAdminToken": "SYS_ADMIN_TOKEN",
|
||||||
|
"ckanURL": "https://ckan-d-d4s.d4science.org",
|
||||||
|
"solrURL": "https://ckan-d-d4s.d4science.org/solr/",
|
||||||
|
"socialPostEnabled": false,
|
||||||
|
"notificationToUsersEnabled": true,
|
||||||
|
"moderationEnabled": false,
|
||||||
|
"ckanDB": {
|
||||||
|
"url": "jdbc:postgresql://ckan-d-d4s.d4science.org:5432/ckan_dev",
|
||||||
|
"username": "ckan",
|
||||||
|
"password": "PWD"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue