From ec0b82631337afd72ae47735c9148bb3f6244562 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 6 Dec 2022 15:15:02 +0100 Subject: [PATCH] Fixes #24235 --- CHANGELOG.md | 3 ++ ckan-plugin/CHANGELOG.md | 3 ++ ckan-plugin/pom.xml | 4 +- cms-plugin-framework/CHANGELOG.md | 3 ++ cms-plugin-framework/pom.xml | 4 +- .../SimpleLifeCycleManager.java | 1 + cms-test-commons/CHANGELOG.md | 3 ++ cms-test-commons/pom.xml | 4 +- concessioni-lifecycle/CHANGELOG.md | 3 ++ concessioni-lifecycle/pom.xml | 4 +- concessioni-model/CHANGELOG.md | 3 ++ concessioni-model/pom.xml | 4 +- dataminer-plugins/CHANGELOG.md | 3 ++ dataminer-plugins/pom.xml | 4 +- geoportal-client/CHANGELOG.md | 3 ++ geoportal-client/pom.xml | 4 +- geoportal-common/CHANGELOG.md | 3 ++ geoportal-common/pom.xml | 4 +- .../common/utils/tests/GCubeTest.java | 4 +- geoportal-service/CHANGELOG.md | 3 ++ geoportal-service/pom.xml | 4 +- images-plugin/CHANGELOG.md | 3 ++ images-plugin/pom.xml | 4 +- notifications-plugins/CHANGELOG.md | 3 ++ notifications-plugins/pom.xml | 4 +- pom.xml | 24 ++++----- sdi-plugins/CHANGELOG.md | 3 ++ sdi-plugins/pom.xml | 4 +- use-cases/CHANGELOG.md | 3 ++ use-cases/pom.xml | 4 +- .../usecases/ExportConcessioniAsProjects.java | 4 +- .../cms/usecases/PublishSubmitted.java | 49 +++++++++++++++++++ 32 files changed, 135 insertions(+), 41 deletions(-) create mode 100644 use-cases/src/test/java/org/gcube/application/cms/usecases/PublishSubmitted.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cfa5f7..9d13e27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.spatial.data.gcube-sdi-suite +## [v1.0.3-SNAPSHOT] - 2022-12-07 +- Updated plugin framework + ## [v1.0.2] - 2021-02-24 -Introduced module sdi-plugins -Introduced module notifications-plugins diff --git a/ckan-plugin/CHANGELOG.md b/ckan-plugin/CHANGELOG.md index a15bf25..68803b9 100644 --- a/ckan-plugin/CHANGELOG.md +++ b/ckan-plugin/CHANGELOG.md @@ -4,5 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains gcube-cms plugins for ckan materializations +## [v1.0.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.0] - 2022-02-24 - First release diff --git a/ckan-plugin/pom.xml b/ckan-plugin/pom.xml index dce9b2a..63ee359 100644 --- a/ckan-plugin/pom.xml +++ b/ckan-plugin/pom.xml @@ -5,14 +5,14 @@ 4.0.0 ckan-plugins - 1.0.0 + 1.0.1-SNAPSHOT gCube CMS - CKAN Plugins org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/cms-plugin-framework/CHANGELOG.md b/cms-plugin-framework/CHANGELOG.md index 09183da..e22e0fc 100644 --- a/cms-plugin-framework/CHANGELOG.md +++ b/cms-plugin-framework/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.cms-plugin-framework +## [v1.0.2-SNAPSHOT] 2022-01-17 +- Fixes #2435 + ## [v1.0.1] 2022-01-17 - Serialization Features diff --git a/cms-plugin-framework/pom.xml b/cms-plugin-framework/pom.xml index 03e6f12..4382e13 100644 --- a/cms-plugin-framework/pom.xml +++ b/cms-plugin-framework/pom.xml @@ -4,12 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cms-plugin-framework - 1.0.1 + 1.0.2-SNAPSHOT org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/implementations/SimpleLifeCycleManager.java b/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/implementations/SimpleLifeCycleManager.java index 2409646..0b3d816 100644 --- a/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/implementations/SimpleLifeCycleManager.java +++ b/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/implementations/SimpleLifeCycleManager.java @@ -228,6 +228,7 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements new MaterializationRequest(request.getUseCaseDescriptor(),request.getCaller(), request.getContext(), request.getDocument()); Document params = new Document(); + params.putAll(parameters); String workspace = request.getUseCaseDescriptor().getId() + request.getContext().getId(); params.put("workspace", Files.fixFilename(workspace)); diff --git a/cms-test-commons/CHANGELOG.md b/cms-test-commons/CHANGELOG.md index 037b2c9..785e863 100644 --- a/cms-test-commons/CHANGELOG.md +++ b/cms-test-commons/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.cms.cms-test-commons +## [v1.0.3-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.2] - 2022-01-17 - Profiles diff --git a/cms-test-commons/pom.xml b/cms-test-commons/pom.xml index a02c5e6..9611845 100644 --- a/cms-test-commons/pom.xml +++ b/cms-test-commons/pom.xml @@ -5,14 +5,14 @@ 4.0.0 cms-test-commons - 1.0.2 + 1.0.3-SNAPSHOT CMS Test Commons org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/concessioni-lifecycle/CHANGELOG.md b/concessioni-lifecycle/CHANGELOG.md index dc8a4a6..e0df8df 100644 --- a/concessioni-lifecycle/CHANGELOG.md +++ b/concessioni-lifecycle/CHANGELOG.md @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains custom extensions for the support of GNA "concessioni" use case +## [v1.0.2-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.1] - 2022-01-17 - Serialization adaptation diff --git a/concessioni-lifecycle/pom.xml b/concessioni-lifecycle/pom.xml index 9efedb7..72c842c 100644 --- a/concessioni-lifecycle/pom.xml +++ b/concessioni-lifecycle/pom.xml @@ -4,14 +4,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 concessioni-lifecycle - 1.0.1 + 1.0.2-SNAPSHOT GNA Concessioni Lifecycle org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/concessioni-model/CHANGELOG.md b/concessioni-model/CHANGELOG.md index 3e4560b..f98c052 100644 --- a/concessioni-model/CHANGELOG.md +++ b/concessioni-model/CHANGELOG.md @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains custom BEANS for the support of GNA "concessioni" use case +## [v1.0.2-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.1] - 2022-01-17 - Defaults Evaluation diff --git a/concessioni-model/pom.xml b/concessioni-model/pom.xml index f93c7e4..b3b375e 100644 --- a/concessioni-model/pom.xml +++ b/concessioni-model/pom.xml @@ -6,14 +6,14 @@ org.gcube.application.cms concessioni-model - 1.0.1 + 1.0.2-SNAPSHOT GNA Concessioni Model org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/dataminer-plugins/CHANGELOG.md b/dataminer-plugins/CHANGELOG.md index e3f2d83..bb5b37e 100644 --- a/dataminer-plugins/CHANGELOG.md +++ b/dataminer-plugins/CHANGELOG.md @@ -4,5 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains gcube-cms plugins for processing via gCube Dataminer +## [v1.0.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.0] - 2022-02-24 - First release diff --git a/dataminer-plugins/pom.xml b/dataminer-plugins/pom.xml index aa7c047..1b075f4 100644 --- a/dataminer-plugins/pom.xml +++ b/dataminer-plugins/pom.xml @@ -5,14 +5,14 @@ 4.0.0 dataminer-plugins - 1.0.0 + 1.0.1-SNAPSHOT gCube CMS - Dataminer Plugins org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/geoportal-client/CHANGELOG.md b/geoportal-client/CHANGELOG.md index c24c1c7..4f6c857 100644 --- a/geoportal-client/CHANGELOG.md +++ b/geoportal-client/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.geoportal-client +## [v1.1.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.1.0] - 2022-02-01 diff --git a/geoportal-client/pom.xml b/geoportal-client/pom.xml index 46a932d..4fcefeb 100644 --- a/geoportal-client/pom.xml +++ b/geoportal-client/pom.xml @@ -4,14 +4,14 @@ 4.0.0 org.gcube.application geoportal-client - 1.1.0 + 1.1.1-SNAPSHOT Geoportal Client org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/geoportal-common/CHANGELOG.md b/geoportal-common/CHANGELOG.md index a1c9125..cc0c5e9 100644 --- a/geoportal-common/CHANGELOG.md +++ b/geoportal-common/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.geoportal-common +## [v1.0.10-SNAPSHOT] - 2022-12-07 +- Pom updates + # [v1.0.9] - 2022-01-17 - Minor fixes in model - Schema and jsonPath support diff --git a/geoportal-common/pom.xml b/geoportal-common/pom.xml index f80f92f..fe35ffa 100644 --- a/geoportal-common/pom.xml +++ b/geoportal-common/pom.xml @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 geoportal-common - 1.0.9 + 1.0.10-SNAPSHOT Geoportal Common org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/geoportal-common/src/main/java/org/gcube/application/geoportal/common/utils/tests/GCubeTest.java b/geoportal-common/src/main/java/org/gcube/application/geoportal/common/utils/tests/GCubeTest.java index 87ed751..e8ce6e7 100644 --- a/geoportal-common/src/main/java/org/gcube/application/geoportal/common/utils/tests/GCubeTest.java +++ b/geoportal-common/src/main/java/org/gcube/application/geoportal/common/utils/tests/GCubeTest.java @@ -14,8 +14,10 @@ public class GCubeTest { // InterfaceConstants.SERVICE_CLASS="Application"; // InterfaceConstants.SERVICE_NAME="GeoPortal"; + testContext = "/pred4s/preprod/preVRE"; - // testContext= "/gcube/devsec/devVRE"; + // testContext = "/d4science.research-infrastructures.eu/D4OS/GNA"; + testContext= "/gcube/devsec/devVRE"; System.out.println("TEST CONTEXT = "+testContext); return testContext; diff --git a/geoportal-service/CHANGELOG.md b/geoportal-service/CHANGELOG.md index ae1221b..4fa1191 100644 --- a/geoportal-service/CHANGELOG.md +++ b/geoportal-service/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.geoportal-service +## [v1.0.11-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.10] 2022-01-17 - Plugin Management - Profiled Document : FileSet Registration diff --git a/geoportal-service/pom.xml b/geoportal-service/pom.xml index 0df9cb7..833aed0 100644 --- a/geoportal-service/pom.xml +++ b/geoportal-service/pom.xml @@ -4,14 +4,14 @@ 4.0.0 org.gcube.application geoportal-service - 1.0.10 + 1.0.11-SNAPSHOT Geoportal Service war org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/images-plugin/CHANGELOG.md b/images-plugin/CHANGELOG.md index f445ba5..2f59270 100644 --- a/images-plugin/CHANGELOG.md +++ b/images-plugin/CHANGELOG.md @@ -4,5 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains gcube-cms plugins for images materializations +## [v1.0.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.0] - 2022-02-24 - First release diff --git a/images-plugin/pom.xml b/images-plugin/pom.xml index fafe03f..39993ff 100644 --- a/images-plugin/pom.xml +++ b/images-plugin/pom.xml @@ -5,14 +5,14 @@ 4.0.0 images-plugins - 1.0.0 + 1.0.1-SNAPSHOT gCube CMS - Images Plugins org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/notifications-plugins/CHANGELOG.md b/notifications-plugins/CHANGELOG.md index a5b05c2..8fb52e6 100644 --- a/notifications-plugins/CHANGELOG.md +++ b/notifications-plugins/CHANGELOG.md @@ -4,5 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains gcube-cms plugins for notitfications events +## [v1.0.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.0] - 2022-02-24 - First release diff --git a/notifications-plugins/pom.xml b/notifications-plugins/pom.xml index 13a13d3..7ed980f 100644 --- a/notifications-plugins/pom.xml +++ b/notifications-plugins/pom.xml @@ -5,14 +5,14 @@ 4.0.0 notifications-plugins - 1.0.0 + 1.0.1-SNAPSHOT gCube CMS - Notifications Plugins org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/pom.xml b/pom.xml index 03fbadd..8e19063 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.application.cms gcube-cms-suite pom - 1.0.2 + 1.0.3-SNAPSHOT Gcube CMS Suite gCube CMS Suite is a set of components designed to manage complex space-temporal Documents defined by metadata Profiles. @@ -22,19 +22,19 @@ https://code-repo.d4science.org/gCubeSystem - 2.0.2 - 2.1.1 - 3.6.3 - [1.0.0,2.0.0-SNAPSHOT) - 1.0.1 + + + + + - - - - - - + 2.1.0-SNAPSHOT + 2.2.0-SNAPSHOT + 3.7.0-SNAPSHOT + [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) + + 1.0.2-SNAPSHOT diff --git a/sdi-plugins/CHANGELOG.md b/sdi-plugins/CHANGELOG.md index c7a9acb..f225aa7 100644 --- a/sdi-plugins/CHANGELOG.md +++ b/sdi-plugins/CHANGELOG.md @@ -4,5 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This library contains gcube-cms plugins for indexing and materializations in gCube SDI +## [v1.0.1-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.0] - 2022-02-24 - First release diff --git a/sdi-plugins/pom.xml b/sdi-plugins/pom.xml index 29ca70b..b9bbaac 100644 --- a/sdi-plugins/pom.xml +++ b/sdi-plugins/pom.xml @@ -5,14 +5,14 @@ 4.0.0 sdi-plugins - 1.0.0 + 1.0.1-SNAPSHOT gCube CMS - SDI Plugins org.gcube.application.cms gcube-cms-suite - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/use-cases/CHANGELOG.md b/use-cases/CHANGELOG.md index 8f03a2b..8863cf5 100644 --- a/use-cases/CHANGELOG.md +++ b/use-cases/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.application.geoportal-client +## [v1.0.3-SNAPSHOT] - 2022-12-07 +- Pom updates + ## [v1.0.2] - 2022-02-24 - Updated parent diff --git a/use-cases/pom.xml b/use-cases/pom.xml index 33e7b66..ce49b82 100644 --- a/use-cases/pom.xml +++ b/use-cases/pom.xml @@ -4,12 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 use-cases - 1.0.2 + 1.0.3-SNAPSHOT CMS Use cases gcube-cms-suite org.gcube.application.cms - 1.0.2 + 1.0.3-SNAPSHOT diff --git a/use-cases/src/test/java/org/gcube/application/cms/usecases/ExportConcessioniAsProjects.java b/use-cases/src/test/java/org/gcube/application/cms/usecases/ExportConcessioniAsProjects.java index 5f90cfb..a313b5f 100644 --- a/use-cases/src/test/java/org/gcube/application/cms/usecases/ExportConcessioniAsProjects.java +++ b/use-cases/src/test/java/org/gcube/application/cms/usecases/ExportConcessioniAsProjects.java @@ -50,7 +50,7 @@ public class ExportConcessioniAsProjects { public static void main(String[] args) throws InterruptedException, IOException { // read from imported folder - File dir= new File("/Users/fabioisti/git/gcube-cms-suite/import1668778302348"); + File dir= new File("/Users/fabioisti/git/gcube-cms-suite/import1669889538860"); // select only cluster // dir = new File(dir,"cluster_1"); @@ -110,7 +110,7 @@ public class ExportConcessioniAsProjects { AtomicLong warnCount = new AtomicLong(0); AtomicLong errCount = new AtomicLong(0); - ExecutorService service = Executors.newFixedThreadPool(1); + ExecutorService service = Executors.newFixedThreadPool(3); long startProcess = System.currentTimeMillis(); diff --git a/use-cases/src/test/java/org/gcube/application/cms/usecases/PublishSubmitted.java b/use-cases/src/test/java/org/gcube/application/cms/usecases/PublishSubmitted.java new file mode 100644 index 0000000..345ff40 --- /dev/null +++ b/use-cases/src/test/java/org/gcube/application/cms/usecases/PublishSubmitted.java @@ -0,0 +1,49 @@ +package org.gcube.application.cms.usecases; + +import lombok.extern.slf4j.Slf4j; +import org.bson.Document; +import org.gcube.application.cms.tests.TokenSetter; +import org.gcube.application.geoportal.common.model.document.Project; +import org.gcube.application.geoportal.common.model.rest.QueryRequest; +import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest; +import org.gcube.application.geoportal.common.rest.Projects; +import org.gcube.application.geoportal.common.utils.tests.GCubeTest; + +import java.rmi.RemoteException; +import java.util.HashMap; +import java.util.concurrent.atomic.AtomicLong; + +import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.projects; + +@Slf4j +public class PublishSubmitted { + + public static void main(String[] args) throws RemoteException { + TokenSetter.set(GCubeTest.getContext()); + Projects client=projects("profiledConcessioni").build(); + + QueryRequest query = new QueryRequest(); + query.setFilter(Document.parse("{\"_lifecycleInformation._lastOperationStatus\":{\"$eq\":\"OK\"},\"_lifecycleInformation._phase\":{\"$eq\":\"Pending Approval\"}}")); + + AtomicLong count=new AtomicLong(); + final StepExecutionRequest step = new StepExecutionRequest(); + step.setStepID("APPROVE-SUBMITTED"); + + HashMap errors = new HashMap<>(); + + client.query(query).forEachRemaining(project -> { + try{ + log.info("Publishing N {}, ID {} ",count.incrementAndGet(),project.getId()); + client.performStep(project.getId(), step); + }catch(Throwable t){ + t.printStackTrace(System.err); + errors.put(project.getId(),t.getMessage()); + } + }); + + System.out.println("Performed OP on "+count.get()+" projects."); + System.out.println("Errors count : "+errors.size()); + errors.forEach((k,v) -> System.err.println(k+"\t"+v)); + } + +}