2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed StartComputationEvent git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128249 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b0bfb85688
commit
bd115101c0
|
@ -6,11 +6,8 @@ import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassificat
|
|||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.dataspace.DataSpacePanel;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.MaskEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.experimentArea.ExperimentPanel;
|
||||
import org.gcube.portlets.user.dataminermanager.client.resources.Resources;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletService;
|
||||
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.Constants;
|
||||
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
||||
|
@ -47,8 +44,8 @@ import com.sencha.gxt.widget.core.client.container.Viewport;
|
|||
public class DataMinerManager implements EntryPoint {
|
||||
|
||||
public static final Resources resources = GWT.create(Resources.class);
|
||||
private static final DataMinerPortletServiceAsync dataMinerService = GWT
|
||||
.create(DataMinerPortletService.class);
|
||||
/*private static final DataMinerPortletServiceAsync dataMinerService = GWT
|
||||
.create(DataMinerPortletService.class);*/
|
||||
private static final String SM_DIV = "contentDiv";
|
||||
|
||||
private static List<OperatorsClassification> operatorsClassifications = null;
|
||||
|
@ -280,16 +277,7 @@ public class DataMinerManager implements EntryPoint {
|
|||
* });
|
||||
*/
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(
|
||||
ResubmitComputationEvent.getType(),
|
||||
new ResubmitComputationEvent.ResubmitComputationHandler() {
|
||||
@Override
|
||||
public void onResubmitComputation(
|
||||
ResubmitComputationEvent event) {
|
||||
switchTo(experimentPanel);
|
||||
header.setMenuSelected(MenuItem.EXPERIMENT);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -422,9 +410,9 @@ public class DataMinerManager implements EntryPoint {
|
|||
return (find == null ? getDefaultOperatorsClassification() : find);
|
||||
}
|
||||
|
||||
public static DataMinerPortletServiceAsync getService() {
|
||||
/*public static DataMinerPortletServiceAsync getService() {
|
||||
return dataMinerService;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionEvent;
|
||||
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.StartComputationExecutionEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationExecutionRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaEventType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
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;
|
||||
|
@ -104,13 +111,175 @@ public class DataMinerManagerController {
|
|||
|
||||
@Override
|
||||
public void onChange(SessionExpiredEvent event) {
|
||||
Log.debug("Catch Event SessionExpiredEvent");
|
||||
Log.debug("Catch SessionExpiredEvent");
|
||||
sessionExpiredShow();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
StartComputationExecutionRequestEvent.TYPE,
|
||||
new StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onStart(
|
||||
StartComputationExecutionRequestEvent event) {
|
||||
Log.debug("Catch StartComputationExecutionRequestEvent");
|
||||
startComputationRequest(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
CancelComputationRequestEvent.TYPE,
|
||||
new CancelComputationRequestEvent.CancelComputationRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onCancel(
|
||||
CancelComputationRequestEvent event) {
|
||||
Log.debug("Catch CancelComputationRequestEvent");
|
||||
cancelComputationRequest(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
ResubmitComputationExecutionRequestEvent.TYPE,
|
||||
new ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onResubmit(
|
||||
ResubmitComputationExecutionRequestEvent event) {
|
||||
Log.debug("Catch ResubmitComputationExecutionRequestEvent");
|
||||
resubmitComputationRequest(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* EventBusProvider.INSTANCE.addHandler(
|
||||
* ResubmitComputationEvent.getType(), new
|
||||
* ResubmitComputationEvent.ResubmitComputationHandler() {
|
||||
*
|
||||
* @Override public void onResubmitComputation( ResubmitComputationEvent
|
||||
* event) { switchTo(experimentPanel);
|
||||
* header.setMenuSelected(MenuItem.EXPERIMENT); } });
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
private void startComputationRequest(
|
||||
final StartComputationExecutionRequestEvent event) {
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(),
|
||||
event.getComputationTitle(), event.getComputationDescription(),
|
||||
new AsyncCallback<ComputationId>() {
|
||||
@Override
|
||||
public void onSuccess(ComputationId computationId) {
|
||||
if (computationId == null)
|
||||
UtilsGXT3.alert("Error",
|
||||
"Failed to start computation "
|
||||
+ event.getOp().getName()
|
||||
+ ", the computation id is null");
|
||||
else {
|
||||
startComputation(computationId,
|
||||
event.getComputationStatusPanelIndex());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert("Error",
|
||||
"Failed to start computation "
|
||||
+ event.getOp().getName()
|
||||
+ "<br/>Cause:" + caught.getCause()
|
||||
+ "<br/>Message:" + caught.getMessage());
|
||||
caught.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void startComputation(ComputationId computationId,
|
||||
int computationStatusPanelIndex) {
|
||||
StartComputationExecutionEvent event = new StartComputationExecutionEvent(
|
||||
computationId, computationStatusPanelIndex);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
private void cancelComputationRequest(CancelComputationRequestEvent event) {
|
||||
final ComputationId computationId = event.getComputationId();
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId,
|
||||
new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof ExpiredSessionServiceException) {
|
||||
UtilsGXT3.alert("Error", "Expired Session");
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
UtilsGXT3.alert(
|
||||
"Error",
|
||||
"Error in cancel computation: ComputationId="
|
||||
+ computationId.getId()
|
||||
+ ", Error="
|
||||
+ caught.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
Log.debug("Computation Deleted!");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void resubmitComputationRequest(
|
||||
final ResubmitComputationExecutionRequestEvent event) {
|
||||
DataMinerPortletServiceAsync.INSTANCE.resubmit(event.getComputationId(), new AsyncCallback<ComputationId>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert("Error",
|
||||
"Failed to resubmit computation "
|
||||
+ event.getComputationId()
|
||||
+ "<br/>Cause:" + caught.getCause()
|
||||
+ "<br/>Message:" + caught.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ComputationId result) {
|
||||
if (result == null)
|
||||
UtilsGXT3
|
||||
.alert("Error",
|
||||
"Failed to resubmit computation, the computation id is null!");
|
||||
else {
|
||||
resubmitComputation(result);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void resubmitComputation(ComputationId computationId) {
|
||||
ComputationItem computationItem=new ComputationItem(computationId, null);
|
||||
ResubmitComputationExecutionEvent event = new ResubmitComputationExecutionEvent(
|
||||
computationItem);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
|
||||
private void retrieveDataMinerWorkArea() {
|
||||
DataMinerPortletServiceAsync.INSTANCE
|
||||
.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
|
||||
|
@ -138,14 +307,12 @@ public class DataMinerManagerController {
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void fireDataMinerWorkAreaEventRetrieved(DataMinerWorkArea result){
|
||||
|
||||
private void fireDataMinerWorkAreaEventRetrieved(DataMinerWorkArea result) {
|
||||
dataMinerWorkArea = result;
|
||||
DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent(
|
||||
DataMinerWorkAreaEventType.OPEN, result);
|
||||
eventBus.fireEvent(dataMinerWorkAreaEvent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -10,18 +10,17 @@ 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 {
|
||||
|
||||
|
||||
|
||||
|
||||
public class ComputationItem implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 7948340340190844208L;
|
||||
|
||||
// force to implement these objects in javascript
|
||||
private ComputationId computationId;
|
||||
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
|
@ -34,8 +33,6 @@ public class ComputationItem implements Serializable{
|
|||
private Resource resource;
|
||||
private Operator operator;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -43,41 +40,48 @@ public class ComputationItem implements Serializable{
|
|||
super();
|
||||
}
|
||||
|
||||
public ComputationItem(ComputationId computationId, String name, String description,
|
||||
String categoryId, String operatorId, String infrastructure,
|
||||
Date creationDate, Date endDate,
|
||||
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;
|
||||
}
|
||||
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)
|
||||
OperatorsClassification classification = DataMinerManager
|
||||
.getDefaultOperatorsClassification();
|
||||
if (classification == null)
|
||||
return null;
|
||||
else
|
||||
return classification.getCategoryById(categoryId);
|
||||
}
|
||||
|
||||
|
||||
public Operator getOperator() {
|
||||
if (operator==null) {
|
||||
OperatorsClassification classification = DataMinerManager.getDefaultOperatorsClassification();
|
||||
if (classification!=null)
|
||||
operator=classification.getOperatorById(operatorId);
|
||||
if (operator == null) {
|
||||
OperatorsClassification classification = DataMinerManager
|
||||
.getDefaultOperatorsClassification();
|
||||
if (classification != null)
|
||||
operator = classification.getOperatorById(operatorId);
|
||||
}
|
||||
return operator;
|
||||
}
|
||||
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
|
@ -124,7 +128,7 @@ public class ComputationItem implements Serializable{
|
|||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate=endDate;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* Cancel Computation Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class CancelComputationRequestEvent
|
||||
extends
|
||||
GwtEvent<CancelComputationRequestEvent.CancelComputationRequestEventHandler> {
|
||||
|
||||
public static Type<CancelComputationRequestEventHandler> TYPE = new Type<CancelComputationRequestEventHandler>();
|
||||
private ComputationId computationId;
|
||||
|
||||
public interface CancelComputationRequestEventHandler extends EventHandler {
|
||||
void onCancel(CancelComputationRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasCancelComputationRequestEventHandler extends
|
||||
HasHandlers {
|
||||
public HandlerRegistration addCancelComputationRequestEventHandler(
|
||||
CancelComputationRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public CancelComputationRequestEvent(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(CancelComputationRequestEventHandler handler) {
|
||||
handler.onCancel(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<CancelComputationRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<CancelComputationRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
CancelComputationRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CancelComputationRequestEvent [computationId=" + computationId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
/**
|
||||
* Computation Ready Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationReadyEvent extends
|
||||
GwtEvent<ComputationReadyEvent.ComputationReadyEventHandler> {
|
||||
|
||||
public static Type<ComputationReadyEventHandler> TYPE = new Type<ComputationReadyEventHandler>();
|
||||
private Operator operator;
|
||||
private String computationTitle;
|
||||
private String computationDescription;
|
||||
|
||||
public interface ComputationReadyEventHandler extends EventHandler {
|
||||
void onReady(ComputationReadyEvent event);
|
||||
}
|
||||
|
||||
public interface HasComputationReadyEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addComputationReadyEventHandler(
|
||||
ComputationReadyEventHandler handler);
|
||||
}
|
||||
|
||||
public ComputationReadyEvent(Operator operator, String computationTitle,
|
||||
String computationDescription) {
|
||||
super();
|
||||
this.operator = operator;
|
||||
this.computationTitle = computationTitle;
|
||||
this.computationDescription = computationDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ComputationReadyEventHandler handler) {
|
||||
handler.onReady(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ComputationReadyEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ComputationReadyEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, ComputationReadyEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public static Type<ComputationReadyEventHandler> getTYPE() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public Operator getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public String getComputationTitle() {
|
||||
return computationTitle;
|
||||
}
|
||||
|
||||
public String getComputationDescription() {
|
||||
return computationDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationReadyEvent [operator=" + operator
|
||||
+ ", computationTitle=" + computationTitle
|
||||
+ ", computationDescription=" + computationDescription + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import java.lang.String;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
public class ImportCreatedEvent extends
|
||||
GwtEvent<ImportCreatedEvent.ImportCreatedHandler> {
|
||||
|
||||
public static Type<ImportCreatedHandler> TYPE = new Type<ImportCreatedHandler>();
|
||||
private String importId;
|
||||
|
||||
public interface ImportCreatedHandler extends EventHandler {
|
||||
void onImportCreated(ImportCreatedEvent event);
|
||||
}
|
||||
|
||||
public ImportCreatedEvent(String importId) {
|
||||
this.importId = importId;
|
||||
}
|
||||
|
||||
public String getImportId() {
|
||||
return importId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ImportCreatedHandler handler) {
|
||||
handler.onImportCreated(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ImportCreatedHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ImportCreatedHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, String importId) {
|
||||
source.fireEvent(new ImportCreatedEvent(importId));
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
public class ImportTerminatedEvent extends
|
||||
GwtEvent<ImportTerminatedEvent.ImportTerminatedHandler> {
|
||||
|
||||
public static Type<ImportTerminatedHandler> TYPE = new Type<ImportTerminatedHandler>();
|
||||
private ImportStatus importStatus;
|
||||
|
||||
public interface ImportTerminatedHandler extends EventHandler {
|
||||
void onImportTerminated(ImportTerminatedEvent event);
|
||||
}
|
||||
|
||||
public ImportTerminatedEvent(ImportStatus importStatus) {
|
||||
this.importStatus = importStatus;
|
||||
}
|
||||
|
||||
public ImportStatus getImportStatus() {
|
||||
return importStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ImportTerminatedHandler handler) {
|
||||
handler.onImportTerminated(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ImportTerminatedHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ImportTerminatedHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, ImportStatus importStatus) {
|
||||
source.fireEvent(new ImportTerminatedEvent(importStatus));
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
public class JobsGridGotDirtyEvent extends GwtEvent<JobsGridGotDirtyEvent.JobsGridGotDirtyHandler> {
|
||||
|
||||
public static Type<JobsGridGotDirtyHandler> TYPE = new Type<JobsGridGotDirtyHandler>();
|
||||
|
||||
public interface JobsGridGotDirtyHandler extends EventHandler {
|
||||
void onJobsGridGotDirty(JobsGridGotDirtyEvent event);
|
||||
}
|
||||
|
||||
public JobsGridGotDirtyEvent() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(JobsGridGotDirtyHandler handler) {
|
||||
handler.onJobsGridGotDirty(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<JobsGridGotDirtyHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<JobsGridGotDirtyHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source) {
|
||||
source.fireEvent(new JobsGridGotDirtyEvent());
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
|
||||
/**
|
||||
* @author ceras
|
||||
*
|
||||
*/
|
||||
public interface JobsGridHandler {
|
||||
|
||||
public void jobSelected(ComputationItem jobItem);
|
||||
|
||||
public void removeComputation(ComputationItem jobItem);
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
public class ResubmitComputationEvent extends
|
||||
GwtEvent<ResubmitComputationEvent.ResubmitComputationHandler> {
|
||||
|
||||
public static Type<ResubmitComputationHandler> TYPE = new Type<ResubmitComputationHandler>();
|
||||
private ComputationItem jobItem;
|
||||
|
||||
public interface ResubmitComputationHandler extends EventHandler {
|
||||
void onResubmitComputation(ResubmitComputationEvent event);
|
||||
}
|
||||
|
||||
public ResubmitComputationEvent(ComputationItem jobItem) {
|
||||
this.jobItem = jobItem;
|
||||
}
|
||||
|
||||
public ComputationItem getJobItem() {
|
||||
return jobItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ResubmitComputationHandler handler) {
|
||||
handler.onResubmitComputation(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ResubmitComputationHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ResubmitComputationHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, ComputationItem jobItem) {
|
||||
source.fireEvent(new ResubmitComputationEvent(jobItem));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Resubmit Computation Execution Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ResubmitComputationExecutionEvent
|
||||
extends
|
||||
GwtEvent<ResubmitComputationExecutionEvent.ResubmitComputationExecutionEventHandler> {
|
||||
|
||||
public static Type<ResubmitComputationExecutionEventHandler> TYPE = new Type<ResubmitComputationExecutionEventHandler>();
|
||||
private ComputationItem computationItem;
|
||||
|
||||
public interface ResubmitComputationExecutionEventHandler extends
|
||||
EventHandler {
|
||||
void onResubmit(ResubmitComputationExecutionEvent event);
|
||||
}
|
||||
|
||||
public interface HasResubmitComputationExecutionEventHandler extends
|
||||
HasHandlers {
|
||||
public HandlerRegistration addResubmitComputationExecutionEventHandler(
|
||||
ResubmitComputationExecutionEventHandler handler);
|
||||
}
|
||||
|
||||
public ResubmitComputationExecutionEvent(ComputationItem computationItem) {
|
||||
this.computationItem = computationItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ResubmitComputationExecutionEventHandler handler) {
|
||||
handler.onResubmit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ResubmitComputationExecutionEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ResubmitComputationExecutionEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
ResubmitComputationExecutionEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationItem getComputationItem() {
|
||||
return computationItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResubmitComputationExecutionEvent [computationItem="
|
||||
+ computationItem + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* Resubmit Computation Execution Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ResubmitComputationExecutionRequestEvent
|
||||
extends
|
||||
GwtEvent<ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler> {
|
||||
|
||||
public static Type<ResubmitComputationExecutionRequestEventHandler> TYPE = new Type<ResubmitComputationExecutionRequestEventHandler>();
|
||||
private ComputationId computationId;
|
||||
|
||||
public interface ResubmitComputationExecutionRequestEventHandler extends
|
||||
EventHandler {
|
||||
void onResubmit(ResubmitComputationExecutionRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasResubmitComputationExecutionRequestEventHandler extends
|
||||
HasHandlers {
|
||||
public HandlerRegistration addResubmitComputationExecutionRequestEventHandler(
|
||||
ResubmitComputationExecutionRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public ResubmitComputationExecutionRequestEvent(ComputationId computationId) {
|
||||
this.computationId = computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ResubmitComputationExecutionRequestEventHandler handler) {
|
||||
handler.onResubmit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<ResubmitComputationExecutionRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<ResubmitComputationExecutionRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
ResubmitComputationExecutionRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResubmitComputationExecutionRequestEvent [computationId="
|
||||
+ computationId + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
/**
|
||||
* Start Computation Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StartComputationEvent extends
|
||||
GwtEvent<StartComputationEvent.StartComputationEventHandler> {
|
||||
|
||||
public static Type<StartComputationEventHandler> TYPE = new Type<StartComputationEventHandler>();
|
||||
private Operator op;
|
||||
private String computationTitle;
|
||||
private String computationDescription;
|
||||
|
||||
public interface StartComputationEventHandler extends EventHandler {
|
||||
void onStart(StartComputationEvent event);
|
||||
}
|
||||
|
||||
public interface HasStartComputationEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addStartComputationEventHandler(
|
||||
StartComputationEventHandler handler);
|
||||
}
|
||||
|
||||
public StartComputationEvent(Operator op, String computationTitle, String computationDescription) {
|
||||
this.op=op;
|
||||
this.computationTitle=computationTitle;
|
||||
this.computationDescription=computationDescription;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(StartComputationEventHandler handler) {
|
||||
handler.onStart(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<StartComputationEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<StartComputationEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
StartComputationEvent startComputationEvent) {
|
||||
source.fireEvent(startComputationEvent);
|
||||
}
|
||||
|
||||
public Operator getOp() {
|
||||
return op;
|
||||
}
|
||||
|
||||
public String getComputationTitle() {
|
||||
return computationTitle;
|
||||
}
|
||||
|
||||
public String getComputationDescription() {
|
||||
return computationDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StartComputationEvent [op=" + op + ", computationTitle="
|
||||
+ computationTitle + ", computationDescription="
|
||||
+ computationDescription + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* Start Computation Execution Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StartComputationExecutionEvent
|
||||
extends
|
||||
GwtEvent<StartComputationExecutionEvent.StartComputationExecutionEventHandler> {
|
||||
|
||||
public static Type<StartComputationExecutionEventHandler> TYPE = new Type<StartComputationExecutionEventHandler>();
|
||||
private ComputationId computationId;
|
||||
private int computationStatusPanelIndex;
|
||||
|
||||
public interface StartComputationExecutionEventHandler extends EventHandler {
|
||||
void onStart(StartComputationExecutionEvent event);
|
||||
}
|
||||
|
||||
public interface HasStartComputationExecutionEventHandler extends
|
||||
HasHandlers {
|
||||
public HandlerRegistration addStartComputationExecutionEventHandler(
|
||||
StartComputationExecutionEventHandler handler);
|
||||
}
|
||||
|
||||
public StartComputationExecutionEvent(ComputationId computationId,
|
||||
int computationStatusPanelIndex) {
|
||||
this.computationId = computationId;
|
||||
this.computationStatusPanelIndex = computationStatusPanelIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(StartComputationExecutionEventHandler handler) {
|
||||
handler.onStart(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<StartComputationExecutionEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<StartComputationExecutionEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
StartComputationExecutionEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public ComputationId getComputationId() {
|
||||
return computationId;
|
||||
}
|
||||
|
||||
public int getComputationStatusPanelIndex() {
|
||||
return computationStatusPanelIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StartComputationExecutionEvent [computationId=" + computationId
|
||||
+ ", computationStatusPanelIndex="
|
||||
+ computationStatusPanelIndex + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
/**
|
||||
* Start Computation Execution Request Event
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StartComputationExecutionRequestEvent
|
||||
extends
|
||||
GwtEvent<StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler> {
|
||||
|
||||
public static Type<StartComputationExecutionRequestEventHandler> TYPE = new Type<StartComputationExecutionRequestEventHandler>();
|
||||
private Operator op;
|
||||
private String computationTitle;
|
||||
private String computationDescription;
|
||||
private int computationStatusPanelIndex;
|
||||
|
||||
public interface StartComputationExecutionRequestEventHandler extends EventHandler {
|
||||
void onStart(StartComputationExecutionRequestEvent event);
|
||||
}
|
||||
|
||||
public interface HasStartComputationExecutionRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addStartComputationExecutionRequestEventHandler(
|
||||
StartComputationExecutionRequestEventHandler handler);
|
||||
}
|
||||
|
||||
public StartComputationExecutionRequestEvent(Operator op, String computationTitle,
|
||||
String computationDescription, int computationStatusPanelIndex) {
|
||||
this.op = op;
|
||||
this.computationTitle = computationTitle;
|
||||
this.computationDescription = computationDescription;
|
||||
this.computationStatusPanelIndex = computationStatusPanelIndex;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(StartComputationExecutionRequestEventHandler handler) {
|
||||
handler.onStart(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<StartComputationExecutionRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static Type<StartComputationExecutionRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source,
|
||||
StartComputationExecutionRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
public Operator getOp() {
|
||||
return op;
|
||||
}
|
||||
|
||||
public String getComputationTitle() {
|
||||
return computationTitle;
|
||||
}
|
||||
|
||||
public String getComputationDescription() {
|
||||
return computationDescription;
|
||||
}
|
||||
|
||||
public int getComputationStatusPanelIndex() {
|
||||
return computationStatusPanelIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StartComputationExecutionRequestEvent [op=" + op
|
||||
+ ", computationTitle=" + computationTitle
|
||||
+ ", computationDescription=" + computationDescription
|
||||
+ ", computationStatusPanelIndex="
|
||||
+ computationStatusPanelIndex + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -4,16 +4,13 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
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.JobsGridGotDirtyEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
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;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
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;
|
||||
|
@ -50,13 +47,13 @@ public class ComputationExecutionPanel extends FramedPanel {
|
|||
*/
|
||||
public ComputationExecutionPanel() {
|
||||
super();
|
||||
Log.debug("Computation Execution Panel");
|
||||
init();
|
||||
create();
|
||||
bind();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
// this.setHeading(".: Computation Execution");
|
||||
setHeaderVisible(false);
|
||||
addStyleName("computationExcecutionPanel");
|
||||
setBodyStyle("backgroundColor:white;");
|
||||
|
@ -74,99 +71,86 @@ public class ComputationExecutionPanel extends FramedPanel {
|
|||
add(topV);
|
||||
}
|
||||
|
||||
private void bind() {
|
||||
EventBusProvider.INSTANCE.addHandler(
|
||||
ResubmitComputationExecutionEvent.getType(),
|
||||
new ResubmitComputationExecutionEvent.ResubmitComputationExecutionEventHandler() {
|
||||
@Override
|
||||
public void onResubmit(ResubmitComputationExecutionEvent event) {
|
||||
resubmitComputation(event);
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(StartComputationExecutionEvent.getType(),
|
||||
new StartComputationExecutionEvent.StartComputationExecutionEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onStart(StartComputationExecutionEvent event) {
|
||||
startComputation(event);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void startNewComputation(final Operator operator,
|
||||
String computationTitle, String computationDescription) {
|
||||
Log.debug("Computation Panel: start new computation ");
|
||||
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
|
||||
ComputationStatusPanel statusPanel = new ComputationStatusPanel(
|
||||
operator);
|
||||
computationStatusPanels.add(statusPanel);
|
||||
int index = computationStatusPanels.indexOf(statusPanel);
|
||||
statusPanel.setItemId("ComputationStatusPanel" + String.valueOf(index));
|
||||
|
||||
Log.debug("Added status bar");
|
||||
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1, new Margins(20)));
|
||||
removeAllButton.setEnabled(true);
|
||||
|
||||
DataMinerManager.getService().startComputation(operator,
|
||||
computationTitle, computationDescription,
|
||||
new AsyncCallback<ComputationId>() {
|
||||
@Override
|
||||
public void onSuccess(ComputationId computationId) {
|
||||
if (computationId == null)
|
||||
UtilsGXT3
|
||||
.alert("ERROR",
|
||||
"Failed to start computation "
|
||||
+ operator.getName()
|
||||
+ ", the computation id is null (1)");
|
||||
else {
|
||||
statusPanel.computationStarted(computationId);
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new JobsGridGotDirtyEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert(
|
||||
"ERROR",
|
||||
"Failed to start computation "
|
||||
+ operator.getName()
|
||||
+ " (2)<br/>Cause:" + caught.getCause()
|
||||
+ "<br/>Message:" + caught.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
forceLayout();
|
||||
|
||||
StartComputationExecutionRequestEvent event = new StartComputationExecutionRequestEvent(
|
||||
operator, computationTitle, computationDescription, index);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void bind() {
|
||||
EventBusProvider.INSTANCE.addHandler(
|
||||
ResubmitComputationEvent.getType(),
|
||||
new ResubmitComputationEvent.ResubmitComputationHandler() {
|
||||
@Override
|
||||
public void onResubmitComputation(
|
||||
ResubmitComputationEvent event) {
|
||||
resubmitComputation(event.getJobItem());
|
||||
}
|
||||
});
|
||||
private void startComputation(StartComputationExecutionEvent event) {
|
||||
try {
|
||||
ComputationStatusPanel statusPanel = null;
|
||||
try {
|
||||
statusPanel = computationStatusPanels.get(event
|
||||
.getComputationStatusPanelIndex());
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
Log.debug("No ComputationStatusPanel retrieved!");
|
||||
Log.debug(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
if (statusPanel == null) {
|
||||
|
||||
} else {
|
||||
statusPanel.computationStarted(event.getComputationId());
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void resubmitComputation(final ComputationItem computationItem) {
|
||||
public void resubmitComputation(ResubmitComputationExecutionEvent event) {
|
||||
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
|
||||
computationItem.getOperator());
|
||||
event.getComputationItem().getOperator());
|
||||
computationStatusPanels.add(statusPanel);
|
||||
if(v.getWidgetCount()==0){
|
||||
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)));
|
||||
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1, new Margins(
|
||||
20)));
|
||||
}
|
||||
removeAllButton.setEnabled(true);
|
||||
|
||||
DataMinerManager.getService().resubmit(
|
||||
computationItem.getComputationId(),
|
||||
new AsyncCallback<ComputationId>() {
|
||||
@Override
|
||||
public void onSuccess(ComputationId computationId) {
|
||||
if (computationId == null)
|
||||
UtilsGXT3
|
||||
.alert("ERROR",
|
||||
"Failed to resubmit computation "
|
||||
+ computationItem.getName()
|
||||
+ ", the computation id is null (1)");
|
||||
else {
|
||||
statusPanel.computationStarted(computationId);
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new JobsGridGotDirtyEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert("ERROR",
|
||||
"Failed to start computation "
|
||||
+ computationItem.getName()
|
||||
+ " (2)<br/>Cause:" + caught.getCause()
|
||||
+ "<br/>Message:" + caught.getMessage());
|
||||
}
|
||||
});
|
||||
statusPanel.computationStarted(event.getComputationItem()
|
||||
.getComputationId());
|
||||
|
||||
forceLayout();
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResourc
|
|||
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.rpc.DataMinerPortletServiceAsync;
|
||||
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;
|
||||
|
@ -56,7 +57,7 @@ public class ComputationOutputPanel extends SimpleContainer {
|
|||
add(v);
|
||||
|
||||
// request for a jobItem linked with the computationId (or jobId)
|
||||
DataMinerManager.getService().getResourceByComputationId(computationId,
|
||||
DataMinerPortletServiceAsync.INSTANCE.getResourceByComputationId(computationId,
|
||||
new AsyncCallback<Resource>() {
|
||||
@Override
|
||||
public void onSuccess(Resource result) {
|
||||
|
|
|
@ -2,9 +2,9 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
|||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.HasStartComputationEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.StartComputationEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationReadyEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationReadyEvent.ComputationReadyEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationReadyEvent.HasComputationReadyEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanager.client.experimentArea.ComputationParametersPanel.ComputationParametersPanelHandler;
|
||||
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
|
@ -32,8 +32,8 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ComputationPanel extends FramedPanel implements
|
||||
HasStartComputationEventHandler {
|
||||
public class ComputationPanel extends FramedPanel implements HasComputationReadyEventHandler
|
||||
{
|
||||
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators";
|
||||
private TextButton removeAllButton;
|
||||
private ToolBar toolBar;
|
||||
|
@ -55,6 +55,7 @@ public class ComputationPanel extends FramedPanel implements
|
|||
private void create() {
|
||||
computationParametersPanel=null;
|
||||
topV = new VerticalLayoutContainer();
|
||||
topV.setScrollMode(ScrollMode.NONE);
|
||||
setToolBar();
|
||||
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
SimpleContainer operator = new SimpleContainer();
|
||||
|
@ -107,21 +108,20 @@ public class ComputationPanel extends FramedPanel implements
|
|||
new BoxLayoutData(new Margins(0)));
|
||||
v.add(hBox, new VerticalLayoutData(1, -1, new Margins(10,0,0,0)));
|
||||
v.add(computationParametersPanel, new VerticalLayoutData(1, -1,
|
||||
new Margins(0,5,5,5)));
|
||||
new Margins(0)));
|
||||
removeAllButton.setEnabled(true);
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerRegistration addStartComputationEventHandler(
|
||||
StartComputationEventHandler handler) {
|
||||
return addHandler(handler, StartComputationEvent.getType());
|
||||
public HandlerRegistration addComputationReadyEventHandler(
|
||||
ComputationReadyEventHandler handler) {
|
||||
return addHandler(handler, ComputationReadyEvent.getType());
|
||||
|
||||
}
|
||||
|
||||
public void addOperator(Operator op) {
|
||||
computationParametersPanel = new ComputationParametersPanel(op);
|
||||
public void addOperator(Operator operator) {
|
||||
computationParametersPanel = new ComputationParametersPanel(operator);
|
||||
computationParametersPanel.setHandler(new ComputationParametersPanelHandler() {
|
||||
@Override
|
||||
public void startComputation(String computationTitle,
|
||||
|
@ -130,8 +130,8 @@ public class ComputationPanel extends FramedPanel implements
|
|||
forceLayout();
|
||||
computationParametersPanel.updateOperatorParametersValues();
|
||||
Operator op = computationParametersPanel.getOperator();
|
||||
StartComputationEvent startComputationEvent = new StartComputationEvent(op, computationTitle, computationDescription);
|
||||
fireEvent(startComputationEvent);
|
||||
ComputationReadyEvent event = new ComputationReadyEvent(op, computationTitle, computationDescription);
|
||||
fireEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnFld
|
|||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnListFld;
|
||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.OperatorFieldWidget;
|
||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -98,22 +99,21 @@ public class ComputationParametersPanel extends SimpleContainer {
|
|||
Image img = new Image(GWT.getModuleBaseURL() + "../images/operators/"
|
||||
+ (operator.hasImage() ? operator.getId() : "DEFAULT_IMAGE")
|
||||
+ ".png");
|
||||
img.setStylePrimaryName("workflow-icon");
|
||||
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-10, 0, 0, 5)));
|
||||
img.setStylePrimaryName("workflow-icon");//-15
|
||||
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-15, 0, 0, 5)));
|
||||
|
||||
HtmlLayoutContainer title = new HtmlLayoutContainer("<span>"
|
||||
+ operator.getName() + "</span>");
|
||||
title.addStyleName("workflow-title");
|
||||
v.add(title, new VerticalLayoutData(-1, -1, new Margins(15, 0, 0, -25)));
|
||||
v.add(title, new VerticalLayoutData(-1, -1, new Margins(20, 0, 0, -25)));
|
||||
|
||||
String descr = operator.getDescription();
|
||||
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
||||
: operator.getDescription();
|
||||
HtmlLayoutContainer description = new HtmlLayoutContainer("<span style='padding-right:10px;'>"
|
||||
: operator.getDescription();//display:block;clear:both;'
|
||||
HtmlLayoutContainer description = new HtmlLayoutContainer("<span style='padding-left:10px;padding-right:10px'>"
|
||||
+ descr + "</span>");
|
||||
description.addStyleName("workflow-description");
|
||||
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0, 5, 0,
|
||||
10)));
|
||||
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
|
||||
addTitleField();
|
||||
|
||||
|
@ -194,15 +194,16 @@ public class ComputationParametersPanel extends SimpleContainer {
|
|||
titleField.setWidth(250);
|
||||
titleField.setValue(defaultComputationTitle);
|
||||
FieldLabel titleLabel = new FieldLabel(titleField, "Computation Title");
|
||||
titleLabel.addStyleName("workflow-computation-title");
|
||||
v.add(titleLabel, new VerticalLayoutData(-1, -1,
|
||||
new Margins(5, 0, 0, 5)));
|
||||
new Margins(0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parametersPanel
|
||||
*/
|
||||
private void loadOperatorParameters() {
|
||||
DataMinerManager.getService().getParameters(operator,
|
||||
DataMinerPortletServiceAsync.INSTANCE.getParameters(operator,
|
||||
new AsyncCallback<List<Parameter>>() {
|
||||
@Override
|
||||
public void onSuccess(List<Parameter> result) {
|
||||
|
|
|
@ -5,16 +5,15 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationRequestEvent;
|
||||
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.Constants;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
|
@ -137,29 +136,11 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
|
||||
|
||||
private void cancelComputation(){
|
||||
DataMinerManager.getService().cancelComputation(computationId, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof ExpiredSessionServiceException) {
|
||||
UtilsGXT3.alert("Error", "Expired Session");
|
||||
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
UtilsGXT3.alert(
|
||||
"Error",
|
||||
"Error in cancel computation: ComputationId="+computationId.getId()+", Error="
|
||||
+ caught.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
Log.debug(result);
|
||||
|
||||
}
|
||||
});
|
||||
CancelComputationRequestEvent event=new CancelComputationRequestEvent(computationId);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param computationId
|
||||
|
@ -234,7 +215,7 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
@Override
|
||||
public void run() {
|
||||
Log.debug("Timer run .....");
|
||||
DataMinerManager.getService().getComputationStatus(computationId, new AsyncCallback<ComputationStatus>() {
|
||||
DataMinerPortletServiceAsync.INSTANCE.getComputationStatus(computationId, new AsyncCallback<ComputationStatus>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -12,6 +12,7 @@ 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.OperatorCategory;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
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.Constants;
|
||||
|
||||
|
@ -95,7 +96,7 @@ public class OperatorsPanel extends FramedPanel {
|
|||
// if the operators classification is not loaded, let's load by an rpc
|
||||
if (DataMinerManager.getOperatorsClassifications() == null) {
|
||||
waitMessage(true);
|
||||
DataMinerManager.getService().getOperatorsClassifications(
|
||||
DataMinerPortletServiceAsync.INSTANCE.getOperatorsClassifications(
|
||||
new AsyncCallback<List<OperatorsClassification>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,8 +6,8 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
|||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ComputationReadyEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionEvent;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
||||
|
@ -50,12 +50,12 @@ public class WorkflowPanel extends TabPanel {
|
|||
.folderExplore());
|
||||
computationPanel = new ComputationPanel();
|
||||
computationPanel
|
||||
.addStartComputationEventHandler(new StartComputationEvent.StartComputationEventHandler() {
|
||||
.addComputationReadyEventHandler(new ComputationReadyEvent.ComputationReadyEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onStart(StartComputationEvent event) {
|
||||
public void onReady(ComputationReadyEvent event) {
|
||||
Log.debug("StartComputationEvent Received:"+event);
|
||||
startComputation(event.getOp(), event.getComputationTitle(),
|
||||
startComputation(event.getOperator(), event.getComputationTitle(),
|
||||
event.getComputationDescription());
|
||||
|
||||
}
|
||||
|
@ -77,15 +77,22 @@ public class WorkflowPanel extends TabPanel {
|
|||
*/
|
||||
private void bind() {
|
||||
EventBusProvider.INSTANCE.addHandler(
|
||||
ResubmitComputationEvent.getType(),
|
||||
new ResubmitComputationEvent.ResubmitComputationHandler() {
|
||||
ResubmitComputationExecutionEvent.getType(),
|
||||
new ResubmitComputationExecutionEvent.ResubmitComputationExecutionEventHandler() {
|
||||
@Override
|
||||
public void onResubmitComputation(
|
||||
ResubmitComputationEvent event) {
|
||||
setActiveWidget(computationExecutionPanel);
|
||||
public void onResubmit(
|
||||
ResubmitComputationExecutionEvent event) {
|
||||
resubmitComputation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void resubmitComputation(){
|
||||
setActiveWidget(computationExecutionPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param computationTitle
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.rpc;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem;
|
||||
|
|
|
@ -58,7 +58,6 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// private static final long CACHE_REFRESH_TIME = 30 * 60 * 1000; // 30
|
||||
// minutes
|
||||
|
||||
|
||||
// private final static String SEPARATOR = AlgorithmConfiguration
|
||||
// .getListSeparator();
|
||||
private static Logger logger = LoggerFactory
|
||||
|
@ -142,38 +141,40 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public ComputationId startComputation(Operator operator, String computationTitle,
|
||||
String computationDescription) throws Exception {
|
||||
public ComputationId startComputation(Operator operator,
|
||||
String computationTitle, String computationDescription)
|
||||
throws Exception {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
||||
logger.debug("StartComputation(): [computationTitle="
|
||||
+ computationTitle + ", computationDescription="
|
||||
+ computationDescription + ", operator=" + operator + "]");
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.startComputation(operator, computationTitle,
|
||||
computationDescription);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in computation: " + e.getLocalizedMessage());
|
||||
logger.error("Error in start computation: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputationId resubmit(ComputationId computationId) throws ServiceException {
|
||||
public ComputationId resubmit(ComputationId computationId)
|
||||
throws ServiceException {
|
||||
try {
|
||||
logger.info("RESUBMIT COMPUTATION: " + computationId);
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("Resubmit(): " + computationId);
|
||||
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
|
||||
// String computationId =
|
||||
// factory.resubmitComputation(jobItem.getId());
|
||||
// return computationId;
|
||||
return computationId;
|
||||
return smClient.resubmitComputation(computationId);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in resubmit: " + e.getLocalizedMessage());
|
||||
logger.error("Error in resubmit computation: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -232,20 +233,19 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationId(ComputationId computationId) {
|
||||
try {
|
||||
Log.debug("getResourceByComputationId: "+computationId);
|
||||
Log.debug("getResourceByComputationId: " + 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);
|
||||
Resource resource = smClient
|
||||
.getResourceByComputationId(computationId);
|
||||
Log.debug("Resoure: " + resource);
|
||||
return resource;
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in getResourceByComputationId: "
|
||||
+ e.getLocalizedMessage());
|
||||
|
@ -256,8 +256,8 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParametersMapByComputationId(ComputationId jobId)
|
||||
throws ServiceException {
|
||||
public Map<String, String> getParametersMapByComputationId(
|
||||
ComputationId jobId) throws ServiceException {
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -281,7 +281,7 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage(),e);
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -301,13 +301,9 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String saveImage(ComputationId computationId, ImagesResource imagesResource)
|
||||
throws Exception {
|
||||
public String saveImage(ComputationId computationId,
|
||||
ImagesResource imagesResource) throws Exception {
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -336,7 +332,8 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
"This folder contains images obtained from Data Miner Manager");
|
||||
|
||||
} catch (ItemAlreadyExistException e) {
|
||||
folder = (WorkspaceFolder) rootFolder.find(computationId.getId());
|
||||
folder = (WorkspaceFolder) rootFolder.find(computationId
|
||||
.getId());
|
||||
}
|
||||
InputStream inputStream = new URL(imagesResource.getLink())
|
||||
.openStream();
|
||||
|
@ -437,9 +434,10 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("getDataMinerWorkArea()");
|
||||
DataMinerWorkAreaManager dataMinerWorkAreaManager=new DataMinerWorkAreaManager(aslSession);
|
||||
DataMinerWorkAreaManager dataMinerWorkAreaManager = new DataMinerWorkAreaManager(
|
||||
aslSession);
|
||||
return dataMinerWorkAreaManager.getDataMinerWorkArea();
|
||||
|
||||
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
|
@ -448,8 +446,7 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
throw new ServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getPublicLink(ItemDescription itemDescription)
|
||||
throws ServiceException {
|
||||
|
@ -478,8 +475,8 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("CancelComputation(): " + computationId);
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
String result=smClient.cancelComputation(computationId);
|
||||
|
||||
String result = smClient.cancelComputation(computationId);
|
||||
|
||||
return result;
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
|
@ -490,7 +487,4 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.portlets.user.dataminermanager.server.smservice;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
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;
|
||||
|
@ -33,18 +34,20 @@ public abstract class SClient {
|
|||
String computationTitle, String computationDescription)
|
||||
throws Exception;
|
||||
|
||||
public abstract ComputationStatus getComputationStatus(ComputationId computationId)
|
||||
throws Exception;
|
||||
public abstract ComputationStatus getComputationStatus(
|
||||
ComputationId computationId) throws Exception;
|
||||
|
||||
public abstract Resource getResourceByComputationId(ComputationId computationId)
|
||||
throws Exception;
|
||||
public abstract Resource getResourceByComputationId(
|
||||
ComputationId computationId) throws Exception;
|
||||
|
||||
public abstract String cancelComputation(ComputationId computationId)
|
||||
throws Exception;
|
||||
|
||||
public abstract ComputationId resubmitComputation(
|
||||
ComputationId computationId) throws Exception;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SClient []";
|
||||
}
|
||||
|
||||
}
|
|
@ -26,6 +26,7 @@ import net.opengis.wps.x100.SupportedComplexDataInputType;
|
|||
import net.opengis.wps.x100.impl.ExecuteResponseDocumentImpl;
|
||||
|
||||
import org.apache.xmlbeans.XmlString;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
|
@ -1117,4 +1118,11 @@ public class SClient4WPS extends SClient {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputationId resubmitComputation(ComputationId computationId)
|
||||
throws Exception {
|
||||
//TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -256,6 +256,12 @@
|
|||
color: #505050;
|
||||
}
|
||||
|
||||
.workflow-computation-title {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.workflow-fieldDescription {
|
||||
font-size: 12px;
|
||||
color: #505050;
|
||||
|
|
614315
test.log.1
614315
test.log.1
File diff suppressed because one or more lines are too long
383697
test.log.2
383697
test.log.2
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue