2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed Layout on ComputationPanel git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@126949 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cf12db1eb6
commit
98f8c1859d
|
@ -11,7 +11,9 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.StringUtil;
|
import org.gcube.portlets.user.dataminermanager.shared.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ceras
|
*
|
||||||
|
* @author Giancarlo Panichi
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Operator implements Serializable {
|
public class Operator implements Serializable {
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.event.shared.HasHandlers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component Refresh Layout Event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ComponentRefreshLayoutEvent
|
||||||
|
extends
|
||||||
|
GwtEvent<ComponentRefreshLayoutEvent.ComponentRefreshLayoutEventHandler> {
|
||||||
|
|
||||||
|
public static Type<ComponentRefreshLayoutEventHandler> TYPE = new Type<ComponentRefreshLayoutEventHandler>();
|
||||||
|
|
||||||
|
public interface ComponentRefreshLayoutEventHandler extends EventHandler {
|
||||||
|
void onRefresh(ComponentRefreshLayoutEvent event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HasComponentRefreshLayoutEventHandler extends HasHandlers {
|
||||||
|
public HandlerRegistration addComponentRefreshLayoutEventHandler(
|
||||||
|
ComponentRefreshLayoutEventHandler handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentRefreshLayoutEvent() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ComponentRefreshLayoutEventHandler handler) {
|
||||||
|
handler.onRefresh(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<ComponentRefreshLayoutEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type<ComponentRefreshLayoutEventHandler> getType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fire(HasHandlers source,
|
||||||
|
ComponentRefreshLayoutEvent event) {
|
||||||
|
source.fireEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ComponentRefreshLayoutEvent []";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,58 +0,0 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.events;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
|
||||||
import com.google.gwt.event.shared.HandlerRegistration;
|
|
||||||
import com.google.gwt.event.shared.HasHandlers;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Empty ComputationPanal Event
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi" <a
|
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class EmptyComputationPanelEvent extends
|
|
||||||
GwtEvent<EmptyComputationPanelEvent.EmptyComputationPanelEventHandler> {
|
|
||||||
|
|
||||||
public static Type<EmptyComputationPanelEventHandler> TYPE = new Type<EmptyComputationPanelEventHandler>();
|
|
||||||
|
|
||||||
public interface EmptyComputationPanelEventHandler extends EventHandler {
|
|
||||||
void onEmpty(EmptyComputationPanelEvent event);
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface HasEmptyComputationPanelEventHandler extends HasHandlers {
|
|
||||||
public HandlerRegistration addEmptyComputationPanelEventHandler(
|
|
||||||
EmptyComputationPanelEventHandler handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EmptyComputationPanelEvent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void dispatch(EmptyComputationPanelEventHandler handler) {
|
|
||||||
handler.onEmpty(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Type<EmptyComputationPanelEventHandler> getAssociatedType() {
|
|
||||||
return TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Type<EmptyComputationPanelEventHandler> getType() {
|
|
||||||
return TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void fire(HasHandlers source,
|
|
||||||
EmptyComputationPanelEvent emptyComputationPanelEvent) {
|
|
||||||
source.fireEvent(emptyComputationPanelEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "EmptyComputationPanelEvent []";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.event.shared.HasHandlers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start Computation Event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class StartComputationEvent extends
|
||||||
|
GwtEvent<StartComputationEvent.StartComputationEventHandler> {
|
||||||
|
|
||||||
|
public static Type<StartComputationEventHandler> TYPE = new Type<StartComputationEventHandler>();
|
||||||
|
private Operator op;
|
||||||
|
private String computationTitle;
|
||||||
|
private String computationDescription;
|
||||||
|
|
||||||
|
public interface StartComputationEventHandler extends EventHandler {
|
||||||
|
void onStart(StartComputationEvent event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HasStartComputationEventHandler extends HasHandlers {
|
||||||
|
public HandlerRegistration addStartComputationEventHandler(
|
||||||
|
StartComputationEventHandler handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StartComputationEvent(Operator op, String computationTitle, String computationDescription) {
|
||||||
|
this.op=op;
|
||||||
|
this.computationTitle=computationTitle;
|
||||||
|
this.computationDescription=computationDescription;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(StartComputationEventHandler handler) {
|
||||||
|
handler.onStart(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<StartComputationEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type<StartComputationEventHandler> getType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fire(HasHandlers source,
|
||||||
|
StartComputationEvent startComputationEvent) {
|
||||||
|
source.fireEvent(startComputationEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Operator getOp() {
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComputationTitle() {
|
||||||
|
return computationTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComputationDescription() {
|
||||||
|
return computationDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StartComputationEvent [op=" + op + ", computationTitle="
|
||||||
|
+ computationTitle + ", computationDescription="
|
||||||
|
+ computationDescription + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,9 +1,13 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent;
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent.EmptyComputationPanelEventHandler;
|
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent.HasEmptyComputationPanelEventHandler;
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.ComponentRefreshLayoutEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.StartComputationEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.HasStartComputationEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.experimentArea.ComputationParametersPanel.ComputationParametersPanelHandler;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.HandlerRegistration;
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
@ -31,12 +35,13 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ComputationPanel extends FramedPanel implements
|
public class ComputationPanel extends FramedPanel implements
|
||||||
HasEmptyComputationPanelEventHandler {
|
HasStartComputationEventHandler {
|
||||||
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators";
|
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators";
|
||||||
private TextButton removeAllButton;
|
private TextButton removeAllButton;
|
||||||
private ToolBar toolBar;
|
private ToolBar toolBar;
|
||||||
private VerticalLayoutContainer topV;
|
private VerticalLayoutContainer topV;
|
||||||
private VerticalLayoutContainer v;
|
private VerticalLayoutContainer v;
|
||||||
|
private ComputationParametersPanel computationParametersPanel;
|
||||||
|
|
||||||
public ComputationPanel() {
|
public ComputationPanel() {
|
||||||
super();
|
super();
|
||||||
|
@ -47,10 +52,10 @@ public class ComputationPanel extends FramedPanel implements
|
||||||
private void init() {
|
private void init() {
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
setBodyStyle("backgroundColor:white;");
|
setBodyStyle("backgroundColor:white;");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void create() {
|
private void create() {
|
||||||
|
computationParametersPanel=null;
|
||||||
topV = new VerticalLayoutContainer();
|
topV = new VerticalLayoutContainer();
|
||||||
setToolBar();
|
setToolBar();
|
||||||
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
|
@ -76,8 +81,7 @@ public class ComputationPanel extends FramedPanel implements
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
emptyPanel();
|
emptyPanel();
|
||||||
EmptyComputationPanelEvent emptyEvent = new EmptyComputationPanelEvent();
|
computationParametersPanel = null;
|
||||||
fireEvent(emptyEvent);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -95,30 +99,49 @@ public class ComputationPanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
private void addComputationParametersPanel(
|
||||||
* @param workflowOperatorPanel
|
ComputationParametersPanel computationParametersPanel) {
|
||||||
* algorithm
|
|
||||||
*/
|
|
||||||
public void addWorkflowOperatorPanel(
|
|
||||||
WorkflowOperatorPanel workflowOperatorPanel) {
|
|
||||||
v.clear();
|
v.clear();
|
||||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||||
hBox.setPack(BoxLayoutPack.CENTER);
|
hBox.setPack(BoxLayoutPack.CENTER);
|
||||||
hBox.add(new Image(DataMinerManager.resources.workflowConnector1()),
|
hBox.add(new Image(DataMinerManager.resources.workflowConnector1()),
|
||||||
new BoxLayoutData(new Margins(0)));
|
new BoxLayoutData(new Margins(0)));
|
||||||
v.add(hBox, new VerticalLayoutData(1, -1, new Margins(10,0,0,0)));
|
v.add(hBox, new VerticalLayoutData(1, -1, new Margins(10,0,0,0)));
|
||||||
v.add(workflowOperatorPanel, new VerticalLayoutData(-1, -1,
|
v.add(computationParametersPanel, new VerticalLayoutData(1, -1,
|
||||||
new Margins(0))); // operator
|
new Margins(0,5,5,5)));
|
||||||
removeAllButton.setEnabled(true);
|
removeAllButton.setEnabled(true);
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HandlerRegistration addEmptyComputationPanelEventHandler(
|
public HandlerRegistration addStartComputationEventHandler(
|
||||||
EmptyComputationPanelEventHandler handler) {
|
StartComputationEventHandler handler) {
|
||||||
return addHandler(handler, EmptyComputationPanelEvent.getType());
|
return addHandler(handler, StartComputationEvent.getType());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addOperator(Operator op) {
|
||||||
|
computationParametersPanel = new ComputationParametersPanel(op);
|
||||||
|
computationParametersPanel.setHandler(new ComputationParametersPanelHandler() {
|
||||||
|
@Override
|
||||||
|
public void startComputation(String computationTitle,
|
||||||
|
String computationDescription) {
|
||||||
|
if (computationParametersPanel != null) {
|
||||||
|
forceLayout();
|
||||||
|
computationParametersPanel.updateOperatorParametersValues();
|
||||||
|
Operator op = computationParametersPanel.getOperator();
|
||||||
|
StartComputationEvent startComputationEvent = new StartComputationEvent(op, computationTitle, computationDescription);
|
||||||
|
fireEvent(startComputationEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
addComputationParametersPanel(computationParametersPanel);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,295 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.ComponentRefreshLayoutEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.HasComponentRefreshLayoutEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.AbstractFld;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.OperatorFieldWidget;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
|
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
||||||
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
import com.google.gwt.user.client.ui.Image;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.FormPanel;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ComputationParametersPanel extends SimpleContainer {
|
||||||
|
|
||||||
|
public interface ComputationParametersPanelHandler {
|
||||||
|
public void startComputation(String computationTitle,
|
||||||
|
String computationDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String START_BUTTON_TOOLTIP = "Start Computation";
|
||||||
|
|
||||||
|
private static final ImageResource PRELOAD_IMAGE = DataMinerManager.resources
|
||||||
|
.loaderBig();
|
||||||
|
|
||||||
|
private VerticalLayoutContainer v;
|
||||||
|
private Operator operator;
|
||||||
|
private FormPanel parametersPanel;
|
||||||
|
private FieldSet parametersFieldSet;
|
||||||
|
private VerticalLayoutContainer vParameters;
|
||||||
|
private Map<String, OperatorFieldWidget> fieldWidgetsMap;
|
||||||
|
private ComputationParametersPanelHandler handler = null;
|
||||||
|
private TextField titleField;
|
||||||
|
private String defaultComputationTitle;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* public ComputationParametersPanel(DataMinerPortletServiceAsync service,
|
||||||
|
* Operator operator, ComputationParametersPanelHandler handler) {
|
||||||
|
* this(operator); this.setHandler(handler); }
|
||||||
|
*/
|
||||||
|
|
||||||
|
public ComputationParametersPanel(Operator operator) {
|
||||||
|
super();
|
||||||
|
this.operator = operator;
|
||||||
|
fieldWidgetsMap = new HashMap<>();
|
||||||
|
try {
|
||||||
|
setDefaultComputationTitle();
|
||||||
|
init();
|
||||||
|
create();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
addStyleName("workflow");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void create() {
|
||||||
|
v = new VerticalLayoutContainer();
|
||||||
|
add(v);
|
||||||
|
|
||||||
|
Image img = new Image(GWT.getModuleBaseURL() + "../images/operators/"
|
||||||
|
+ (operator.hasImage() ? operator.getId() : "DEFAULT_IMAGE")
|
||||||
|
+ ".png");
|
||||||
|
img.setStylePrimaryName("workflow-icon");
|
||||||
|
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-10,0,0,5)));
|
||||||
|
|
||||||
|
HtmlLayoutContainer title = new HtmlLayoutContainer(operator.getName());
|
||||||
|
title.addStyleName("workflow-title");
|
||||||
|
v.add(title, new VerticalLayoutData(-1, -1, new Margins(15,0,0,-25)));
|
||||||
|
|
||||||
|
String descr = operator.getDescription();
|
||||||
|
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
||||||
|
: operator.getDescription();
|
||||||
|
HtmlLayoutContainer description = new HtmlLayoutContainer(descr);
|
||||||
|
description.addStyleName("workflow-description");
|
||||||
|
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0,0,0,5)));
|
||||||
|
|
||||||
|
addTitleField();
|
||||||
|
|
||||||
|
parametersPanel = new FormPanel() {
|
||||||
|
@Override
|
||||||
|
public boolean isValid(boolean preventMark) {
|
||||||
|
boolean flag = super.isValid(preventMark);
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
for (Map.Entry<String, OperatorFieldWidget> entry : fieldWidgetsMap
|
||||||
|
.entrySet()) {
|
||||||
|
OperatorFieldWidget fieldWidget = entry.getValue();
|
||||||
|
flag = flag && fieldWidget.isValid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
parametersPanel.setBorders(false);
|
||||||
|
|
||||||
|
// parametersPanel.getElement().getStyle().setMargin(20, px);
|
||||||
|
parametersFieldSet = new FieldSet();
|
||||||
|
parametersFieldSet.setHeadingText("Parameters");
|
||||||
|
vParameters = new VerticalLayoutContainer();
|
||||||
|
parametersFieldSet.add(vParameters, new MarginData(0));
|
||||||
|
parametersFieldSet.setCollapsible(false);
|
||||||
|
parametersPanel.add(parametersFieldSet, new MarginData(new Margins(5,5, 5, 5)));
|
||||||
|
|
||||||
|
v.add(parametersPanel, new VerticalLayoutData(1, -1, new Margins()));
|
||||||
|
|
||||||
|
loadOperatorParameters();
|
||||||
|
|
||||||
|
fireEvent(new ComponentRefreshLayoutEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private void addTitleField() {
|
||||||
|
titleField = new TextField();
|
||||||
|
titleField.setWidth(250);
|
||||||
|
titleField.setValue(defaultComputationTitle);
|
||||||
|
FieldLabel titleLabel = new FieldLabel(titleField, "Computation Title");
|
||||||
|
v.add(titleLabel, new VerticalLayoutData(-1, -1,
|
||||||
|
new Margins(0,0,0,5)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param parametersPanel
|
||||||
|
*/
|
||||||
|
private void loadOperatorParameters() {
|
||||||
|
DataMinerManager.getService().getParameters(operator,
|
||||||
|
new AsyncCallback<List<Parameter>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<Parameter> result) {
|
||||||
|
Log.debug("Retrieved Parameters!");
|
||||||
|
operator.setOperatorParameters(result);
|
||||||
|
vParameters.clear();
|
||||||
|
showForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
UtilsGXT3.alert("Error ",
|
||||||
|
"Impossible to retrieve parameters.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Image img = new Image(PRELOAD_IMAGE);
|
||||||
|
img.setStyleName("workflow-parameters-preload");
|
||||||
|
vParameters.add(img, new VerticalLayoutData(-1, -1, new Margins()));
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected void showForm() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
// field widgets creation
|
||||||
|
for (Parameter p : operator.getOperatorParameters()) {
|
||||||
|
OperatorFieldWidget fieldWidget = new OperatorFieldWidget(p);
|
||||||
|
fieldWidgetsMap.put(p.getName(), fieldWidget);
|
||||||
|
vParameters.add(fieldWidget.getParameterLabel(),
|
||||||
|
new VerticalLayoutData(1, -1, new Margins()));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Parameter p : operator.getOperatorParameters()) {
|
||||||
|
if (p.isColumn() || p.isColumnList()) {
|
||||||
|
// search for the table parameter which it depends
|
||||||
|
String tabParamName = (p.isColumn() ? ((ColumnParameter) p)
|
||||||
|
.getReferredTabularParameterName()
|
||||||
|
: ((ColumnListParameter) p)
|
||||||
|
.getReferredTabularParameterName());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// get the column field and the tabular field referred
|
||||||
|
TabularFld tabularField = (TabularFld) fieldWidgetsMap
|
||||||
|
.get(tabParamName).getField();
|
||||||
|
if (tabularField != null) {
|
||||||
|
AbstractFld field = fieldWidgetsMap
|
||||||
|
.get(p.getName()).getField();
|
||||||
|
tabularField.addChangeListener(field);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error",
|
||||||
|
"Column parameter \""
|
||||||
|
+ p.getName()
|
||||||
|
+ " refers to a tabular parameter that doesn't exists ("
|
||||||
|
+ tabParamName + ")\"", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final TextButton submit = new TextButton("Start Computation");
|
||||||
|
submit.setToolTip(START_BUTTON_TOOLTIP);
|
||||||
|
submit.setIcon(DataMinerManager.resources.startComputation());
|
||||||
|
submit.getElement().getStyle().setMarginLeft(20, Unit.PX);
|
||||||
|
submit.getElement().getStyle().setMarginBottom(20, Unit.PX);
|
||||||
|
|
||||||
|
submit.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
if (handler != null && parametersPanel.isValid()) {
|
||||||
|
String value = titleField.getValue();
|
||||||
|
String title = (value == null || value
|
||||||
|
.contentEquals("")) ? defaultComputationTitle
|
||||||
|
: value;
|
||||||
|
handler.startComputation(title, title); // TODO insert
|
||||||
|
// description
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//new VerticalLayoutData(-1, -1, new Margins(0, 0, 20,20))
|
||||||
|
v.add(submit);
|
||||||
|
|
||||||
|
forceLayout();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.error("Error in show form:" + e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateOperatorParametersValues() {
|
||||||
|
for (Map.Entry<String, OperatorFieldWidget> entry : fieldWidgetsMap
|
||||||
|
.entrySet()) {
|
||||||
|
OperatorFieldWidget fieldWidget = entry.getValue();
|
||||||
|
fieldWidget.updateOperatorParameterValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the operator
|
||||||
|
*/
|
||||||
|
public Operator getOperator() {
|
||||||
|
return operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHandler(ComputationParametersPanelHandler handler) {
|
||||||
|
this.handler = handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultComputationTitle() {
|
||||||
|
String name = this.operator.getName();
|
||||||
|
String date = DateTimeFormat
|
||||||
|
.getFormat(PredefinedFormat.DATE_TIME_SHORT).format(new Date());
|
||||||
|
defaultComputationTitle = name + "-" + date;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,252 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.form.AbstractFld;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.form.OperatorFieldWidget;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.form.TabularFld;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
|
||||||
import com.google.gwt.resources.client.ImageResource;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Image;
|
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.FormPanel;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ceras
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class WorkflowOperatorPanel extends SimpleContainer {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ceras
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface WorkflowOperatorPanelHandler {
|
|
||||||
public void startComputation(String computationTitle, String computationDescription);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String START_BUTTON_TOOLTIP = "Start Computation";
|
|
||||||
|
|
||||||
private static final ImageResource PRELOAD_IMAGE = DataMinerManager.resources.loaderBig();
|
|
||||||
|
|
||||||
private VerticalLayoutContainer v;
|
|
||||||
private Operator operator;
|
|
||||||
private FormPanel parametersPanel;
|
|
||||||
private FieldSet parametersFieldSet;
|
|
||||||
private Map<String, OperatorFieldWidget> fieldWidgetsMap = new HashMap<String, OperatorFieldWidget>();
|
|
||||||
//private Map<Parameter, String> parameterValues = new HashMap<Parameter, String>();
|
|
||||||
private WorkflowOperatorPanelHandler handler=null;
|
|
||||||
private TextField titleField;
|
|
||||||
|
|
||||||
private String defaultComputationTitle;
|
|
||||||
|
|
||||||
|
|
||||||
public WorkflowOperatorPanel(DataMinerPortletServiceAsync service, Operator operator, WorkflowOperatorPanelHandler handler) {
|
|
||||||
this(operator);
|
|
||||||
this.setHandler(handler);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public WorkflowOperatorPanel(Operator operator) {
|
|
||||||
super();
|
|
||||||
v=new VerticalLayoutContainer();
|
|
||||||
add(v);
|
|
||||||
|
|
||||||
this.operator = operator;
|
|
||||||
|
|
||||||
this.defaultComputationTitle = getDefaultComputationTitle();
|
|
||||||
//lc.setLayout(new FitLayout());
|
|
||||||
|
|
||||||
addStyleName("workflow");
|
|
||||||
|
|
||||||
Image img = new Image(GWT.getModuleBaseURL()+"../images/operators/"+(operator.hasImage() ? operator.getId() : "DEFAULT_IMAGE")+".png");
|
|
||||||
img.addStyleName("workflow-icon");
|
|
||||||
v.add(img);
|
|
||||||
|
|
||||||
HTML title = new HTML(operator.getName());
|
|
||||||
title.addStyleName("workflow-title");
|
|
||||||
v.add(title);
|
|
||||||
|
|
||||||
String descr = operator.getDescription();
|
|
||||||
descr = (descr==null || descr.contentEquals("")) ? "no-description" : operator.getDescription();
|
|
||||||
HTML description = new HTML(descr);
|
|
||||||
description.addStyleName("workflow-description");
|
|
||||||
v.add(description);
|
|
||||||
|
|
||||||
addTitleField();
|
|
||||||
|
|
||||||
parametersPanel = new FormPanel(){
|
|
||||||
@Override
|
|
||||||
public boolean isValid(boolean preventMark) {
|
|
||||||
boolean flag = super.isValid(preventMark);
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
for (Map.Entry<String, OperatorFieldWidget> entry : fieldWidgetsMap.entrySet()) {
|
|
||||||
OperatorFieldWidget fieldWidget = entry.getValue();
|
|
||||||
flag = flag && fieldWidget.isValid();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
parametersPanel.setBorders(false);
|
|
||||||
|
|
||||||
//parametersPanel.getElement().getStyle().setMargin(20, px);
|
|
||||||
parametersFieldSet = new FieldSet();
|
|
||||||
parametersFieldSet.setHeadingText("Parameters");
|
|
||||||
parametersPanel.add(parametersFieldSet);
|
|
||||||
|
|
||||||
v.add(parametersPanel);
|
|
||||||
|
|
||||||
loadOperatorParameters();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private void addTitleField() {
|
|
||||||
HorizontalLayoutContainer hp = new HorizontalLayoutContainer();
|
|
||||||
hp.add(new HTML("<div style='margin-left:30px; margin-right:10px; margin-top:5px'>Computation Title: </div>"));
|
|
||||||
titleField = new TextField();
|
|
||||||
titleField.setWidth(250);
|
|
||||||
titleField.setValue(this.defaultComputationTitle);
|
|
||||||
FieldLabel titleLabel=new FieldLabel(titleField,"Computation Title");
|
|
||||||
hp.add(titleLabel);
|
|
||||||
v.add(hp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param parametersPanel
|
|
||||||
*/
|
|
||||||
private void loadOperatorParameters() {
|
|
||||||
DataMinerManager.getService().getParameters(operator, new AsyncCallback<List<Parameter>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<Parameter> result) {
|
|
||||||
operator.setOperatorParameters(result);
|
|
||||||
parametersFieldSet.clear();
|
|
||||||
showForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
UtilsGXT3.alert("Error ", "Impossible to retrieve parameters.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Image img = new Image(PRELOAD_IMAGE);
|
|
||||||
img.setStyleName("workflow-parameters-preload");
|
|
||||||
parametersFieldSet.add(img);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected void showForm() {
|
|
||||||
// field widgets creation
|
|
||||||
for (Parameter p : operator.getOperatorParameters()) {
|
|
||||||
OperatorFieldWidget fieldWidget = new OperatorFieldWidget(p);
|
|
||||||
fieldWidgetsMap.put(p.getName(), fieldWidget);
|
|
||||||
parametersFieldSet.add(fieldWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Parameter p: operator.getOperatorParameters()) {
|
|
||||||
if (p.isColumn() || p.isColumnList()) {
|
|
||||||
// search for the table parameter which it depends
|
|
||||||
String tabParamName = (p.isColumn()
|
|
||||||
? ((ColumnParameter)p).getReferredTabularParameterName()
|
|
||||||
: ((ColumnListParameter)p).getReferredTabularParameterName());
|
|
||||||
|
|
||||||
try {
|
|
||||||
// get the column field and the tabular field referred
|
|
||||||
TabularFld tabularField = (TabularFld)fieldWidgetsMap.get(tabParamName).getField();
|
|
||||||
AbstractFld field = fieldWidgetsMap.get(p.getName()).getField();
|
|
||||||
tabularField.addChangeListener(field);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
UtilsGXT3.alert("Error", "Column parameter \""+p.getName()+" refers to a tabular parameter that doesn't exists ("+tabParamName+")\"", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
final TextButton submit = new TextButton("Start Computation");
|
|
||||||
submit.setToolTip(START_BUTTON_TOOLTIP);
|
|
||||||
submit.setIcon(DataMinerManager.resources.startComputation());
|
|
||||||
submit.getElement().getStyle().setMarginLeft(20,Unit.PX);
|
|
||||||
submit.getElement().getStyle().setMarginBottom(20, Unit.PX);
|
|
||||||
|
|
||||||
submit.addSelectHandler(new SelectHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelect(SelectEvent event) {
|
|
||||||
if (handler!=null && parametersPanel.isValid()) {
|
|
||||||
String value = titleField.getValue();
|
|
||||||
String title = (value==null || value.contentEquals("")) ? defaultComputationTitle : value;
|
|
||||||
handler.startComputation(title, title); // TODO insert description
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
v.add(submit);
|
|
||||||
forceLayout();
|
|
||||||
|
|
||||||
parametersPanel.forceLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateOperatorParametersValues() {
|
|
||||||
for (Map.Entry<String, OperatorFieldWidget> entry : fieldWidgetsMap.entrySet()) {
|
|
||||||
OperatorFieldWidget fieldWidget = entry.getValue();
|
|
||||||
fieldWidget.updateOperatorParameterValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the operator
|
|
||||||
*/
|
|
||||||
public Operator getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHandler(WorkflowOperatorPanelHandler handler) {
|
|
||||||
this.handler = handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultComputationTitle() {
|
|
||||||
String name = this.operator.getName();
|
|
||||||
//String date = DateTimeFormat.getShortDateTimeFormat().format(new Date());
|
|
||||||
String date = DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_SHORT).format(new Date());
|
|
||||||
|
|
||||||
return name+"-"+date;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,9 +6,8 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.experimentArea.WorkflowOperatorPanel.WorkflowOperatorPanelHandler;
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
||||||
|
@ -24,7 +23,7 @@ public class WorkflowPanel extends TabPanel {
|
||||||
|
|
||||||
public static final String DEFAULT_OPERATOR = "AQUAMAPS_SUITABLE";
|
public static final String DEFAULT_OPERATOR = "AQUAMAPS_SUITABLE";
|
||||||
|
|
||||||
private WorkflowOperatorPanel workflowOperatorPanel;
|
|
||||||
private ComputationExecutionPanel computationExecutionPanel;
|
private ComputationExecutionPanel computationExecutionPanel;
|
||||||
private ComputationPanel computationPanel;
|
private ComputationPanel computationPanel;
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ public class WorkflowPanel extends TabPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void create() {
|
private void create() {
|
||||||
workflowOperatorPanel = null;
|
|
||||||
|
|
||||||
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(
|
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(
|
||||||
".: Computation", false);
|
".: Computation", false);
|
||||||
|
@ -52,12 +50,13 @@ public class WorkflowPanel extends TabPanel {
|
||||||
.folderExplore());
|
.folderExplore());
|
||||||
computationPanel = new ComputationPanel();
|
computationPanel = new ComputationPanel();
|
||||||
computationPanel
|
computationPanel
|
||||||
.addEmptyComputationPanelEventHandler(new EmptyComputationPanelEvent.EmptyComputationPanelEventHandler() {
|
.addStartComputationEventHandler(new StartComputationEvent.StartComputationEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEmpty(EmptyComputationPanelEvent event) {
|
public void onStart(StartComputationEvent event) {
|
||||||
Log.debug("EmptyComputationPanelEvent Received");
|
Log.debug("StartComputationEvent Received:"+event);
|
||||||
workflowOperatorPanel = null;
|
startComputation(event.getOp(), event.getComputationTitle(),
|
||||||
|
event.getComputationDescription());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -93,35 +92,22 @@ public class WorkflowPanel extends TabPanel {
|
||||||
* @param operator
|
* @param operator
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void startComputation(String computationTitle,
|
private void startComputation(Operator op, String computationTitle,
|
||||||
String computationDescription) {
|
String computationDescription) {
|
||||||
|
setActiveWidget(computationExecutionPanel);
|
||||||
|
computationExecutionPanel.startNewComputation(op, computationTitle,
|
||||||
|
computationDescription);
|
||||||
|
|
||||||
if (workflowOperatorPanel != null) {
|
|
||||||
forceLayout();
|
|
||||||
workflowOperatorPanel.updateOperatorParametersValues();
|
|
||||||
Operator op = workflowOperatorPanel.getOperator();
|
|
||||||
|
|
||||||
computationExecutionPanel.startNewComputation(op, computationTitle,
|
|
||||||
computationDescription);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOperator(Operator op) {
|
public void addOperator(Operator op) {
|
||||||
setActiveWidget(computationPanel);
|
setActiveWidget(computationPanel);
|
||||||
|
computationPanel.addOperator(op);
|
||||||
workflowOperatorPanel = new WorkflowOperatorPanel(op);
|
|
||||||
workflowOperatorPanel.setHandler(new WorkflowOperatorPanelHandler() {
|
|
||||||
@Override
|
|
||||||
public void startComputation(String computationTitle,
|
|
||||||
String computationDescription) {
|
|
||||||
WorkflowPanel.this.startComputation(computationTitle,
|
|
||||||
computationDescription);
|
|
||||||
setActiveWidget(computationExecutionPanel);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
computationPanel.addWorkflowOperatorPanel(workflowOperatorPanel);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Giancarlo Panichi
|
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class StringFld extends AbstractFld {
|
|
||||||
|
|
||||||
private TextField textField;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param parameter
|
|
||||||
*/
|
|
||||||
public StringFld(Parameter parameter) {
|
|
||||||
super(parameter);
|
|
||||||
|
|
||||||
textField = new TextField();
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
|
||||||
textField.setValue(p.getDefaultValue());
|
|
||||||
|
|
||||||
if (p.getDefaultValue() == null)
|
|
||||||
textField.setAllowBlank(false);
|
|
||||||
if (p.getDescription() != null)
|
|
||||||
textField.setToolTip(p.getDescription());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getValue() {
|
|
||||||
return textField.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Widget getWidget() {
|
|
||||||
return textField;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +1,16 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ceras
|
*
|
||||||
|
* @author Giancarlo Panichi
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractFld {
|
public abstract class AbstractFld {
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.EnumParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.EnumParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
|
@ -1,35 +1,27 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ceras
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OperatorFieldWidget extends SimpleContainer {
|
public class OperatorFieldWidget {
|
||||||
|
|
||||||
private Parameter parameter;
|
private Parameter parameter;
|
||||||
|
|
||||||
private AbstractFld field;
|
private AbstractFld field;
|
||||||
private HorizontalLayoutContainer horiz;
|
private FieldLabel parameterLabel;
|
||||||
|
|
||||||
// private Field generalParameterField;
|
|
||||||
// private SimpleComboBox<String> inputDataParameterField;
|
|
||||||
// private TextField<String> outputDataParameterField;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -37,10 +29,8 @@ public class OperatorFieldWidget extends SimpleContainer {
|
||||||
public OperatorFieldWidget(Parameter p) {
|
public OperatorFieldWidget(Parameter p) {
|
||||||
super();
|
super();
|
||||||
this.parameter = p;
|
this.parameter = p;
|
||||||
horiz = new HorizontalLayoutContainer();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// this.setStyleAttribute("margin", "10px");
|
|
||||||
if (p.isObject())
|
if (p.isObject())
|
||||||
field = createObjectField((ObjectParameter) p);
|
field = createObjectField((ObjectParameter) p);
|
||||||
else if (p.isEnum())
|
else if (p.isEnum())
|
||||||
|
@ -58,22 +48,21 @@ public class OperatorFieldWidget extends SimpleContainer {
|
||||||
else if (p.isFile())
|
else if (p.isFile())
|
||||||
field = new FileFld(p);
|
field = new FileFld(p);
|
||||||
|
|
||||||
FieldLabel label = new FieldLabel(field.getWidget(), p.getName());
|
if (field == null) {
|
||||||
horiz.add(label, new HorizontalLayoutData(-1, 1, new Margins(0)));
|
parameterLabel = new FieldLabel(null, p.getName());
|
||||||
|
parameterLabel.setLabelWidth(200);
|
||||||
|
parameterLabel.setLabelWordWrap(true);
|
||||||
|
|
||||||
if (p.getDescription() != null) {
|
} else {
|
||||||
HTML descr = new HTML(p.getDescription());
|
parameterLabel = new FieldLabel(field.getWidget(), p.getName());
|
||||||
descr.addStyleName("workflow-fieldDescription");
|
parameterLabel.setLabelWidth(200);
|
||||||
horiz.add(descr);
|
parameterLabel.setLabelWordWrap(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.error("Error: " + e.getLocalizedMessage());
|
Log.error("Error: " + e.getLocalizedMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
horiz.add(new FieldLabel(new HTML("Error in field retrieving!"),p.getName()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add(horiz, new MarginData(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,6 +80,10 @@ public class OperatorFieldWidget extends SimpleContainer {
|
||||||
return getFieldValue();
|
return getFieldValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FieldLabel getParameterLabel() {
|
||||||
|
return parameterLabel;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param p
|
* @param p
|
||||||
* @return
|
* @return
|
|
@ -0,0 +1,87 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
|
import com.sencha.gxt.core.client.util.Padding;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class StringFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer simpleContainer;
|
||||||
|
private HorizontalLayoutContainer horiz;
|
||||||
|
private TextField textField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param parameter
|
||||||
|
*/
|
||||||
|
public StringFld(Parameter parameter) {
|
||||||
|
super(parameter);
|
||||||
|
simpleContainer=new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
|
|
||||||
|
textField = new TextField();
|
||||||
|
textField.setValue(p.getDefaultValue());
|
||||||
|
|
||||||
|
if (p.getDefaultValue() == null)
|
||||||
|
textField.setAllowBlank(false);
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr=new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
textField.setToolTip(p.getDescription());
|
||||||
|
descr=new HtmlLayoutContainer("<p style='margin-left:5px;'>"+p.getDescription()+"</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
|
||||||
|
horiz.add(textField,new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr,new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
/*horiz.add(textField, new HorizontalLayoutData(-1,-1,new Margins()));
|
||||||
|
horiz.add(descr,new HorizontalLayoutData(1,-1,new Margins()));*/
|
||||||
|
simpleContainer.add(horiz);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return textField.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Widget getWidget() {
|
||||||
|
return simpleContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.dataminermanager.client.form;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,13 +1,9 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.rpc;
|
package org.gcube.portlets.user.dataminermanager.client.rpc;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem;
|
import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem;
|
||||||
|
@ -32,21 +28,6 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
@RemoteServiceRelativePath("dataminerman")
|
@RemoteServiceRelativePath("dataminerman")
|
||||||
public interface DataMinerPortletService extends RemoteService {
|
public interface DataMinerPortletService extends RemoteService {
|
||||||
|
|
||||||
public UserInfo hello() throws ServiceException;
|
|
||||||
|
|
||||||
// get all operators and categories
|
|
||||||
public List<OperatorsClassification> getOperatorsClassifications()
|
|
||||||
throws Exception;
|
|
||||||
|
|
||||||
// get parameters for a given operator
|
|
||||||
public List<Parameter> getParameters(Operator operator) throws Exception;
|
|
||||||
|
|
||||||
public ComputationId startComputation(Operator op, String computationTitle,
|
|
||||||
String computationDescription) throws Exception;
|
|
||||||
|
|
||||||
// get a status for a computation
|
|
||||||
public ComputationStatus getComputationStatus(ComputationId computationId)
|
|
||||||
throws Exception;
|
|
||||||
|
|
||||||
// get tables info belongs to a given templates set (for relative user)
|
// get tables info belongs to a given templates set (for relative user)
|
||||||
public List<TableItemSimple> getTableItems(List<String> templates)
|
public List<TableItemSimple> getTableItems(List<String> templates)
|
||||||
|
@ -59,16 +40,6 @@ public interface DataMinerPortletService extends RemoteService {
|
||||||
|
|
||||||
public Map<String, String> getParametersMapByComputationId(ComputationId computationId) throws ServiceException;
|
public Map<String, String> getParametersMapByComputationId(ComputationId computationId) throws ServiceException;
|
||||||
|
|
||||||
public String importTable(CsvMetadata csvMetadata) throws Exception;
|
|
||||||
|
|
||||||
public CsvMetadata getCsvMetadataFromCsvImporterWizard() throws Exception;
|
|
||||||
|
|
||||||
public List<ImportStatus> getImportsStatus(Date todayDate)
|
|
||||||
throws ServiceException;
|
|
||||||
|
|
||||||
// get a status for an import
|
|
||||||
public ImportStatus getImportStatusById(String id) throws ServiceException;
|
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Resource> getMapFromMapResource(MapResource mapResource)
|
public Map<String, Resource> getMapFromMapResource(MapResource mapResource)
|
||||||
throws Exception;
|
throws Exception;
|
||||||
|
@ -86,11 +57,27 @@ public interface DataMinerPortletService extends RemoteService {
|
||||||
public String exportResource(String folderId, String fileName,
|
public String exportResource(String folderId, String fileName,
|
||||||
ResourceItem resourceItem) throws Exception;
|
ResourceItem resourceItem) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dataminer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public UserInfo hello() throws ServiceException;
|
||||||
|
|
||||||
|
public List<OperatorsClassification> getOperatorsClassifications()
|
||||||
|
throws Exception;
|
||||||
|
|
||||||
|
public List<Parameter> getParameters(Operator operator) throws Exception;
|
||||||
|
|
||||||
|
public ComputationId startComputation(Operator op, String computationTitle,
|
||||||
|
String computationDescription) throws Exception;
|
||||||
|
|
||||||
|
public ComputationStatus getComputationStatus(ComputationId computationId)
|
||||||
|
throws Exception;
|
||||||
|
|
||||||
|
|
||||||
public ComputationId resubmit(ComputationId computationId) throws ServiceException;
|
public ComputationId resubmit(ComputationId computationId) throws ServiceException;
|
||||||
|
|
||||||
public FileMetadata getFilePathFromImporterWizard() throws Exception;
|
|
||||||
|
|
||||||
public String importFile(FileMetadata fileMetadata) throws Exception;
|
|
||||||
|
|
||||||
public TableItemSimple retrieveTableInformation(Item item)
|
public TableItemSimple retrieveTableInformation(Item item)
|
||||||
throws ServiceException;
|
throws ServiceException;
|
||||||
|
|
|
@ -37,6 +37,37 @@ public interface DataMinerPortletServiceAsync {
|
||||||
.create(DataMinerPortletService.class);
|
.create(DataMinerPortletService.class);
|
||||||
|
|
||||||
|
|
||||||
|
void getTableItems(List<String> templates,
|
||||||
|
AsyncCallback<List<TableItemSimple>> callback);
|
||||||
|
|
||||||
|
void getFileItems(List<String> templates,
|
||||||
|
AsyncCallback<List<TableItemSimple>> callback);
|
||||||
|
|
||||||
|
|
||||||
|
void getResourceByComputationId(ComputationId computationId,
|
||||||
|
AsyncCallback<Resource> callback);
|
||||||
|
|
||||||
|
void getMapFromMapResource(MapResource mapResource,
|
||||||
|
AsyncCallback<Map<String, Resource>> callback);
|
||||||
|
|
||||||
|
void getParametersMapByComputationId(ComputationId computationId,
|
||||||
|
AsyncCallback<Map<String, String>> callback);
|
||||||
|
|
||||||
|
void saveImage(ComputationId computationId, ImagesResource imageResource,
|
||||||
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
void removeResource(String id, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
|
void removeImport(String id, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
|
void exportResource(String folderId, String fileName,
|
||||||
|
ResourceItem resourceItem, AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DataMiner
|
||||||
|
*
|
||||||
|
*/
|
||||||
void hello(AsyncCallback<UserInfo> callback);
|
void hello(AsyncCallback<UserInfo> callback);
|
||||||
|
|
||||||
void getOperatorsClassifications(
|
void getOperatorsClassifications(
|
||||||
|
@ -52,47 +83,8 @@ public interface DataMinerPortletServiceAsync {
|
||||||
void getComputationStatus(ComputationId computationId,
|
void getComputationStatus(ComputationId computationId,
|
||||||
AsyncCallback<ComputationStatus> asyncCallback);
|
AsyncCallback<ComputationStatus> asyncCallback);
|
||||||
|
|
||||||
void getTableItems(List<String> templates,
|
|
||||||
AsyncCallback<List<TableItemSimple>> callback);
|
|
||||||
|
|
||||||
void getFileItems(List<String> templates,
|
|
||||||
AsyncCallback<List<TableItemSimple>> callback);
|
|
||||||
|
|
||||||
|
|
||||||
void getResourceByComputationId(ComputationId computationId,
|
|
||||||
AsyncCallback<Resource> callback);
|
|
||||||
|
|
||||||
void importTable(CsvMetadata csvMetadata, AsyncCallback<String> callback);
|
|
||||||
|
|
||||||
void getImportsStatus(Date todayDate,
|
|
||||||
AsyncCallback<List<ImportStatus>> callback);
|
|
||||||
|
|
||||||
void getImportStatusById(String id, AsyncCallback<ImportStatus> callback);
|
|
||||||
|
|
||||||
void getMapFromMapResource(MapResource mapResource,
|
|
||||||
AsyncCallback<Map<String, Resource>> callback);
|
|
||||||
|
|
||||||
void getParametersMapByComputationId(ComputationId computationId,
|
|
||||||
AsyncCallback<Map<String, String>> callback);
|
|
||||||
|
|
||||||
void saveImage(ComputationId computationId, ImagesResource imageResource,
|
|
||||||
AsyncCallback<String> callback);
|
|
||||||
|
|
||||||
void removeResource(String id, AsyncCallback<Void> callback);
|
|
||||||
|
|
||||||
void removeImport(String id, AsyncCallback<Void> callback);
|
|
||||||
|
|
||||||
void getCsvMetadataFromCsvImporterWizard(AsyncCallback<CsvMetadata> callback);
|
|
||||||
|
|
||||||
void exportResource(String folderId, String fileName,
|
|
||||||
ResourceItem resourceItem, AsyncCallback<String> callback);
|
|
||||||
|
|
||||||
void resubmit(ComputationId computationId, AsyncCallback<ComputationId> callback);
|
void resubmit(ComputationId computationId, AsyncCallback<ComputationId> callback);
|
||||||
|
|
||||||
void getFilePathFromImporterWizard(AsyncCallback<FileMetadata> callback);
|
|
||||||
|
|
||||||
void importFile(FileMetadata fileMetadata, AsyncCallback<String> callback);
|
|
||||||
|
|
||||||
void retrieveTableInformation(Item item, AsyncCallback<TableItemSimple> callback);
|
void retrieveTableInformation(Item item, AsyncCallback<TableItemSimple> callback);
|
||||||
|
|
||||||
void getDataMinerWorkArea(AsyncCallback<DataMinerWorkArea> asyncCallback);
|
void getDataMinerWorkArea(AsyncCallback<DataMinerWorkArea> asyncCallback);
|
||||||
|
|
|
@ -47,19 +47,19 @@
|
||||||
<entry-point
|
<entry-point
|
||||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||||
|
|
||||||
<!--
|
|
||||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||||
/> -->
|
/>
|
||||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
|
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
|
||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
|
<!--
|
||||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||||
<set-property name="log_DivLogger" value="DISABLED" />
|
<set-property name="log_DivLogger" value="DISABLED" />
|
||||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
<set-property name="log_SystemLogger" value="DISABLED" /> -->
|
||||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
|
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
|
||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package org.gcube.portlets.user.dataminermanager.server;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -20,10 +19,6 @@ import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException;
|
||||||
import org.gcube.common.homelibrary.util.WorkspaceUtil;
|
import org.gcube.common.homelibrary.util.WorkspaceUtil;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem;
|
import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem;
|
||||||
|
@ -327,106 +322,7 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String importTable(CsvMetadata csvMetadata) throws Exception {
|
|
||||||
try {
|
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
|
||||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
|
||||||
|
|
||||||
return "1";
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e.getLocalizedMessage(), e);
|
|
||||||
// e.printStackTrace();
|
|
||||||
throw (e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String importFile(FileMetadata fileMetadata) throws Exception {
|
|
||||||
try {
|
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
|
||||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
|
||||||
|
|
||||||
String id = "";
|
|
||||||
|
|
||||||
return id;
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e.getLocalizedMessage(), e);
|
|
||||||
throw (e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CsvMetadata getCsvMetadataFromCsvImporterWizard() throws Exception {
|
|
||||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
|
||||||
//CSVParserConfiguration csvParserConfiguration = (CSVParserConfiguration) httpSession
|
|
||||||
// .getAttribute("csvParserConfiguration");
|
|
||||||
//String csvImportFilePath = (String) httpSession
|
|
||||||
// .getAttribute("csvImportFilePath");
|
|
||||||
//boolean hasHeader = csvParserConfiguration.isHasHeader();
|
|
||||||
//String delimiter = "" + csvParserConfiguration.getDelimiter();
|
|
||||||
//String comment = "" + csvParserConfiguration.getComment();
|
|
||||||
|
|
||||||
//return new CsvMetadata(hasHeader, csvImportFilePath, delimiter, comment);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FileMetadata getFilePathFromImporterWizard() throws Exception {
|
|
||||||
FileMetadata result;
|
|
||||||
// logger.info("getFilePathFromImporterWizard");
|
|
||||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
|
||||||
String fileImportFilePath = (String) httpSession
|
|
||||||
.getAttribute("fileImportPath");
|
|
||||||
// logger.info("filePaht: " + fileImportFilePath);
|
|
||||||
String type = (String) httpSession.getAttribute("typeFile");
|
|
||||||
// logger.info("type: " + type);
|
|
||||||
|
|
||||||
if (type == "DARWINCORE") {
|
|
||||||
String fileTaxaImportFilePath = (String) httpSession
|
|
||||||
.getAttribute("generatedTaxaFilePath");
|
|
||||||
// logger.info("fileTaxaImportFilePath: " + fileTaxaImportFilePath);
|
|
||||||
String fileVernacularImportFilePath = (String) httpSession
|
|
||||||
.getAttribute("generatedVernacular");
|
|
||||||
// logger.info("fileVernacularImportFilePath: "
|
|
||||||
// + fileVernacularImportFilePath);
|
|
||||||
|
|
||||||
result = new FileMetadata(fileImportFilePath,
|
|
||||||
fileTaxaImportFilePath, fileVernacularImportFilePath, type);
|
|
||||||
} else
|
|
||||||
result = new FileMetadata(fileImportFilePath, type);
|
|
||||||
|
|
||||||
// logger.info("result.filePath: " + result.getFileAbsolutePath());
|
|
||||||
// logger.info("result.type: " + result.getType());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ImportStatus> getImportsStatus(Date todayDate)
|
|
||||||
throws ServiceException {
|
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
|
||||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
|
||||||
|
|
||||||
List<ImportStatus> listStatus = new ArrayList<ImportStatus>();
|
|
||||||
|
|
||||||
return listStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ImportStatus getImportStatusById(String importId)
|
|
||||||
throws ServiceException {
|
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
|
||||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
|
||||||
|
|
||||||
Status status = Status.COMPLETE;
|
|
||||||
|
|
||||||
ImportStatus importStatus = new ImportStatus();
|
|
||||||
|
|
||||||
importStatus.setStatus(status);
|
|
||||||
|
|
||||||
return importStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -617,4 +513,5 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,8 +191,7 @@
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WORKFLOW PANEL */
|
.tableImporter, .uploadMonitor {
|
||||||
.workflow, .tableImporter, .uploadMonitor {
|
|
||||||
box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
||||||
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
||||||
rgba(77, 77, 77, 1);
|
rgba(77, 77, 77, 1);
|
||||||
|
@ -215,6 +214,33 @@
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* WORKFLOW PANEL */
|
||||||
|
.workflow {
|
||||||
|
box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
||||||
|
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
||||||
|
rgba(77, 77, 77, 1);
|
||||||
|
-moz-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
||||||
|
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
||||||
|
rgba(77, 77, 77, 1);
|
||||||
|
-webkit-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
||||||
|
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
||||||
|
rgba(77, 77, 77, 1);
|
||||||
|
-o-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
|
||||||
|
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
|
||||||
|
rgba(77, 77, 77, 1);
|
||||||
|
border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-o-border-radius: 5px;
|
||||||
|
/*padding: 5px;*/
|
||||||
|
border: 1px solid black;
|
||||||
|
/*margin-left: 5px;
|
||||||
|
margin-right: 5px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.workflow-icon {
|
.workflow-icon {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -228,22 +254,18 @@
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #000077;
|
color: #000077;
|
||||||
margin: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.workflow-description {
|
.workflow-description {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #505050;
|
color: #505050;
|
||||||
margin-left: 65px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.workflow-fieldDescription {
|
.workflow-fieldDescription {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #505050;
|
color: #505050;
|
||||||
text-align: right;
|
|
||||||
margin-left: 20px;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-templatesList {
|
.workflow-templatesList {
|
||||||
|
|
Loading…
Reference in New Issue