2022-02-14 12:23:38 +01:00
|
|
|
package org.gcube.application.cms.plugins.reports;
|
|
|
|
|
2022-03-04 11:30:11 +01:00
|
|
|
import lombok.ToString;
|
2022-08-31 18:05:22 +02:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2022-03-04 11:30:11 +01:00
|
|
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
2022-02-14 12:23:38 +01:00
|
|
|
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
2022-02-17 16:01:05 +01:00
|
|
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
2022-02-14 12:23:38 +01:00
|
|
|
|
2022-03-04 11:30:11 +01:00
|
|
|
@ToString(callSuper = true)
|
2022-08-31 18:05:22 +02:00
|
|
|
@Slf4j
|
2022-02-17 14:47:51 +01:00
|
|
|
public class EventExecutionReport extends DocumentHandlingReport<EventExecutionRequest>{
|
2022-02-14 12:23:38 +01:00
|
|
|
|
2022-03-04 11:30:11 +01:00
|
|
|
public EventExecutionReport(EventExecutionRequest req) throws InvalidPluginRequestException {
|
2022-02-23 17:13:22 +01:00
|
|
|
super(req);
|
2022-08-31 18:05:22 +02:00
|
|
|
try{
|
|
|
|
if(theRequest.getDocument().getLifecycleInformation()!=null)
|
|
|
|
this.setToSetLifecycleInformation(theRequest.getDocument().getLifecycleInformation().cleanState());
|
|
|
|
else theRequest.getDocument().setLifecycleInformation(new LifecycleInformation().cleanState());
|
|
|
|
}catch(Throwable t){
|
|
|
|
log.warn("Cannot to clean state for lifecycle information {} in {} : {}",
|
|
|
|
theRequest.getDocument().getLifecycleInformation(),
|
|
|
|
theRequest.getDocument().getProfileID(),
|
|
|
|
theRequest.getDocument().getId(),
|
|
|
|
t);
|
|
|
|
}
|
2022-05-17 11:43:50 +02:00
|
|
|
this.getToSetLifecycleInformation().setLastOperationStatus(LifecycleInformation.Status.OK);
|
2022-02-23 17:13:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-17 16:01:05 +01:00
|
|
|
@Override
|
|
|
|
public void setToSetLifecycleInformation(LifecycleInformation toSetLifecycleInformation) {
|
|
|
|
}
|
2022-03-28 16:35:30 +02:00
|
|
|
|
2022-02-14 12:23:38 +01:00
|
|
|
}
|