2019-01-17 20:11:53 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.portlets.user.dataminerexecutor.client.experiments;
|
|
|
|
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
|
|
|
|
import org.gcube.portlets.user.dataminerexecutor.client.DataMinerExecutor;
|
|
|
|
import org.gcube.portlets.user.dataminerexecutor.client.common.EventBusProvider;
|
|
|
|
import org.gcube.portlets.user.dataminerexecutor.client.events.ComputationReadyEvent;
|
|
|
|
import org.gcube.portlets.user.dataminerexecutor.client.events.ResubmitComputationExecutionEvent;
|
2019-10-01 11:49:02 +02:00
|
|
|
import org.gcube.portlets.user.dataminerexecutor.client.info.ServiceInfoPanel;
|
2019-03-13 11:53:59 +01:00
|
|
|
import org.gcube.portlets.user.dataminerexecutor.shared.process.InvocationModel;
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
|
|
|
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
|
|
|
import com.sencha.gxt.widget.core.client.TabPanel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class WorkflowPanel extends TabPanel {
|
2019-10-01 11:49:02 +02:00
|
|
|
private static final String OPERATOR = "Operator";
|
|
|
|
private static final String COMPUTATIONS_EXECUTION = "Computations Execution";
|
|
|
|
private static final String SERVICE_INFO = "Service Profile";
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
private ComputationExecutionPanel computationExecutionPanel;
|
|
|
|
private ComputationPanel computationPanel;
|
2019-10-03 11:28:49 +02:00
|
|
|
private ServiceInfoPanel serviceInfoPanel;
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public WorkflowPanel() {
|
|
|
|
super();
|
|
|
|
init();
|
|
|
|
create();
|
|
|
|
bind();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void init() {
|
|
|
|
setBodyBorder(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void create() {
|
|
|
|
|
2019-10-01 11:49:02 +02:00
|
|
|
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(OPERATOR, false);
|
|
|
|
tabWorkFlowLcItemConf.setIcon(DataMinerExecutor.resources.folderExplore());
|
2019-01-17 20:11:53 +01:00
|
|
|
computationPanel = new ComputationPanel();
|
2019-10-01 11:49:02 +02:00
|
|
|
computationPanel.addComputationReadyEventHandler(new ComputationReadyEvent.ComputationReadyEventHandler() {
|
2019-01-17 20:11:53 +01:00
|
|
|
|
2019-10-01 11:49:02 +02:00
|
|
|
@Override
|
|
|
|
public void onReady(ComputationReadyEvent event) {
|
|
|
|
Log.debug("StartComputationEvent Received:" + event);
|
|
|
|
startComputation(event.getOperator());
|
2019-01-17 20:11:53 +01:00
|
|
|
|
2019-10-01 11:49:02 +02:00
|
|
|
}
|
|
|
|
});
|
2019-01-17 20:11:53 +01:00
|
|
|
add(computationPanel, tabWorkFlowLcItemConf);
|
|
|
|
|
2019-10-01 11:49:02 +02:00
|
|
|
TabItemConfig tabComputationPanelItemConf = new TabItemConfig(COMPUTATIONS_EXECUTION, false);
|
|
|
|
tabComputationPanelItemConf.setIcon(DataMinerExecutor.resources.folderExplore());
|
2019-01-17 20:11:53 +01:00
|
|
|
computationExecutionPanel = new ComputationExecutionPanel();
|
|
|
|
add(computationExecutionPanel, tabComputationPanelItemConf);
|
|
|
|
|
2019-10-03 11:28:49 +02:00
|
|
|
TabItemConfig tabServiceInfoPanelItemConf = new TabItemConfig(SERVICE_INFO, false);
|
|
|
|
tabServiceInfoPanelItemConf.setIcon(DataMinerExecutor.resources.folderExplore());
|
|
|
|
serviceInfoPanel = new ServiceInfoPanel();
|
|
|
|
add(serviceInfoPanel, tabServiceInfoPanelItemConf);
|
2019-10-01 11:49:02 +02:00
|
|
|
|
2019-01-17 20:11:53 +01:00
|
|
|
setActiveWidget(computationPanel);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private void bind() {
|
2019-10-01 11:49:02 +02:00
|
|
|
EventBusProvider.INSTANCE.addHandler(ResubmitComputationExecutionEvent.getType(),
|
|
|
|
new ResubmitComputationExecutionEvent.ResubmitComputationExecutionEventHandler() {
|
|
|
|
@Override
|
|
|
|
public void onResubmit(ResubmitComputationExecutionEvent event) {
|
|
|
|
resubmitComputation();
|
|
|
|
}
|
|
|
|
});
|
2019-01-17 20:11:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private void resubmitComputation() {
|
|
|
|
setActiveWidget(computationExecutionPanel);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param computationTitle
|
|
|
|
* @param operator
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private void startComputation(Operator op) {
|
|
|
|
setActiveWidget(computationExecutionPanel);
|
|
|
|
computationExecutionPanel.startNewComputation(op);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-03-13 11:53:59 +01:00
|
|
|
public void addInvocation(InvocationModel invocationModel) {
|
2019-01-17 20:11:53 +01:00
|
|
|
setActiveWidget(computationPanel);
|
2019-03-13 11:53:59 +01:00
|
|
|
computationPanel.addInvocation(invocationModel);
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|