refs 2521: Explore the possibility to port the StatMan interface onto Dataminer

https://support.d4science.org/issues/2521

Fixed the visualization of properties 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128589 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-05-13 09:11:09 +00:00
parent 112931f5a9
commit c67176d5fb
6 changed files with 80 additions and 94 deletions

View File

@ -6,9 +6,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
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.ComputationDataRequestEvent;
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent; import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent; import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
import org.gcube.portlets.user.dataminermanager.client.events.ComputationDataRequestEvent;
import org.gcube.portlets.user.dataminermanager.client.events.RefreshDataMinerWorkAreaEvent; import org.gcube.portlets.user.dataminermanager.client.events.RefreshDataMinerWorkAreaEvent;
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionRequestEvent; import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionRequestEvent;
import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent; import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent;
@ -80,7 +80,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
setHeaderVisible(true); setHeaderVisible(true);
setResize(true); setResize(true);
setAnimCollapse(false); setAnimCollapse(false);
setHeadingText("Computations Executed"); setHeadingText("List of Computations");
} }
@ -188,21 +188,16 @@ public class ComputationsExecutedPanel extends FramedPanel {
return; return;
} }
List<String> showProperties = new ArrayList<String>(); List<String> showProperties = new ArrayList<String>();
showProperties.add(ComputationsProperties.COMPUTATION_ID.getLabel()); for (ComputationsPropertiesType computationsProperties : ComputationsPropertiesType
showProperties.add(ComputationsProperties.OPERATOR_NAME.getLabel()); .values()) {
//showProperties.add(ComputationsProperties.OPERATOR_DESCRIPTION.getLabel()); showProperties.add(computationsProperties.getLabel());
showProperties.add(ComputationsProperties.START_DATE.getLabel()); }
showProperties.add(ComputationsProperties.END_DATE.getLabel());
showProperties.add(ComputationsProperties.STATUS.getLabel());
showProperties.add(ComputationsProperties.VRE.getLabel());
//showProperties.add(ComputationsProperties.EXECUTION_TYPE.getLabel());
FilterCriteria filterCriteria = new FilterCriteria(); FilterCriteria filterCriteria = new FilterCriteria();
Map<String, String> map = new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
filterCriteria.setRequiredProperties(map); filterCriteria.setRequiredProperties(map);
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel( wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
event.getDataMinerWorkArea().getComputations().getFolder() event.getDataMinerWorkArea().getComputations().getFolder()
.getId(), false, showProperties, filterCriteria); .getId(), false, showProperties, filterCriteria);
@ -296,8 +291,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
}); });
btnOpen = new TextButton("Open"); btnOpen = new TextButton("Open");
// btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16()); // btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16());
btnOpen.setScale(ButtonScale.SMALL); btnOpen.setScale(ButtonScale.SMALL);
@ -339,7 +333,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
}); });
btnResubmit = new TextButton("Resubmit"); btnResubmit = new TextButton("Resubmit");
// btnResubmit.setIcon(StatAlgoImporterResources.INSTANCE.reload16()); // btnResubmit.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
btnResubmit.setScale(ButtonScale.SMALL); btnResubmit.setScale(ButtonScale.SMALL);
@ -353,10 +347,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
}); });
btnCancel = new TextButton("Cancel"); btnCancel = new TextButton("Cancel");
// btnCancel.setIcon(StatAlgoImporterResources.INSTANCE.reload16()); // btnCancel.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
btnCancel.setScale(ButtonScale.SMALL); btnCancel.setScale(ButtonScale.SMALL);
@ -370,7 +361,6 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
}); });
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.add(btnShow, new BoxLayoutData(new Margins(0))); toolBar.add(btnShow, new BoxLayoutData(new Margins(0)));
@ -393,9 +383,6 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
} }
private void refreshWSResourceExplorerPanel() { private void refreshWSResourceExplorerPanel() {
if (wsResourcesExplorerPanel != null) { if (wsResourcesExplorerPanel != null) {
wsResourcesExplorerPanel.refreshRootFolderView(); wsResourcesExplorerPanel.refreshRootFolderView();
@ -428,7 +415,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent); EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
Log.debug("Fired: " + deleteItemEvent); Log.debug("Fired: " + deleteItemEvent);
} }
private void showComputation() { private void showComputation() {
if (selectedItem != null) { if (selectedItem != null) {
@ -436,15 +423,15 @@ public class ComputationsExecutedPanel extends FramedPanel {
selectedItem.getId(), selectedItem.getName(), selectedItem.getId(), selectedItem.getName(),
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getOwner(), selectedItem.getPath(),
selectedItem.getType().name()); selectedItem.getType().name());
ComputationDataRequestEvent event=new ComputationDataRequestEvent(itemDescription); ComputationDataRequestEvent event = new ComputationDataRequestEvent(
itemDescription);
EventBusProvider.INSTANCE.fireEvent(event); EventBusProvider.INSTANCE.fireEvent(event);
} else { } else {
UtilsGXT3.info("Attention", "Select a computation!"); UtilsGXT3.info("Attention", "Select a computation!");
} }
} }
private void openFile() { private void openFile() {
@ -486,27 +473,26 @@ public class ComputationsExecutedPanel extends FramedPanel {
} }
} }
private void cancelComputation() { private void cancelComputation() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
private void resubmitComputation() { private void resubmitComputation() {
if (selectedItem != null) { if (selectedItem != null) {
ItemDescription itemDescription = new ItemDescription( ItemDescription itemDescription = new ItemDescription(
selectedItem.getId(), selectedItem.getName(), selectedItem.getId(), selectedItem.getName(),
selectedItem.getOwner(), selectedItem.getPath(), selectedItem selectedItem.getOwner(), selectedItem.getPath(),
.getType().name()); selectedItem.getType().name());
ResubmitComputationExecutionRequestEvent resubmitComputationEvent = new ResubmitComputationExecutionRequestEvent( ResubmitComputationExecutionRequestEvent resubmitComputationEvent = new ResubmitComputationExecutionRequestEvent(
itemDescription); itemDescription);
EventBusProvider.INSTANCE.fireEvent(resubmitComputationEvent); EventBusProvider.INSTANCE.fireEvent(resubmitComputationEvent);
Log.debug("Fired: " + resubmitComputationEvent); Log.debug("Fired: " + resubmitComputationEvent);
} else { } else {
UtilsGXT3.info("Attention", "Select a computation!"); UtilsGXT3.info("Attention", "Select a computation!");
} }
} }
} }

