Compare commits

...

18 Commits

Author SHA1 Message Date
luca.frosini ad9d5a3776 Ignored MacOs File 2023-06-21 11:38:09 +02:00
Luca Frosini a0ac2b3b9c Removed -SNAPSHOT to release the component 2023-03-03 12:17:32 +01:00
Luca Frosini 0c6ca18b08 Added AUTHOR_FULLNAME metadata key constant 2023-03-01 13:58:24 +01:00
Luca Frosini 13782f02ac Fixed changelog 2023-02-23 16:00:42 +01:00
Luca Frosini 48ac672b9a Updated gcube-bom version 2023-02-23 12:17:43 +01:00
Luca Frosini b56ef53759 Adding new version to export file 2023-02-17 15:21:47 +01:00
Luca Frosini 3620a5918b Fixed changelog 2023-02-17 15:18:10 +01:00
Luca Frosini b7013ce493 Merge remote-tracking branch 'origin/migrating_to_smartgears_4' 2023-02-17 14:17:34 +01:00
Luca Frosini 40082495bd Adding JSON:API support 2023-02-17 14:14:45 +01:00
Luca Frosini 0c405ad0b1 Fixed README and added FUNDING 2023-01-16 19:16:47 +01:00
Luca Frosini a84521a1ef Fixed changelog and added json to publish/export software 2023-01-16 19:04:10 +01:00
Luca Frosini 5c882338d5 Fixed changelog 2023-01-13 14:00:50 +01:00
Luca Frosini d7a1d3bf20 Removed uneeded constant 2022-12-13 11:16:54 +01:00
Luca Frosini 19f0975ce9 Fixed map initialization 2022-12-13 10:51:00 +01:00
Luca Frosini 0dfd0000d9 Added facilities to simplify new IS adoption 2022-12-01 16:18:56 +01:00
Luca Frosini faf102e5d7 Changed solution to support both Smartgears 3 and 4 2022-11-28 14:29:49 +01:00
Luca Frosini ec25766c3b Migrating to smartgears 4 2022-11-16 12:38:31 +01:00
Luca Frosini e95483a15e Switched to ContextBean 2022-11-16 11:46:51 +01:00
9 changed files with 339 additions and 63 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
target
.classpath
.project
/.DS_Store

View File

