From 7d2eda43ca7929f7cb4d1514b364c7e0a7b84b2c Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 3 Nov 2020 16:57:01 +0100 Subject: [PATCH] added new non mandatory property publish to determine if to publish the upload or leave it pending. Default value flase --- .../eu/dnetlib/dhp/oa/graph/dump/SendToZenodoHDFS.java | 7 ++++++- .../eu/dnetlib/dhp/oa/graph/dump/upload_zenodo.json | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/SendToZenodoHDFS.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/SendToZenodoHDFS.java index 058048ba7..23cd27449 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/SendToZenodoHDFS.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/SendToZenodoHDFS.java @@ -42,6 +42,10 @@ public class SendToZenodoHDFS implements Serializable { final String concept_rec_id = Optional .ofNullable(parser.get("conceptRecordId")) .orElse(null); + final Boolean publish = Optional + .ofNullable(parser.get("publish")) + .map(Boolean::valueOf) + .orElse(false); final String depositionId = Optional.ofNullable(parser.get("depositionId")).orElse(null); final String communityMapPath = parser.get("communityMapPath"); @@ -96,7 +100,8 @@ public class SendToZenodoHDFS implements Serializable { } zenodoApiClient.sendMretadata(metadata); - zenodoApiClient.publish(); + if (publish) + zenodoApiClient.publish(); } diff --git a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/dump/upload_zenodo.json b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/dump/upload_zenodo.json index 7632c76cd..683b6f4b7 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/dump/upload_zenodo.json +++ b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/dump/upload_zenodo.json @@ -53,5 +53,11 @@ "paramLongName":"metadata", "paramDescription": "metadata associated to the deposition", "paramRequired": false -} +}, + { + "paramName":"p", + "paramLongName":"publish", + "paramDescription": "if to publish the upload", + "paramRequired": false + } ] \ No newline at end of file