refs 4713: DataMiner - Add a direct link to the algorithms
https://support.d4science.org/issues/4713 Added direct link git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@130300 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a1ed1043a5
commit
cf49f22d33
|
@ -9,6 +9,7 @@ import org.gcube.portlets.user.dataminermanager.client.experiments.ExperimentPan
|
||||||
import org.gcube.portlets.user.dataminermanager.client.resources.Resources;
|
import org.gcube.portlets.user.dataminermanager.client.resources.Resources;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRegionType;
|
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRegionType;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRequestEventType;
|
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRequestEventType;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.type.MenuType;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
||||||
|
|
||||||
|
@ -27,18 +28,15 @@ 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.SimpleContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.Viewport;
|
import com.sencha.gxt.widget.core.client.container.Viewport;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point classes define <code>onModuleLoad()</code>.
|
* Entry point classes define <code>onModuleLoad()</code>.
|
||||||
*/
|
*/
|
||||||
public class DataMinerManager implements EntryPoint {
|
public class DataMinerManager implements EntryPoint {
|
||||||
public static final Resources resources = GWT.create(Resources.class);
|
public static final Resources resources = GWT.create(Resources.class);
|
||||||
|
|
||||||
private static final String SM_DIV = "contentDiv";
|
private static final String SM_DIV = "contentDiv";
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private DataMinerManagerController dataMinerManagerController;
|
private DataMinerManagerController dataMinerManagerController;
|
||||||
|
|
||||||
private Header header;
|
private Header header;
|
||||||
private HomePanel homePanel;
|
private HomePanel homePanel;
|
||||||
private DataSpacePanel dataSpacePanel;
|
private DataSpacePanel dataSpacePanel;
|
||||||
|
@ -47,8 +45,7 @@ public class DataMinerManager implements EntryPoint {
|
||||||
|
|
||||||
private SimpleContainer previousPanel;
|
private SimpleContainer previousPanel;
|
||||||
private SimpleContainer centerPanel;
|
private SimpleContainer centerPanel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -100,7 +97,7 @@ public class DataMinerManager implements EntryPoint {
|
||||||
dataSpacePanel = new DataSpacePanel();
|
dataSpacePanel = new DataSpacePanel();
|
||||||
experimentPanel = new ExperimentPanel();
|
experimentPanel = new ExperimentPanel();
|
||||||
computationsPanel = new ComputationsPanel();
|
computationsPanel = new ComputationsPanel();
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
|
@ -109,15 +106,14 @@ public class DataMinerManager implements EntryPoint {
|
||||||
mainPanelLayout.setBorders(false);
|
mainPanelLayout.setBorders(false);
|
||||||
mainPanelLayout.setResize(true);
|
mainPanelLayout.setResize(true);
|
||||||
mainPanelLayout.getElement().getStyle().setBackgroundColor("#FFFFFF");
|
mainPanelLayout.getElement().getStyle().setBackgroundColor("#FFFFFF");
|
||||||
|
|
||||||
// Center
|
// Center
|
||||||
centerPanel = new SimpleContainer();
|
centerPanel = new SimpleContainer();
|
||||||
MarginData mainData = new MarginData(new Margins(0));
|
MarginData mainData = new MarginData(new Margins(0));
|
||||||
mainPanelLayout.setCenterWidget(centerPanel, mainData);
|
mainPanelLayout.setCenterWidget(centerPanel, mainData);
|
||||||
|
|
||||||
|
|
||||||
// Menu
|
// Menu
|
||||||
header = new Header();
|
header = new Header();
|
||||||
|
|
||||||
BorderLayoutData menuData = new BorderLayoutData(40);
|
BorderLayoutData menuData = new BorderLayoutData(40);
|
||||||
menuData.setMargins(new Margins(5));
|
menuData.setMargins(new Margins(5));
|
||||||
|
@ -127,14 +123,24 @@ public class DataMinerManager implements EntryPoint {
|
||||||
mainPanelLayout.setNorthWidget(header, menuData);
|
mainPanelLayout.setNorthWidget(header, menuData);
|
||||||
|
|
||||||
//
|
//
|
||||||
centerPanel.add(homePanel);
|
|
||||||
previousPanel = homePanel;
|
if (dataMinerManagerController.getOperatorId() != null
|
||||||
|
&& !dataMinerManagerController.getOperatorId().isEmpty()){
|
||||||
|
header.setMenu(MenuType.EXPERIMENT);
|
||||||
|
centerPanel.add(experimentPanel);
|
||||||
|
previousPanel = experimentPanel;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
centerPanel.add(homePanel);
|
||||||
|
previousPanel = homePanel;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bindWindow(mainPanelLayout);
|
bindWindow(mainPanelLayout);
|
||||||
mainPanelLayout.forceLayout();
|
mainPanelLayout.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bind() {
|
private void bind() {
|
||||||
EventBusProvider.INSTANCE.addHandler(MenuSwitchEvent.TYPE,
|
EventBusProvider.INSTANCE.addHandler(MenuSwitchEvent.TYPE,
|
||||||
new MenuSwitchEvent.MenuSwitchEventHandler() {
|
new MenuSwitchEvent.MenuSwitchEventHandler() {
|
||||||
|
@ -183,19 +189,16 @@ public class DataMinerManager implements EntryPoint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
private void menuSwitch(MenuSwitchEvent event){
|
private void menuSwitch(MenuSwitchEvent event) {
|
||||||
if(event==null||event.getMenuType()==null){
|
if (event == null || event.getMenuType() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(event.getMenuType()){
|
switch (event.getMenuType()) {
|
||||||
case COMPUTATIONS:
|
case COMPUTATIONS:
|
||||||
switchPanel(computationsPanel);
|
switchPanel(computationsPanel);
|
||||||
fireDataMinerWorkAreareRequestUpdate(DataMinerWorkAreaRegionType.Computations);
|
fireDataMinerWorkAreareRequestUpdate(DataMinerWorkAreaRegionType.Computations);
|
||||||
|
@ -212,19 +215,19 @@ public class DataMinerManager implements EntryPoint {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fireDataMinerWorkAreareRequestUpdate(DataMinerWorkAreaRegionType dataMinerWorkAreaRegionType) {
|
private void fireDataMinerWorkAreareRequestUpdate(
|
||||||
|
DataMinerWorkAreaRegionType dataMinerWorkAreaRegionType) {
|
||||||
DataMinerWorkAreaRequestEvent event = new DataMinerWorkAreaRequestEvent(
|
DataMinerWorkAreaRequestEvent event = new DataMinerWorkAreaRequestEvent(
|
||||||
DataMinerWorkAreaRequestEventType.UPDATE, dataMinerWorkAreaRegionType);
|
DataMinerWorkAreaRequestEventType.UPDATE,
|
||||||
|
dataMinerWorkAreaRegionType);
|
||||||
EventBusProvider.INSTANCE.fireEvent(event);
|
EventBusProvider.INSTANCE.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param panel
|
* @param panel
|
||||||
|
@ -236,8 +239,4 @@ public class DataMinerManager implements EntryPoint {
|
||||||
previousPanel = panel;
|
previousPanel = panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class DataMinerManagerController {
|
||||||
private DataMinerWorkArea dataMinerWorkArea;
|
private DataMinerWorkArea dataMinerWorkArea;
|
||||||
private List<OperatorsClassification> operatorsClassifications;
|
private List<OperatorsClassification> operatorsClassifications;
|
||||||
private MenuType currentVisualization;
|
private MenuType currentVisualization;
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
public DataMinerManagerController() {
|
public DataMinerManagerController() {
|
||||||
init();
|
init();
|
||||||
|
@ -68,9 +69,14 @@ public class DataMinerManagerController {
|
||||||
public DataMinerWorkArea getDataMinerWorkArea() {
|
public DataMinerWorkArea getDataMinerWorkArea() {
|
||||||
return dataMinerWorkArea;
|
return dataMinerWorkArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOperatorId(){
|
||||||
|
return operatorId;
|
||||||
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
currentVisualization = MenuType.HOME;
|
currentVisualization = MenuType.HOME;
|
||||||
|
restoreUISession();
|
||||||
bind();
|
bind();
|
||||||
callHello();
|
callHello();
|
||||||
checkSession();
|
checkSession();
|
||||||
|
@ -256,6 +262,14 @@ public class DataMinerManagerController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void restoreUISession() {
|
||||||
|
// checkLocale();
|
||||||
|
operatorId = com.google.gwt.user.client.Window.Location
|
||||||
|
.getParameter(Constants.DATA_MINER_OPERATOR_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void callHello() {
|
private void callHello() {
|
||||||
|
|
||||||
DataMinerPortletServiceAsync.INSTANCE
|
DataMinerPortletServiceAsync.INSTANCE
|
||||||
|
@ -521,8 +535,15 @@ public class DataMinerManagerController {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OperatorsClassificationEvent ocEvent = new OperatorsClassificationEvent(
|
|
||||||
|
OperatorsClassificationEvent ocEvent;
|
||||||
|
if(event.isOperatorId()){
|
||||||
|
ocEvent = new OperatorsClassificationEvent(
|
||||||
|
find, operatorId);
|
||||||
|
} else {
|
||||||
|
ocEvent = new OperatorsClassificationEvent(
|
||||||
find);
|
find);
|
||||||
|
}
|
||||||
EventBusProvider.INSTANCE.fireEvent(ocEvent);
|
EventBusProvider.INSTANCE.fireEvent(ocEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,8 +565,15 @@ public class DataMinerManagerController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OperatorsClassificationEvent ocEvent = new OperatorsClassificationEvent(
|
|
||||||
|
OperatorsClassificationEvent ocEvent;
|
||||||
|
if(event.isOperatorId()){
|
||||||
|
ocEvent = new OperatorsClassificationEvent(
|
||||||
|
event.getClassificationName(), find, operatorId);
|
||||||
|
} else {
|
||||||
|
ocEvent = new OperatorsClassificationEvent(
|
||||||
event.getClassificationName(), find);
|
event.getClassificationName(), find);
|
||||||
|
}
|
||||||
EventBusProvider.INSTANCE.fireEvent(ocEvent);
|
EventBusProvider.INSTANCE.fireEvent(ocEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,54 @@ public class Header extends HorizontalPanel {
|
||||||
menuComputations.setVisible(false);
|
menuComputations.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMenu(MenuType menuType){
|
||||||
|
Log.debug("SetMenu: " + menuType);
|
||||||
|
|
||||||
|
if (menuType.compareTo(MenuType.HOME) == 0) {
|
||||||
|
menuGoBack.setVisible(false);
|
||||||
|
menuDataSpace.setVisible(false);
|
||||||
|
menuExperiment.setVisible(false);
|
||||||
|
menuComputations.setVisible(false);
|
||||||
|
|
||||||
|
if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.EXPERIMENT) == 0)
|
||||||
|
menuExperiment.removeStyleName("menuItemImage-selected");
|
||||||
|
else if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.DATA_SPACE) == 0)
|
||||||
|
menuDataSpace.removeStyleName("menuItemImage-selected");
|
||||||
|
else if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.COMPUTATIONS) == 0)
|
||||||
|
menuComputations.removeStyleName("menuItemImage-selected");
|
||||||
|
} else {
|
||||||
|
if (currentSelection == null
|
||||||
|
|| (currentSelection != null && currentSelection
|
||||||
|
.compareTo(MenuType.HOME) == 0)) {
|
||||||
|
menuGoBack.setVisible(true);
|
||||||
|
menuDataSpace.setVisible(true);
|
||||||
|
menuExperiment.setVisible(true);
|
||||||
|
menuComputations.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.EXPERIMENT) == 0)
|
||||||
|
menuExperiment.removeStyleName("menuItemImage-selected");
|
||||||
|
else if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.DATA_SPACE) == 0)
|
||||||
|
menuDataSpace.removeStyleName("menuItemImage-selected");
|
||||||
|
else if (currentSelection != null
|
||||||
|
&& currentSelection.compareTo(MenuType.COMPUTATIONS) == 0)
|
||||||
|
menuComputations.removeStyleName("menuItemImage-selected");
|
||||||
|
|
||||||
|
Image imgNew = (menuType.compareTo(MenuType.DATA_SPACE) == 0 ? menuDataSpace
|
||||||
|
: (menuType.compareTo(MenuType.EXPERIMENT) == 0 ? menuExperiment
|
||||||
|
: menuComputations));
|
||||||
|
|
||||||
|
imgNew.addStyleName("menuItemImage-selected");
|
||||||
|
}
|
||||||
|
|
||||||
|
currentSelection = menuType;
|
||||||
|
return;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param inputSpace
|
* @param inputSpace
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* 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, Comparable<Operator> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4084498655645951188L;
|
private static final long serialVersionUID = -4084498655645951188L;
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -231,4 +231,9 @@ public class Operator implements Serializable {
|
||||||
+ operatorParameters + ", hasImage=" + hasImage + "]";
|
+ operatorParameters + ", hasImage=" + hasImage + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Operator o) {
|
||||||
|
return id.compareTo(o.getId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OperatorCategory implements Serializable {
|
public class OperatorCategory implements Serializable, Comparable<OperatorCategory> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7511425996378626337L;
|
private static final long serialVersionUID = 7511425996378626337L;
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -215,6 +215,11 @@ public class OperatorCategory implements Serializable {
|
||||||
+ description + ", operators=" + operators + ", hasImage="
|
+ description + ", operators=" + operators + ", hasImage="
|
||||||
+ hasImage + "]";
|
+ hasImage + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(OperatorCategory o) {
|
||||||
|
return id.compareTo(o.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,28 +24,45 @@ public class OperatorsClassificationEvent
|
||||||
private OperatorsClassificationRequestType operatorsClassificationRequestType;
|
private OperatorsClassificationRequestType operatorsClassificationRequestType;
|
||||||
private String classificationName;
|
private String classificationName;
|
||||||
private OperatorsClassification operatorsClassification;
|
private OperatorsClassification operatorsClassification;
|
||||||
|
private String operatorId;
|
||||||
public interface OperatorsClassificationEventHandler extends
|
|
||||||
EventHandler {
|
public interface OperatorsClassificationEventHandler extends EventHandler {
|
||||||
void onOperatorsClassification(OperatorsClassificationEvent event);
|
void onOperatorsClassification(OperatorsClassificationEvent event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface HasOperatorsClassificationEventHandler extends
|
public interface HasOperatorsClassificationEventHandler extends HasHandlers {
|
||||||
HasHandlers {
|
|
||||||
public HandlerRegistration addOperatorsClassificationEventHandler(
|
public HandlerRegistration addOperatorsClassificationEventHandler(
|
||||||
OperatorsClassificationEventHandler handler);
|
OperatorsClassificationEventHandler handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OperatorsClassificationEvent(OperatorsClassification operatorsClassification) {
|
|
||||||
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
|
||||||
this.operatorsClassification=operatorsClassification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OperatorsClassificationEvent(
|
public OperatorsClassificationEvent(
|
||||||
String classificationName, OperatorsClassification operatorsClassification) {
|
OperatorsClassification operatorsClassification) {
|
||||||
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
||||||
|
this.operatorsClassification = operatorsClassification;
|
||||||
|
this.operatorId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OperatorsClassificationEvent(String classificationName,
|
||||||
|
OperatorsClassification operatorsClassification) {
|
||||||
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
||||||
this.classificationName=classificationName;
|
this.classificationName = classificationName;
|
||||||
this.operatorsClassification=operatorsClassification;
|
this.operatorsClassification = operatorsClassification;
|
||||||
|
this.operatorId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OperatorsClassificationEvent(
|
||||||
|
OperatorsClassification operatorsClassification, String operatorId) {
|
||||||
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
||||||
|
this.operatorsClassification = operatorsClassification;
|
||||||
|
this.operatorId = operatorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OperatorsClassificationEvent(String classificationName,
|
||||||
|
OperatorsClassification operatorsClassification, String operatorId) {
|
||||||
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
||||||
|
this.classificationName = classificationName;
|
||||||
|
this.operatorsClassification = operatorsClassification;
|
||||||
|
this.operatorId = operatorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,6 +96,10 @@ public class OperatorsClassificationEvent
|
||||||
return operatorsClassification;
|
return operatorsClassification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOperatorId() {
|
||||||
|
return operatorId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "OperatorsClassificationEvent [operatorsClassificationRequestType="
|
return "OperatorsClassificationEvent [operatorsClassificationRequestType="
|
||||||
|
@ -86,11 +107,7 @@ public class OperatorsClassificationEvent
|
||||||
+ ", classificationName="
|
+ ", classificationName="
|
||||||
+ classificationName
|
+ classificationName
|
||||||
+ ", operatorsClassification="
|
+ ", operatorsClassification="
|
||||||
+ operatorsClassification + "]";
|
+ operatorsClassification + ", operatorId=" + operatorId + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,8 @@ public class OperatorsClassificationRequestEvent
|
||||||
public static Type<OperatorsClassificationRequestEventHandler> TYPE = new Type<OperatorsClassificationRequestEventHandler>();
|
public static Type<OperatorsClassificationRequestEventHandler> TYPE = new Type<OperatorsClassificationRequestEventHandler>();
|
||||||
private OperatorsClassificationRequestType operatorsClassificationRequestType;
|
private OperatorsClassificationRequestType operatorsClassificationRequestType;
|
||||||
private String classificationName;
|
private String classificationName;
|
||||||
|
private boolean operatorId;
|
||||||
|
|
||||||
public interface OperatorsClassificationRequestEventHandler extends
|
public interface OperatorsClassificationRequestEventHandler extends
|
||||||
EventHandler {
|
EventHandler {
|
||||||
void onRequest(OperatorsClassificationRequestEvent event);
|
void onRequest(OperatorsClassificationRequestEvent event);
|
||||||
|
@ -34,16 +35,24 @@ public class OperatorsClassificationRequestEvent
|
||||||
OperatorsClassificationRequestEventHandler handler);
|
OperatorsClassificationRequestEventHandler handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OperatorsClassificationRequestEvent() {
|
/*public OperatorsClassificationRequestEvent() {
|
||||||
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
||||||
}
|
this.operatorId = false;
|
||||||
|
}*/
|
||||||
public OperatorsClassificationRequestEvent(
|
|
||||||
String classificationName) {
|
public OperatorsClassificationRequestEvent(String classificationName,
|
||||||
|
boolean operatorId) {
|
||||||
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
||||||
this.classificationName=classificationName;
|
this.classificationName = classificationName;
|
||||||
|
this.operatorId = operatorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*public OperatorsClassificationRequestEvent(String classificationName) {
|
||||||
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
||||||
|
this.classificationName = classificationName;
|
||||||
|
this.operatorId = false;
|
||||||
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dispatch(OperatorsClassificationRequestEventHandler handler) {
|
protected void dispatch(OperatorsClassificationRequestEventHandler handler) {
|
||||||
handler.onRequest(this);
|
handler.onRequest(this);
|
||||||
|
@ -71,14 +80,16 @@ public class OperatorsClassificationRequestEvent
|
||||||
return classificationName;
|
return classificationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOperatorId() {
|
||||||
|
return operatorId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "OperatorsClassificationRequestEvent [operatorsClassificationRequestType="
|
return "OperatorsClassificationRequestEvent [operatorsClassificationRequestType="
|
||||||
+ operatorsClassificationRequestType
|
+ operatorsClassificationRequestType
|
||||||
+ ", classificationName="
|
+ ", classificationName="
|
||||||
+ classificationName + "]";
|
+ classificationName + ", operatorId=" + operatorId + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import org.gcube.portlets.user.dataminermanager.client.parametersfield.OperatorF
|
||||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.exception.SessionExpiredServiceException;
|
import org.gcube.portlets.user.dataminermanager.shared.exception.SessionExpiredServiceException;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnListParameter;
|
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnListParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnParameter;
|
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnParameter;
|
||||||
|
@ -28,6 +29,7 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.resources.client.ImageResource;
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
import com.google.gwt.user.client.Window.Location;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
|
@ -98,8 +100,18 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
img.setStylePrimaryName("workflow-icon");// -15
|
img.setStylePrimaryName("workflow-icon");// -15
|
||||||
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-15, 0, 0, 5)));
|
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-15, 0, 0, 5)));
|
||||||
|
|
||||||
HtmlLayoutContainer title = new HtmlLayoutContainer("<span>"
|
String locationRef = "";
|
||||||
+ operator.getName() + "</span>");
|
try {
|
||||||
|
String location = Location.getHref();
|
||||||
|
String[] locationData = location.split("\\?");
|
||||||
|
locationRef=locationData[0];
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.error("Error retrieving location: "+e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
HtmlLayoutContainer title = new HtmlLayoutContainer("<span><a href='"
|
||||||
|
+ locationRef + "?" + Constants.DATA_MINER_OPERATOR_ID + "="
|
||||||
|
+ operator.getId() + "'>" + operator.getName() + "</a></span>");
|
||||||
title.addStyleName("workflow-title");
|
title.addStyleName("workflow-title");
|
||||||
v.add(title, new VerticalLayoutData(-1, -1, new Margins(20, 0, 0, -25)));
|
v.add(title, new VerticalLayoutData(-1, -1, new Margins(20, 0, 0, -25)));
|
||||||
|
|
||||||
|
@ -107,8 +119,8 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
||||||
: operator.getDescription();// display:block;clear:both;'
|
: operator.getDescription();// display:block;clear:both;'
|
||||||
HtmlLayoutContainer description = new HtmlLayoutContainer(
|
HtmlLayoutContainer description = new HtmlLayoutContainer(
|
||||||
"<span style='padding-left:10px;padding-right:10px;display:inline-block;'>" + descr
|
"<span style='padding-left:10px;padding-right:10px;display:inline-block;'>"
|
||||||
+ "</span>");
|
+ descr + "</span>");
|
||||||
description.addStyleName("workflow-description");
|
description.addStyleName("workflow-description");
|
||||||
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0)));
|
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
|
||||||
|
@ -282,7 +294,7 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.error("Error in show form:" + e.getLocalizedMessage());
|
Log.error("Error in show form:" + e.getLocalizedMessage());
|
||||||
Log.error("Error: "+Arrays.asList(e.getStackTrace()).toString());
|
Log.error("Error: " + Arrays.asList(e.getStackTrace()).toString());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,14 @@ public class OperatorCategoryPanel extends SimpleContainer {
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public OperatorCategory getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void create(){
|
private void create(){
|
||||||
v=new VerticalLayoutContainer();
|
v=new VerticalLayoutContainer();
|
||||||
add(v);
|
add(v);
|
||||||
|
@ -149,4 +157,21 @@ public class OperatorCategoryPanel extends SimpleContainer {
|
||||||
isCollapsed = false;
|
isCollapsed = false;
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDefaultOperator(){
|
||||||
|
expand();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setOperatorDefault(Operator operatorDefault) {
|
||||||
|
expand();
|
||||||
|
for(OperatorPanel opPanel:operatorPanelsList){
|
||||||
|
if(opPanel.getOperator().compareTo(operatorDefault)==0){
|
||||||
|
opPanel.setAsTheDefaultOperator();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,4 +127,9 @@ public class OperatorPanel extends SimpleContainer {
|
||||||
this.removeStyleName("operatorPanel-selected");
|
this.removeStyleName("operatorPanel-selected");
|
||||||
// titleHtml.removeStyleName("operatorPanel-title-selected");
|
// titleHtml.removeStyleName("operatorPanel-title-selected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAsTheDefaultOperator(){
|
||||||
|
handler.addOperator(OperatorPanel.this, operator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ public class OperatorsPanel extends FramedPanel {
|
||||||
private View view = null;
|
private View view = null;
|
||||||
private String currentClassificationName = Constants.UserClassificationName;
|
private String currentClassificationName = Constants.UserClassificationName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -118,8 +119,56 @@ public class OperatorsPanel extends FramedPanel {
|
||||||
operators.clear();
|
operators.clear();
|
||||||
operators.addAll(event.getOperatorsClassification()
|
operators.addAll(event.getOperatorsClassification()
|
||||||
.getOperators());
|
.getOperators());
|
||||||
|
String operatorId = event.getOperatorId();
|
||||||
|
|
||||||
|
Log.debug("ShowCategoriesList");
|
||||||
|
List<OperatorCategoryPanel> categoryPanels = mapCategoriesPanels
|
||||||
|
.get(currentClassificationName);
|
||||||
|
if (categoryPanels == null) {
|
||||||
|
categoryPanels = new ArrayList<OperatorCategoryPanel>();
|
||||||
|
if (operatorsClassification != null) {
|
||||||
|
for (OperatorCategory cat : operatorsClassification
|
||||||
|
.getOperatorCategories()) {
|
||||||
|
categoryPanels.add(new OperatorCategoryPanel(
|
||||||
|
handler, cat));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mapCategoriesPanels.put(currentClassificationName,
|
||||||
|
categoryPanels);
|
||||||
|
}
|
||||||
|
|
||||||
|
v.clear();
|
||||||
|
for (OperatorCategoryPanel panel : categoryPanels){
|
||||||
|
v.add(panel);
|
||||||
|
|
||||||
|
}
|
||||||
|
view = View.CATEGORIES;
|
||||||
|
if(operatorId!=null&&!operatorId.isEmpty()){
|
||||||
|
OperatorCategory operatorCategoryDefault=null;
|
||||||
|
Operator operatorDefault=null;
|
||||||
|
for(Operator op:operators){
|
||||||
|
if(op.getId().compareTo(operatorId)==0){
|
||||||
|
operatorDefault=op;
|
||||||
|
operatorCategoryDefault=op.getCategory();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(operatorCategoryDefault!=null){
|
||||||
|
for (OperatorCategoryPanel opCategoryPanel : categoryPanels){
|
||||||
|
if(opCategoryPanel.getCategory().compareTo(operatorCategoryDefault)==0){
|
||||||
|
opCategoryPanel.setOperatorDefault(operatorDefault);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
forceLayout();
|
||||||
}
|
}
|
||||||
showCategoriesList(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,29 +186,10 @@ public class OperatorsPanel extends FramedPanel {
|
||||||
add(topV);
|
add(topV);
|
||||||
waitMessage(true);
|
waitMessage(true);
|
||||||
OperatorsClassificationRequestEvent operatorsClassificationRequestEvent = new OperatorsClassificationRequestEvent(
|
OperatorsClassificationRequestEvent operatorsClassificationRequestEvent = new OperatorsClassificationRequestEvent(
|
||||||
currentClassificationName);
|
currentClassificationName, true);
|
||||||
Log.debug("OperatorsPanel fire: "+operatorsClassificationRequestEvent);
|
Log.debug("OperatorsPanel fire: " + operatorsClassificationRequestEvent);
|
||||||
EventBusProvider.INSTANCE
|
EventBusProvider.INSTANCE
|
||||||
.fireEvent(operatorsClassificationRequestEvent);
|
.fireEvent(operatorsClassificationRequestEvent);
|
||||||
|
|
||||||
/*
|
|
||||||
* // if the operators classification is not loaded, let's load by an
|
|
||||||
* rpc if (DataMinerManager.getOperatorsClassifications() == null) {
|
|
||||||
*
|
|
||||||
* DataMinerPortletServiceAsync.INSTANCE
|
|
||||||
* .getOperatorsClassifications(new
|
|
||||||
* AsyncCallback<List<OperatorsClassification>>() {
|
|
||||||
*
|
|
||||||
* @Override public void onSuccess( List<OperatorsClassification>
|
|
||||||
* result) { waitMessage(false);
|
|
||||||
*
|
|
||||||
* DataMinerManager .setOperatorsClassifications(result);
|
|
||||||
* showCategoriesList(false); }
|
|
||||||
*
|
|
||||||
* @Override public void onFailure(Throwable caught) {
|
|
||||||
* waitMessage(false); UtilsGXT3.alert("Error", ERROR_GET_OPERATORS); }
|
|
||||||
* }); } else showCategoriesList(false);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -263,7 +293,6 @@ public class OperatorsPanel extends FramedPanel {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void waitMessage(boolean show) {
|
private void waitMessage(boolean show) {
|
||||||
if (show)
|
if (show)
|
||||||
this.mask(LOADING_MESSAGE);
|
this.mask(LOADING_MESSAGE);
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class Constants {
|
||||||
public static final String DATA_MINER_MANAGER_ID = "DataMinerManagerId";
|
public static final String DATA_MINER_MANAGER_ID = "DataMinerManagerId";
|
||||||
public static final String DATA_MINER_LANG_COOKIE = "DataMinerLangCookie";
|
public static final String DATA_MINER_LANG_COOKIE = "DataMinerLangCookie";
|
||||||
public static final String DATA_MINER_LANG = "DataMinerLang";
|
public static final String DATA_MINER_LANG = "DataMinerLang";
|
||||||
public static final String DATA_MINER_ALGORITHM_ID = "AlgorirthmId";
|
public static final String DATA_MINER_OPERATOR_ID = "OperatorId";
|
||||||
|
|
||||||
|
|
||||||
public static final String DEFAULT_USER = "giancarlo.panichi";
|
public static final String DEFAULT_USER = "giancarlo.panichi";
|
||||||
|
|
Loading…
Reference in New Issue