Report Validation

This commit is contained in:
Fabio Sinibaldi 2022-02-17 16:01:05 +01:00
parent 31b7d28572
commit 089341c375
2 changed files with 14 additions and 4 deletions

View File

@ -29,11 +29,14 @@ public class DocumentHandlingReport<T extends BaseExecutionRequest> extends Repo
}
if(toSetLifecycleInformation != null){
log.trace("Merging lifecycleInformation");
Document original = Serialization.asDocument(toReturn.getLifecycleInformation());
Document toSet = Serialization.asDocument(toSetLifecycleInformation);
toSet.putAll(original);
toReturn.setLifecycleInformation(Serialization.convert(toSet,LifecycleInformation.class));
// Document original = Serialization.asDocument(toReturn.getLifecycleInformation());
// Document toSet = Serialization.asDocument(toSetLifecycleInformation);
// toSet.putAll(original);
// toReturn.setLifecycleInformation(Serialization.convert(toSet,LifecycleInformation.class));
toReturn.setLifecycleInformation(toSetLifecycleInformation);
}
// Force Report status into info
log.trace("Report status is {} ",getStatus());
LifecycleInformation info = toReturn.getLifecycleInformation();
switch (getStatus()){
@ -48,6 +51,9 @@ public class DocumentHandlingReport<T extends BaseExecutionRequest> extends Repo
break;
}
case OK: {
if(info.getLastOperationStatus()==null)
info.setLastOperationStatus(LifecycleInformation.Status.OK);
break;
}
}
return toReturn;

View File

@ -4,9 +4,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.Data;
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
@Data
public class EventExecutionReport extends DocumentHandlingReport<EventExecutionRequest>{
@Override
public void setToSetLifecycleInformation(LifecycleInformation toSetLifecycleInformation) {
}
}