2014-04-15 20:24:49 +02:00
|
|
|
package org.gcube.portlets.user.td.tablewidget.client.history;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
2014-09-30 13:07:04 +02:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
2014-05-16 16:21:10 +02:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
2014-04-15 20:24:49 +02:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory;
|
2014-04-16 12:19:40 +02:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
|
2014-04-15 20:24:49 +02:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
2014-08-27 12:08:40 +02:00
|
|
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
|
|
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
2014-04-17 18:39:03 +02:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.custom.ActionButtonCellNoFirst;
|
2014-04-15 20:24:49 +02:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.properties.OpHistoryProperties;
|
2014-04-16 12:19:40 +02:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
2014-04-15 20:24:49 +02:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
2014-08-27 12:08:40 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
2014-05-16 16:21:10 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
2014-08-27 12:08:40 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
2014-05-16 16:21:10 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
2015-01-29 18:33:19 +01:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
|
2014-04-15 20:24:49 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|
|
|
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
|
|
|
import com.google.gwt.cell.client.AbstractCell;
|
2014-04-16 12:19:40 +02:00
|
|
|
import com.google.gwt.cell.client.Cell.Context;
|
2014-04-15 20:24:49 +02:00
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
|
|
|
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
2014-10-29 18:57:37 +01:00
|
|
|
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
2014-04-15 20:24:49 +02:00
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
import com.google.web.bindery.event.shared.EventBus;
|
|
|
|
import com.sencha.gxt.core.client.IdentityValueProvider;
|
|
|
|
import com.sencha.gxt.data.client.loader.RpcProxy;
|
|
|
|
import com.sencha.gxt.data.shared.ListStore;
|
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoader;
|
|
|
|
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
|
|
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
2014-04-16 19:10:01 +02:00
|
|
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
2014-04-15 20:24:49 +02:00
|
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
2014-04-16 12:19:40 +02:00
|
|
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
|
|
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
2014-04-15 20:24:49 +02:00
|
|
|
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
|
|
|
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
|
|
|
import com.sencha.gxt.widget.core.client.grid.Grid;
|
|
|
|
import com.sencha.gxt.widget.core.client.grid.RowExpander;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author "Giancarlo Panichi" <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
|
|
|
*/
|
2014-08-27 12:08:40 +02:00
|
|
|
public class HistoryPanel extends FramedPanel implements MonitorDialogListener {
|
2014-04-16 19:10:01 +02:00
|
|
|
protected String WIDTH = "298px";
|
2014-04-15 20:24:49 +02:00
|
|
|
protected String HEIGHT = "520px";
|
|
|
|
|
|
|
|
protected TRId trId;
|
|
|
|
protected TableData table;
|
|
|
|
protected String headingTitle;
|
|
|
|
protected VerticalLayoutContainer vl;
|
|
|
|
protected EventBus eventBus;
|
|
|
|
|
|
|
|
protected ListStore<OpHistory> store;
|
|
|
|
protected ListLoader<ListLoadConfig, ListLoadResult<OpHistory>> loader;
|
|
|
|
protected Grid<OpHistory> grid;
|
2014-04-16 19:10:01 +02:00
|
|
|
|
|
|
|
protected OpHistory currentOpHistory;
|
|
|
|
protected int currentRowIndex;
|
|
|
|
protected RollBackSession rollBackSession;
|
|
|
|
|
|
|
|
private boolean drawed = false;
|
2014-04-15 20:24:49 +02:00
|
|
|
|
|
|
|
public HistoryPanel(EventBus eventBus) {
|
|
|
|
super();
|
|
|
|
this.eventBus = eventBus;
|
|
|
|
forceLayoutOnResize = true;
|
2014-04-16 19:10:01 +02:00
|
|
|
retrieveCurrentTR();
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public HistoryPanel(TRId trId, EventBus eventBus) {
|
|
|
|
super();
|
|
|
|
this.trId = trId;
|
|
|
|
this.eventBus = eventBus;
|
|
|
|
forceLayoutOnResize = true;
|
2014-04-16 19:10:01 +02:00
|
|
|
draw();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void draw() {
|
|
|
|
drawed = true;
|
2014-04-15 20:24:49 +02:00
|
|
|
init();
|
|
|
|
create();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void init() {
|
|
|
|
setWidth(WIDTH);
|
|
|
|
setHeight(HEIGHT);
|
|
|
|
setHeaderVisible(false);
|
|
|
|
setBodyBorder(false);
|
2014-04-16 19:10:01 +02:00
|
|
|
setResize(true);
|
2014-04-16 19:56:10 +02:00
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void create() {
|
|
|
|
OpHistoryProperties props = GWT.create(OpHistoryProperties.class);
|
|
|
|
|
|
|
|
IdentityValueProvider<OpHistory> identityProvider = new IdentityValueProvider<OpHistory>();
|
|
|
|
RowExpander<OpHistory> expander = new RowExpander<OpHistory>(
|
|
|
|
identityProvider, new AbstractCell<OpHistory>() {
|
|
|
|
@Override
|
|
|
|
public void render(Context context, OpHistory value,
|
|
|
|
SafeHtmlBuilder sb) {
|
2014-10-29 18:57:37 +01:00
|
|
|
sb.appendHtmlConstant("<p style='margin: 5px 5px 10px'><b>Date:</b>"
|
2014-10-30 10:04:50 +01:00
|
|
|
+ SafeHtmlUtils.htmlEscape(value.getDate()) + "</p>");
|
2014-10-29 18:57:37 +01:00
|
|
|
sb.appendHtmlConstant("<p style='margin: 5px 5px 10px'><b>Description:</b>"
|
|
|
|
+ SafeHtmlUtils.htmlEscape(value
|
|
|
|
.getDescription()) + "</p>");
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
});
|
2014-04-16 19:56:10 +02:00
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
ColumnConfig<OpHistory, String> nameCol = new ColumnConfig<OpHistory, String>(
|
2014-04-16 19:21:27 +02:00
|
|
|
props.name(), 132, "Step");
|
2014-04-16 19:56:10 +02:00
|
|
|
|
|
|
|
nameCol.setCell(new AbstractCell<String>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void render(Context context, String value, SafeHtmlBuilder sb) {
|
2014-10-29 18:57:37 +01:00
|
|
|
sb.appendHtmlConstant("<span title='"
|
|
|
|
+ SafeHtmlUtils.htmlEscape(value) + "'>"
|
|
|
|
+ SafeHtmlUtils.htmlEscape(value) + "</span>");
|
2014-04-16 19:56:10 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
ColumnConfig<OpHistory, String> dateCol = new ColumnConfig<OpHistory, String>(
|
2014-04-16 19:10:01 +02:00
|
|
|
props.date(), 106, "Date");
|
|
|
|
|
2014-04-16 12:19:40 +02:00
|
|
|
ColumnConfig<OpHistory, String> rollBackColumn = new ColumnConfig<OpHistory, String>(
|
2014-04-16 19:10:01 +02:00
|
|
|
props.date(), 40, "Undo");
|
2014-04-15 20:24:49 +02:00
|
|
|
|
2014-04-17 18:39:03 +02:00
|
|
|
ActionButtonCellNoFirst button = new ActionButtonCellNoFirst();
|
2014-04-16 12:19:40 +02:00
|
|
|
button.setIcon(ResourceBundle.INSTANCE.undo());
|
2014-04-17 17:19:26 +02:00
|
|
|
button.setTitle("Undo");
|
2014-04-16 12:19:40 +02:00
|
|
|
button.addSelectHandler(new SelectHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSelect(SelectEvent event) {
|
2014-04-17 17:19:26 +02:00
|
|
|
Log.debug("Button Undo Pressed");
|
2014-04-16 12:19:40 +02:00
|
|
|
Context c = event.getContext();
|
|
|
|
int rowIndex = c.getIndex();
|
2014-04-16 12:35:20 +02:00
|
|
|
startSearchRollBackId(rowIndex);
|
2014-04-16 12:19:40 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
rollBackColumn.setCell(button);
|
2014-05-16 16:21:10 +02:00
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
List<ColumnConfig<OpHistory, ?>> l = new ArrayList<ColumnConfig<OpHistory, ?>>();
|
|
|
|
l.add(expander);
|
|
|
|
l.add(nameCol);
|
|
|
|
l.add(dateCol);
|
2014-04-16 12:35:20 +02:00
|
|
|
l.add(rollBackColumn);
|
2014-04-15 20:24:49 +02:00
|
|
|
|
|
|
|
ColumnModel<OpHistory> cm = new ColumnModel<OpHistory>(l);
|
|
|
|
|
|
|
|
store = new ListStore<OpHistory>(props.id());
|
|
|
|
|
|
|
|
RpcProxy<ListLoadConfig, ListLoadResult<OpHistory>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<OpHistory>>() {
|
|
|
|
|
|
|
|
public void load(ListLoadConfig loadConfig,
|
|
|
|
final AsyncCallback<ListLoadResult<OpHistory>> callback) {
|
|
|
|
loadData(loadConfig, callback);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
loader = new ListLoader<ListLoadConfig, ListLoadResult<OpHistory>>(
|
|
|
|
proxy);
|
|
|
|
|
|
|
|
loader.setRemoteSort(false);
|
|
|
|
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, OpHistory, ListLoadResult<OpHistory>>(
|
|
|
|
store) {
|
|
|
|
});
|
|
|
|
|
|
|
|
grid = new Grid<OpHistory>(store, cm) {
|
|
|
|
@Override
|
|
|
|
protected void onAfterFirstAttach() {
|
|
|
|
super.onAfterFirstAttach();
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
public void execute() {
|
|
|
|
loader.load();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
2014-04-16 19:56:10 +02:00
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
grid.setLoader(loader);
|
2014-04-16 19:56:10 +02:00
|
|
|
grid.setSize("200px", "300px");
|
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
grid.getView().setStripeRows(true);
|
|
|
|
grid.getView().setColumnLines(true);
|
|
|
|
grid.getView().setAutoFill(true);
|
|
|
|
grid.setBorders(false);
|
|
|
|
grid.setLoadMask(true);
|
|
|
|
grid.setColumnReordering(true);
|
|
|
|
grid.setColumnResize(true);
|
|
|
|
grid.getView().setAutoExpandColumn(nameCol);
|
|
|
|
grid.getView().setEmptyText("Empty");
|
2014-04-16 19:10:01 +02:00
|
|
|
expander.initPlugin(grid);
|
2014-04-16 19:56:10 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VerticalLayoutContainer v = new VerticalLayoutContainer();
|
|
|
|
* v.setScrollMode(ScrollMode.AUTO); v.add(grid, new
|
|
|
|
* VerticalLayoutData(1, 1, new Margins(0))); v.forceLayout();
|
|
|
|
*/
|
2014-04-16 19:10:01 +02:00
|
|
|
add(grid, new MarginData(0));
|
2014-04-16 19:56:10 +02:00
|
|
|
|
2014-04-16 19:10:01 +02:00
|
|
|
onResize();
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
2014-04-16 19:10:01 +02:00
|
|
|
|
2014-04-16 12:35:20 +02:00
|
|
|
protected void startSearchRollBackId(int rowIndex) {
|
2014-04-16 12:19:40 +02:00
|
|
|
currentRowIndex = rowIndex;
|
2014-05-16 16:21:10 +02:00
|
|
|
currentOpHistory = store.get(rowIndex - 1);
|
2014-04-16 12:19:40 +02:00
|
|
|
Log.debug(currentOpHistory.toString() + " was clicked.[rowIndex="
|
|
|
|
+ currentRowIndex + " ]");
|
|
|
|
callRollBack();
|
2014-04-16 19:10:01 +02:00
|
|
|
|
2014-04-16 12:19:40 +02:00
|
|
|
}
|
2014-04-16 19:10:01 +02:00
|
|
|
|
|
|
|
protected void callRollBack() {
|
|
|
|
rollBackSession = new RollBackSession(trId,
|
|
|
|
currentOpHistory.getHistoryId());
|
2014-08-27 12:08:40 +02:00
|
|
|
TDGWTServiceAsync.INSTANCE.startRollBack(rollBackSession,
|
|
|
|
new AsyncCallback<String>() {
|
2014-04-16 12:19:40 +02:00
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
2014-05-16 16:21:10 +02:00
|
|
|
if (caught instanceof TDGWTSessionExpiredException) {
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(
|
|
|
|
SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
} else {
|
2014-09-30 13:07:04 +02:00
|
|
|
if (caught instanceof TDGWTIsLockedException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error Locked",
|
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
if (caught instanceof TDGWTIsFinalException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error Final",
|
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
Log.error("Error in rollback: "
|
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3
|
|
|
|
.alert("Error in rollback",
|
|
|
|
"Error: "
|
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
}
|
|
|
|
}
|
2014-05-16 16:21:10 +02:00
|
|
|
}
|
2014-04-16 12:19:40 +02:00
|
|
|
}
|
2014-04-15 20:24:49 +02:00
|
|
|
|
2014-08-27 12:08:40 +02:00
|
|
|
public void onSuccess(String taskId) {
|
2014-04-16 12:19:40 +02:00
|
|
|
Log.debug("Rollback started");
|
2014-08-27 12:08:40 +02:00
|
|
|
openMonitorDialog(taskId);
|
2014-09-30 13:07:04 +02:00
|
|
|
|
2014-04-16 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
2014-04-16 19:10:01 +02:00
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
protected void loadData(ListLoadConfig loadConfig,
|
|
|
|
final AsyncCallback<ListLoadResult<OpHistory>> callback) {
|
|
|
|
|
|
|
|
TDGWTServiceAsync.INSTANCE.getHistory(trId,
|
|
|
|
new AsyncCallback<ArrayList<OpHistory>>() {
|
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
2014-05-16 16:21:10 +02:00
|
|
|
if (caught instanceof TDGWTSessionExpiredException) {
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(
|
|
|
|
SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
} else {
|
2014-09-30 13:07:04 +02:00
|
|
|
if (caught instanceof TDGWTIsLockedException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error Locked",
|
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
Log.error("Error Retrieving History: "
|
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error retrieving history",
|
|
|
|
"Error retrieving history");
|
|
|
|
}
|
2014-05-16 16:21:10 +02:00
|
|
|
}
|
2014-04-15 20:24:49 +02:00
|
|
|
callback.onFailure(caught);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSuccess(ArrayList<OpHistory> result) {
|
|
|
|
Log.debug("loaded " + result.size());
|
|
|
|
callback.onSuccess(new ListLoadResultBean<OpHistory>(
|
|
|
|
result));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void update() {
|
|
|
|
retrieveCurrentTR();
|
|
|
|
loader.load();
|
2014-06-03 15:17:53 +02:00
|
|
|
forceLayout();
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void retrieveCurrentTR() {
|
|
|
|
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
|
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
2014-05-16 16:21:10 +02:00
|
|
|
if (caught instanceof TDGWTSessionExpiredException) {
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(
|
|
|
|
SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
} else {
|
2014-09-30 13:07:04 +02:00
|
|
|
if (caught instanceof TDGWTIsLockedException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error Locked",
|
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
Log.error("Error retrieving current TRId: "
|
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error",
|
|
|
|
"Error retrieving current tabular resource id");
|
|
|
|
}
|
2014-05-16 16:21:10 +02:00
|
|
|
}
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void onSuccess(TRId result) {
|
|
|
|
Log.debug("retrieved " + result);
|
|
|
|
trId = result;
|
2014-04-16 19:10:01 +02:00
|
|
|
if (!drawed) {
|
|
|
|
draw();
|
|
|
|
}
|
|
|
|
|
2014-04-15 20:24:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
2014-09-30 13:07:04 +02:00
|
|
|
|
2014-08-27 12:08:40 +02:00
|
|
|
protected void close() {
|
|
|
|
/*
|
|
|
|
* if (parent != null) { parent.close(); }
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
// /
|
|
|
|
protected void openMonitorDialog(String taskId) {
|
|
|
|
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
|
|
|
|
monitorDialog.addProgressDialogListener(this);
|
|
|
|
monitorDialog.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-01-29 18:33:19 +01:00
|
|
|
public void operationComplete(OperationResult operationResult) {
|
2014-08-27 12:08:40 +02:00
|
|
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
|
|
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
2015-01-29 18:33:19 +01:00
|
|
|
ChangeTableRequestType.ROLLBACK, operationResult.getTrId(), why);
|
2014-08-27 12:08:40 +02:00
|
|
|
eventBus.fireEvent(changeTableRequestEvent);
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationFailed(Throwable caught, String reason, String details) {
|
|
|
|
UtilsGXT3.alert(reason, details);
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-01-29 18:33:19 +01:00
|
|
|
public void operationStopped(OperationResult operationResult, String reason, String details) {
|
2014-08-27 12:08:40 +02:00
|
|
|
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
|
|
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
2015-01-29 18:33:19 +01:00
|
|
|
ChangeTableRequestType.ROLLBACK, operationResult.getTrId(), why);
|
2014-08-27 12:08:40 +02:00
|
|
|
eventBus.fireEvent(changeTableRequestEvent);
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationAborted() {
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationPutInBackground() {
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
2014-04-15 20:24:49 +02:00
|
|
|
|
|
|
|
}
|