View File

@ -1,42 +0,0 @@
package org.gcube.portlets.user.dataminermanager.client.computations;
/**
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum ComputationsProperties {
OPERATOR_DESCRIPTION("operator_description"), OPERATOR_NAME(
"operator_name"), END_DATE("end_date"), ERROR("error"), COMPUTATION_ID(
"computation_id"), STATUS("status"), VRE("VRE"), EXECUTION_TYPE(
"execution_type"), START_DATE("start_date");
/**
* @param text
*/
private ComputationsProperties(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
public String getLabel() {
return id;
}
public static ComputationsProperties getFromId(String id) {
for (ComputationsProperties prop : values()) {
if (prop.id.compareToIgnoreCase(id) == 0) {
return prop;
}
}
return null;
}
}

View File

@ -0,0 +1,45 @@
package org.gcube.portlets.user.dataminermanager.client.computations;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum ComputationsPropertiesType {
OPERATOR_NAME("operator_name"), START_DATE("start_date"), END_DATE(
"end_date"), STATUS("status"), EXECUTION_TYPE("execution_type"), VRE(
"VRE");
// COMPUTATION_ID("computation_id"),
// OPERATOR_DESCRIPTION("operator_description"),
// ERROR("error"),
// EXECUTION_PLATFORM("execution_platform")
/**
* @param text
*/
private ComputationsPropertiesType(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
public String getLabel() {
return id;
}
public static ComputationsPropertiesType getFromId(String id) {
for (ComputationsPropertiesType prop : values()) {
if (prop.id.compareToIgnoreCase(id) == 0) {
return prop;
}
}
return null;
}
}

View File

@ -6,14 +6,14 @@ package org.gcube.portlets.user.dataminermanager.client.dataspace;
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public enum DataSpaceProperties { public enum DataSpacePropertiesType {
COMPUTATION_ID("computation_id"), DATA_ID("data_id"), DATA_TYPE("data_type"), OPERATOR_NAME( COMPUTATION_ID("computation_id"), DATA_DESCRIPTION(
"operator_name"), VRE("VRE"); "data_description"), CREATION_DATE("creation_date"), DATA_ID(
"data_id"), DATA_TYPE("data_type"), OPERATOR_NAME("operator"), VRE("VRE");
/** /**
* @param text * @param text
*/ */
private DataSpaceProperties(final String id) { private DataSpacePropertiesType(final String id) {
this.id = id; this.id = id;
} }
@ -28,8 +28,8 @@ public enum DataSpaceProperties {
return id; return id;
} }
public static DataSpaceProperties getFromId(String id) { public static DataSpacePropertiesType getFromId(String id) {
for (DataSpaceProperties prop : values()) { for (DataSpacePropertiesType prop : values()) {
if (prop.id.compareToIgnoreCase(id) == 0) { if (prop.id.compareToIgnoreCase(id) == 0) {
return prop; return prop;
} }

View File

@ -185,11 +185,9 @@ public class InputDataSetsPanel extends ContentPanel {
} }
List<String> showProperties = new ArrayList<String>(); List<String> showProperties = new ArrayList<String>();
showProperties.add(DataSpaceProperties.COMPUTATION_ID.getLabel()); for(DataSpacePropertiesType dataSpaceProperties:DataSpacePropertiesType.values()){
showProperties.add(DataSpaceProperties.DATA_ID.getLabel()); showProperties.add(dataSpaceProperties.getLabel());
showProperties.add(DataSpaceProperties.DATA_TYPE.getLabel()); }
showProperties.add(DataSpaceProperties.OPERATOR_NAME.getLabel());
showProperties.add(DataSpaceProperties.VRE.getLabel());
FilterCriteria filterCriteria = new FilterCriteria(); FilterCriteria filterCriteria = new FilterCriteria();
Map<String, String> map = new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
filterCriteria.setRequiredProperties(map); filterCriteria.setRequiredProperties(map);

View File

@ -184,11 +184,10 @@ public class OutputDataSetsPanel extends ContentPanel {
} }
List<String> showProperties = new ArrayList<String>(); List<String> showProperties = new ArrayList<String>();
showProperties.add(DataSpaceProperties.COMPUTATION_ID.getLabel()); for (DataSpacePropertiesType dataSpaceProperties : DataSpacePropertiesType
showProperties.add(DataSpaceProperties.DATA_ID.getLabel()); .values()) {
showProperties.add(DataSpaceProperties.DATA_TYPE.getLabel()); showProperties.add(dataSpaceProperties.getLabel());
showProperties.add(DataSpaceProperties.OPERATOR_NAME.getLabel()); }
showProperties.add(DataSpaceProperties.VRE.getLabel());
FilterCriteria filterCriteria = new FilterCriteria(); FilterCriteria filterCriteria = new FilterCriteria();
Map<String, String> map = new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
filterCriteria.setRequiredProperties(map); filterCriteria.setRequiredProperties(map);