Added SessionExpiredShow
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-export-widget@95788 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e56d041841
commit
5e3fa60764
|
@ -8,7 +8,11 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -51,85 +55,95 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi"
|
* @author "Giancarlo Panichi" <a
|
||||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AgenciesSelectionPanel extends ContentPanel implements HasSelectionHandlers<Agencies> {
|
public class AgenciesSelectionPanel extends ContentPanel implements
|
||||||
|
HasSelectionHandlers<Agencies> {
|
||||||
|
|
||||||
private static final AgenciesProperties properties = GWT.create(AgenciesProperties.class);
|
private static final AgenciesProperties properties = GWT
|
||||||
|
.create(AgenciesProperties.class);
|
||||||
protected static final ColumnConfig<Agencies, String> nameColumn = new ColumnConfig<Agencies, String>(properties.name(), 50, "Name");
|
|
||||||
protected static final ColumnConfig<Agencies, String> descriptionColumn = new ColumnConfig<Agencies, String>(properties.description(), 50, "Description");
|
protected static final ColumnConfig<Agencies, String> nameColumn = new ColumnConfig<Agencies, String>(
|
||||||
|
properties.name(), 50, "Name");
|
||||||
|
protected static final ColumnConfig<Agencies, String> descriptionColumn = new ColumnConfig<Agencies, String>(
|
||||||
|
properties.description(), 50, "Description");
|
||||||
|
|
||||||
protected Grid<Agencies> grid;
|
protected Grid<Agencies> grid;
|
||||||
protected ResourceBundle res;
|
protected ResourceBundle res;
|
||||||
|
|
||||||
|
private WizardCard parent;
|
||||||
public AgenciesSelectionPanel(ResourceBundle res)
|
|
||||||
{
|
public AgenciesSelectionPanel(WizardCard parent, ResourceBundle res) {
|
||||||
this.res=res;
|
this.parent = parent;
|
||||||
|
this.res = res;
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
||||||
buildPanel(properties.key(), Arrays.<ColumnConfig<Agencies, ?>>asList(nameColumn, descriptionColumn), nameColumn);
|
buildPanel(properties.key(), Arrays.<ColumnConfig<Agencies, ?>> asList(
|
||||||
|
nameColumn, descriptionColumn), nameColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void buildPanel(ModelKeyProvider<Agencies> keyProvider,
|
||||||
protected void buildPanel(ModelKeyProvider<Agencies> keyProvider, List<ColumnConfig<Agencies, ?>> columns, ColumnConfig<Agencies, ?> autoexpandColumn)
|
List<ColumnConfig<Agencies, ?>> columns,
|
||||||
{
|
ColumnConfig<Agencies, ?> autoexpandColumn) {
|
||||||
|
|
||||||
ToolBar toolBar = new ToolBar();
|
ToolBar toolBar = new ToolBar();
|
||||||
toolBar.add(new LabelToolItem("Search: "));
|
toolBar.add(new LabelToolItem("Search: "));
|
||||||
final TextField searchField = new TextField();
|
final TextField searchField = new TextField();
|
||||||
toolBar.add(searchField);
|
toolBar.add(searchField);
|
||||||
|
|
||||||
TextButton btnReload = new TextButton();
|
TextButton btnReload = new TextButton();
|
||||||
//btnReload.setText("Reload");
|
// btnReload.setText("Reload");
|
||||||
btnReload.setIcon(res.refresh16());
|
btnReload.setIcon(res.refresh16());
|
||||||
btnReload.setToolTip("Reload");
|
btnReload.setToolTip("Reload");
|
||||||
toolBar.add(btnReload);
|
toolBar.add(btnReload);
|
||||||
|
|
||||||
|
|
||||||
IdentityValueProvider<Agencies> identity = new IdentityValueProvider<Agencies>();
|
IdentityValueProvider<Agencies> identity = new IdentityValueProvider<Agencies>();
|
||||||
final CheckBoxSelectionModel<Agencies> sm = new CheckBoxSelectionModel<Agencies>(identity);
|
final CheckBoxSelectionModel<Agencies> sm = new CheckBoxSelectionModel<Agencies>(
|
||||||
|
identity);
|
||||||
|
|
||||||
ColumnModel<Agencies> cm = new ColumnModel<Agencies>(columns);
|
ColumnModel<Agencies> cm = new ColumnModel<Agencies>(columns);
|
||||||
|
|
||||||
final ExtendedListStore<Agencies> store = new ExtendedListStore<Agencies>(keyProvider);
|
final ExtendedListStore<Agencies> store = new ExtendedListStore<Agencies>(
|
||||||
|
keyProvider);
|
||||||
|
|
||||||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
searchField.addKeyUpHandler(new KeyUpHandler() {
|
||||||
|
|
||||||
|
|
||||||
public void onKeyUp(KeyUpEvent event) {
|
public void onKeyUp(KeyUpEvent event) {
|
||||||
Log.trace("searchTerm: "+searchField.getCurrentValue());
|
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
||||||
store.applyFilters();
|
store.applyFilters();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
store.addFilter(new StoreFilter<Agencies>() {
|
store.addFilter(new StoreFilter<Agencies>() {
|
||||||
|
|
||||||
public boolean select(Store<Agencies> store, Agencies parent, Agencies item) {
|
public boolean select(Store<Agencies> store, Agencies parent,
|
||||||
|
Agencies item) {
|
||||||
String searchTerm = searchField.getCurrentValue();
|
String searchTerm = searchField.getCurrentValue();
|
||||||
if (searchTerm == null) return true;
|
if (searchTerm == null)
|
||||||
|
return true;
|
||||||
return AgenciesSelectionPanel.this.select(item, searchTerm);
|
return AgenciesSelectionPanel.this.select(item, searchTerm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
store.setEnableFilters(true);
|
store.setEnableFilters(true);
|
||||||
|
|
||||||
RpcProxy<ListLoadConfig, ListLoadResult<Agencies>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<Agencies>>() {
|
RpcProxy<ListLoadConfig, ListLoadResult<Agencies>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<Agencies>>() {
|
||||||
|
|
||||||
|
public void load(ListLoadConfig loadConfig,
|
||||||
public void load(ListLoadConfig loadConfig, final AsyncCallback<ListLoadResult<Agencies>> callback) {
|
final AsyncCallback<ListLoadResult<Agencies>> callback) {
|
||||||
loadData(loadConfig, callback);
|
loadData(loadConfig, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
final ListLoader<ListLoadConfig, ListLoadResult<Agencies>> loader = new ListLoader<ListLoadConfig, ListLoadResult<Agencies>>(proxy);
|
final ListLoader<ListLoadConfig, ListLoadResult<Agencies>> loader = new ListLoader<ListLoadConfig, ListLoadResult<Agencies>>(
|
||||||
|
proxy);
|
||||||
|
|
||||||
loader.setRemoteSort(false);
|
loader.setRemoteSort(false);
|
||||||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, Agencies, ListLoadResult<Agencies>>(store));
|
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, Agencies, ListLoadResult<Agencies>>(
|
||||||
|
store));
|
||||||
|
|
||||||
grid = new Grid<Agencies>(store, cm){
|
grid = new Grid<Agencies>(store, cm) {
|
||||||
@Override
|
@Override
|
||||||
protected void onAfterFirstAttach() {
|
protected void onAfterFirstAttach() {
|
||||||
super.onAfterFirstAttach();
|
super.onAfterFirstAttach();
|
||||||
|
@ -140,8 +154,8 @@ public class AgenciesSelectionPanel extends ContentPanel implements HasSelection
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
sm.setSelectionMode(SelectionMode.SINGLE);
|
sm.setSelectionMode(SelectionMode.SINGLE);
|
||||||
grid.setLoader(loader);
|
grid.setLoader(loader);
|
||||||
grid.setSelectionModel(sm);
|
grid.setSelectionModel(sm);
|
||||||
grid.getView().setAutoExpandColumn(autoexpandColumn);
|
grid.getView().setAutoExpandColumn(autoexpandColumn);
|
||||||
|
@ -151,72 +165,86 @@ public class AgenciesSelectionPanel extends ContentPanel implements HasSelection
|
||||||
grid.setBorders(false);
|
grid.setBorders(false);
|
||||||
grid.setLoadMask(true);
|
grid.setLoadMask(true);
|
||||||
grid.setColumnReordering(true);
|
grid.setColumnReordering(true);
|
||||||
|
|
||||||
SelectHandler sh = new SelectHandler() {
|
SelectHandler sh = new SelectHandler() {
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
loader.load();
|
loader.load();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
btnReload.addSelectHandler(sh);
|
btnReload.addSelectHandler(sh);
|
||||||
|
|
||||||
VerticalLayoutContainer con = new VerticalLayoutContainer();
|
VerticalLayoutContainer con = new VerticalLayoutContainer();
|
||||||
con.add(toolBar, new VerticalLayoutData(1, -1));
|
con.add(toolBar, new VerticalLayoutData(1, -1));
|
||||||
con.add(grid, new VerticalLayoutData(1, 1));
|
con.add(grid, new VerticalLayoutData(1, 1));
|
||||||
setWidget(con);
|
setWidget(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected boolean select(Agencies item, String searchTerm) {
|
protected boolean select(Agencies item, String searchTerm) {
|
||||||
if (item.getName()!=null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
if (item.getName() != null
|
||||||
if (item.getDescription()!=null && item.getDescription().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
&& item.getName().toLowerCase()
|
||||||
if (item.getId()!=null &&item.getId().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
.contains(searchTerm.toLowerCase()))
|
||||||
|
return true;
|
||||||
|
if (item.getDescription() != null
|
||||||
|
&& item.getDescription().toLowerCase()
|
||||||
|
.contains(searchTerm.toLowerCase()))
|
||||||
|
return true;
|
||||||
|
if (item.getId() != null
|
||||||
|
&& item.getId().toLowerCase()
|
||||||
|
.contains(searchTerm.toLowerCase()))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void loadData(ListLoadConfig loadConfig,
|
||||||
protected void loadData(ListLoadConfig loadConfig, final AsyncCallback<ListLoadResult<Agencies>> callback) {
|
final AsyncCallback<ListLoadResult<Agencies>> callback) {
|
||||||
TDGWTServiceAsync.INSTANCE.getAgencies(new AsyncCallback<ArrayList<Agencies>>() {
|
TDGWTServiceAsync.INSTANCE
|
||||||
|
.getAgencies(new AsyncCallback<ArrayList<Agencies>>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
callback.onFailure(caught);
|
parent.getEventBus()
|
||||||
}
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("No agencies retrieved");
|
||||||
|
}
|
||||||
|
callback.onFailure(caught);
|
||||||
|
}
|
||||||
|
|
||||||
public void onSuccess(ArrayList<Agencies> result) {
|
public void onSuccess(ArrayList<Agencies> result) {
|
||||||
Log.trace("loaded "+result.size()+" agencies");
|
Log.trace("loaded " + result.size() + " agencies");
|
||||||
callback.onSuccess(new ListLoadResultBean<Agencies>(result));
|
callback.onSuccess(new ListLoadResultBean<Agencies>(
|
||||||
}
|
result));
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HandlerRegistration addSelectionHandler(
|
||||||
public HandlerRegistration addSelectionHandler(SelectionHandler<Agencies> handler) {
|
SelectionHandler<Agencies> handler) {
|
||||||
return grid.getSelectionModel().addSelectionHandler(handler);
|
return grid.getSelectionModel().addSelectionHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/*public List<Agencies> getSelectedItems() {
|
* public List<Agencies> getSelectedItems() { return
|
||||||
return grid.getSelectionModel().getSelectedItems();
|
* grid.getSelectionModel().getSelectedItems(); }
|
||||||
}*/
|
*/
|
||||||
|
|
||||||
public Agencies getSelectedItem() {
|
public Agencies getSelectedItem() {
|
||||||
return grid.getSelectionModel().getSelectedItem();
|
return grid.getSelectionModel().getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
protected class ExtendedListStore<M> extends ListStore<M> {
|
||||||
|
|
||||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
||||||
super(keyProvider);
|
super(keyProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyFilters()
|
public void applyFilters() {
|
||||||
{
|
|
||||||
super.applyFilters();
|
super.applyFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,11 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -66,10 +70,13 @@ public class CodelistSelectionPanel extends ContentPanel implements HasSelection
|
||||||
|
|
||||||
protected Grid<Codelist> grid;
|
protected Grid<Codelist> grid;
|
||||||
protected ResourceBundle res;
|
protected ResourceBundle res;
|
||||||
|
|
||||||
|
private WizardCard parent;
|
||||||
|
|
||||||
|
|
||||||
public CodelistSelectionPanel(ResourceBundle res)
|
public CodelistSelectionPanel(WizardCard parent,ResourceBundle res)
|
||||||
{
|
{
|
||||||
|
this.parent=parent;
|
||||||
this.res=res;
|
this.res=res;
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
||||||
|
@ -183,7 +190,15 @@ public class CodelistSelectionPanel extends ContentPanel implements HasSelection
|
||||||
TDGWTServiceAsync.INSTANCE.getCodelists(new AsyncCallback<ArrayList<Codelist>>() {
|
TDGWTServiceAsync.INSTANCE.getCodelists(new AsyncCallback<ArrayList<Codelist>>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
callback.onFailure(caught);
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
parent.getEventBus()
|
||||||
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("No codelists retrieved");
|
||||||
|
}
|
||||||
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(ArrayList<Codelist> result) {
|
public void onSuccess(ArrayList<Codelist> result) {
|
||||||
|
@ -199,10 +214,6 @@ public class CodelistSelectionPanel extends ContentPanel implements HasSelection
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*public List<Codelist> getSelectedItems() {
|
|
||||||
return grid.getSelectionModel().getSelectedItems();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public Codelist getSelectedItem() {
|
public Codelist getSelectedItem() {
|
||||||
return grid.getSelectionModel().getSelectedItem();
|
return grid.getSelectionModel().getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,12 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -61,8 +66,14 @@ public class DatasetSelectionPanel extends ContentPanel implements HasSelectionH
|
||||||
|
|
||||||
protected Grid<Dataset> grid;
|
protected Grid<Dataset> grid;
|
||||||
|
|
||||||
public DatasetSelectionPanel()
|
protected ResourceBundle res;
|
||||||
|
|
||||||
|
private WizardCard parent;
|
||||||
|
|
||||||
|
public DatasetSelectionPanel(WizardCard parent, ResourceBundle res)
|
||||||
{
|
{
|
||||||
|
this.parent=parent;
|
||||||
|
this.res=res;
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
||||||
buildPanel(properties.key(), Arrays.<ColumnConfig<Dataset, ?>>asList(nameColumn, agencyIdColumn, versionColumn, descriptionColumn), nameColumn);
|
buildPanel(properties.key(), Arrays.<ColumnConfig<Dataset, ?>>asList(nameColumn, agencyIdColumn, versionColumn, descriptionColumn), nameColumn);
|
||||||
|
@ -159,6 +170,15 @@ public class DatasetSelectionPanel extends ContentPanel implements HasSelectionH
|
||||||
TDGWTServiceAsync.INSTANCE.getDatasets(new AsyncCallback<ArrayList<Dataset>>() {
|
TDGWTServiceAsync.INSTANCE.getDatasets(new AsyncCallback<ArrayList<Dataset>>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
parent.getEventBus()
|
||||||
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("No datasets retrieved");
|
||||||
|
}
|
||||||
|
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class SDMXAgenciesSelectionCard extends WizardCard {
|
||||||
this.exportSession = exportSession;
|
this.exportSession = exportSession;
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
this.agenciesSelectionPanel=new AgenciesSelectionPanel(res);
|
this.agenciesSelectionPanel=new AgenciesSelectionPanel(thisCard,res);
|
||||||
|
|
||||||
agenciesSelectionPanel.addSelectionHandler(new SelectionHandler<Agencies>(){
|
agenciesSelectionPanel.addSelectionHandler(new SelectionHandler<Agencies>(){
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class SDMXCodelistSelectionCard extends WizardCard {
|
||||||
this.exportSession = exportSession;
|
this.exportSession = exportSession;
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
this.codelistSelectionPanel=new CodelistSelectionPanel(res);
|
this.codelistSelectionPanel=new CodelistSelectionPanel(thisCard,res);
|
||||||
|
|
||||||
codelistSelectionPanel.addSelectionHandler(new SelectionHandler<Codelist>() {
|
codelistSelectionPanel.addSelectionHandler(new SelectionHandler<Codelist>() {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SDMXDatasetSelectionCard extends WizardCard {
|
||||||
|
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
this.datasetSelectionPanel=new DatasetSelectionPanel();
|
this.datasetSelectionPanel=new DatasetSelectionPanel(thisCard,res);
|
||||||
|
|
||||||
setContent(datasetSelectionPanel);
|
setContent(datasetSelectionPanel);
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,13 @@
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressBarUpdater;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressBarUpdater;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressListener;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressListener;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressUpdater;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.SDMXExportProgressUpdater;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
|
@ -114,11 +117,19 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
showErrorAndHide(
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
"Error in exportSDMX",
|
getEventBus()
|
||||||
"An error occured in exportSDMX: "
|
.fireEvent(
|
||||||
+ caught.getLocalizedMessage(), caught
|
new SessionExpiredEvent(
|
||||||
.getStackTrace().toString(), caught);
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
showErrorAndHide(
|
||||||
|
"Error in exportSDMX",
|
||||||
|
"An error occured in exportSDMX: "
|
||||||
|
+ caught.getLocalizedMessage(),
|
||||||
|
caught.getStackTrace().toString(), caught);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -132,7 +143,7 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
getWizardWindow().setNextButtonToFinish();
|
getWizardWindow().setNextButtonToFinish();
|
||||||
exportSDMX();
|
exportSDMX();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationInitializing() {
|
public void operationInitializing() {
|
||||||
|
|
||||||
|
@ -167,13 +178,21 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
|
|
||||||
public void operationFailed(Throwable caught, String reason,
|
public void operationFailed(Throwable caught, String reason,
|
||||||
String failureDetails) {
|
String failureDetails) {
|
||||||
AlertMessageBox d = new AlertMessageBox("Error in SDMX Export", reason);
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
d.addHideHandler(new HideHandler() {
|
getEventBus()
|
||||||
public void onHide(HideEvent event) {
|
.fireEvent(
|
||||||
}
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
AlertMessageBox d = new AlertMessageBox("Error in SDMX Export",
|
||||||
|
reason);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
d.show();
|
d.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -203,13 +222,13 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
@Override
|
@Override
|
||||||
public void operationGeneratingView() {
|
public void operationGeneratingView() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationValidate(float elaborated) {
|
public void operationValidate(float elaborated) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,11 @@
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -147,8 +150,15 @@ public class SDMXRegistrySelectionCard extends WizardCard {
|
||||||
((SDMXRegistrySource)exportSession.getSource()), new AsyncCallback<Void>() {
|
((SDMXRegistrySource)exportSession.getSource()), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
getEventBus()
|
||||||
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
Log.error("SDMXRegistrySource do not stored "
|
Log.error("SDMXRegistrySource do not stored "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
|
|
Loading…
Reference in New Issue