Fixed the description of the errors

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/data-miner-manager-widget@169990 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-07-30 14:24:03 +00:00
parent 05febf6b27
commit bbce113747
1 changed files with 259 additions and 373 deletions

View File

@ -122,8 +122,7 @@ public class DataMinerManagerController {
} }
}); });
EventBusProvider.INSTANCE.addHandler(MenuEvent.TYPE, EventBusProvider.INSTANCE.addHandler(MenuEvent.TYPE, new MenuEvent.MenuEventHandler() {
new MenuEvent.MenuEventHandler() {
@Override @Override
public void onSelect(MenuEvent event) { public void onSelect(MenuEvent event) {
@ -133,64 +132,48 @@ public class DataMinerManagerController {
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(StartComputationExecutionRequestEvent.TYPE,
.addHandler(
StartComputationExecutionRequestEvent.TYPE,
new StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler() { new StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler() {
@Override @Override
public void onStart( public void onStart(StartComputationExecutionRequestEvent event) {
StartComputationExecutionRequestEvent event) { Log.debug("Catch StartComputationExecutionRequestEvent In Controller: " + event);
Log.debug("Catch StartComputationExecutionRequestEvent In Controller: " ExternalExecutionRequestEvent ev = new ExternalExecutionRequestEvent(event.getOp());
+ event);
ExternalExecutionRequestEvent ev=new ExternalExecutionRequestEvent(event.getOp());
EventBusProvider.INSTANCE.fireEvent(ev); EventBusProvider.INSTANCE.fireEvent(ev);
//startComputationRequest(event); // startComputationRequest(event);
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(CancelComputationExecutionRequestEvent.TYPE,
.addHandler(
CancelComputationExecutionRequestEvent.TYPE,
new CancelComputationExecutionRequestEvent.CancelComputationExecutionRequestEventHandler() { new CancelComputationExecutionRequestEvent.CancelComputationExecutionRequestEventHandler() {
@Override @Override
public void onCancel( public void onCancel(CancelComputationExecutionRequestEvent event) {
CancelComputationExecutionRequestEvent event) { Log.debug("Catch CancelComputationRequestEvent: " + event);
Log.debug("Catch CancelComputationRequestEvent: "
+ event);
cancelComputationRequest(event); cancelComputationRequest(event);
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(CancelExecutionFromComputationsRequestEvent.TYPE,
.addHandler(
CancelExecutionFromComputationsRequestEvent.TYPE,
new CancelExecutionFromComputationsRequestEvent.CancelExecutionFromComputationsRequestEventHandler() { new CancelExecutionFromComputationsRequestEvent.CancelExecutionFromComputationsRequestEventHandler() {
@Override @Override
public void onCancel( public void onCancel(CancelExecutionFromComputationsRequestEvent event) {
CancelExecutionFromComputationsRequestEvent event) { Log.debug("Catch CancelExecutionFromComputationsRequestEvent: " + event);
Log.debug("Catch CancelExecutionFromComputationsRequestEvent: "
+ event);
cancelExecutionFromComputationsRequest(event); cancelExecutionFromComputationsRequest(event);
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(ResubmitComputationExecutionRequestEvent.TYPE,
.addHandler(
ResubmitComputationExecutionRequestEvent.TYPE,
new ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler() { new ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler() {
@Override @Override
public void onResubmit( public void onResubmit(ResubmitComputationExecutionRequestEvent event) {
ResubmitComputationExecutionRequestEvent event) { Log.debug("Catch ResubmitComputationExecutionRequestEvent: " + event);
Log.debug("Catch ResubmitComputationExecutionRequestEvent: "
+ event);
resubmitComputationRequest(event); resubmitComputationRequest(event);
} }
@ -209,32 +192,24 @@ public class DataMinerManagerController {
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(ComputationDataRequestEvent.TYPE,
.addHandler(
ComputationDataRequestEvent.TYPE,
new ComputationDataRequestEvent.ComputationDataRequestEventHandler() { new ComputationDataRequestEvent.ComputationDataRequestEventHandler() {
@Override @Override
public void onComputationDataRequest( public void onComputationDataRequest(ComputationDataRequestEvent event) {
ComputationDataRequestEvent event) { Log.debug("Catch ComputationDataRequestEvent: " + event);
Log.debug("Catch ComputationDataRequestEvent: "
+ event);
manageComputationDataRequestEvent(event); manageComputationDataRequestEvent(event);
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(OperatorsClassificationRequestEvent.TYPE,
.addHandler(
OperatorsClassificationRequestEvent.TYPE,
new OperatorsClassificationRequestEvent.OperatorsClassificationRequestEventHandler() { new OperatorsClassificationRequestEvent.OperatorsClassificationRequestEventHandler() {
@Override @Override
public void onRequest( public void onRequest(OperatorsClassificationRequestEvent event) {
OperatorsClassificationRequestEvent event) { Log.debug("Catch OperatorsClassificationRequestEvent: " + event);
Log.debug("Catch OperatorsClassificationRequestEvent: "
+ event);
operatorsClassificationRequest(event); operatorsClassificationRequest(event);
} }
@ -253,34 +228,25 @@ public class DataMinerManagerController {
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaRequestEvent.TYPE,
.addHandler(
DataMinerWorkAreaRequestEvent.TYPE,
new DataMinerWorkAreaRequestEvent.DataMinerWorkAreaRequestEventHandler() { new DataMinerWorkAreaRequestEvent.DataMinerWorkAreaRequestEventHandler() {
@Override @Override
public void onRequest( public void onRequest(DataMinerWorkAreaRequestEvent event) {
DataMinerWorkAreaRequestEvent event) { Log.debug("Catch DataMinerWorkAreaRequestEvent: " + event);
Log.debug("Catch DataMinerWorkAreaRequestEvent: "
+ event);
retrieveDataMinerWorkArea(event); retrieveDataMinerWorkArea(event);
} }
}); });
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.addHandler(TabularResourceInfoRequestEvent.TYPE,
.addHandler(
TabularResourceInfoRequestEvent.TYPE,
new TabularResourceInfoRequestEvent.TabularResourceInfoRequestEventHandler() { new TabularResourceInfoRequestEvent.TabularResourceInfoRequestEventHandler() {
@Override @Override
public void onRequest( public void onRequest(TabularResourceInfoRequestEvent event) {
TabularResourceInfoRequestEvent event) { Log.debug("Catch TabularResourceInfoRequestEvent: " + event);
Log.debug("Catch TabularResourceInfoRequestEvent: " TabularResourceInfoEvent ev = new TabularResourceInfoEvent(tabularResourceData);
+ event);
TabularResourceInfoEvent ev = new TabularResourceInfoEvent(
tabularResourceData);
EventBusProvider.INSTANCE.fireEvent(ev); EventBusProvider.INSTANCE.fireEvent(ev);
} }
@ -297,20 +263,15 @@ public class DataMinerManagerController {
private void callHello() { private void callHello() {
DataMinerPortletServiceAsync.INSTANCE DataMinerPortletServiceAsync.INSTANCE.hello(new AsyncCallback<UserInfo>() {
.hello(new AsyncCallback<UserInfo>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!"); UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert( UtilsGXT3.alert("Error", "No user found: " + caught.getLocalizedMessage());
"Error",
"No user found: "
+ caught.getLocalizedMessage());
} }
} }
@ -326,83 +287,57 @@ public class DataMinerManagerController {
private void manageMenuEvent(MenuEvent event) { private void manageMenuEvent(MenuEvent event) {
Log.debug("CurrentVisualization=" + currentVisualization); Log.debug("CurrentVisualization=" + currentVisualization);
if (event == null if (event == null || event.getMenuType() == null
|| event.getMenuType() == null || (currentVisualization == null && event.getMenuType().compareTo(MenuType.HOME) == 0)
|| (currentVisualization == null && event.getMenuType() || (currentVisualization != null && event.getMenuType().compareTo(currentVisualization) == 0)) {
.compareTo(MenuType.HOME) == 0)
|| (currentVisualization != null && event.getMenuType()
.compareTo(currentVisualization) == 0)) {
return; return;
} }
currentVisualization = event.getMenuType(); currentVisualization = event.getMenuType();
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent( MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(event.getMenuType());
event.getMenuType());
EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent); EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent);
} }
/* /*
private void startComputationRequest( * private void startComputationRequest( final
final StartComputationExecutionRequestEvent event) { * StartComputationExecutionRequestEvent event) {
DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(), * DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(), new
new AsyncCallback<ComputationId>() { * AsyncCallback<ComputationId>() {
*
* @Override public void onFailure(Throwable caught) { if (caught instanceof
* SessionExpiredServiceException) { UtilsGXT3.alert("Error",
* "Expired Session!"); EventBusProvider.INSTANCE .fireEvent(new
* SessionExpiredEvent()); } else { UtilsGXT3.alert("Error",
* "Failed start computation " + event.getOp().getName() + "! " +
* caught.getLocalizedMessage()); caught.printStackTrace(); } }
*
* @Override public void onSuccess(ComputationId computationId) { if
* (computationId == null) UtilsGXT3.alert("Error",
* "Failed start computation " + event.getOp().getName() +
* ", the computation id is null!"); else { startComputation(computationId,
* event.getComputationStatusPanelIndex()); } } });
*
* }
*
* private void startComputation(ComputationId computationId, int
* computationStatusPanelIndex) { StartComputationExecutionEvent event = new
* StartComputationExecutionEvent( computationId,
* computationStatusPanelIndex); EventBusProvider.INSTANCE.fireEvent(event);
* }
*/
@Override private void cancelExecutionFromComputationsRequest(CancelExecutionFromComputationsRequestEvent event) {
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Failed start computation "
+ event.getOp().getName() + "! "
+ caught.getLocalizedMessage());
caught.printStackTrace();
}
}
@Override
public void onSuccess(ComputationId computationId) {
if (computationId == null)
UtilsGXT3.alert("Error",
"Failed start computation "
+ event.getOp().getName()
+ ", the computation id is null!");
else {
startComputation(computationId,
event.getComputationStatusPanelIndex());
}
}
});
}
private void startComputation(ComputationId computationId,
int computationStatusPanelIndex) {
StartComputationExecutionEvent event = new StartComputationExecutionEvent(
computationId, computationStatusPanelIndex);
EventBusProvider.INSTANCE.fireEvent(event);
}*/
private void cancelExecutionFromComputationsRequest(
CancelExecutionFromComputationsRequestEvent event) {
final ItemDescription itemDescription = event.getItemDescription(); final ItemDescription itemDescription = event.getItemDescription();
DataMinerPortletServiceAsync.INSTANCE.cancelComputation( DataMinerPortletServiceAsync.INSTANCE.cancelComputation(itemDescription, new AsyncCallback<String>() {
itemDescription, new AsyncCallback<String>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!"); UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
Log.error("Error in cancenExecutionFromComputations:" Log.error("Error in cancenExecutionFromComputations:" + caught.getLocalizedMessage());
+ caught.getLocalizedMessage()); UtilsGXT3.alert("Error", "Error in cancel computation " + itemDescription.getName() + ": "
UtilsGXT3.alert("Error",
"Error in cancel computation "
+ itemDescription.getName() + ": "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
} }
@ -426,22 +361,17 @@ public class DataMinerManagerController {
} }
private void cancelComputationRequest( private void cancelComputationRequest(CancelComputationExecutionRequestEvent event) {
CancelComputationExecutionRequestEvent event) {
final ComputationId computationId = event.getComputationId(); final ComputationId computationId = event.getComputationId();
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId, DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId, new AsyncCallback<String>() {
new AsyncCallback<String>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!"); UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error", "Error in cancel computation " + computationId.getId() + ": "
"Error in cancel computation "
+ computationId.getId() + ": "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
} }
@ -455,36 +385,27 @@ public class DataMinerManagerController {
}); });
} }
private void resubmitComputationRequest( private void resubmitComputationRequest(final ResubmitComputationExecutionRequestEvent event) {
final ResubmitComputationExecutionRequestEvent event) {
currentVisualization = MenuType.EXPERIMENT; currentVisualization = MenuType.EXPERIMENT;
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent( MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(MenuType.EXPERIMENT);
MenuType.EXPERIMENT);
EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent); EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent);
DataMinerPortletServiceAsync.INSTANCE.resubmit( DataMinerPortletServiceAsync.INSTANCE.resubmit(event.getItemDescription(), new AsyncCallback<ComputationId>() {
event.getItemDescription(), new AsyncCallback<ComputationId>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!"); UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert( UtilsGXT3.alert("Error", "Failed to resubmit computation: " + caught.getMessage());
"Error",
"Failed to resubmit computation: "
+ caught.getMessage());
} }
} }
@Override @Override
public void onSuccess(ComputationId result) { public void onSuccess(ComputationId result) {
if (result == null) if (result == null)
UtilsGXT3 UtilsGXT3.alert("Error", "Failed to resubmit computation, the computation id is null!");
.alert("Error",
"Failed to resubmit computation, the computation id is null!");
else { else {
resubmitComputation(result); resubmitComputation(result);
} }
@ -494,13 +415,11 @@ public class DataMinerManagerController {
} }
private void resubmitComputation(ComputationId computationId) { private void resubmitComputation(ComputationId computationId) {
ResubmitComputationExecutionEvent event = new ResubmitComputationExecutionEvent( ResubmitComputationExecutionEvent event = new ResubmitComputationExecutionEvent(computationId);
computationId);
EventBusProvider.INSTANCE.fireEvent(event); EventBusProvider.INSTANCE.fireEvent(event);
} }
private void operatorsClassificationRequest( private void operatorsClassificationRequest(OperatorsClassificationRequestEvent event) {
OperatorsClassificationRequestEvent event) {
if (operatorsClassifications == null) { if (operatorsClassifications == null) {
getOperatorsClassifications(event); getOperatorsClassifications(event);
} else { } else {
@ -523,8 +442,7 @@ public class DataMinerManagerController {
} }
private void getOperatorsClassifications( private void getOperatorsClassifications(final OperatorsClassificationRequestEvent event) {
final OperatorsClassificationRequestEvent event) {
DataMinerPortletServiceAsync.INSTANCE DataMinerPortletServiceAsync.INSTANCE
.getOperatorsClassifications(new AsyncCallback<List<OperatorsClassification>>() { .getOperatorsClassifications(new AsyncCallback<List<OperatorsClassification>>() {
@ -538,13 +456,12 @@ public class DataMinerManagerController {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session"); UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
"Error retrieving operators classification! " "The VRE currently has problems loading all required operators. We apologize for this inconvenience.");
+ caught.getLocalizedMessage()); Log.error(
Log.error("Error retrieving operators classification: " "The VRE currently has problems loading all required operators. We apologize for this inconvenience: "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
caught.printStackTrace(); caught.printStackTrace();
} }
@ -552,8 +469,7 @@ public class DataMinerManagerController {
}); });
} }
private void getOperatorsClassificationDefault( private void getOperatorsClassificationDefault(OperatorsClassificationRequestEvent event) {
OperatorsClassificationRequestEvent event) {
OperatorsClassification find = null; OperatorsClassification find = null;
for (OperatorsClassification oc : operatorsClassifications) { for (OperatorsClassification oc : operatorsClassifications) {
if (oc.getName().equals(Constants.UserClassificationName)) { if (oc.getName().equals(Constants.UserClassificationName)) {
@ -573,8 +489,7 @@ public class DataMinerManagerController {
EventBusProvider.INSTANCE.fireEvent(ocEvent); EventBusProvider.INSTANCE.fireEvent(ocEvent);
} }
private void getOperatorsClassificationByName( private void getOperatorsClassificationByName(OperatorsClassificationRequestEvent event) {
OperatorsClassificationRequestEvent event) {
OperatorsClassification find = null; OperatorsClassification find = null;
for (OperatorsClassification oc : operatorsClassifications) { for (OperatorsClassification oc : operatorsClassifications) {
if (oc.getName().equals(event.getClassificationName())) { if (oc.getName().equals(event.getClassificationName())) {
@ -598,29 +513,24 @@ public class DataMinerManagerController {
// ocEvent = new OperatorsClassificationEvent( // ocEvent = new OperatorsClassificationEvent(
// event.getClassificationName(), find, operatorId); // event.getClassificationName(), find, operatorId);
// } else { // } else {
ocEvent = new OperatorsClassificationEvent( ocEvent = new OperatorsClassificationEvent(event.getClassificationName(), find);
event.getClassificationName(), find);
// } // }
EventBusProvider.INSTANCE.fireEvent(ocEvent); EventBusProvider.INSTANCE.fireEvent(ocEvent);
} }
private void retrieveDataMinerWorkArea( private void retrieveDataMinerWorkArea(final DataMinerWorkAreaRequestEvent event) {
final DataMinerWorkAreaRequestEvent event) {
final StatusMonitor monitor = new StatusMonitor(); final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE DataMinerPortletServiceAsync.INSTANCE.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitor.hide(); monitor.hide();
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session"); UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
"Error retrieving DataMiner work area info: " "Error retrieving DataMiner work area info: " + caught.getLocalizedMessage());
+ caught.getLocalizedMessage());
} }
} }
@ -636,31 +546,25 @@ public class DataMinerManagerController {
} }
private void fireDataMinerWorkAreaEventRetrieved( private void fireDataMinerWorkAreaEventRetrieved(DataMinerWorkAreaRequestEvent event, DataMinerWorkArea result) {
DataMinerWorkAreaRequestEvent event, DataMinerWorkArea result) {
dataMinerWorkArea = result; dataMinerWorkArea = result;
DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent( DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent(DataMinerWorkAreaEventType.OPEN,
DataMinerWorkAreaEventType.OPEN,
event.getDataMinerWorkAreaRegionType(), result); event.getDataMinerWorkAreaRegionType(), result);
EventBusProvider.INSTANCE.fireEvent(dataMinerWorkAreaEvent); EventBusProvider.INSTANCE.fireEvent(dataMinerWorkAreaEvent);
} }
private void deleteItemRequest(final DeleteItemRequestEvent event) { private void deleteItemRequest(final DeleteItemRequestEvent event) {
final StatusMonitor monitor = new StatusMonitor(); final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE.deleteItem( DataMinerPortletServiceAsync.INSTANCE.deleteItem(event.getItemDescription(), new AsyncCallback<Void>() {
event.getItemDescription(), new AsyncCallback<Void>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitor.hide(); monitor.hide();
if (caught instanceof SessionExpiredServiceException) { if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session"); UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
.fireEvent(new SessionExpiredEvent());
} else { } else {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error", "Error deleting item on workspace: " + caught.getLocalizedMessage());
"Error deleting item on workspace: "
+ caught.getLocalizedMessage());
} }
} }
@ -668,8 +572,7 @@ public class DataMinerManagerController {
public void onSuccess(Void result) { public void onSuccess(Void result) {
monitor.hide(); monitor.hide();
Log.debug("Deleted Item!"); Log.debug("Deleted Item!");
fireRefreshDataMinerWorkAreaEvent(event fireRefreshDataMinerWorkAreaEvent(event.getDataMinerWorkAreaElementType());
.getDataMinerWorkAreaElementType());
} }
@ -677,10 +580,8 @@ public class DataMinerManagerController {
} }
private void fireRefreshDataMinerWorkAreaEvent( private void fireRefreshDataMinerWorkAreaEvent(DataMinerWorkAreaElementType dataMinerWorkAreaElementType) {
DataMinerWorkAreaElementType dataMinerWorkAreaElementType) { RefreshDataMinerWorkAreaEvent refreshEvent = new RefreshDataMinerWorkAreaEvent(dataMinerWorkAreaElementType);
RefreshDataMinerWorkAreaEvent refreshEvent = new RefreshDataMinerWorkAreaEvent(
dataMinerWorkAreaElementType);
EventBusProvider.INSTANCE.fireEvent(refreshEvent); EventBusProvider.INSTANCE.fireEvent(refreshEvent);
} }
@ -689,17 +590,12 @@ public class DataMinerManagerController {
if (event == null) { if (event == null) {
UtilsGXT3.alert("Error", "Invalid output request!"); UtilsGXT3.alert("Error", "Invalid output request!");
} else { } else {
if (event.getComputationId() == null if (event.getComputationId() == null || event.getComputationId().getId() == null
|| event.getComputationId().getId() == null
|| event.getComputationId().getId().isEmpty()) { || event.getComputationId().getId().isEmpty()) {
UtilsGXT3.alert( UtilsGXT3.alert("Error", "Invalid output request, computation id: " + event.getComputationId());
"Error",
"Invalid output request, computation id: "
+ event.getComputationId());
} else { } else {
final StatusMonitor monitor = new StatusMonitor(); final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE DataMinerPortletServiceAsync.INSTANCE.getOutputDataByComputationId(event.getComputationId(),
.getOutputDataByComputationId(event.getComputationId(),
new AsyncCallback<OutputData>() { new AsyncCallback<OutputData>() {
@Override @Override
public void onSuccess(OutputData outputData) { public void onSuccess(OutputData outputData) {
@ -710,12 +606,9 @@ public class DataMinerManagerController {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitor.hide(); monitor.hide();
Log.error("Error in getResourceByComputationId: " Log.error("Error in getResourceByComputationId: " + caught.getLocalizedMessage());
+ caught.getLocalizedMessage()); UtilsGXT3.alert("Error",
UtilsGXT3 "Impossible to retrieve output info. " + caught.getLocalizedMessage());
.alert("Error",
"Impossible to retrieve output info. "
+ caught.getLocalizedMessage());
} }
}); });
@ -729,25 +622,20 @@ public class DataMinerManagerController {
} }
private void manageComputationDataRequestEvent( private void manageComputationDataRequestEvent(ComputationDataRequestEvent event) {
ComputationDataRequestEvent event) {
if (event == null) { if (event == null) {
UtilsGXT3.alert("Error", "Invalid computation info request!"); UtilsGXT3.alert("Error", "Invalid computation info request!");
} else { } else {
if (event.getItemDescription() == null if (event.getItemDescription() == null || event.getItemDescription().getId() == null
|| event.getItemDescription().getId() == null
|| event.getItemDescription().getId().isEmpty()) { || event.getItemDescription().getId().isEmpty()) {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
"Invalid computation info request, item description: " "Invalid computation info request, item description: " + event.getItemDescription());
+ event.getItemDescription());
} else { } else {
final StatusMonitor monitor = new StatusMonitor(); final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE.getComputationData( DataMinerPortletServiceAsync.INSTANCE.getComputationData(event.getItemDescription(),
event.getItemDescription(),
new AsyncCallback<ComputationData>() { new AsyncCallback<ComputationData>() {
@Override @Override
public void onSuccess( public void onSuccess(ComputationData computationData) {
ComputationData computationData) {
monitor.hide(); monitor.hide();
fireComputationDataEvent(computationData); fireComputationDataEvent(computationData);
} }
@ -755,12 +643,10 @@ public class DataMinerManagerController {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitor.hide(); monitor.hide();
Log.error("Error in getComputationData: " Log.error("Error in getComputationData: " + caught.getLocalizedMessage());
+ caught.getLocalizedMessage());
caught.printStackTrace(); caught.printStackTrace();
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
"Impossible to retrieve computation info. " "Impossible to retrieve computation info. " + caught.getLocalizedMessage());
+ caught.getLocalizedMessage());
} }
}); });