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,80 +122,63 @@ public class DataMinerManagerController {
}
});
EventBusProvider.INSTANCE.addHandler(MenuEvent.TYPE,
new MenuEvent.MenuEventHandler() {
EventBusProvider.INSTANCE.addHandler(MenuEvent.TYPE, new MenuEvent.MenuEventHandler() {
@Override
public void onSelect(MenuEvent event) {
Log.debug("Catch MenuEvent:" + event);
manageMenuEvent(event);
}
});
EventBusProvider.INSTANCE.addHandler(StartComputationExecutionRequestEvent.TYPE,
new StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler() {
@Override
public void onSelect(MenuEvent event) {
Log.debug("Catch MenuEvent:" + event);
manageMenuEvent(event);
public void onStart(StartComputationExecutionRequestEvent event) {
Log.debug("Catch StartComputationExecutionRequestEvent In Controller: " + event);
ExternalExecutionRequestEvent ev = new ExternalExecutionRequestEvent(event.getOp());
EventBusProvider.INSTANCE.fireEvent(ev);
// startComputationRequest(event);
}
});
EventBusProvider.INSTANCE
.addHandler(
StartComputationExecutionRequestEvent.TYPE,
new StartComputationExecutionRequestEvent.StartComputationExecutionRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(CancelComputationExecutionRequestEvent.TYPE,
new CancelComputationExecutionRequestEvent.CancelComputationExecutionRequestEventHandler() {
@Override
public void onStart(
StartComputationExecutionRequestEvent event) {
Log.debug("Catch StartComputationExecutionRequestEvent In Controller: "
+ event);
ExternalExecutionRequestEvent ev=new ExternalExecutionRequestEvent(event.getOp());
EventBusProvider.INSTANCE.fireEvent(ev);
//startComputationRequest(event);
@Override
public void onCancel(CancelComputationExecutionRequestEvent event) {
Log.debug("Catch CancelComputationRequestEvent: " + event);
cancelComputationRequest(event);
}
});
}
});
EventBusProvider.INSTANCE
.addHandler(
CancelComputationExecutionRequestEvent.TYPE,
new CancelComputationExecutionRequestEvent.CancelComputationExecutionRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(CancelExecutionFromComputationsRequestEvent.TYPE,
new CancelExecutionFromComputationsRequestEvent.CancelExecutionFromComputationsRequestEventHandler() {
@Override
public void onCancel(
CancelComputationExecutionRequestEvent event) {
Log.debug("Catch CancelComputationRequestEvent: "
+ event);
cancelComputationRequest(event);
@Override
public void onCancel(CancelExecutionFromComputationsRequestEvent event) {
Log.debug("Catch CancelExecutionFromComputationsRequestEvent: " + event);
cancelExecutionFromComputationsRequest(event);
}
});
}
EventBusProvider.INSTANCE
.addHandler(
CancelExecutionFromComputationsRequestEvent.TYPE,
new CancelExecutionFromComputationsRequestEvent.CancelExecutionFromComputationsRequestEventHandler() {
});
@Override
public void onCancel(
CancelExecutionFromComputationsRequestEvent event) {
Log.debug("Catch CancelExecutionFromComputationsRequestEvent: "
+ event);
cancelExecutionFromComputationsRequest(event);
EventBusProvider.INSTANCE.addHandler(ResubmitComputationExecutionRequestEvent.TYPE,
new ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler() {
}
@Override
public void onResubmit(ResubmitComputationExecutionRequestEvent event) {
Log.debug("Catch ResubmitComputationExecutionRequestEvent: " + event);
resubmitComputationRequest(event);
});
}
EventBusProvider.INSTANCE
.addHandler(
ResubmitComputationExecutionRequestEvent.TYPE,
new ResubmitComputationExecutionRequestEvent.ResubmitComputationExecutionRequestEventHandler() {
@Override
public void onResubmit(
ResubmitComputationExecutionRequestEvent event) {
Log.debug("Catch ResubmitComputationExecutionRequestEvent: "
+ event);
resubmitComputationRequest(event);
}
});
});
EventBusProvider.INSTANCE.addHandler(OutputDataRequestEvent.TYPE,
new OutputDataRequestEvent.OutputDataRequestEventHandler() {
@ -209,37 +192,29 @@ public class DataMinerManagerController {
});
EventBusProvider.INSTANCE
.addHandler(
ComputationDataRequestEvent.TYPE,
new ComputationDataRequestEvent.ComputationDataRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(ComputationDataRequestEvent.TYPE,
new ComputationDataRequestEvent.ComputationDataRequestEventHandler() {
@Override
public void onComputationDataRequest(
ComputationDataRequestEvent event) {
Log.debug("Catch ComputationDataRequestEvent: "
+ event);
manageComputationDataRequestEvent(event);
@Override
public void onComputationDataRequest(ComputationDataRequestEvent event) {
Log.debug("Catch ComputationDataRequestEvent: " + event);
manageComputationDataRequestEvent(event);
}
}
});
});
EventBusProvider.INSTANCE
.addHandler(
OperatorsClassificationRequestEvent.TYPE,
new OperatorsClassificationRequestEvent.OperatorsClassificationRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(OperatorsClassificationRequestEvent.TYPE,
new OperatorsClassificationRequestEvent.OperatorsClassificationRequestEventHandler() {
@Override
public void onRequest(
OperatorsClassificationRequestEvent event) {
Log.debug("Catch OperatorsClassificationRequestEvent: "
+ event);
operatorsClassificationRequest(event);
@Override
public void onRequest(OperatorsClassificationRequestEvent event) {
Log.debug("Catch OperatorsClassificationRequestEvent: " + event);
operatorsClassificationRequest(event);
}
}
});
});
EventBusProvider.INSTANCE.addHandler(DeleteItemRequestEvent.TYPE,
new DeleteItemRequestEvent.DeleteItemRequestEventHandler() {
@ -253,39 +228,30 @@ public class DataMinerManagerController {
});
EventBusProvider.INSTANCE
.addHandler(
DataMinerWorkAreaRequestEvent.TYPE,
new DataMinerWorkAreaRequestEvent.DataMinerWorkAreaRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaRequestEvent.TYPE,
new DataMinerWorkAreaRequestEvent.DataMinerWorkAreaRequestEventHandler() {
@Override
public void onRequest(
DataMinerWorkAreaRequestEvent event) {
Log.debug("Catch DataMinerWorkAreaRequestEvent: "
+ event);
retrieveDataMinerWorkArea(event);
@Override
public void onRequest(DataMinerWorkAreaRequestEvent event) {
Log.debug("Catch DataMinerWorkAreaRequestEvent: " + event);
retrieveDataMinerWorkArea(event);
}
}
});
});
EventBusProvider.INSTANCE
.addHandler(
TabularResourceInfoRequestEvent.TYPE,
new TabularResourceInfoRequestEvent.TabularResourceInfoRequestEventHandler() {
EventBusProvider.INSTANCE.addHandler(TabularResourceInfoRequestEvent.TYPE,
new TabularResourceInfoRequestEvent.TabularResourceInfoRequestEventHandler() {
@Override
public void onRequest(
TabularResourceInfoRequestEvent event) {
Log.debug("Catch TabularResourceInfoRequestEvent: "
+ event);
TabularResourceInfoEvent ev = new TabularResourceInfoEvent(
tabularResourceData);
EventBusProvider.INSTANCE.fireEvent(ev);
@Override
public void onRequest(TabularResourceInfoRequestEvent event) {
Log.debug("Catch TabularResourceInfoRequestEvent: " + event);
TabularResourceInfoEvent ev = new TabularResourceInfoEvent(tabularResourceData);
EventBusProvider.INSTANCE.fireEvent(ev);
}
}
});
});
}
@ -297,210 +263,163 @@ public class DataMinerManagerController {
private void callHello() {
DataMinerPortletServiceAsync.INSTANCE
.hello(new AsyncCallback<UserInfo>() {
DataMinerPortletServiceAsync.INSTANCE.hello(new AsyncCallback<UserInfo>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert(
"Error",
"No user found: "
+ caught.getLocalizedMessage());
}
}
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error", "No user found: " + caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(UserInfo result) {
userInfo = result;
Log.info("Hello: " + userInfo.getUsername());
}
@Override
public void onSuccess(UserInfo result) {
userInfo = result;
Log.info("Hello: " + userInfo.getUsername());
}
});
});
}
private void manageMenuEvent(MenuEvent event) {
Log.debug("CurrentVisualization=" + currentVisualization);
if (event == null
|| event.getMenuType() == null
|| (currentVisualization == null && event.getMenuType()
.compareTo(MenuType.HOME) == 0)
|| (currentVisualization != null && event.getMenuType()
.compareTo(currentVisualization) == 0)) {
if (event == null || event.getMenuType() == null
|| (currentVisualization == null && event.getMenuType().compareTo(MenuType.HOME) == 0)
|| (currentVisualization != null && event.getMenuType().compareTo(currentVisualization) == 0)) {
return;
}
currentVisualization = event.getMenuType();
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(
event.getMenuType());
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(event.getMenuType());
EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent);
}
/*
private void startComputationRequest(
final StartComputationExecutionRequestEvent event) {
DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(),
new AsyncCallback<ComputationId>() {
* private void startComputationRequest( final
* StartComputationExecutionRequestEvent event) {
* DataMinerPortletServiceAsync.INSTANCE.startComputation(event.getOp(), new
* 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
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) {
private void cancelExecutionFromComputationsRequest(CancelExecutionFromComputationsRequestEvent event) {
final ItemDescription itemDescription = event.getItemDescription();
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(
itemDescription, new AsyncCallback<String>() {
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(itemDescription, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
Log.error("Error in cancenExecutionFromComputations:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error in cancel computation "
+ itemDescription.getName() + ": "
+ caught.getLocalizedMessage());
}
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
Log.error("Error in cancenExecutionFromComputations:" + caught.getLocalizedMessage());
UtilsGXT3.alert("Error", "Error in cancel computation " + itemDescription.getName() + ": "
+ caught.getLocalizedMessage());
}
}
}
@Override
public void onSuccess(String result) {
Log.debug("Computation Cancelled!");
final InfoMessageBox d = new InfoMessageBox("Info",
"Computation cancellation request has been accepted!");
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
fireRefreshDataMinerWorkAreaEvent(DataMinerWorkAreaElementType.Computations);
}
});
d.show();
@Override
public void onSuccess(String result) {
Log.debug("Computation Cancelled!");
final InfoMessageBox d = new InfoMessageBox("Info",
"Computation cancellation request has been accepted!");
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
fireRefreshDataMinerWorkAreaEvent(DataMinerWorkAreaElementType.Computations);
}
});
d.show();
}
});
}
private void cancelComputationRequest(
CancelComputationExecutionRequestEvent event) {
private void cancelComputationRequest(CancelComputationExecutionRequestEvent event) {
final ComputationId computationId = event.getComputationId();
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId,
new AsyncCallback<String>() {
DataMinerPortletServiceAsync.INSTANCE.cancelComputation(computationId, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Error in cancel computation "
+ computationId.getId() + ": "
+ caught.getLocalizedMessage());
}
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session!");
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error", "Error in cancel computation " + computationId.getId() + ": "
+ caught.getLocalizedMessage());
}
}
}
@Override
public void onSuccess(String result) {
Log.debug("Computation Cancelled!");
@Override
public void onSuccess(String result) {
Log.debug("Computation Cancelled!");
}
});
}
});
}
private void resubmitComputationRequest(
final ResubmitComputationExecutionRequestEvent event) {
private void resubmitComputationRequest(final ResubmitComputationExecutionRequestEvent event) {
currentVisualization = MenuType.EXPERIMENT;
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(
MenuType.EXPERIMENT);
MenuSwitchEvent menuSwitchEvent = new MenuSwitchEvent(MenuType.EXPERIMENT);
EventBusProvider.INSTANCE.fireEvent(menuSwitchEvent);
DataMinerPortletServiceAsync.INSTANCE.resubmit(
event.getItemDescription(), new AsyncCallback<ComputationId>() {
DataMinerPortletServiceAsync.INSTANCE.resubmit(event.getItemDescription(), new 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 to resubmit computation: "
+ caught.getMessage());
}
}
@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 to resubmit computation: " + 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);
}
@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) {
ResubmitComputationExecutionEvent event = new ResubmitComputationExecutionEvent(
computationId);
ResubmitComputationExecutionEvent event = new ResubmitComputationExecutionEvent(computationId);
EventBusProvider.INSTANCE.fireEvent(event);
}
private void operatorsClassificationRequest(
OperatorsClassificationRequestEvent event) {
private void operatorsClassificationRequest(OperatorsClassificationRequestEvent event) {
if (operatorsClassifications == null) {
getOperatorsClassifications(event);
} else {
@ -523,8 +442,7 @@ public class DataMinerManagerController {
}
private void getOperatorsClassifications(
final OperatorsClassificationRequestEvent event) {
private void getOperatorsClassifications(final OperatorsClassificationRequestEvent event) {
DataMinerPortletServiceAsync.INSTANCE
.getOperatorsClassifications(new AsyncCallback<List<OperatorsClassification>>() {
@ -538,22 +456,20 @@ public class DataMinerManagerController {
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Error retrieving operators classification! "
"The VRE currently has problems loading all required operators. We apologize for this inconvenience.");
Log.error(
"The VRE currently has problems loading all required operators. We apologize for this inconvenience: "
+ caught.getLocalizedMessage());
Log.error("Error retrieving operators classification: "
+ caught.getLocalizedMessage());
caught.printStackTrace();
}
}
});
}
private void getOperatorsClassificationDefault(
OperatorsClassificationRequestEvent event) {
private void getOperatorsClassificationDefault(OperatorsClassificationRequestEvent event) {
OperatorsClassification find = null;
for (OperatorsClassification oc : operatorsClassifications) {
if (oc.getName().equals(Constants.UserClassificationName)) {
@ -573,8 +489,7 @@ public class DataMinerManagerController {
EventBusProvider.INSTANCE.fireEvent(ocEvent);
}
private void getOperatorsClassificationByName(
OperatorsClassificationRequestEvent event) {
private void getOperatorsClassificationByName(OperatorsClassificationRequestEvent event) {
OperatorsClassification find = null;
for (OperatorsClassification oc : operatorsClassifications) {
if (oc.getName().equals(event.getClassificationName())) {
@ -598,89 +513,75 @@ public class DataMinerManagerController {
// ocEvent = new OperatorsClassificationEvent(
// event.getClassificationName(), find, operatorId);
// } else {
ocEvent = new OperatorsClassificationEvent(
event.getClassificationName(), find);
ocEvent = new OperatorsClassificationEvent(event.getClassificationName(), find);
// }
EventBusProvider.INSTANCE.fireEvent(ocEvent);
}
private void retrieveDataMinerWorkArea(
final DataMinerWorkAreaRequestEvent event) {
private void retrieveDataMinerWorkArea(final DataMinerWorkAreaRequestEvent event) {
final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE
.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
DataMinerPortletServiceAsync.INSTANCE.getDataMinerWorkArea(new AsyncCallback<DataMinerWorkArea>() {
@Override
public void onFailure(Throwable caught) {
monitor.hide();
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Error retrieving DataMiner work area info: "
+ caught.getLocalizedMessage());
}
}
@Override
public void onFailure(Throwable caught) {
monitor.hide();
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Error retrieving DataMiner work area info: " + caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(DataMinerWorkArea result) {
monitor.hide();
Log.debug("DataMinerWorkArea: " + result);
fireDataMinerWorkAreaEventRetrieved(event, result);
@Override
public void onSuccess(DataMinerWorkArea result) {
monitor.hide();
Log.debug("DataMinerWorkArea: " + result);
fireDataMinerWorkAreaEventRetrieved(event, result);
}
}
});
});
}
private void fireDataMinerWorkAreaEventRetrieved(
DataMinerWorkAreaRequestEvent event, DataMinerWorkArea result) {
private void fireDataMinerWorkAreaEventRetrieved(DataMinerWorkAreaRequestEvent event, DataMinerWorkArea result) {
dataMinerWorkArea = result;
DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent(
DataMinerWorkAreaEventType.OPEN,
DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent(DataMinerWorkAreaEventType.OPEN,
event.getDataMinerWorkAreaRegionType(), result);
EventBusProvider.INSTANCE.fireEvent(dataMinerWorkAreaEvent);
}
private void deleteItemRequest(final DeleteItemRequestEvent event) {
final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE.deleteItem(
event.getItemDescription(), new AsyncCallback<Void>() {
DataMinerPortletServiceAsync.INSTANCE.deleteItem(event.getItemDescription(), new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
monitor.hide();
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error",
"Error deleting item on workspace: "
+ caught.getLocalizedMessage());
}
}
@Override
public void onFailure(Throwable caught) {
monitor.hide();
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
UtilsGXT3.alert("Error", "Error deleting item on workspace: " + caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(Void result) {
monitor.hide();
Log.debug("Deleted Item!");
fireRefreshDataMinerWorkAreaEvent(event
.getDataMinerWorkAreaElementType());
@Override
public void onSuccess(Void result) {
monitor.hide();
Log.debug("Deleted Item!");
fireRefreshDataMinerWorkAreaEvent(event.getDataMinerWorkAreaElementType());
}
}
});
});
}
private void fireRefreshDataMinerWorkAreaEvent(
DataMinerWorkAreaElementType dataMinerWorkAreaElementType) {
RefreshDataMinerWorkAreaEvent refreshEvent = new RefreshDataMinerWorkAreaEvent(
dataMinerWorkAreaElementType);
private void fireRefreshDataMinerWorkAreaEvent(DataMinerWorkAreaElementType dataMinerWorkAreaElementType) {
RefreshDataMinerWorkAreaEvent refreshEvent = new RefreshDataMinerWorkAreaEvent(dataMinerWorkAreaElementType);
EventBusProvider.INSTANCE.fireEvent(refreshEvent);
}
@ -689,36 +590,28 @@ public class DataMinerManagerController {
if (event == null) {
UtilsGXT3.alert("Error", "Invalid output request!");
} else {
if (event.getComputationId() == null
|| event.getComputationId().getId() == null
if (event.getComputationId() == null || event.getComputationId().getId() == null
|| event.getComputationId().getId().isEmpty()) {
UtilsGXT3.alert(
"Error",
"Invalid output request, computation id: "
+ event.getComputationId());
UtilsGXT3.alert("Error", "Invalid output request, computation id: " + event.getComputationId());
} else {
final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE
.getOutputDataByComputationId(event.getComputationId(),
new AsyncCallback<OutputData>() {
@Override
public void onSuccess(OutputData outputData) {
monitor.hide();
fireOutputDataEvent(outputData);
}
DataMinerPortletServiceAsync.INSTANCE.getOutputDataByComputationId(event.getComputationId(),
new AsyncCallback<OutputData>() {
@Override
public void onSuccess(OutputData outputData) {
monitor.hide();
fireOutputDataEvent(outputData);
}
@Override
public void onFailure(Throwable caught) {
monitor.hide();
Log.error("Error in getResourceByComputationId: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error",
"Impossible to retrieve output info. "
+ caught.getLocalizedMessage());
@Override
public void onFailure(Throwable caught) {
monitor.hide();
Log.error("Error in getResourceByComputationId: " + caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Impossible to retrieve output info. " + caught.getLocalizedMessage());
}
});
}
});
}
}
}
@ -729,25 +622,20 @@ public class DataMinerManagerController {
}
private void manageComputationDataRequestEvent(
ComputationDataRequestEvent event) {
private void manageComputationDataRequestEvent(ComputationDataRequestEvent event) {
if (event == null) {
UtilsGXT3.alert("Error", "Invalid computation info request!");
} else {
if (event.getItemDescription() == null
|| event.getItemDescription().getId() == null
if (event.getItemDescription() == null || event.getItemDescription().getId() == null
|| event.getItemDescription().getId().isEmpty()) {
UtilsGXT3.alert("Error",
"Invalid computation info request, item description: "
+ event.getItemDescription());
"Invalid computation info request, item description: " + event.getItemDescription());
} else {
final StatusMonitor monitor = new StatusMonitor();
DataMinerPortletServiceAsync.INSTANCE.getComputationData(
event.getItemDescription(),
DataMinerPortletServiceAsync.INSTANCE.getComputationData(event.getItemDescription(),
new AsyncCallback<ComputationData>() {
@Override
public void onSuccess(
ComputationData computationData) {
public void onSuccess(ComputationData computationData) {
monitor.hide();
fireComputationDataEvent(computationData);
}
@ -755,12 +643,10 @@ public class DataMinerManagerController {
@Override
public void onFailure(Throwable caught) {
monitor.hide();
Log.error("Error in getComputationData: "
+ caught.getLocalizedMessage());
Log.error("Error in getComputationData: " + caught.getLocalizedMessage());
caught.printStackTrace();
UtilsGXT3.alert("Error",
"Impossible to retrieve computation info. "
+ caught.getLocalizedMessage());
"Impossible to retrieve computation info. " + caught.getLocalizedMessage());
}
});