@ -2,23 +2,31 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for gCube Catalogue (gCat) API
## [v2.3.1]
## [v2.3.2]
- Library modified to be compliant with both Smartgears 3 and 4
- Added support for JSON:API on listing method of 'items' collection [#24601]
- Added support for JSON:API on listing method of 'licenses' collection [#24601]
## [v2.3.1] [r5.14.0] - 2022-12-07
- Added Item Author as system:cm_ metadata to keep track of item author
## [v2.3.0]
## [v2.3.0] [r5.13.1] - 2022-09-19
- Aligned constants name used as query parameters
- Added query parameter constant used in item listing to get the whole item instead of just the name [#23691]
## [v2.2.0]
## [v2.2.0] [r5.11.0] - 2022-05-12
- Added support to manage configurations [#22658]
- Migrated to ServiceClass corresponding to Maven groupId
## [v2.1.0]
## [v2.1.0] [r5.7.0] - 2022-01-27
- Added query parameter social_post_notification to override default VRE behaviour [#21345]
- Added support for moderation [#21342]
@ -26,28 +34,28 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added empty trash API [#13322]
## [v2.0.0]
## [v2.0.0] [r5.2.0] - 2021-05-04
- Changed service class
## [v1.2.2]
## [v1.2.2] [r5.0.0] - 2021-02-24
- Added count method for Item collection [#20627]
- Added count method for Organization, Group and Profile collection [#20629]
- Switched JSON management to gcube-jackson [#19735]
## [v1.2.1] [r4.18.0] - 2019-12-10
## [v1.2.1] [r4.18.0] - 2019-12-20
- Fixed distro files and pom according to new release procedure
## [v1.2.0] [r4.15.0] - 2019-11-06
## [v1.2.0] [r4.15.0] - 2019-11-19
- Added org parameter to support to list item at VO level in gCat Service [#17635]
## [v1.1.0] [r4.14.0] - 2019-05-27
## [v1.1.0] [r4.14.0] - 2019-05-16
- Added Social Post parameter [#13335]

26
FUNDING.md Normal file
View File

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

View File

@ -25,16 +25,14 @@ Tell people how to cite this software.
* Cite an associated paper?
* Use a specific BibTeX entry for the software?
@Manual{,
title = {gCube Catalogue (gCat) API},
author = {{Frosini, Luca}},
organization = {ISTI - CNR},
address = {Pisa, Italy},
year = 2019,
url = {http://www.gcube-system.org/}
}
@software{gcat-api,
author = {{Luca Frosini}},
title = {gCube Catalogue (gCat) API},
abstract = {gCube Catalogue (gCat) API is a library containing classes shared across gcat* components.},
url = {https://doi.org/10.5281/zenodo.7446431},
keywords = {Catalogue, D4Science, gCube}
}
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
@ -46,26 +44,6 @@ open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- DILIGENT (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488);
- D4Science-II (grant no.239019);
- ENVRI (grant no. 283465);
- iMarine(grant no. 283644);
- EUBrazilOpenBio (grant no. 288754).
- the H2020 research and innovation programme
- SoBigData (grant no. 654024);
- PARTHENOS (grant no. 654119);
- EGIEngage (grant no. 654142);
- ENVRIplus (grant no. 654182);
- BlueBRIDGE (grant no. 675680);
- PerformFish (grant no. 727610);
- AGINFRAplus (grant no. 731001);
- DESIRA (grant no. 818194);
- ARIADNEplus (grant no. 823914);
- RISIS2 (grant no. 824091);
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)

248
gcube/gcat-api-export.json Normal file
View File

@ -0,0 +1,248 @@
{
"global": {
"name": "gcat-api",
"group": "data-catalogue",
"title": "gCube Catalogue (gCat) API {{version}}",
"license": {
"id": "EUPL-1.1",
"url": "https://opensource.org/licenses/EUPL-1.1"
},
"keywords": ["gCube", "Catalogue", "D4Science"],
"description": "gCube Catalogue (gCat) API is a library containing classes shared across gcat* components.",
"authors": [
{
"affiliation": "Istituto di Scienza e Tecnologie dell'Informazione \"A. Faedo\" - CNR, Italy",
"name": "Frosini, Luca",
"orcid": "0000-0003-3183-2291"
}
],
"files": [
{
"url": "https://code-repo.d4science.org/gCubeSystem/{{name}}/archive/v{{version}}.zip",
"desired_name": "{{name}}-v{{version}}.zip"
},
{
"url": "https://code-repo.d4science.org/gCubeSystem/{{name}}/archive/v{{version}}.tar.gz",
"desired_name": "{{name}}-v{{version}}.tar.gz"
},
{
"url": "https://nexus.d4science.org/nexus/service/local/repo_groups/gcube-releases-all/content/org/gcube/{{group}}/{{name}}/{{version}}/{{name}}-{{version}}.jar",
"desired_name": "{{name}}-v{{version}}.jar"
}
],
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}",
"doi_url": null,
"grants": [
{
"id": "004260",
"name": "DILIGENT",
"url": "https://cordis.europa.eu/project/id/004260"
},
{
"id": "212488",
"name": "D4Science",
"url": "https://cordis.europa.eu/project/id/212488"
},
{
"id": "239019",
"name": "D4Science-II",
"url": "https://cordis.europa.eu/project/id/239019"
},
{
"id": "283465",
"name": "ENVRI",
"url": "https://cordis.europa.eu/project/id/283465"
},
{
"id": "283644",
"name": "iMarine",
"url": "https://cordis.europa.eu/project/id/283644"
},
{
"id": "288754",
"name": "EUBrazilOpenBio",
"url": "https://cordis.europa.eu/project/id/288754"
},
{
"id": "654024",
"name": "SoBigData",
"url": "https://cordis.europa.eu/project/id/654024"
},
{
"id": "654119",
"name": "PARTHENOS",
"url": "https://cordis.europa.eu/project/id/654119"
},
{
"id": "654142",
"name": "EGI-Engage",
"url": "https://cordis.europa.eu/project/id/654142"
},
{
"id": "654182",
"name": "ENVRI PLUS",
"url": "https://cordis.europa.eu/project/id/654182"
},
{
"id": "675680",
"name": "BlueBRIDGE",
"url": "https://cordis.europa.eu/project/id/675680"
},
{
"id": "727610",
"name": "PerformFISH",
"url": "https://cordis.europa.eu/project/id/727610"
},
{
"id": "731001",
"name": "AGINFRA PLUS",
"url": "https://cordis.europa.eu/project/id/731001"
},
{
"id": "818194",
"name": "DESIRA",
"url": "https://cordis.europa.eu/project/id/818194"
},
{
"id": "823914",
"name": "ARIADNEplus",
"url": "https://cordis.europa.eu/project/id/823914"
},
{
"id": "824091",
"name": "RISIS 2",
"url": "https://cordis.europa.eu/project/id/824091"
},
{
"id": "857650",
"name": "EOSC-Pillar",
"url": "https://cordis.europa.eu/project/id/857650"
},
{
"id": "862409",
"name": "Blue Cloud",
"url": "https://cordis.europa.eu/project/id/862409"
},
{
"id": "871042",
"name": "SoBigData-PlusPlus",
"url": "https://cordis.europa.eu/project/id/871042"
}
],
"publishers": {
"ZenodoSoftwareVersionPublisher": {
"elaboration": "NONE",
"html_description": "<p><a href=\"https://www.gcube-system.org/\">gCube</a> Catalogue (gCat) API is a library containing classes shared across gcat* components.</p>\n\n<p><a href=\"https://www.gcube-system.org/\">gCube</a> is an open-source software toolkit used for building and operating Hybrid Data Infrastructures enabling the dynamic deployment of Virtual Research Environments, such as the <a href=\"https://www.d4science.org/\">D4Science Infrastructure</a>, by favouring the realisation of reuse-oriented policies.</p>\n\n<p><a href=\"https://www.gcube-system.org/\">gCube</a> has been used to successfully build and operate infrastructures and virtual research environments for application domains ranging from biodiversity to environmental data management and cultural heritage.</p>\n\n<p><a href=\"https://www.gcube-system.org/\">gCube</a> offers components supporting typical data management workflows including data access, curation, processing, and visualisation on a large set of data typologies ranging from primary biodiversity data to geospatial and tabular data.</p>\n\n<p><a href=\"https://www.d4science.org/\">D4Science</a> is a Hybrid Data Infrastructure combining over 500 software components and integrating data from more than 50 different data providers into a coherent and managed system of hardware, software, and data resources. The D4Science infrastructure drastically reduces the cost of ownership, maintenance, and operation thanks to the exploitation of gCube.</p>\n\n<p>&nbsp;</p>",
"html_code_location": "\n\n<p>The official source code location of this software version is available at:</p>\n\n<p><a href=\"{{code_location}}\">{{code_location}}</a></p>",
"skip_grants": ["004260"]
}
},
"exporters": {
"BibLaTeXSoftwareVersionExporter": {
"elaboration": "ALL"
}
},
"export_filename": "{{name}}"
},
"versions": [
{
"version": "1.0.0",
"date": "2019-02-26",
"group": "data-publishing",
"gcube_release_version": "4.13.1",
"gcube_release_ticket": "https://support.d4science.org/issues/13241",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "1.1.0",
"date": "2019-05-27",
"group": "data-publishing",
"gcube_release_version": "4.14.0",
"gcube_release_ticket": "https://support.d4science.org/issues/16491",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "1.2.0",
"date": "2019-11-06",
"group": "data-publishing",
"gcube_release_version": "4.15.0",
"gcube_release_ticket": "https://support.d4science.org/issues/17295",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "1.2.1",
"date": "2019-12-10",
"group": "data-publishing",
"gcube_release_version": "4.18.0",
"gcube_release_ticket": "https://support.d4science.org/issues/18336",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "1.2.2",
"date": "2021-02-24",
"group": "data-publishing",
"gcube_release_version": "5.0.0",
"gcube_release_ticket": "https://support.d4science.org/issues/20647",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.0.0",
"date": "2021-05-04",
"gcube_release_version": "5.2.0",
"gcube_release_ticket": "https://support.d4science.org/issues/19739",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": "https://doi.org/10.5281/zenodo.7446432",
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.1.0",
"date": "2022-01-27",
"gcube_release_version": "5.7.0",
"gcube_release_ticket": "https://support.d4science.org/issues/21687",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": "https://doi.org/10.5281/zenodo.7446592",
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.2.0",
"date": "2022-05-12",
"gcube_release_version": "5.11.0",
"gcube_release_ticket": "https://support.d4science.org/issues/22944",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": "https://doi.org/10.5281/zenodo.7446606",
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.3.0",
"date": "2022-09-19",
"gcube_release_version": "5.13.1",
"gcube_release_ticket": "https://support.d4science.org/issues/23697",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": "https://doi.org/10.5281/zenodo.7448620",
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.3.1",
"date": "2022-12-07",
"gcube_release_version": "5.14.0",
"gcube_release_ticket": "https://support.d4science.org/issues/23990",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": "https://doi.org/10.5281/zenodo.7467223",
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
},
{
"version": "2.3.2",
"date": null,
"gcube_release_version": null,
"gcube_release_ticket": "https://support.d4science.org/issues/24286",
"doi_url": "https://doi.org/10.5281/zenodo.7446431",
"version_doi_url": null,
"code_location": "https://code-repo.d4science.org/gCubeSystem/{{name}}/releases/tag/v{{version}}"
}
]
}

11
pom.xml
View File

@ -9,7 +9,7 @@
</parent>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcat-api</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<name>gCube Catalogue (gCat) API</name>
<description>gCube Catalogue (gCat) API is a library containing classes shared across gcat* components</description>
<properties>
@ -25,7 +25,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>2.1.0</version>
<version>2.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -48,15 +48,12 @@
<groupId>org.gcube.common</groupId>
<artifactId>gcube-jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope</artifactId>
</dependency>
<!-- Added to support Java 11 JDK -->
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- END Added to support Java 11 JDK -->

View File

@ -14,6 +14,7 @@ public class GCatConstants {
public static final String SERVICE_ENTRY_NAME = "org.gcube.gcat.ResourceInitializer";
public static final String PURGE_QUERY_PARAMETER = "purge";
public static final String APPLICATION_JSON_CHARSET_UTF_8 = "application/json;charset=UTF-8";
public static final String APPLICATION_JSON_API = "application/vnd.api+json";
public static final String LIMIT_QUERY_PARAMETER = "limit";
public static final String OFFSET_QUERY_PARAMETER = "offset";
public static final String COUNT_QUERY_PARAMETER = "count";
@ -32,4 +33,7 @@ public class GCatConstants {
public static final String ORGANIZATION_FILTER_TEMPLATE = ORGANIZATION_PARAMETER + ":%s";
public static final String JSON_API_DATA_FIELD_NAME = "data";
}

View File

@ -1,15 +1,14 @@
package org.gcube.gcat.api.configuration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
import org.gcube.common.scope.impl.ScopeBean;
/**
* @author Luca Frosini (ISTI - CNR)
@ -32,10 +31,27 @@ public class CatalogueConfiguration {
public static final String CKAN_DB_KEY = "ckanDB";
public static final Set<String> KNOWN_PROPERTIES;
static {
KNOWN_PROPERTIES = new HashSet<>();
KNOWN_PROPERTIES.add(ID_KEY);
KNOWN_PROPERTIES.add(CONTEXT_KEY);
KNOWN_PROPERTIES.add(DEFAULT_ORGANIZATION_KEY);
KNOWN_PROPERTIES.add(SUPPORTED_ORGANIZATIONS_KEY);
KNOWN_PROPERTIES.add(SYS_ADMIN_TOKEN_KEY);
KNOWN_PROPERTIES.add(SOCIAL_POST_ENABLED_KEY);
KNOWN_PROPERTIES.add(NOTIFICATION_TO_USER_ENABLED_KEY);
KNOWN_PROPERTIES.add(MODERATION_ENABLED_KEY);
KNOWN_PROPERTIES.add(CKAN_URL_KEY);
KNOWN_PROPERTIES.add(SOLR_URL_KEY);
KNOWN_PROPERTIES.add(CKAN_DB_KEY);
}
protected String id;
protected String context;
protected ScopeBean scopeBean;
protected String defaultOrganization;
protected Set<String> supportedOrganizations;
@ -56,13 +72,9 @@ public class CatalogueConfiguration {
* Return the CKAN organization name using the current context name
*/
public static String getOrganizationName(String context) {
ScopeBean scopeBean = new ScopeBean(context);
return getOrganizationName(scopeBean);
}
public static String getOrganizationName(ScopeBean scopeBean) {
String contextName = scopeBean.name();
return contextName.toLowerCase().replace(" ", "_");
String[] components = context.split("/");
String name = components[components.length-1];
return name.toLowerCase().replace(" ", "_");
}
protected CatalogueConfiguration() {
@ -77,6 +89,8 @@ public class CatalogueConfiguration {
this.moderationEnabled = false; // default is false
additionalProperties = new HashMap<>();
}
public CatalogueConfiguration(String context) {
@ -103,12 +117,6 @@ public class CatalogueConfiguration {
@JsonSetter
private void setContext(String context) {
this.context = context;
this.scopeBean = new ScopeBean(context);
}
@JsonIgnore
public ScopeBean getScopeBean() {
return scopeBean;
}
@JsonProperty(value = DEFAULT_ORGANIZATION_KEY)

View File

@ -22,7 +22,13 @@ public interface Moderated {
* Used to keep tack of item author
*/
public static final String SYSTEM_CM_ITEM_AUTHOR = SYSTEM_CM_PREFIX + "item_author";
/**
* Used to keep tack of item author fullname
*/
public static final String SYSTEM_CM_ITEM_AUTHOR_FULLNAME = SYSTEM_CM_PREFIX + "item_author_fullname";
public String approve(String moderatorMessage);
public String reject(String moderatorMessage);