2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Updated shows results for computations git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128550 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cba8207002
commit
8944d6dd0a
|
@ -3,9 +3,11 @@ package org.gcube.portlets.user.dataminermanager.client;
|
|||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.computations.ComputationsPanel;
|
||||
import org.gcube.portlets.user.dataminermanager.client.dataspace.DataSpacePanel;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.MenuSwitchEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.experiments.ExperimentPanel;
|
||||
import org.gcube.portlets.user.dataminermanager.client.resources.Resources;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRequestEventType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
||||
|
||||
|
@ -23,8 +25,7 @@ import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderL
|
|||
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.Viewport;
|
||||
//import com.google.gwt.event.logical.shared.ResizeEvent;
|
||||
//import com.google.gwt.event.logical.shared.ResizeHandler;
|
||||
|
||||
|
||||
/**
|
||||
* Entry point classes define <code>onModuleLoad()</code>.
|
||||
|
@ -196,9 +197,11 @@ public class DataMinerManager implements EntryPoint {
|
|||
switch(event.getMenuType()){
|
||||
case COMPUTATIONS:
|
||||
switchPanel(computationsPanel);
|
||||
fireDataMinerWorkAreareRequestUpdate();
|
||||
break;
|
||||
case DATA_SPACE:
|
||||
switchPanel(dataSpacePanel);
|
||||
fireDataMinerWorkAreareRequestUpdate();
|
||||
break;
|
||||
case EXPERIMENT:
|
||||
switchPanel(experimentPanel);
|
||||
|
@ -213,6 +216,14 @@ public class DataMinerManager implements EntryPoint {
|
|||
|
||||
}
|
||||
|
||||
private void fireDataMinerWorkAreareRequestUpdate() {
|
||||
DataMinerWorkAreaRequestEvent event = new DataMinerWorkAreaRequestEvent(
|
||||
DataMinerWorkAreaRequestEventType.UPDATE);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param panel
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.gcube.portlets.user.dataminermanager.client;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationExecutionRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||
|
@ -13,10 +12,10 @@ import org.gcube.portlets.user.dataminermanager.client.events.MenuEvent;
|
|||
import org.gcube.portlets.user.dataminermanager.client.events.MenuSwitchEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OperatorsClassificationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OperatorsClassificationRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputResourceEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputResourceRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputShowEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputShowRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputDataEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputDataRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationDataEvent;
|
||||
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.ResubmitComputationExecutionEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionRequestEvent;
|
||||
|
@ -30,7 +29,9 @@ import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaEve
|
|||
import org.gcube.portlets.user.dataminermanager.client.type.MenuType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea;
|
||||
|
@ -50,7 +51,6 @@ public class DataMinerManagerController {
|
|||
private DataMinerWorkArea dataMinerWorkArea;
|
||||
private List<OperatorsClassification> operatorsClassifications;
|
||||
private MenuType currentVisualization;
|
||||
private StatusMonitor monitor;
|
||||
|
||||
public DataMinerManagerController() {
|
||||
init();
|
||||
|
@ -162,15 +162,15 @@ public class DataMinerManagerController {
|
|||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
OutputResourceRequestEvent.TYPE,
|
||||
new OutputResourceRequestEvent.OutputResourceRequestEventHandler() {
|
||||
OutputDataRequestEvent.TYPE,
|
||||
new OutputDataRequestEvent.OutputDataRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onOutputRequest(
|
||||
OutputResourceRequestEvent event) {
|
||||
Log.debug("Catch OutputResourceRequestEvent: "
|
||||
OutputDataRequestEvent event) {
|
||||
Log.debug("Catch OutputDataRequestEvent: "
|
||||
+ event);
|
||||
manageOutputResourceRequestEvent(event);
|
||||
manageOutputDataRequestEvent(event);
|
||||
|
||||
}
|
||||
|
||||
|
@ -178,15 +178,15 @@ public class DataMinerManagerController {
|
|||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
OutputShowRequestEvent.TYPE,
|
||||
new OutputShowRequestEvent.OutputShowRequestEventHandler() {
|
||||
ComputationDataRequestEvent.TYPE,
|
||||
new ComputationDataRequestEvent.ComputationDataRequestEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onOutputShowRequest(OutputShowRequestEvent event) {
|
||||
Log.debug("Catch OutputShowRequestEvent: "
|
||||
public void onComputationDataRequest(ComputationDataRequestEvent event) {
|
||||
Log.debug("Catch ComputationDataRequestEvent: "
|
||||
+ event);
|
||||
manageOutputShowRequestEvent(event);
|
||||
manageComputationDataRequestEvent(event);
|
||||
|
||||
|
||||
}
|
||||
|
@ -262,7 +262,6 @@ public class DataMinerManagerController {
|
|||
public void onSuccess(UserInfo result) {
|
||||
userInfo = result;
|
||||
Log.info("Hello: " + userInfo.getUsername());
|
||||
retrieveDataMinerWorkArea();
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -287,7 +286,7 @@ public class DataMinerManagerController {
|
|||
|
||||
private void startComputationRequest(
|
||||
final StartComputationExecutionRequestEvent event) {
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(),
|
||||
new AsyncCallback<ComputationId>() {
|
||||
|
||||
|
@ -334,7 +333,7 @@ public class DataMinerManagerController {
|
|||
private void cancelComputationRequest(
|
||||
CancelComputationExecutionRequestEvent event) {
|
||||
final ComputationId computationId = event.getComputationId();
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId,
|
||||
new AsyncCallback<String>() {
|
||||
|
||||
|
@ -365,7 +364,7 @@ public class DataMinerManagerController {
|
|||
|
||||
private void resubmitComputationRequest(
|
||||
final ResubmitComputationExecutionRequestEvent event) {
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE.resubmit(
|
||||
event.getItemDescription(), new AsyncCallback<ComputationId>() {
|
||||
|
||||
|
@ -496,7 +495,7 @@ public class DataMinerManagerController {
|
|||
}
|
||||
|
||||
private void retrieveDataMinerWorkArea() {
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE
|
||||
.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
|
||||
|
||||
|
@ -534,7 +533,7 @@ public class DataMinerManagerController {
|
|||
}
|
||||
|
||||
private void deleteItemRequest(final DeleteItemRequestEvent event) {
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE.deleteItem(
|
||||
event.getItemDescription(), new AsyncCallback<Void>() {
|
||||
|
||||
|
@ -573,8 +572,8 @@ public class DataMinerManagerController {
|
|||
|
||||
}
|
||||
|
||||
private void manageOutputResourceRequestEvent(
|
||||
OutputResourceRequestEvent event) {
|
||||
private void manageOutputDataRequestEvent(
|
||||
OutputDataRequestEvent event) {
|
||||
if (event == null) {
|
||||
UtilsGXT3.alert("Error", "Invalid output request!");
|
||||
} else {
|
||||
|
@ -586,14 +585,14 @@ public class DataMinerManagerController {
|
|||
"Invalid output request, computation id: "
|
||||
+ event.getComputationId());
|
||||
} else {
|
||||
monitor = new StatusMonitor();
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE
|
||||
.getResourceByComputationId(event.getComputationId(),
|
||||
new AsyncCallback<Resource>() {
|
||||
.getOutputDataByComputationId(event.getComputationId(),
|
||||
new AsyncCallback<OutputData>() {
|
||||
@Override
|
||||
public void onSuccess(Resource resource) {
|
||||
public void onSuccess(OutputData outputData) {
|
||||
monitor.hide();
|
||||
fireOutputResourceEvent(resource);
|
||||
fireOutputDataEvent(outputData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -612,43 +611,42 @@ public class DataMinerManagerController {
|
|||
}
|
||||
}
|
||||
|
||||
private void fireOutputResourceEvent(Resource resource) {
|
||||
OutputResourceEvent event = new OutputResourceEvent(resource);
|
||||
private void fireOutputDataEvent(OutputData outputData) {
|
||||
OutputDataEvent event = new OutputDataEvent(outputData);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void manageOutputShowRequestEvent(OutputShowRequestEvent event) {
|
||||
private void manageComputationDataRequestEvent(ComputationDataRequestEvent event) {
|
||||
if (event == null) {
|
||||
UtilsGXT3.alert("Error", "Invalid show output request!");
|
||||
UtilsGXT3.alert("Error", "Invalid computation info request!");
|
||||
} else {
|
||||
if (event.getItemDescription() == null
|
||||
|| event.getItemDescription().getId() == null
|
||||
|| event.getItemDescription().getId().isEmpty()) {
|
||||
UtilsGXT3.alert(
|
||||
"Error",
|
||||
"Invalid show output request, item description: "
|
||||
"Invalid computation info request, item description: "
|
||||
+ event.getItemDescription());
|
||||
} else {
|
||||
monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE
|
||||
.getResourceByComputationItem(
|
||||
final StatusMonitor monitor = new StatusMonitor();
|
||||
DataMinerPortletServiceAsync.INSTANCE.getComputationData(
|
||||
event.getItemDescription(),
|
||||
new AsyncCallback<Resource>() {
|
||||
new AsyncCallback<ComputationData>() {
|
||||
@Override
|
||||
public void onSuccess(Resource resource) {
|
||||
public void onSuccess(ComputationData computationData) {
|
||||
monitor.hide();
|
||||
fireOutputShowEvent(resource);
|
||||
fireComputationDataEvent(computationData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
monitor.hide();
|
||||
Log.error("Error in getResourceByComputationItem: "
|
||||
Log.error("Error in getComputationData: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Error",
|
||||
"Impossible to retrieve output info. "
|
||||
"Impossible to retrieve computation info. "
|
||||
+ caught.getLocalizedMessage());
|
||||
|
||||
}
|
||||
|
@ -657,8 +655,8 @@ public class DataMinerManagerController {
|
|||
}
|
||||
}
|
||||
|
||||
protected void fireOutputShowEvent(Resource resource) {
|
||||
OutputShowEvent event = new OutputShowEvent(resource);
|
||||
private void fireComputationDataEvent(ComputationData computationData) {
|
||||
ComputationDataEvent event = new ComputationDataEvent(computationData);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,139 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7948340340190844208L;
|
||||
|
||||
private ComputationId computationId;
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String categoryId;
|
||||
private String operatorId;
|
||||
private String infrastructure;
|
||||
private Date creationDate;
|
||||
private Date endDate;
|
||||
private ComputationStatus status;
|
||||
private Resource resource;
|
||||
private Operator operator;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ComputationItem() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ComputationItem(ComputationId computationId, String operatorId) {
|
||||
this.computationId=computationId;
|
||||
this.operatorId=operatorId;
|
||||
}
|
||||
|
||||
/*
|
||||
public ComputationItem(ComputationId computationId, String name,
|
||||
String description, String categoryId, String operatorId,
|
||||
String infrastructure, Date creationDate, Date endDate,
|
||||
ComputationStatus status, Resource resource) {
|
||||
super();
|
||||
this.computationId = computationId;
|
||||
this.id = computationId.getId();
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.categoryId = categoryId;
|
||||
this.operatorId = operatorId;
|
||||
this.infrastructure = infrastructure;
|
||||
this.creationDate = creationDate;
|
||||
this.endDate = endDate;
|
||||
this.status = status;
|
||||
this.resource = resource;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
public OperatorCategory getOperatorCategory() {
|
||||
/*OperatorsClassification classification = DataMinerManager
|
||||
.getDefaultOperatorsClassification();
|
||||
if (classification == null)
|
||||
return null;
|
||||
else
|
||||
return classification.getCategoryById(categoryId);
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
|
||||
public Operator getOperator() {
|
||||
/*if (operator == null) {
|
||||
OperatorsClassification classification = DataMinerManager
|
||||
.getDefaultOperatorsClassification();
|
||||
if (classification != null)
|
||||
operator = classification.getOperatorById(operatorId);
|
||||
}
|
||||
return operator;*/
|
||||
return null;
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public String getOperatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
public String getInfrastructure() {
|
||||
return infrastructure;
|
||||
}
|
||||
|
||||
public Date getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public ComputationStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public Resource getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
}
|
|
@ -3,9 +3,14 @@ package org.gcube.portlets.user.dataminermanager.client.bean;
|
|||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationStatus implements Serializable {
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,8 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.parameters.Parameter;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OperatorCategory implements IsSerializable {
|
||||
public class OperatorCategory implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7511425996378626337L;
|
||||
private String id;
|
||||
private String name;
|
||||
private String briefDescription;
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OperatorsClassification implements IsSerializable {
|
||||
public class OperatorsClassification implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7347445659350838584L;
|
||||
private String name;
|
||||
private List<OperatorCategory> operatorCategories = new ArrayList<OperatorCategory>();
|
||||
private List<Operator> operators = new ArrayList<Operator>();
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ErrorResource extends Resource implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5452797429958563962L;
|
||||
private String stackTrace;
|
||||
|
||||
public ErrorResource() {
|
||||
super();
|
||||
this.setResourceType(ResourceType.ERROR);
|
||||
}
|
||||
|
||||
public ErrorResource(String stackTrace) {
|
||||
super();
|
||||
this.stackTrace = stackTrace;
|
||||
this.setResourceType(ResourceType.ERROR);
|
||||
}
|
||||
|
||||
public String getStackTrace() {
|
||||
return stackTrace;
|
||||
}
|
||||
|
||||
public void setStackTrace(String stackTrace) {
|
||||
this.stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ErrorResource [getResourceId()=" + getResourceId()
|
||||
+ ", getDescription()=" + getDescription() + ", getName()="
|
||||
+ getName() + ", getResourceType()=" + getResourceType()
|
||||
+ ", stackTrace=" + stackTrace + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class ColumnListParameter extends Parameter implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6743494426144267089L;
|
||||
String referredTabularParameterName;
|
||||
List<String> columnNames = new ArrayList<String>();
|
||||
String value;
|
||||
private String separator;
|
||||
|
||||
public ColumnListParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.COLUMN_LIST;
|
||||
}
|
||||
|
||||
public ColumnListParameter(String name, String description, String referredTabularParameterName, String separator) {
|
||||
super(name, ParameterTypology.COLUMN_LIST, description);
|
||||
this.referredTabularParameterName = referredTabularParameterName;
|
||||
this.separator = separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param referredTabularParameterName the referredTabularParameterName to set
|
||||
*/
|
||||
public void setReferredTabularParameterName(String referredTabularParameterName) {
|
||||
this.referredTabularParameterName = referredTabularParameterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the referredTabularParameterName
|
||||
*/
|
||||
public String getReferredTabularParameterName() {
|
||||
return referredTabularParameterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the separator
|
||||
*/
|
||||
public String getSeparator() {
|
||||
return separator;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class ColumnParameter extends Parameter implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5084557326770554659L;
|
||||
String referredTabularParameterName;
|
||||
String defaultColumn;
|
||||
String value;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ColumnParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.COLUMN;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ColumnParameter(String name, String description, String referredTabularParameterName, String defaultColumn) {
|
||||
super(name, ParameterTypology.COLUMN, description);
|
||||
this.referredTabularParameterName = referredTabularParameterName;
|
||||
this.defaultColumn = defaultColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param referredTabularParameterName the referredTabularParameterName to set
|
||||
*/
|
||||
public void setReferredTabularParameterName(
|
||||
String referredTabularParameterName) {
|
||||
this.referredTabularParameterName = referredTabularParameterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the referredTabularParameterName
|
||||
*/
|
||||
public String getReferredTabularParameterName() {
|
||||
return referredTabularParameterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultValue
|
||||
*/
|
||||
public String getDefaultColumn() {
|
||||
return defaultColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultValue the defaultValue to set
|
||||
*/
|
||||
public void setDefaultColumn(String defaultColumn) {
|
||||
this.defaultColumn = defaultColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class EnumParameter extends Parameter implements IsSerializable {
|
||||
|
||||
private static final long serialVersionUID = 1673874854501249519L;
|
||||
List<String> values = new ArrayList<String>();
|
||||
String defaultValue;
|
||||
String value;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public EnumParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.ENUM;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* @param defaultValue
|
||||
* @param value
|
||||
*/
|
||||
public EnumParameter(String name, String description, List<String> values, String defaultValue) {
|
||||
super(name, ParameterTypology.ENUM, description);
|
||||
this.values = values;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the defaultValue
|
||||
*/
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultValue the defaultValue to set
|
||||
*/
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param values the values to set
|
||||
*/
|
||||
public void setValues(List<String> values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the values
|
||||
*/
|
||||
public List<String> getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void addValue(String value) {
|
||||
this.values.add(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class FileParameter extends Parameter implements IsSerializable {
|
||||
|
||||
private static final long serialVersionUID = -2967577990287112937L;
|
||||
private String value;
|
||||
private String defaultMimeType;
|
||||
private ArrayList<String> supportedMimeTypes;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public FileParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.FILE;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @param description
|
||||
* @param fileName
|
||||
* @param mimeType
|
||||
*/
|
||||
public FileParameter(String name, String description, String defaultMimeType, ArrayList<String> supportedMimeTypes) {
|
||||
super(name, ParameterTypology.FILE, description);
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
public String getDefaultMimeType() {
|
||||
return defaultMimeType;
|
||||
}
|
||||
|
||||
public void setDefaultMimeType(String defaultMimeType) {
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSupportedMimeTypes() {
|
||||
return supportedMimeTypes;
|
||||
}
|
||||
|
||||
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value=value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileParameter [value=" + value + ", defaultMimeType="
|
||||
+ defaultMimeType + ", supportedMimeTypes="
|
||||
+ supportedMimeTypes + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class ListParameter extends Parameter implements IsSerializable {
|
||||
|
||||
private static final long serialVersionUID = 5405965026753332225L;
|
||||
private String type;
|
||||
private String value;
|
||||
private String separator;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ListParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.LIST;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultValue
|
||||
* @param value
|
||||
*/
|
||||
public ListParameter(String name, String description, String type, String separator) {
|
||||
super(name, ParameterTypology.LIST, description);
|
||||
this.type = type;
|
||||
this.separator = separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the separator
|
||||
*/
|
||||
public String getSeparator() {
|
||||
return separator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ListParameter [type=" + type + ", value=" + value
|
||||
+ ", separator=" + separator + ", name=" + name
|
||||
+ ", description=" + description + ", typology=" + typology
|
||||
+ "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class ObjectParameter extends Parameter implements IsSerializable {
|
||||
|
||||
private static final long serialVersionUID = 1058462575242430851L;
|
||||
private String type;
|
||||
private String defaultValue;
|
||||
private String value;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ObjectParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.OBJECT;
|
||||
}
|
||||
|
||||
|
||||
public ObjectParameter(String name, String description, String type, String defaultValue) {
|
||||
super(name, ParameterTypology.OBJECT, description);
|
||||
this.type = type;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultValue
|
||||
*/
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultValue the defaultValue to set
|
||||
*/
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ObjectParameter [type=" + type + ", defaultValue="
|
||||
+ defaultValue + ", value=" + value + ", name=" + name
|
||||
+ ", description=" + description + ", typology=" + typology
|
||||
+ "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public abstract class Parameter implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -555286289487491703L;
|
||||
|
||||
public enum ParameterTypology {
|
||||
OBJECT, TABULAR, FILE, ENUM, LIST, COLUMN, COLUMN_LIST, TABULAR_LIST
|
||||
};
|
||||
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected ParameterTypology typology;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Parameter() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @param type
|
||||
* @param description
|
||||
* @param defaultValue
|
||||
* @param value
|
||||
*/
|
||||
public Parameter(String name, ParameterTypology type, String description) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.typology = type;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public abstract void setValue(String value);
|
||||
|
||||
public abstract String getValue();
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the typology
|
||||
*/
|
||||
public ParameterTypology getTypology() {
|
||||
return typology;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param typology
|
||||
* the typology to set
|
||||
*/
|
||||
public void setTypology(ParameterTypology typology) {
|
||||
this.typology = typology;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public boolean isObject() {
|
||||
return this.typology == ParameterTypology.OBJECT;
|
||||
}
|
||||
|
||||
public boolean isTabular() {
|
||||
return this.typology == ParameterTypology.TABULAR;
|
||||
}
|
||||
|
||||
public boolean isFile() {
|
||||
return this.typology == ParameterTypology.FILE;
|
||||
}
|
||||
|
||||
public boolean isEnum() {
|
||||
return this.typology == ParameterTypology.ENUM;
|
||||
}
|
||||
|
||||
public boolean isList() {
|
||||
return this.typology == ParameterTypology.LIST;
|
||||
}
|
||||
|
||||
public boolean isColumn() {
|
||||
return this.typology == ParameterTypology.COLUMN;
|
||||
}
|
||||
|
||||
public boolean isColumnList() {
|
||||
return this.typology == ParameterTypology.COLUMN_LIST;
|
||||
}
|
||||
|
||||
public boolean isTabularList() {
|
||||
return this.typology == ParameterTypology.TABULAR_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Parameter [name=" + name + ", description=" + description
|
||||
+ ", typology=" + typology + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public class TabularListParameter extends Parameter implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1786477950530892502L;
|
||||
private String value;
|
||||
private String separator;
|
||||
private ArrayList<String> templates = new ArrayList<String>();
|
||||
private String defaultMimeType;
|
||||
private ArrayList<String> supportedMimeTypes;
|
||||
|
||||
// private List<String> tableNames = new ArrayList<String>();
|
||||
|
||||
public TabularListParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.TABULAR_LIST;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultValue
|
||||
* @param value
|
||||
*/
|
||||
public TabularListParameter(String name, String description,
|
||||
String separator, String defaultMimeType,
|
||||
ArrayList<String> supportedMimeTypes) {
|
||||
super(name, ParameterTypology.TABULAR_LIST, description);
|
||||
this.separator = separator;
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the separator
|
||||
*/
|
||||
public String getSeparator() {
|
||||
return separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param templates
|
||||
* the templates to set
|
||||
*/
|
||||
public void setTemplates(ArrayList<String> templates) {
|
||||
this.templates = templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the templates
|
||||
*/
|
||||
public ArrayList<String> getTemplates() {
|
||||
return templates;
|
||||
}
|
||||
|
||||
public void addTemplate(String template) {
|
||||
templates.add(template);
|
||||
}
|
||||
|
||||
public String getDefaultMimeType() {
|
||||
return defaultMimeType;
|
||||
}
|
||||
|
||||
public void setDefaultMimeType(String defaultMimeType) {
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSupportedMimeTypes() {
|
||||
return supportedMimeTypes;
|
||||
}
|
||||
|
||||
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
public void setSeparator(String separator) {
|
||||
this.separator = separator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TabularListParameter [value=" + value + ", separator="
|
||||
+ separator + ", templates=" + templates + ", defaultMimeType="
|
||||
+ defaultMimeType + ", supportedMimeTypes="
|
||||
+ supportedMimeTypes + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TabularParameter extends Parameter implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8038591467145151553L;
|
||||
private String tableName;
|
||||
private ArrayList<String> templates = new ArrayList<String>();
|
||||
private String defaultMimeType;
|
||||
private ArrayList<String> supportedMimeTypes;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public TabularParameter() {
|
||||
super();
|
||||
this.typology = ParameterTypology.TABULAR;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @param description
|
||||
* @param tableName
|
||||
*/
|
||||
public TabularParameter(String name, String description, String tableName,
|
||||
String defaultMimeType, ArrayList<String> supportedMimeTypes) {
|
||||
super(name, ParameterTypology.TABULAR, description);
|
||||
this.tableName = tableName;
|
||||
this.templates = null;
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @param description
|
||||
* @param tableName
|
||||
* @param templates
|
||||
*/
|
||||
public TabularParameter(String name, String description, String tableName,
|
||||
ArrayList<String> templates, String defaultMimeType,
|
||||
ArrayList<String> supportedMimeTypes) {
|
||||
super(name, ParameterTypology.TABULAR, description);
|
||||
this.tableName = tableName;
|
||||
this.templates = templates;
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public ArrayList<String> getTemplates() {
|
||||
return templates;
|
||||
}
|
||||
|
||||
public void setTemplates(ArrayList<String> templates) {
|
||||
this.templates = templates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return getTableName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
this.setTableName(value);
|
||||
}
|
||||
|
||||
public String getDefaultMimeType() {
|
||||
return defaultMimeType;
|
||||
}
|
||||
|
||||
public void setDefaultMimeType(String defaultMimeType) {
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSupportedMimeTypes() {
|
||||
return supportedMimeTypes;
|
||||
}
|
||||
|
||||
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TabularParameter [tableName=" + tableName + ", templates="
|
||||
+ templates + ", defaultMimeType=" + defaultMimeType
|
||||
+ ", supportedMimeTypes=" + supportedMimeTypes + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,511 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
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.ComputationDataRequestEvent;
|
||||
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.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.UIStateEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaElementType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
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.toolbar.ToolBar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationsExecutedPanel extends FramedPanel {
|
||||
|
||||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||
private TextButton btnShow;
|
||||
private TextButton btnOpen;
|
||||
private TextButton btnDelete;
|
||||
private TextButton btnRefresh;
|
||||
private TextButton btnResubmit;
|
||||
private TextButton btnCancel;
|
||||
private VerticalLayoutContainer v;
|
||||
|
||||
public ComputationsExecutedPanel() {
|
||||
super();
|
||||
Log.debug("ComputationsPanel");
|
||||
|
||||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
init();
|
||||
bindToEvents();
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setId("ComputationsPanel");
|
||||
forceLayoutOnResize = true;
|
||||
setBodyBorder(true);
|
||||
setBodyStyle("backgroundColor:white;");
|
||||
setHeaderVisible(true);
|
||||
setResize(true);
|
||||
setAnimCollapse(false);
|
||||
setHeadingText("Computations");
|
||||
|
||||
}
|
||||
|
||||
private void bindToEvents() {
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(DataMinerWorkAreaEvent event) {
|
||||
manageDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void manageStateEvents(UIStateEvent event) {
|
||||
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||
+ event.toString());
|
||||
switch (event.getUiStateType()) {
|
||||
case START:
|
||||
break;
|
||||
case WAITING:
|
||||
break;
|
||||
case UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||
|
||||
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||
+ event.toString());
|
||||
switch (event.getDataMinerWorkAreaEventType()) {
|
||||
case OPEN:
|
||||
case UPDATE:
|
||||
refreshWSResourceExplorerPanel(event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void manageRefreshDataMinerWorkAreaEvents(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
switch (event.getDataMinerWorkAreaElementType()) {
|
||||
case Computations:
|
||||
refreshWSResourceExplorerPanel();
|
||||
break;
|
||||
case InputDataSets:
|
||||
break;
|
||||
case OutputDataSets:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void create(DataMinerWorkAreaEvent event) {
|
||||
try {
|
||||
|
||||
if (event == null
|
||||
|| event.getDataMinerWorkArea() == null
|
||||
|| event.getDataMinerWorkArea().getComputations() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId().isEmpty()) {
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
forceLayout();
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
List<String> showProperties = new ArrayList<String>();
|
||||
showProperties.add(ComputationsProperties.COMPUTATION_ID.getLabel());
|
||||
showProperties.add(ComputationsProperties.OPERATOR_NAME.getLabel());
|
||||
//showProperties.add(ComputationsProperties.OPERATOR_DESCRIPTION.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();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
filterCriteria.setRequiredProperties(map);
|
||||
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||
event.getDataMinerWorkArea().getComputations().getFolder()
|
||||
.getId(), false, showProperties, filterCriteria);
|
||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||
@Override
|
||||
public void onSelectedItem(Item item) {
|
||||
Log.debug("Listener Selected Item " + item);
|
||||
selectedItem = item;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable throwable) {
|
||||
Log.error(throwable.getLocalizedMessage());
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAborted() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotValidSelection() {
|
||||
selectedItem = null;
|
||||
}
|
||||
};
|
||||
|
||||
wsResourcesExplorerPanel
|
||||
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||
|
||||
VerticalLayoutContainer vResourcesExplorerContainer = new VerticalLayoutContainer();
|
||||
vResourcesExplorerContainer.setScrollMode(ScrollMode.AUTO);
|
||||
vResourcesExplorerContainer.add(wsResourcesExplorerPanel,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
||||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.addUniqueContainer(vResourcesExplorerContainer);
|
||||
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||
|
||||
@Override
|
||||
public void onUploadCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload completed: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUploadAborted(String parentId, String itemId) {
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String parentId, String itemId,
|
||||
Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload Override Completed: [parentID: "
|
||||
+ parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
}
|
||||
};
|
||||
|
||||
dnd.addWorkspaceUploadNotificationListener(workspaceUploaderListener);
|
||||
|
||||
// ToolBar
|
||||
btnShow = new TextButton("Show");
|
||||
// btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16());
|
||||
btnShow.setScale(ButtonScale.SMALL);
|
||||
btnShow.setIconAlign(IconAlign.LEFT);
|
||||
btnShow.setToolTip("Show");
|
||||
btnShow.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
showComputation();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
btnOpen = new TextButton("Open");
|
||||
// btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16());
|
||||
btnOpen.setScale(ButtonScale.SMALL);
|
||||
btnOpen.setIconAlign(IconAlign.LEFT);
|
||||
btnOpen.setToolTip("Open");
|
||||
btnOpen.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
openFile();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnDelete = new TextButton("Delete");
|
||||
// btnDelete.setIcon(StatAlgoImporterResources.INSTANCE.delete16());
|
||||
btnDelete.setScale(ButtonScale.SMALL);
|
||||
btnDelete.setIconAlign(IconAlign.LEFT);
|
||||
btnDelete.setToolTip("Delete");
|
||||
btnDelete.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
deleteItem(event);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnRefresh = new TextButton("Refresh");
|
||||
// btnRefresh.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnRefresh.setScale(ButtonScale.SMALL);
|
||||
btnRefresh.setIconAlign(IconAlign.LEFT);
|
||||
btnRefresh.setToolTip("Refresh");
|
||||
btnRefresh.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
refreshWSResourceExplorerPanel();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnResubmit = new TextButton("Resubmit");
|
||||
// btnResubmit.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnResubmit.setScale(ButtonScale.SMALL);
|
||||
btnResubmit.setIconAlign(IconAlign.LEFT);
|
||||
btnResubmit.setToolTip("Resubmit");
|
||||
btnResubmit.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
resubmitComputation();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
btnCancel = new TextButton("Cancel");
|
||||
// btnCancel.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnCancel.setScale(ButtonScale.SMALL);
|
||||
btnCancel.setIconAlign(IconAlign.LEFT);
|
||||
btnCancel.setToolTip("Cancel");
|
||||
btnCancel.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
cancelComputation();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(btnShow, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnOpen, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnDelete, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnRefresh, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnResubmit, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnCancel, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
v = new VerticalLayoutContainer();
|
||||
|
||||
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(dnd, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
add(v);
|
||||
forceLayout();
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.error("Error opening wsResourceExplorerPanel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void refreshWSResourceExplorerPanel() {
|
||||
if (wsResourcesExplorerPanel != null) {
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshWSResourceExplorerPanel(DataMinerWorkAreaEvent event) {
|
||||
try {
|
||||
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
create(event);
|
||||
} else {
|
||||
create(event);
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in ComputationsPanel: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteItem(SelectEvent event) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.Computations, itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
}
|
||||
|
||||
private void showComputation() {
|
||||
if (selectedItem != null) {
|
||||
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
|
||||
ComputationDataRequestEvent event=new ComputationDataRequestEvent(itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a computation!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void openFile() {
|
||||
if (selectedItem != null && !selectedItem.isFolder()) {
|
||||
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
|
||||
itemDescription, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof ExpiredSessionServiceException) {
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a file!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void cancelComputation() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void resubmitComputation() {
|
||||
if (selectedItem != null) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
ResubmitComputationExecutionRequestEvent resubmitComputationEvent = new ResubmitComputationExecutionRequestEvent(
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(resubmitComputationEvent);
|
||||
Log.debug("Fired: " + resubmitComputationEvent);
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a computation!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,45 +1,12 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
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.RefreshDataMinerWorkAreaEvent;
|
||||
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.UIStateEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaElementType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
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.toolbar.ToolBar;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -49,422 +16,26 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
*/
|
||||
public class ComputationsPanel extends FramedPanel {
|
||||
|
||||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||
private TextButton btnOpen;
|
||||
private TextButton btnDelete;
|
||||
private TextButton btnRefresh;
|
||||
private TextButton btnResubmit;
|
||||
private TextButton btnCancel;
|
||||
private VerticalLayoutContainer v;
|
||||
|
||||
public ComputationsPanel() {
|
||||
super();
|
||||
Log.debug("ComputationsPanel");
|
||||
|
||||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
init();
|
||||
bindToEvents();
|
||||
|
||||
create();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setId("ComputationsPanel");
|
||||
forceLayoutOnResize = true;
|
||||
setBodyBorder(true);
|
||||
setBodyStyle("backgroundColor:white;");
|
||||
setHeaderVisible(true);
|
||||
setResize(true);
|
||||
setAnimCollapse(false);
|
||||
setBodyBorder(true);
|
||||
setHeadingText("Computations");
|
||||
|
||||
setHeaderVisible(true);
|
||||
}
|
||||
|
||||
private void bindToEvents() {
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(DataMinerWorkAreaEvent event) {
|
||||
manageDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void manageStateEvents(UIStateEvent event) {
|
||||
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||
+ event.toString());
|
||||
switch (event.getUiStateType()) {
|
||||
case START:
|
||||
break;
|
||||
case WAITING:
|
||||
break;
|
||||
case UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||
|
||||
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||
+ event.toString());
|
||||
switch (event.getDataMinerWorkAreaEventType()) {
|
||||
case OPEN:
|
||||
case UPDATE:
|
||||
refreshWSResourceExplorerPanel(event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void manageRefreshDataMinerWorkAreaEvents(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
switch (event.getDataMinerWorkAreaElementType()) {
|
||||
case Computations:
|
||||
refreshWSResourceExplorerPanel();
|
||||
break;
|
||||
case InputDataSets:
|
||||
break;
|
||||
case OutputDataSets:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void create(DataMinerWorkAreaEvent event) {
|
||||
try {
|
||||
|
||||
if (event == null
|
||||
|| event.getDataMinerWorkArea() == null
|
||||
|| event.getDataMinerWorkArea().getComputations() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId().isEmpty()) {
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
forceLayout();
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
List<String> showProperties = new ArrayList<String>();
|
||||
showProperties.add(ComputationsProperties.COMPUTATION_ID.getLabel());
|
||||
showProperties.add(ComputationsProperties.OPERATOR_NAME.getLabel());
|
||||
//showProperties.add(ComputationsProperties.OPERATOR_DESCRIPTION.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();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
filterCriteria.setRequiredProperties(map);
|
||||
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||
event.getDataMinerWorkArea().getComputations().getFolder()
|
||||
.getId(), false, showProperties, filterCriteria);
|
||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||
@Override
|
||||
public void onSelectedItem(Item item) {
|
||||
Log.debug("Listener Selected Item " + item);
|
||||
selectedItem = item;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable throwable) {
|
||||
Log.error(throwable.getLocalizedMessage());
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAborted() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotValidSelection() {
|
||||
selectedItem = null;
|
||||
}
|
||||
};
|
||||
|
||||
wsResourcesExplorerPanel
|
||||
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||
|
||||
VerticalLayoutContainer vResourcesExplorerContainer = new VerticalLayoutContainer();
|
||||
vResourcesExplorerContainer.setScrollMode(ScrollMode.AUTO);
|
||||
vResourcesExplorerContainer.add(wsResourcesExplorerPanel,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
||||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.addUniqueContainer(vResourcesExplorerContainer);
|
||||
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||
|
||||
@Override
|
||||
public void onUploadCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload completed: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUploadAborted(String parentId, String itemId) {
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String parentId, String itemId,
|
||||
Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload Override Completed: [parentID: "
|
||||
+ parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
}
|
||||
};
|
||||
|
||||
dnd.addWorkspaceUploadNotificationListener(workspaceUploaderListener);
|
||||
|
||||
// ToolBar
|
||||
btnOpen = new TextButton("Open");
|
||||
// btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16());
|
||||
btnOpen.setScale(ButtonScale.SMALL);
|
||||
btnOpen.setIconAlign(IconAlign.LEFT);
|
||||
btnOpen.setToolTip("Open");
|
||||
btnOpen.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
openFile();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnDelete = new TextButton("Delete");
|
||||
// btnDelete.setIcon(StatAlgoImporterResources.INSTANCE.delete16());
|
||||
btnDelete.setScale(ButtonScale.SMALL);
|
||||
btnDelete.setIconAlign(IconAlign.LEFT);
|
||||
btnDelete.setToolTip("Delete");
|
||||
btnDelete.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
deleteItem(event);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnRefresh = new TextButton("Refresh");
|
||||
// btnRefresh.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnRefresh.setScale(ButtonScale.SMALL);
|
||||
btnRefresh.setIconAlign(IconAlign.LEFT);
|
||||
btnRefresh.setToolTip("Refresh");
|
||||
btnRefresh.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
refreshWSResourceExplorerPanel();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnResubmit = new TextButton("Resubmit");
|
||||
// btnResubmit.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnResubmit.setScale(ButtonScale.SMALL);
|
||||
btnResubmit.setIconAlign(IconAlign.LEFT);
|
||||
btnResubmit.setToolTip("Resubmit");
|
||||
btnResubmit.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
resubmitComputation();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnCancel = new TextButton("Cancel");
|
||||
// btnCancel.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||
btnCancel.setScale(ButtonScale.SMALL);
|
||||
btnCancel.setIconAlign(IconAlign.LEFT);
|
||||
btnCancel.setToolTip("Cancel");
|
||||
btnCancel.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
cancelComputation();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(btnOpen, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnDelete, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnRefresh, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnResubmit, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnCancel, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
v = new VerticalLayoutContainer();
|
||||
|
||||
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(dnd, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
private void create() {
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
ComputationsExecutedPanel importedDataPanel = new ComputationsExecutedPanel();
|
||||
ComputationsViewerPanel computedDataPanel = new ComputationsViewerPanel();
|
||||
v.add(importedDataPanel, new VerticalLayoutData(1, 0.5, new Margins(0)));
|
||||
v.add(computedDataPanel, new VerticalLayoutData(1, 0.5, new Margins(0)));
|
||||
add(v);
|
||||
forceLayout();
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.error("Error opening wsResourceExplorerPanel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void refreshWSResourceExplorerPanel() {
|
||||
if (wsResourcesExplorerPanel != null) {
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshWSResourceExplorerPanel(DataMinerWorkAreaEvent event) {
|
||||
try {
|
||||
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
create(event);
|
||||
} else {
|
||||
create(event);
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in ComputationsPanel: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteItem(SelectEvent event) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.Computations, itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
}
|
||||
|
||||
private void openFile() {
|
||||
if (selectedItem != null && !selectedItem.isFolder()) {
|
||||
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
|
||||
itemDescription, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof ExpiredSessionServiceException) {
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a file!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void cancelComputation() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void resubmitComputation() {
|
||||
if (selectedItem != null) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
ResubmitComputationExecutionRequestEvent resubmitComputationEvent = new ResubmitComputationExecutionRequestEvent(
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(resubmitComputationEvent);
|
||||
Log.debug("Fired: " + resubmitComputationEvent);
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a computation!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,309 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationDataEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.RefreshDataMinerWorkAreaEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.UIStateEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
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.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
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.TextArea;
|
||||
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 ComputationsViewerPanel extends FramedPanel {
|
||||
|
||||
private VerticalLayoutContainer v;
|
||||
private ComputationData computationData;
|
||||
|
||||
public ComputationsViewerPanel() {
|
||||
super();
|
||||
Log.debug("ComputationsPanel");
|
||||
|
||||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
init();
|
||||
bindToEvents();
|
||||
create();
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setId("ComputationsViewerPanel");
|
||||
forceLayoutOnResize = true;
|
||||
setBodyBorder(true);
|
||||
setBodyStyle("backgroundColor:white;");
|
||||
setHeaderVisible(true);
|
||||
setResize(true);
|
||||
setAnimCollapse(false);
|
||||
setHeadingText("Computations Viewer");
|
||||
|
||||
}
|
||||
|
||||
private void create() {
|
||||
v = new VerticalLayoutContainer();
|
||||
v.setScrollMode(ScrollMode.AUTO);
|
||||
add(v);
|
||||
}
|
||||
|
||||
private void bindToEvents() {
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
Log.debug("Catch UIStateEvent: " + event);
|
||||
manageStateEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(DataMinerWorkAreaEvent event) {
|
||||
Log.debug("Catch DataMinerWorkAreaEvent: " + event);
|
||||
manageDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
Log.debug("Catch RefreshDataMinerWorkAreaEvent: "
|
||||
+ event);
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(ComputationDataEvent.getType(),
|
||||
new ComputationDataEvent.ComputationDataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onComputationData(ComputationDataEvent event) {
|
||||
Log.debug("Catch ComputationDataEvent: " + event);
|
||||
showOutput(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void manageStateEvents(UIStateEvent event) {
|
||||
|
||||
switch (event.getUiStateType()) {
|
||||
case START:
|
||||
break;
|
||||
case WAITING:
|
||||
break;
|
||||
case UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||
switch (event.getDataMinerWorkAreaEventType()) {
|
||||
case OPEN:
|
||||
case UPDATE:
|
||||
resetPanel();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void manageRefreshDataMinerWorkAreaEvents(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
switch (event.getDataMinerWorkAreaElementType()) {
|
||||
case Computations:
|
||||
resetPanel();
|
||||
break;
|
||||
case InputDataSets:
|
||||
break;
|
||||
case OutputDataSets:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void resetPanel() {
|
||||
v.clear();
|
||||
SimpleContainer sectionTitle=new SimpleContainer();
|
||||
HtmlLayoutContainer title=new HtmlLayoutContainer(
|
||||
"<br><center>No computation selected.</center>");
|
||||
sectionTitle.add(title);
|
||||
v.add(sectionTitle, new VerticalLayoutData(-1, -1, new Margins(15)));
|
||||
computationData=null;
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
private void showOutput(ComputationDataEvent event) {
|
||||
v.clear();
|
||||
computationData = event.getComputationData();
|
||||
addComputationData();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void addComputationData() {
|
||||
if(computationData==null){
|
||||
Log.error("ComputationData is null!");
|
||||
UtilsGXT3.alert("Error", "No information on computation is retrieved!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SimpleContainer sectionTitle=new SimpleContainer();
|
||||
// title
|
||||
HtmlLayoutContainer title = new HtmlLayoutContainer(
|
||||
".: Computation Report of <b>" + computationData.getComputationId().getId() + "</b>");
|
||||
sectionTitle.add(title);
|
||||
|
||||
//v.add(sectionTitle, new VerticalLayoutData(1, -1, new Margins(15)));
|
||||
|
||||
|
||||
if(computationData.getOutputParameters()!=null&&!computationData.getOutputParameters().isEmpty()){
|
||||
VerticalLayoutContainer outputVBox=new VerticalLayoutContainer();
|
||||
LinkedHashMap<String,String> output=computationData.getOutputParameters();
|
||||
for(String key:output.keySet()){
|
||||
TextField textField=new TextField();
|
||||
textField.setValue(output.get(key));
|
||||
textField.setReadOnly(true);
|
||||
FieldLabel fieldLabel=new FieldLabel(textField, key);
|
||||
fieldLabel.setLabelWidth(200);
|
||||
fieldLabel.setLabelWordWrap(true);
|
||||
outputVBox.add(fieldLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
}
|
||||
|
||||
FieldSet outputFieldSet=new FieldSet();
|
||||
outputFieldSet.setHeadingText("Output Result");
|
||||
outputFieldSet.setCollapsible(true);
|
||||
outputFieldSet.add(outputVBox);
|
||||
outputFieldSet.getElement().getStyle().setMarginRight(15, Unit.PX);
|
||||
v.add(outputFieldSet, new VerticalLayoutData(1, -1, new Margins(15)));
|
||||
}
|
||||
|
||||
if(computationData.getInputParameters()!=null&&!computationData.getInputParameters().isEmpty()){
|
||||
VerticalLayoutContainer inputVBox=new VerticalLayoutContainer();
|
||||
LinkedHashMap<String,String> input=computationData.getInputParameters();
|
||||
for(String key:input.keySet()){
|
||||
TextField textField=new TextField();
|
||||
textField.setValue(input.get(key));
|
||||
textField.setReadOnly(true);
|
||||
FieldLabel fieldLabel=new FieldLabel(textField, key);
|
||||
fieldLabel.setLabelWidth(200);
|
||||
fieldLabel.setLabelWordWrap(true);
|
||||
inputVBox.add(fieldLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
}
|
||||
|
||||
FieldSet inputFieldSet=new FieldSet();
|
||||
inputFieldSet.setHeadingText("Input Parameters");
|
||||
inputFieldSet.setCollapsible(true);
|
||||
inputFieldSet.add(inputVBox);
|
||||
inputFieldSet.getElement().getStyle().setMarginRight(15, Unit.PX);
|
||||
v.add(inputFieldSet, new VerticalLayoutData(1, -1, new Margins(15)));
|
||||
}
|
||||
|
||||
VerticalLayoutContainer detailsVBox=new VerticalLayoutContainer();
|
||||
TextField startDateField=new TextField();
|
||||
startDateField.setValue(computationData.getStartDate());
|
||||
startDateField.setReadOnly(true);
|
||||
FieldLabel startDateLabel=new FieldLabel(startDateField, "Start Date");
|
||||
startDateLabel.setLabelWidth(200);
|
||||
startDateLabel.setLabelWordWrap(true);
|
||||
detailsVBox.add(startDateLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
|
||||
TextField endDateField=new TextField();
|
||||
endDateField.setValue(computationData.getEndDate());
|
||||
endDateField.setReadOnly(true);
|
||||
FieldLabel endDateLabel=new FieldLabel(endDateField, "End Date");
|
||||
endDateLabel.setLabelWidth(200);
|
||||
endDateLabel.setLabelWordWrap(true);
|
||||
detailsVBox.add(endDateLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
|
||||
TextField statusField=new TextField();
|
||||
statusField.setValue(computationData.getStatus());
|
||||
statusField.setReadOnly(true);
|
||||
FieldLabel statusLabel=new FieldLabel(statusField, "Status");
|
||||
statusLabel.setLabelWidth(200);
|
||||
statusLabel.setLabelWordWrap(true);
|
||||
detailsVBox.add(statusLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
|
||||
TextField vreField=new TextField();
|
||||
vreField.setValue(computationData.getVre());
|
||||
vreField.setReadOnly(true);
|
||||
FieldLabel vreLabel=new FieldLabel(vreField, "VRE");
|
||||
vreLabel.setLabelWidth(200);
|
||||
vreLabel.setLabelWordWrap(true);
|
||||
detailsVBox.add(vreLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
|
||||
FieldSet detailsFieldSet=new FieldSet();
|
||||
detailsFieldSet.setHeadingText("Computation Details");
|
||||
detailsFieldSet.setCollapsible(true);
|
||||
detailsFieldSet.add(detailsVBox);
|
||||
detailsFieldSet.getElement().getStyle().setMarginRight(15, Unit.PX);
|
||||
v.add(detailsFieldSet, new VerticalLayoutData(1, -1, new Margins(15)));
|
||||
|
||||
VerticalLayoutContainer operatorVBox=new VerticalLayoutContainer();
|
||||
TextField operatorNameField=new TextField();
|
||||
operatorNameField.setValue(computationData.getComputationId().getOperatorName());
|
||||
operatorNameField.setReadOnly(true);
|
||||
FieldLabel operatorNameLabel=new FieldLabel(operatorNameField, "Operator Name");
|
||||
operatorNameLabel.setLabelWidth(200);
|
||||
operatorNameLabel.setLabelWordWrap(true);
|
||||
operatorVBox.add(operatorNameLabel,new VerticalLayoutData(1, -1, new Margins(4)));
|
||||
|
||||
TextArea operatorDescriptionField=new TextArea();
|
||||
operatorDescriptionField.setHeight("50px");
|
||||
operatorDescriptionField.setValue(computationData.getOperatorDescription());
|
||||
operatorDescriptionField.setReadOnly(true);
|
||||
FieldLabel operatorDescriptionLabel=new FieldLabel(operatorDescriptionField, "Operator Description");
|
||||
operatorDescriptionLabel.setLabelWidth(200);
|
||||
operatorDescriptionLabel.setLabelWordWrap(true);
|
||||
operatorVBox.add(operatorDescriptionLabel,new VerticalLayoutData(1, -1, new Margins(5)));
|
||||
|
||||
FieldSet operatorFieldSet=new FieldSet();
|
||||
operatorFieldSet.setHeadingText("Operator Details");
|
||||
operatorFieldSet.setCollapsible(true);
|
||||
operatorFieldSet.add(operatorVBox);
|
||||
operatorFieldSet.getElement().getStyle().setMarginRight(15, Unit.PX);
|
||||
v.add(operatorFieldSet, new VerticalLayoutData(1, -1, new Margins(15)));
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Computation Data Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationDataEvent extends
|
||||
GwtEvent<ComputationDataEvent.ComputationDataEventHandler> {
|
||||
|
||||
public static Type<ComputationDataEventHandler> TYPE = new Type<ComputationDataEventHandler>();
|
||||
private ComputationData computationData;
|
||||
|
||||
public interface ComputationDataEventHandler extends EventHandler {
|
||||
void onComputationData(ComputationDataEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputShowResourceEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputShowResourceEventHandler(
|
||||
ComputationDataEventHandler handler);
|
||||
}
|
||||
|
||||
public ComputationDataEvent(ComputationData computationData) {
|
||||
this.computationData = computationData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ComputationDataEventHandler handler) {
|
||||
handler.onComputationData(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ComputationDataEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ComputationDataEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, ComputationDataEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationData getComputationData() {
|
||||
return computationData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationDataEvent [computationData=" + computationData + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Show Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationDataRequestEvent
|
||||
extends
|
||||
GwtEvent<ComputationDataRequestEvent.ComputationDataRequestEventHandler> {
|
||||
|
||||
public static Type<ComputationDataRequestEventHandler> TYPE = new Type<ComputationDataRequestEventHandler>();
|
||||
private ItemDescription itemDescription;
|
||||
|
||||
public interface ComputationDataRequestEventHandler extends EventHandler {
|
||||
void onComputationDataRequest(ComputationDataRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasComputationDataRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addComputationDataRequestEventHandler(
|
||||
ComputationDataRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public ComputationDataRequestEvent(ItemDescription itemDescription) {
|
||||
this.itemDescription = itemDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ComputationDataRequestEventHandler handler) {
|
||||
handler.onComputationDataRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ComputationDataRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ComputationDataRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
ComputationDataRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ItemDescription getItemDescription() {
|
||||
return itemDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationDataRequestEvent [itemDescription="
|
||||
+ itemDescription + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Data Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputDataEvent extends
|
||||
GwtEvent<OutputDataEvent.OutputDataEventHandler> {
|
||||
public static Type<OutputDataEventHandler> TYPE = new Type<OutputDataEventHandler>();
|
||||
public OutputData outputData;
|
||||
|
||||
public interface OutputDataEventHandler extends EventHandler {
|
||||
void onOutput(OutputDataEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputDataEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputDataEventHandler(
|
||||
OutputDataEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputDataEvent(OutputData outputData) {
|
||||
this.outputData = outputData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputDataEventHandler handler) {
|
||||
handler.onOutput(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputDataEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputDataEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputDataEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public OutputData getOutputData() {
|
||||
return outputData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputDataEvent [outputData=" + outputData + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Data Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputDataRequestEvent extends
|
||||
GwtEvent<OutputDataRequestEvent.OutputDataRequestEventHandler> {
|
||||
|
||||
public static Type<OutputDataRequestEventHandler> TYPE = new Type<OutputDataRequestEventHandler>();
|
||||
private ComputationId computationId;
|
||||
|
||||
public interface OutputDataRequestEventHandler extends EventHandler {
|
||||
void onOutputRequest(OutputDataRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputDataRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputDataRequestEventHandler(
|
||||
OutputDataRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputDataRequestEvent(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputDataRequestEventHandler handler) {
|
||||
handler.onOutputRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputDataRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputDataRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputDataRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputDataRequestEvent [computationId=" + computationId + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Resource Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputResourceEvent extends
|
||||
GwtEvent<OutputResourceEvent.OutputResourceEventHandler> {
|
||||
public static Type<OutputResourceEventHandler> TYPE = new Type<OutputResourceEventHandler>();
|
||||
private Resource resource;
|
||||
|
||||
public interface OutputResourceEventHandler extends EventHandler {
|
||||
void onOutput(OutputResourceEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputResourceEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputResourceEventHandler(
|
||||
OutputResourceEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputResourceEvent(Resource resource) {
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputResourceEventHandler handler) {
|
||||
handler.onOutput(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputResourceEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputResourceEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputResourceEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public Resource getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputResourceEvent [resource=" + resource + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Resource Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputResourceRequestEvent extends
|
||||
GwtEvent<OutputResourceRequestEvent.OutputResourceRequestEventHandler> {
|
||||
|
||||
public static Type<OutputResourceRequestEventHandler> TYPE = new Type<OutputResourceRequestEventHandler>();
|
||||
private ComputationId computationId;
|
||||
|
||||
public interface OutputResourceRequestEventHandler extends EventHandler {
|
||||
void onOutputRequest(OutputResourceRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputResourceRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputResourceRequestEventHandler(
|
||||
OutputResourceRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputResourceRequestEvent(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputResourceRequestEventHandler handler) {
|
||||
handler.onOutputRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputResourceRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputResourceRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputResourceRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputResourceRequestEvent [computationId=" + computationId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Show Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputShowEvent extends
|
||||
GwtEvent<OutputShowEvent.OutputShowEventHandler> {
|
||||
|
||||
public static Type<OutputShowEventHandler> TYPE = new Type<OutputShowEventHandler>();
|
||||
private Resource resource;
|
||||
|
||||
public interface OutputShowEventHandler extends EventHandler {
|
||||
void onOutputShow(OutputShowEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputShowResourceEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputShowResourceEventHandler(
|
||||
OutputShowEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputShowEvent(Resource resource) {
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputShowEventHandler handler) {
|
||||
handler.onOutputShow(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputShowEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputShowEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputShowEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public Resource getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputShowEvent [resource=" + resource + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Output Show Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputShowRequestEvent extends
|
||||
GwtEvent<OutputShowRequestEvent.OutputShowRequestEventHandler> {
|
||||
|
||||
public static Type<OutputShowRequestEventHandler> TYPE = new Type<OutputShowRequestEventHandler>();
|
||||
private ItemDescription itemDescription;
|
||||
|
||||
public interface OutputShowRequestEventHandler extends EventHandler {
|
||||
void onOutputShowRequest(OutputShowRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasOutputShowResourceRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addOutputShowResourceRequestEventHandler(
|
||||
OutputShowRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public OutputShowRequestEvent(ItemDescription itemDescription) {
|
||||
this.itemDescription = itemDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OutputShowRequestEventHandler handler) {
|
||||
handler.onOutputShowRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OutputShowRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<OutputShowRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, OutputShowRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ItemDescription getItemDescription() {
|
||||
return itemDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputShowRequestEvent [itemDescription=" + itemDescription
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -6,8 +6,6 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
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.events.OutputResourceEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputShowEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationExecutionEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationExecutionRequestEvent;
|
||||
|
@ -81,6 +79,8 @@ public class ComputationExecutionPanel extends FramedPanel {
|
|||
@Override
|
||||
public void onResubmit(
|
||||
ResubmitComputationExecutionEvent event) {
|
||||
Log.debug("ResubmitComputationExecutionEvent: "
|
||||
+ event);
|
||||
resubmitComputation(event);
|
||||
}
|
||||
});
|
||||
|
@ -93,31 +93,18 @@ public class ComputationExecutionPanel extends FramedPanel {
|
|||
@Override
|
||||
public void onStart(
|
||||
StartComputationExecutionEvent event) {
|
||||
Log.debug("Catch StartComputationExecutionEvent: "
|
||||
+ event);
|
||||
startComputation(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
OutputShowEvent.getType(),
|
||||
new OutputShowEvent.OutputShowEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onOutputShow(OutputShowEvent event) {
|
||||
showOutput(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void startNewComputation(final Operator operator) {
|
||||
Log.debug("Computation Panel: start new computation ");
|
||||
ComputationStatusPanel statusPanel = new ComputationStatusPanel(
|
||||
|
@ -180,24 +167,6 @@ public class ComputationExecutionPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
|
||||
private void showOutput(OutputShowEvent event) {
|
||||
/*
|
||||
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
|
||||
event.getComputationId().getOperatorName());
|
||||
computationStatusPanels.add(statusPanel);
|
||||
if (v.getWidgetCount() == 0) {
|
||||
v.add(statusPanel, new VerticalLayoutData(1, -1, new Margins(20)));
|
||||
} else {
|
||||
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1, new Margins(
|
||||
20)));
|
||||
}
|
||||
removeAllButton.setEnabled(true);
|
||||
|
||||
statusPanel.computationStarted(event.getComputationId());
|
||||
|
||||
forceLayout();
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -7,19 +7,20 @@ import java.util.LinkedHashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.FileResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource.ResourceType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.TableResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputResourceEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputResourceRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputDataEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.OutputDataRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.client.widgets.ImagesViewer;
|
||||
import org.gcube.portlets.user.dataminermanager.client.widgets.ResourceViewer;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.FileResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource.ResourceType;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.TableResource;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -48,48 +49,64 @@ public class ComputationOutputPanel extends SimpleContainer {
|
|||
public ComputationOutputPanel(ComputationId computationId) {
|
||||
super();
|
||||
this.computationId = computationId;
|
||||
Log.debug("ComputationOutputPanel");
|
||||
Log.debug("ComputationOutputPanel: " + computationId);
|
||||
bind();
|
||||
init();
|
||||
OutputDataRequestEvent event = new OutputDataRequestEvent(computationId);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
v = new VerticalLayoutContainer();
|
||||
add(v);
|
||||
OutputResourceRequestEvent event=new OutputResourceRequestEvent(computationId);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
private void bind() {
|
||||
EventBusProvider.INSTANCE.addHandler(
|
||||
OutputResourceEvent.TYPE,
|
||||
new OutputResourceEvent.OutputResourceEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(OutputDataEvent.TYPE,
|
||||
new OutputDataEvent.OutputDataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onOutput(
|
||||
OutputResourceEvent event) {
|
||||
Log.debug("Catch OutputResourceEvent: "
|
||||
+ event);
|
||||
showOutputInfo(event);
|
||||
public void onOutput(OutputDataEvent event) {
|
||||
Log.debug("Catch OutputDataEvent: " + event);
|
||||
if (event!=null&& event.getOutputData()!=null&&
|
||||
event.getOutputData().getComputationId()!=null&&
|
||||
event.getOutputData().getComputationId().getId()
|
||||
.compareTo(computationId.getId()) == 0) {
|
||||
manageOutputDataEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param resource
|
||||
*/
|
||||
private void showOutputInfo(OutputResourceEvent event) {
|
||||
private void manageOutputDataEvent(OutputDataEvent event) {
|
||||
try {
|
||||
Resource resource=event.getResource();
|
||||
Log.info("Show Output Info on: " + resource);
|
||||
if (resource == null)
|
||||
if (event == null || event.getOutputData() == null) {
|
||||
Log.error("OutputDataEvent is null");
|
||||
UtilsGXT3.alert("Error", "Invalid output data!");
|
||||
return;
|
||||
}
|
||||
Resource resource = event.getOutputData().getResource();
|
||||
showResource(resource);
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in show output info: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void showResource(Resource resource) {
|
||||
try {
|
||||
Log.info("Show Output Info on: " + resource);
|
||||
if (resource == null) {
|
||||
Log.debug("Output Data hasn't resource!");
|
||||
return;
|
||||
}
|
||||
|
||||
ResourceType resourceType = resource.getResourceType();
|
||||
|
||||
|
@ -140,7 +157,7 @@ public class ComputationOutputPanel extends SimpleContainer {
|
|||
|
||||
forceLayout();
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in show output info: " + e.getLocalizedMessage());
|
||||
Log.error("Error in show resource: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,6 @@ 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.parametersfield.AbstractFld;
|
||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnFld;
|
||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnListFld;
|
||||
|
@ -19,6 +16,9 @@ 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.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
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.Parameter;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
|
|
@ -3,17 +3,13 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.experiments;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.progress.GreenProgressBar;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.progress.RedProgressBar;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationExecutionRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaRequestEventType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
@ -62,7 +58,6 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
|
||||
private void init() {
|
||||
setStylePrimaryName("computationStatusPanel");
|
||||
|
||||
}
|
||||
|
||||
private void create() {
|
||||
|
@ -70,13 +65,7 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
HtmlLayoutContainer title = new HtmlLayoutContainer(
|
||||
"<div class='computationStatusTitle'><p>Computation of <b>"
|
||||
+ operatorName + "</b></p></div>");
|
||||
HtmlLayoutContainer date = new HtmlLayoutContainer(
|
||||
"<div class='computationStatusDate'><p>"
|
||||
+ new Date().toString() + "</p></div>");
|
||||
|
||||
vert.add(title, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
vert.add(date, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
|
||||
add(vert);
|
||||
forceLayout();
|
||||
}
|
||||
|
@ -87,6 +76,13 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
*/
|
||||
public void computationStarted(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
/*
|
||||
* HtmlLayoutContainer date = new HtmlLayoutContainer(
|
||||
* "<div class='computationStatusDate'><p>" + new Date().toString() +
|
||||
* "</p></div>");
|
||||
*/
|
||||
// vert.add(date, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
|
||||
vert.add(new HtmlLayoutContainer("<p>Created, the id is "
|
||||
+ computationId.getId() + " [<a href='"
|
||||
+ computationId.getUrlId() + "' >link</a>]</p>"));
|
||||
|
@ -115,6 +111,8 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
timer.scheduleRepeating(Constants.TIME_UPDATE_COMPUTATION_STATUS_PANEL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void cancelComputation() {
|
||||
CancelComputationExecutionRequestEvent event = new CancelComputationExecutionRequestEvent(
|
||||
computationId);
|
||||
|
@ -126,7 +124,7 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
* @param operator
|
||||
*
|
||||
*/
|
||||
protected void computationTerminated(ComputationId computationId,
|
||||
private void computationTerminated(ComputationId computationId,
|
||||
ComputationStatus computationStatus) {
|
||||
Log.debug("Computation Terminated");
|
||||
Log.debug("Computation Status:" + computationStatus);
|
||||
|
@ -146,8 +144,7 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
progressBar.updateProgress(1, "Computation Complete");
|
||||
vert.insert(progressBar, index, new VerticalLayoutData(1, -1,
|
||||
new Margins(20)));
|
||||
showOutput();
|
||||
fireDataMinerWorkAreareRequestUpdate();
|
||||
showComputationCompletedOutput();
|
||||
} else if (computationStatus.isFailed()) {
|
||||
Log.debug("Computation is Failed");
|
||||
String errorMessage;
|
||||
|
@ -165,8 +162,7 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
UtilsGXT3.alert("Failed",
|
||||
"The computation " + computationId.getId() + " of "
|
||||
+ computationId.getOperatorName()
|
||||
+ " has failed.</br>"
|
||||
+ errorMessage);
|
||||
+ " has failed.</br>" + errorMessage);
|
||||
int index = vert.getWidgetIndex(progressBar);
|
||||
vert.remove(index);
|
||||
// TODO
|
||||
|
@ -176,7 +172,6 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
.setMarginBottom(36, Unit.PX);
|
||||
vert.insert(progressBar, index, new VerticalLayoutData(1, -1,
|
||||
new Margins(20)));
|
||||
fireDataMinerWorkAreareRequestUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -184,16 +179,12 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
forceLayout();
|
||||
}
|
||||
|
||||
private void fireDataMinerWorkAreareRequestUpdate() {
|
||||
DataMinerWorkAreaRequestEvent event = new DataMinerWorkAreaRequestEvent(
|
||||
DataMinerWorkAreaRequestEventType.UPDATE);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void showOutput() {
|
||||
private void showComputationCompletedOutput() {
|
||||
HtmlLayoutContainer computationEndMessage = new HtmlLayoutContainer(
|
||||
"<p>The computation <b>" + computationId.getOperatorName()
|
||||
+ "</b> finished.</p>");
|
||||
|
@ -208,10 +199,12 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param computationStatus
|
||||
*/
|
||||
protected void updateStatus(ComputationStatus computationStatus) {
|
||||
private void updateStatus(ComputationStatus computationStatus) {
|
||||
Log.debug("Conputation Status Panel ::Update Status ");
|
||||
if (computationStatus.getStatus() == Status.PENDING)
|
||||
progressBar.updateText("Pending...");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
*/
|
||||
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 org.gcube.portlets.user.dataminermanager.shared.StringUtil;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -5,13 +5,13 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
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.TabularFldChangeEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemPropertiesCombo;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
|
|
@ -6,13 +6,13 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemProperties;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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 org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
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.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.EnumParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
|
|
|
@ -8,11 +8,11 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.FileParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.FileParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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 org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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 org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -7,9 +7,9 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
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.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -6,9 +6,9 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
*/
|
||||
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.ObjectParameter;
|
||||
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.parameters.ListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
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 org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
|
|
|
@ -5,11 +5,11 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularParameter;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.HasTabularFldChangeEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||
|
@ -17,6 +15,8 @@ import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServi
|
|||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularParameter;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
|
|
|
@ -6,9 +6,9 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularParameter;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
|
|
@ -5,11 +5,12 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
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.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
|
@ -52,8 +53,8 @@ public interface DataMinerPortletService extends RemoteService {
|
|||
public void deleteItem(ItemDescription itemDescription)
|
||||
throws ServiceException;
|
||||
|
||||
public Resource getResourceByComputationId(ComputationId computationId) throws ServiceException;
|
||||
public OutputData getOutputDataByComputationId(ComputationId computationId) throws ServiceException;
|
||||
|
||||
public Resource getResourceByComputationItem(ItemDescription itemDescription) throws ServiceException;
|
||||
public ComputationData getComputationData(ItemDescription itemDescription) throws ServiceException;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,10 +5,11 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
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.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
|
@ -59,10 +60,10 @@ public interface DataMinerPortletServiceAsync {
|
|||
void deleteItem(ItemDescription itemDescription,
|
||||
AsyncCallback<Void> callback);
|
||||
|
||||
void getResourceByComputationId(ComputationId computationId,
|
||||
AsyncCallback<Resource> callback);
|
||||
void getOutputDataByComputationId(ComputationId computationId,
|
||||
AsyncCallback<OutputData> callback);
|
||||
|
||||
void getResourceByComputationItem(ItemDescription itemDescription,
|
||||
AsyncCallback<Resource> callback);
|
||||
void getComputationData(ItemDescription itemDescription,
|
||||
AsyncCallback<ComputationData> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.widgets;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ImagesResource;
|
||||
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
|
|
@ -6,8 +6,8 @@ package org.gcube.portlets.user.dataminermanager.client.widgets;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource;
|
||||
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
|
||||
|
|
|
@ -11,17 +11,18 @@ import org.gcube.application.framework.core.session.ASLSession;
|
|||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
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.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletService;
|
||||
import org.gcube.portlets.user.dataminermanager.server.smservice.SClient;
|
||||
import org.gcube.portlets.user.dataminermanager.server.storage.StorageUtil;
|
||||
import org.gcube.portlets.user.dataminermanager.server.util.DataMinerWorkAreaManager;
|
||||
import org.gcube.portlets.user.dataminermanager.server.util.SessionUtil;
|
||||
import org.gcube.portlets.user.dataminermanager.server.util.TableReader;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||
|
@ -295,23 +296,23 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationId(ComputationId computationId)
|
||||
public OutputData getOutputDataByComputationId(ComputationId computationId)
|
||||
throws ServiceException {
|
||||
try {
|
||||
Log.debug("getResourceByComputationId: " + computationId);
|
||||
Log.debug("getOutputDataByComputationId: " + computationId);
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
Resource resource = smClient
|
||||
.getResourceByComputationId(computationId);
|
||||
Log.debug("Resoure: " + resource);
|
||||
return resource;
|
||||
OutputData outputData = smClient
|
||||
.getOutputDataByComputationId(computationId);
|
||||
Log.debug("OutputData: " + outputData);
|
||||
return outputData;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getResourceByComputationId: "
|
||||
logger.error("Error retrieving output by computation id: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
|
@ -321,22 +322,22 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationItem(ItemDescription itemDescription)
|
||||
public ComputationData getComputationData(ItemDescription itemDescription)
|
||||
throws ServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("ResourceByComputationItemt(): " + itemDescription);
|
||||
logger.debug("OutputDataByComputationItemt(): " + itemDescription);
|
||||
Map<String, String> properties = StorageUtil.getProperties(
|
||||
aslSession.getUsername(), itemDescription.getId());
|
||||
logger.debug("Properties: " + properties);
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.getResourceByComputationProperties(properties);
|
||||
return smClient.getComputationDataByComputationProperties(properties);
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error retrieving resource by computation item: "
|
||||
logger.error("Error retrieving output by item: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
|
|
|
@ -6,9 +6,10 @@ import java.util.Map;
|
|||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
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.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -36,10 +37,10 @@ public abstract class SClient {
|
|||
public abstract ComputationStatus getComputationStatus(
|
||||
ComputationId computationId) throws Exception;
|
||||
|
||||
public abstract Resource getResourceByComputationId(
|
||||
public abstract OutputData getOutputDataByComputationId(
|
||||
ComputationId computationId) throws Exception;
|
||||
|
||||
public abstract Resource getResourceByComputationProperties(
|
||||
public abstract ComputationData getComputationDataByComputationProperties(
|
||||
Map<String, String> computationProperties) throws Exception;
|
||||
|
||||
public abstract String cancelComputation(ComputationId computationId)
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.net.URL;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
@ -34,14 +35,6 @@ import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.St
|
|||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.FileResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
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.TabularListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.server.is.InformationSystemUtils;
|
||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ProcessInformations;
|
||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ResponseWPS;
|
||||
|
@ -50,7 +43,17 @@ import org.gcube.portlets.user.dataminermanager.server.smservice.wps.WPS2SM;
|
|||
import org.gcube.portlets.user.dataminermanager.server.storage.StorageUtil;
|
||||
import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.OutputData;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.FileResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.ObjectResource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularListParameter;
|
||||
import org.n52.wps.client.ExecuteRequestBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -399,10 +402,15 @@ public class SClient4WPS extends SClient {
|
|||
Object responseObject = wpsClient.execute(wpsProcessingServlet,
|
||||
execute);
|
||||
String processLocation = null;
|
||||
Date creationData = null;
|
||||
if (responseObject != null) {
|
||||
if (responseObject instanceof ExecuteResponseDocumentImpl) {
|
||||
processLocation = ((ExecuteResponseDocumentImpl) responseObject)
|
||||
ExecuteResponseDocumentImpl executeResponseDocumentImpl = ((ExecuteResponseDocumentImpl) responseObject);
|
||||
processLocation = executeResponseDocumentImpl
|
||||
.getExecuteResponse().getStatusLocation();
|
||||
creationData = executeResponseDocumentImpl
|
||||
.getExecuteResponse().getStatus().getCreationTime()
|
||||
.getTime();
|
||||
} else {
|
||||
throw new Exception(
|
||||
"Invalid response from service, "
|
||||
|
@ -413,7 +421,8 @@ public class SClient4WPS extends SClient {
|
|||
throw new Exception("Invalid Response from service, "
|
||||
+ responseObject);
|
||||
}
|
||||
logger.debug("Retrieved ProcessLocation: " + processLocation);
|
||||
logger.debug("Retrieved: [ProcessLocation=" + processLocation
|
||||
+ ", CreationDate=" + creationData + "]");
|
||||
return processLocation;
|
||||
|
||||
} catch (Throwable e) {
|
||||
|
@ -930,13 +939,14 @@ public class SClient4WPS extends SClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationId(ComputationId computationId)
|
||||
public OutputData getOutputDataByComputationId(ComputationId computationId)
|
||||
throws Exception {
|
||||
Map<String, Resource> resources = retrieveOutput(computationId);
|
||||
MapResource mapResource = new MapResource("mapResource", "Resources",
|
||||
"Resources", resources);
|
||||
OutputData outputData = new OutputData(computationId, mapResource);
|
||||
|
||||
return mapResource;
|
||||
return outputData;
|
||||
}
|
||||
|
||||
private Map<String, Resource> retrieveOutput(ComputationId computationId)
|
||||
|
@ -1171,16 +1181,15 @@ public class SClient4WPS extends SClient {
|
|||
}
|
||||
|
||||
Map<String, String> userInputs = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> entry : computationProperties.entrySet()) {
|
||||
if (entry.getKey().startsWith("input")) {
|
||||
int inputSeparatorIndex = entry.getKey().indexOf("_");
|
||||
String inputKey = entry.getKey().substring(
|
||||
inputSeparatorIndex + 1);
|
||||
for (String key : computationProperties.keySet()) {
|
||||
if (key.startsWith("input")) {
|
||||
int inputSeparatorIndex = key.indexOf("_");
|
||||
String inputKey = key.substring(inputSeparatorIndex + 1);
|
||||
if (inputKey.compareToIgnoreCase("user.name") != 0
|
||||
&& inputKey.compareToIgnoreCase("scope") != 0) {
|
||||
userInputs.put(inputKey, entry.getValue());
|
||||
userInputs.put(inputKey, computationProperties.get(key));
|
||||
logger.debug("UserInputs[key=" + inputKey + ", value="
|
||||
+ entry.getValue() + "]");
|
||||
+ computationProperties.get(key) + "]");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1217,10 +1226,65 @@ public class SClient4WPS extends SClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationProperties(
|
||||
public ComputationData getComputationDataByComputationProperties(
|
||||
Map<String, String> computationProperties) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
if (computationProperties == null || computationProperties.isEmpty()) {
|
||||
throw new Exception("Invalid computation properties: "
|
||||
+ computationProperties);
|
||||
}
|
||||
|
||||
String compId = computationProperties.get("computation_id");
|
||||
|
||||
String operatorId = computationProperties.get("operator_id");
|
||||
String operatorName = computationProperties.get("operator_name");
|
||||
String operatorDescritpion = computationProperties
|
||||
.get("operator_description");
|
||||
String vre = computationProperties.get("VRE");
|
||||
String startDate = computationProperties.get("startDate");
|
||||
String endDate = computationProperties.get("endDate");
|
||||
String status = computationProperties.get("status");
|
||||
String executionType = computationProperties.get("execution_type");
|
||||
|
||||
ComputationId computationId = new ComputationId();
|
||||
computationId.setId(compId);
|
||||
computationId.setOperatorId(operatorId);
|
||||
computationId.setOperatorName(operatorName);
|
||||
|
||||
LinkedHashMap<String, String> inputParameters = new LinkedHashMap<>();
|
||||
LinkedHashMap<String, String> outputParameters = new LinkedHashMap<>();
|
||||
|
||||
for (String key : computationProperties.keySet()) {
|
||||
if (key != null) {
|
||||
if (key.startsWith("input")) {
|
||||
int inputSeparatorIndex = key.indexOf("_");
|
||||
String inputKey = key.substring(inputSeparatorIndex + 1);
|
||||
if (inputKey.compareToIgnoreCase("user.name") != 0
|
||||
&& inputKey.compareToIgnoreCase("scope") != 0) {
|
||||
inputParameters.put(inputKey,
|
||||
computationProperties.get(key));
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if (key.startsWith("output")) {
|
||||
int outputSeparatorIndex = key.indexOf("_");
|
||||
String outputKey = key
|
||||
.substring(outputSeparatorIndex + 1);
|
||||
outputParameters.put(outputKey,
|
||||
computationProperties.get(key));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ComputationData computationData = new ComputationData(computationId,
|
||||
inputParameters, outputParameters, operatorDescritpion,
|
||||
startDate, endDate, status, executionType, vre);
|
||||
|
||||
return computationData;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,16 +17,16 @@ import net.opengis.wps.x100.OutputDescriptionType;
|
|||
import net.opengis.wps.x100.SupportedComplexDataInputType;
|
||||
import net.opengis.wps.x100.SupportedComplexDataType;
|
||||
|
||||
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.EnumParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.FileParameter;
|
||||
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.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
||||
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.EnumParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.FileParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.TabularParameter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
package org.gcube.portlets.user.dataminermanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3039151542008171640L;
|
||||
private ComputationId computationId;
|
||||
private LinkedHashMap<String, String> inputParameters;
|
||||
private LinkedHashMap<String, String> outputParameters;
|
||||
private String operatorDescription;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private String status;
|
||||
private String executionType;
|
||||
private String vre;
|
||||
|
||||
public ComputationData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ComputationData(ComputationId computationId,
|
||||
LinkedHashMap<String, String> inputParameters,
|
||||
LinkedHashMap<String, String> outputParameters,
|
||||
String operatorDescription, String startDate, String endDate,
|
||||
String status, String executionType, String vre) {
|
||||
super();
|
||||
this.computationId = computationId;
|
||||
this.inputParameters = inputParameters;
|
||||
this.outputParameters = outputParameters;
|
||||
this.operatorDescription = operatorDescription;
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
this.status = status;
|
||||
this.executionType = executionType;
|
||||
this.vre = vre;
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
public void setComputationId(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getInputParameters() {
|
||||
return inputParameters;
|
||||
}
|
||||
|
||||
public void setInputParameters(LinkedHashMap<String, String> inputParameters) {
|
||||
this.inputParameters = inputParameters;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getOutputParameters() {
|
||||
return outputParameters;
|
||||
}
|
||||
|
||||
public void setOutputParameters(
|
||||
LinkedHashMap<String, String> outputParameters) {
|
||||
this.outputParameters = outputParameters;
|
||||
}
|
||||
|
||||
public String getOperatorDescription() {
|
||||
return operatorDescription;
|
||||
}
|
||||
|
||||
public void setOperatorDescription(String operatorDescription) {
|
||||
this.operatorDescription = operatorDescription;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getExecutionType() {
|
||||
return executionType;
|
||||
}
|
||||
|
||||
public void setExecutionType(String executionType) {
|
||||
this.executionType = executionType;
|
||||
}
|
||||
|
||||
public String getVre() {
|
||||
return vre;
|
||||
}
|
||||
|
||||
public void setVre(String vre) {
|
||||
this.vre = vre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationData [computationId=" + computationId
|
||||
+ ", inputParameters=" + inputParameters
|
||||
+ ", outputParameters=" + outputParameters
|
||||
+ ", operatorDescription=" + operatorDescription
|
||||
+ ", startDate=" + startDate + ", endDate=" + endDate
|
||||
+ ", status=" + status + ", executionType=" + executionType
|
||||
+ ", vre=" + vre + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package org.gcube.portlets.user.dataminermanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.Resource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OutputData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3039151542008171640L;
|
||||
private ComputationId computationId;
|
||||
private Resource resource;
|
||||
|
||||
public OutputData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public OutputData(ComputationId computationId, Resource resource) {
|
||||
super();
|
||||
this.computationId = computationId;
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
public Resource getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutputData [computationId=" + computationId + ", resource="
|
||||
+ resource + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.bean.output;
|
||||
package org.gcube.portlets.user.dataminermanager.shared.data.output;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
Loading…
Reference in New Issue