From e7438d450b907ee969bfddacd19363f26a3fc876 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 12 Jan 2023 17:56:44 +0100 Subject: [PATCH] Fixed code --- .../analyser/SoftwareConceptAnalyser.java | 14 +- .../ZenodoSoftwareVersionPublisher.java | 3 +- .../analyser/SoftwareConceptAnalyserTest.java | 4 +- .../resources/exported-gcat-from-scratch.bib | 160 +++++++++++ .../resources/exported-gcat-from-scratch.json | 271 ++++++++++++++++++ src/test/resources/gcat-from-scratch.json | 2 +- 6 files changed, 444 insertions(+), 10 deletions(-) create mode 100644 src/test/resources/exported-gcat-from-scratch.bib create mode 100644 src/test/resources/exported-gcat-from-scratch.json diff --git a/src/main/java/org/gcube/common/software/analyser/SoftwareConceptAnalyser.java b/src/main/java/org/gcube/common/software/analyser/SoftwareConceptAnalyser.java index e8a0edd..8f87326 100644 --- a/src/main/java/org/gcube/common/software/analyser/SoftwareConceptAnalyser.java +++ b/src/main/java/org/gcube/common/software/analyser/SoftwareConceptAnalyser.java @@ -102,8 +102,9 @@ public class SoftwareConceptAnalyser { }finally { /* Need to export the original file with the DOI and Version DOI */ - if(softwareVersion.getDOIURL()!=null) { - originalVersion.put(SoftwareVersion.DOI_URL_PROPERTY_NAME, softwareVersion.getDOIURL().toString()); + URL doiURL = softwareVersion.getDOIURL(); + if(doiURL!=null) { + originalVersion.put(SoftwareVersion.DOI_URL_PROPERTY_NAME, doiURL.toString()); } if(softwareVersion.getVersionDOIURL()!=null) { @@ -111,7 +112,6 @@ public class SoftwareConceptAnalyser { } if(newDOI) { - URL doiURL = softwareVersion.getDOIURL(); softwareConcept.setDOIURL(doiURL); concept.put(SoftwareConcept.DOI_URL_PROPERTY_NAME, doiURL.toString()); } @@ -128,13 +128,15 @@ public class SoftwareConceptAnalyser { ObjectNode toBeExported = objectMapper.createObjectNode(); toBeExported.replace(CONCEPT_PROPERTY_NAME, concept); - if(concept.has(SoftwareConcept.DOI_URL_PROPERTY_NAME) && concept.get(SoftwareConcept.DOI_URL_PROPERTY_NAME).getNodeType()!=JsonNodeType.NULL) { + if(concept.has(SoftwareConcept.DOI_URL_PROPERTY_NAME) + && concept.get(SoftwareConcept.DOI_URL_PROPERTY_NAME).getNodeType()!=JsonNodeType.NULL) { String conceptDOIURL = concept.get(SoftwareConcept.DOI_URL_PROPERTY_NAME).asText(); for(i=0; igCube Catalogue (gCat) Service allows any client to publish items in the gCube Catalogue.

\n\n

gCube 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 D4Science Infrastructure, by favouring the realisation of reuse-oriented policies.

\n\n

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

\n\n

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

\n\n

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

\n\n

 

", + "html_code_location" : "\n\n

The official source code location of this software version is available at:

\n\n

{{code_location}}

", + "skip_grants" : [ "004260" ] + } + }, + "exporters" : { } +} \ No newline at end of file diff --git a/src/test/resources/gcat-from-scratch.json b/src/test/resources/gcat-from-scratch.json index 473f243..6d5e4d8 100644 --- a/src/test/resources/gcat-from-scratch.json +++ b/src/test/resources/gcat-from-scratch.json @@ -2,7 +2,7 @@ "concept": { "name": "gcat", "group": "data-catalogue", - "title": "MYTEST gCube Catalogue (gCat) Service {{version}}", + "title": "gCube Catalogue (gCat) Service {{version}}", "license": { "id": "EUPL-1.1", "url": "https://opensource.org/licenses/EUPL-1.1"