Check on get Mandatory

This commit is contained in:
Fabio Sinibaldi 2022-05-31 15:50:25 +02:00
parent a0ffa08813
commit 521b5c90a6
1 changed files with 3 additions and 2 deletions

View File

@ -137,8 +137,9 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
@Override @Override
protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException { protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException {
// Block non draft only if not force // Block non draft only if not force
if(!Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false"))) Boolean force=Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false"));
blockNonDraft(report); log.debug("ON DELETE for {} : force is {}",report.getTheRequest().getDocument().getId(),force);
if(!force) blockNonDraft(report);
// dematerialize all // dematerialize all
JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson()); JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson());
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){ for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){