Fixed CSV Import, monitor added to control file loading on storage
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@102146 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
03b7238b48
commit
f3d98d2567
|
@ -19,6 +19,7 @@ import com.google.gwt.user.client.Command;
|
|||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.FlexTable;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.AutoProgressBar;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
|
@ -35,10 +36,12 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
|
|||
public class CSVOperationInProgressCard extends WizardCard implements
|
||||
MonitorDialogListener {
|
||||
|
||||
protected CSVOperationInProgressCard thisCard;
|
||||
protected CSVImportSession importSession;
|
||||
protected TRId newTrId;
|
||||
protected HtmlLayoutContainer resultField;
|
||||
@SuppressWarnings("unused")
|
||||
private CSVOperationInProgressCard thisCard;
|
||||
private CSVImportSession importSession;
|
||||
private TRId newTrId;
|
||||
private HtmlLayoutContainer resultField;
|
||||
private AutoProgressBar storageLoading;
|
||||
|
||||
public CSVOperationInProgressCard(final CSVImportSession importSession) {
|
||||
super("Operation In Progress", "");
|
||||
|
@ -74,27 +77,46 @@ public class CSVOperationInProgressCard extends WizardCard implements
|
|||
summary.add(description);
|
||||
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
|
||||
5, 10, 5)));
|
||||
|
||||
|
||||
storageLoading=new AutoProgressBar();
|
||||
operationInProgressPanel.add(storageLoading, new BoxLayoutData(
|
||||
new Margins(10, 5, 10, 5)));
|
||||
|
||||
|
||||
resultField = new HtmlLayoutContainer("<div></div>");
|
||||
|
||||
operationInProgressPanel.add(resultField, new BoxLayoutData(
|
||||
new Margins(10, 5, 10, 5)));
|
||||
|
||||
setCenterWidget(operationInProgressPanel, new MarginData(0));
|
||||
storageLoading.setVisible(false);
|
||||
resultField.setVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void importCSV() {
|
||||
//mask("Loading on Storage...");
|
||||
storageLoading.setVisible(true);
|
||||
forceLayout();
|
||||
storageLoading.updateText("Loading on Storage...");
|
||||
storageLoading.redraw();
|
||||
storageLoading.auto();
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startCSVImport(importSession,
|
||||
new AsyncCallback<String>() {
|
||||
|
||||
|
||||
public void onSuccess(String taskId) {
|
||||
storageLoading.setVisible(false);
|
||||
forceLayout();
|
||||
openMonitorDialog(taskId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
storageLoading.setVisible(false);
|
||||
forceLayout();
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
getEventBus()
|
||||
.fireEvent(
|
||||
|
|
Loading…
Reference in New Issue