From 521b5c90a6c3332a9c1cc3f3c255495f686b8a3d Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 31 May 2022 15:50:25 +0200 Subject: [PATCH] Check on get Mandatory --- .../cms/plugins/implementations/SimpleLifeCycleManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 f869e88..f0f5970 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 @@ -137,8 +137,9 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements @Override protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException { // Block non draft only if not force - if(!Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false"))) - blockNonDraft(report); + Boolean force=Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false")); + log.debug("ON DELETE for {} : force is {}",report.getTheRequest().getDocument().getId(),force); + if(!force) blockNonDraft(report); // dematerialize all JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson()); for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){