Added SessionExpiredShow
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@95762 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ae8601952a
commit
29255d0db2
|
@ -3418,3 +3418,35 @@ Compiling...
|
|||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||
Compiling...
|
||||
30% complete (ETR: 10 seconds)
|
||||
30% complete (ETR: 10 seconds)
|
||||
30% complete (ETR: 10 seconds)
|
||||
30% complete (ETR: 10 seconds)
|
||||
40% complete (ETR: 8 seconds)
|
||||
50% complete (ETR: 6 seconds)
|
||||
60% complete (ETR: 4 seconds)
|
||||
70% complete (ETR: 3 seconds)
|
||||
80% complete (ETR: 2 seconds)
|
||||
90% complete (ETR: 1 seconds)
|
||||
100% complete (ETR: 0 seconds)
|
||||
Compilation completed in 16.35 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
|
|
|
@ -20,9 +20,12 @@ import org.gcube.portlets.user.td.columnwidget.client.store.TimeDimensionTypeEle
|
|||
import org.gcube.portlets.user.td.columnwidget.client.store.TimeDimensionTypeStore;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
|
||||
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.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
|
@ -625,11 +628,16 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load combo failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
"Error retrieving columns of tabular resource:"
|
||||
+ trId.getId());
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load combo failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
"Error retrieving columns of tabular resource:"
|
||||
+ trId.getId());
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
|
@ -684,17 +692,19 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
if (type == ColumnTypeCode.CODENAME) {
|
||||
setLocale(cd.getLocale());
|
||||
} else {
|
||||
// TODO Add TimeDimension and Dimension information to
|
||||
// ColumnData
|
||||
/*
|
||||
* if (type == ColumnTypeCode.TIMEDIMENSION) {
|
||||
* changeColumnTypeSession.setColumnDataType(ColumnDataTypeStore
|
||||
* .selectedAttribute(cd.getDataTypeName()));
|
||||
* comboTimeDimensionType.setValue(TimeDimensionTypeStore
|
||||
* .selectedAttributeElement(cd.getDataTypeName())); } else {
|
||||
*
|
||||
* }
|
||||
*/
|
||||
// TODO Add TimeDimension and Dimension information to
|
||||
// ColumnData
|
||||
/*
|
||||
* if (type == ColumnTypeCode.TIMEDIMENSION) {
|
||||
* changeColumnTypeSession
|
||||
* .setColumnDataType(ColumnDataTypeStore
|
||||
* .selectedAttribute(cd.getDataTypeName()));
|
||||
* comboTimeDimensionType.setValue(TimeDimensionTypeStore
|
||||
* .selectedAttributeElement(cd.getDataTypeName())); } else
|
||||
* {
|
||||
*
|
||||
* }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -766,11 +776,11 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
LocaleTypeElement locale = comboLocaleType
|
||||
.getCurrentValue();
|
||||
if (locale != null) {
|
||||
changeColumnTypeSession.setLocale(locale.getLocaleName());
|
||||
changeColumnTypeSession.setLocale(locale
|
||||
.getLocaleName());
|
||||
callChangeColumnType();
|
||||
} else {
|
||||
UtilsGXT3.alert("Attention",
|
||||
"No locale selected!");
|
||||
UtilsGXT3.alert("Attention", "No locale selected!");
|
||||
}
|
||||
break;
|
||||
case CODEDESCRIPTION:
|
||||
|
@ -832,12 +842,16 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
TDGWTServiceAsync.INSTANCE.startChangeColumnType(
|
||||
changeColumnTypeSession, new AsyncCallback<Void>() {
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Change Column Type Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Change Column Type Error ",
|
||||
"Error in invocation of change column type operation!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Change Column Type Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Change Column Type Error ",
|
||||
"Error in invocation of change column type operation!");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(Void result) {
|
||||
|
@ -883,11 +897,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Error retrieving columns: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns on server!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Error retrieving columns: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns on server!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -908,10 +926,14 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug(caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving locales",
|
||||
caught.getLocalizedMessage());
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug(caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving locales",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -931,16 +953,14 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void setLocale(String locale){
|
||||
for(LocaleTypeElement loc:storeComboLocaleType.getAll()){
|
||||
if(loc.getLocaleName().compareTo(locale)==0){
|
||||
|
||||
protected void setLocale(String locale) {
|
||||
for (LocaleTypeElement loc : storeComboLocaleType.getAll()) {
|
||||
if (loc.getLocaleName().compareTo(locale) == 0) {
|
||||
comboLocaleType.setValue(loc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,8 +7,11 @@ import org.gcube.portlets.user.td.columnwidget.client.progress.DeleteColumnProgr
|
|||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.DeleteColumnSession;
|
||||
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 com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -50,9 +53,9 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
|||
* ChangeColumnTypePanel is the panel for change column type
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class DeleteColumnPanel extends FramedPanel {
|
||||
protected String WIDTH = "640px";
|
||||
|
@ -65,7 +68,7 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
protected ColumnData column;
|
||||
|
||||
protected TextButton delete;
|
||||
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||
protected Grid<ColumnData> grid;
|
||||
protected CheckBoxSelectionModel<ColumnData> sm;
|
||||
|
@ -83,14 +86,13 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
this.trId = trId;
|
||||
this.columnName = columnName;
|
||||
this.eventBus = eventBus;
|
||||
Log.debug("DeleteColumnPanel(): [" + trId.toString()
|
||||
+ " columnName: " + columnName + "]");
|
||||
Log.debug("DeleteColumnPanel(): [" + trId.toString() + " columnName: "
|
||||
+ columnName + "]");
|
||||
|
||||
|
||||
build();
|
||||
}
|
||||
|
||||
protected void build(){
|
||||
|
||||
protected void build() {
|
||||
ColumnDataProperties props = GWT.create(ColumnDataProperties.class);
|
||||
|
||||
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
||||
|
@ -106,23 +108,23 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
|
||||
store = new ListStore<ColumnData>(props.id());
|
||||
|
||||
store.addStoreDataChangeHandler(new StoreDataChangeHandler<ColumnData>(){
|
||||
store.addStoreDataChangeHandler(new StoreDataChangeHandler<ColumnData>() {
|
||||
|
||||
@Override
|
||||
public void onDataChange(StoreDataChangeEvent<ColumnData> event) {
|
||||
List<ColumnData> cols=event.getSource().getAll();
|
||||
Log.debug("Columns:"+cols.size());
|
||||
for(ColumnData c:cols){
|
||||
if(c.getName().compareTo(columnName)==0){
|
||||
List<ColumnData> cols = event.getSource().getAll();
|
||||
Log.debug("Columns:" + cols.size());
|
||||
for (ColumnData c : cols) {
|
||||
if (c.getName().compareTo(columnName) == 0) {
|
||||
sm.select(c, false);
|
||||
sm.refresh();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
|
||||
|
||||
public void load(ListLoadConfig loadConfig,
|
||||
|
@ -137,7 +139,6 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, ColumnData, ListLoadResult<ColumnData>>(
|
||||
store) {
|
||||
});
|
||||
|
||||
|
||||
grid = new Grid<ColumnData>(store, cm) {
|
||||
@Override
|
||||
|
@ -147,7 +148,7 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
|
||||
public void execute() {
|
||||
loader.load();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -156,16 +157,16 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
sm.setSelectionMode(SelectionMode.MULTI);
|
||||
grid.setLoader(loader);
|
||||
grid.setSelectionModel(sm);
|
||||
//grid.getView().setAutoExpandColumn(labelCol);
|
||||
// grid.getView().setAutoExpandColumn(labelCol);
|
||||
grid.setHeight(360);
|
||||
grid.getView().setStripeRows(true);
|
||||
grid.getView().setColumnLines(true);
|
||||
grid.getView().setAutoFill(true);
|
||||
grid.getView().setAutoFill(true);
|
||||
grid.setBorders(false);
|
||||
grid.setLoadMask(true);
|
||||
grid.setColumnReordering(true);
|
||||
grid.setColumnResize(false);
|
||||
|
||||
|
||||
// Delete Button
|
||||
delete = new TextButton("Delete");
|
||||
SelectHandler deleteHandler = new SelectHandler() {
|
||||
|
@ -179,23 +180,19 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
|
||||
FieldLabel columnsLabel = new FieldLabel(null, "Columns");
|
||||
columnsLabel.getElement().applyStyles("font-weight:bold");
|
||||
HBoxLayoutContainer hBox=new HBoxLayoutContainer();
|
||||
hBox.add(delete,new BoxLayoutData(new Margins(2,5,2,5)));
|
||||
|
||||
|
||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||
hBox.add(delete, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.setScrollMode(ScrollMode.AUTO);
|
||||
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2,1,5,1)));
|
||||
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
||||
1)));
|
||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0,
|
||||
10, 0)));
|
||||
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected ArrayList<ColumnData> getSelectedItems() {
|
||||
return new ArrayList<ColumnData>(grid.getSelectionModel()
|
||||
.getSelectedItems());
|
||||
|
@ -204,7 +201,7 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
|
||||
public void update(TRId trId, String columnName) {
|
||||
this.trId = trId;
|
||||
this.columnName=columnName;
|
||||
this.columnName = columnName;
|
||||
loader.load();
|
||||
}
|
||||
|
||||
|
@ -214,11 +211,17 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load columns failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load columns failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
|
||||
}
|
||||
|
||||
public void onSuccess(ArrayList<ColumnData> result) {
|
||||
|
@ -232,42 +235,42 @@ public class DeleteColumnPanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void onDeleteColumns() {
|
||||
ArrayList<ColumnData> columns=getSelectedItems();
|
||||
if(columns==null||columns.size()<1){
|
||||
UtilsGXT3.alert("Attention",
|
||||
"Attention no column selected!");
|
||||
ArrayList<ColumnData> columns = getSelectedItems();
|
||||
if (columns == null || columns.size() < 1) {
|
||||
UtilsGXT3.alert("Attention", "Attention no column selected!");
|
||||
return;
|
||||
} else {
|
||||
} else {
|
||||
callDeleteColumn(columns);
|
||||
}
|
||||
}
|
||||
|
||||
private void callDeleteColumn(ArrayList<ColumnData> columns) {
|
||||
deleteColumnSession=new DeleteColumnSession(trId,columns);
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startDeleteColumn(
|
||||
deleteColumnSession, new AsyncCallback<Void>() {
|
||||
deleteColumnSession = new DeleteColumnSession(trId, columns);
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startDeleteColumn(deleteColumnSession,
|
||||
new AsyncCallback<Void>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Delete Column Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Delete Column Error ",
|
||||
"Error in invocation of delete column operation!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Delete Column Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Delete Column Error ",
|
||||
"Error in invocation of delete column operation!");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(Void result) {
|
||||
deleteColumnProgressDialog= new DeleteColumnProgressDialog(deleteColumnSession, eventBus);
|
||||
deleteColumnProgressDialog = new DeleteColumnProgressDialog(
|
||||
deleteColumnSession, eventBus);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,11 @@ import org.gcube.portlets.user.td.columnwidget.client.progress.LabelColumnProgre
|
|||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.LabelColumnSession;
|
||||
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 com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -45,9 +48,9 @@ import com.sencha.gxt.widget.core.client.info.Info;
|
|||
* ChangeColumnTypePanel is the panel for change column type
|
||||
*
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class LabelColumnPanel extends FramedPanel {
|
||||
protected String WIDTH = "640px";
|
||||
|
@ -74,8 +77,8 @@ public class LabelColumnPanel extends FramedPanel {
|
|||
this.trId = trId;
|
||||
this.columnName = columnName;
|
||||
this.eventBus = eventBus;
|
||||
Log.debug("LabelColumnPanel(): [" + trId.toString()
|
||||
+ " columnName: " + columnName + "]");
|
||||
Log.debug("LabelColumnPanel(): [" + trId.toString() + " columnName: "
|
||||
+ columnName + "]");
|
||||
|
||||
// Column Data
|
||||
ColumnDataPropertiesCombo propsColumnData = GWT
|
||||
|
@ -128,19 +131,19 @@ public class LabelColumnPanel extends FramedPanel {
|
|||
comboColumn.setTypeAhead(false);
|
||||
comboColumn.setEditable(false);
|
||||
comboColumn.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
label= new TextField();
|
||||
|
||||
label = new TextField();
|
||||
label.setAllowBlank(false);
|
||||
|
||||
change=new TextButton("Change");
|
||||
|
||||
change = new TextButton("Change");
|
||||
change.addSelectHandler(new SelectHandler() {
|
||||
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
onLabelColumn();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
||||
-1));
|
||||
|
@ -168,32 +171,36 @@ public class LabelColumnPanel extends FramedPanel {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
|
||||
TDGWTServiceAsync.INSTANCE.getColumns(trId,
|
||||
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load combo failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
"Error retrieving columns of tabular resource:"
|
||||
+ trId.getId());
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load combo failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
"Error retrieving columns of tabular resource:"
|
||||
+ trId.getId());
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
public void onSuccess(ArrayList<ColumnData> result) {
|
||||
Log.trace("loaded " + result.size() + " ColumnData");
|
||||
ArrayList<ColumnData> removables=new ArrayList<ColumnData>();
|
||||
for(ColumnData c:result){
|
||||
if(c.getTypeCode().compareTo("DIMENSION")==0||
|
||||
c.getTypeCode().compareTo("TIMEDIMENSION")==0){
|
||||
ArrayList<ColumnData> removables = new ArrayList<ColumnData>();
|
||||
for (ColumnData c : result) {
|
||||
if (c.getTypeCode().compareTo("DIMENSION") == 0
|
||||
|| c.getTypeCode().compareTo(
|
||||
"TIMEDIMENSION") == 0) {
|
||||
removables.add(c);
|
||||
}
|
||||
}
|
||||
if(removables.size()>0){
|
||||
if (removables.size() > 0) {
|
||||
result.removeAll(removables);
|
||||
}
|
||||
setComboStatus(result);
|
||||
|
@ -236,9 +243,9 @@ public class LabelColumnPanel extends FramedPanel {
|
|||
protected void onLabelColumn() {
|
||||
|
||||
ColumnData columnData = comboColumn.getCurrentValue();
|
||||
if(columnData!=null){
|
||||
String lab= label.getCurrentValue();
|
||||
if(lab!=null && !lab.isEmpty()){
|
||||
if (columnData != null) {
|
||||
String lab = label.getCurrentValue();
|
||||
if (lab != null && !lab.isEmpty()) {
|
||||
labelColumnSession = new LabelColumnSession();
|
||||
labelColumnSession.setColumnData(columnData);
|
||||
labelColumnSession.setLabel(lab);
|
||||
|
@ -252,25 +259,29 @@ public class LabelColumnPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void callLabelColumn() {
|
||||
TDGWTServiceAsync.INSTANCE.startLabelColumn(
|
||||
labelColumnSession, new AsyncCallback<Void>() {
|
||||
TDGWTServiceAsync.INSTANCE.startLabelColumn(labelColumnSession,
|
||||
new AsyncCallback<Void>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Change The Column Label Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error Changing The Column Label",
|
||||
"Error in invocation of Change The Column Label operation!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Change The Column Label Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Error Changing The Column Label",
|
||||
"Error in invocation of Change The Column Label operation!");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(Void result) {
|
||||
labelColumnProgressDialog= new LabelColumnProgressDialog(labelColumnSession, eventBus);
|
||||
labelColumnProgressDialog = new LabelColumnProgressDialog(
|
||||
labelColumnSession, eventBus);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,10 @@ import org.gcube.portlets.user.td.columnwidget.client.progress.ReplaceBatchColum
|
|||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.batch.ReplaceBatchColumnSession;
|
||||
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 com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -14,30 +17,29 @@ import com.sencha.gxt.widget.core.client.Window;
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ReplaceBatchDialog extends Window {
|
||||
public class ReplaceBatchDialog extends Window {
|
||||
protected String WIDTH = "650px";
|
||||
protected String HEIGHT = "530px";
|
||||
protected TRId trId;
|
||||
protected String columnName=null;
|
||||
protected String columnName = null;
|
||||
protected EventBus eventBus;
|
||||
|
||||
|
||||
public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) {
|
||||
this.trId=trId;
|
||||
this.columnName=columnName;
|
||||
this.eventBus=eventBus;
|
||||
this.trId = trId;
|
||||
this.columnName = columnName;
|
||||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
ReplaceBatchPanel batchRepalcePanel= new ReplaceBatchPanel(this, trId,columnName,eventBus);
|
||||
add(batchRepalcePanel);
|
||||
ReplaceBatchPanel batchRepalcePanel = new ReplaceBatchPanel(this, trId,
|
||||
columnName, eventBus);
|
||||
add(batchRepalcePanel);
|
||||
}
|
||||
|
||||
|
||||
protected void initWindow() {
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
|
@ -50,7 +52,7 @@ public class ReplaceBatchDialog extends Window {
|
|||
getHeader().setIcon(ResourceBundle.INSTANCE.replaceBatch());
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -60,31 +62,35 @@ public class ReplaceBatchDialog extends Window {
|
|||
|
||||
closeBtn.addSelectHandler(new SelectHandler() {
|
||||
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected void close (){
|
||||
|
||||
protected void close() {
|
||||
hide();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void startBatchReplace(ReplaceBatchColumnSession replaceBatchColumnSession){
|
||||
TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn(replaceBatchColumnSession,
|
||||
new AsyncCallback<Void>() {
|
||||
|
||||
protected void startBatchReplace(
|
||||
ReplaceBatchColumnSession replaceBatchColumnSession) {
|
||||
TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn(
|
||||
replaceBatchColumnSession, new AsyncCallback<Void>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("Start Replace Batch failed:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error on batch replace",
|
||||
"Error on batch replace");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Start Replace Batch failed:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error on batch replace",
|
||||
"Error on batch replace");
|
||||
}
|
||||
close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onSuccess(Void v) {
|
||||
|
@ -94,15 +100,14 @@ public class ReplaceBatchDialog extends Window {
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void callReplaceBatchColumnProgressDialog() {
|
||||
ReplaceBatchColumnProgressDialog dialog = new ReplaceBatchColumnProgressDialog(
|
||||
this, eventBus);
|
||||
dialog.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.gcube.portlets.user.td.columnwidget.client.store.ShowOccurrencesTypeE
|
|||
import org.gcube.portlets.user.td.columnwidget.client.store.ShowOccurrencesTypeStore;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
||||
|
@ -21,6 +22,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForRepla
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceEntry;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ShowOccurrencesType;
|
||||
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.CellData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
|
@ -397,11 +400,15 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
new AsyncCallback<ColumnData>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load column failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
"Error retrieving column");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load column failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
"Error retrieving column");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(ColumnData result) {
|
||||
|
@ -418,11 +425,15 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load column failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
"Error retrieving column");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load column failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
"Error retrieving column");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(ArrayList<ColumnData> result) {
|
||||
|
@ -483,10 +494,15 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
new AsyncCallback<ArrayList<Occurrences>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load columns failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("load columns failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,12 +8,15 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.TabResource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadConfig;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadResult;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.Direction;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.OrderInfo;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -58,7 +61,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CodelistSelectionDialog extends Window {
|
||||
protected static final int WIDTH = 550;
|
||||
|
@ -98,7 +101,7 @@ public class CodelistSelectionDialog extends Window {
|
|||
|
||||
}
|
||||
|
||||
protected void initWindow(){
|
||||
protected void initWindow() {
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
res = ResourceBundle.INSTANCE;
|
||||
|
@ -107,7 +110,7 @@ public class CodelistSelectionDialog extends Window {
|
|||
setHeadingText("Select Codelist");
|
||||
setModal(true);
|
||||
}
|
||||
|
||||
|
||||
protected void create() {
|
||||
|
||||
final FramedPanel panel = new FramedPanel();
|
||||
|
@ -240,11 +243,16 @@ public class CodelistSelectionDialog extends Window {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Attention",
|
||||
"This tabular resource does not have a valid table");
|
||||
UtilsGXT3
|
||||
.alert("Attention",
|
||||
"This tabular resource does not have a valid table");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Attention",
|
||||
"This tabular resource does not have a valid table");
|
||||
UtilsGXT3
|
||||
.alert("Attention",
|
||||
"This tabular resource does not have a valid table");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -256,9 +264,7 @@ public class CodelistSelectionDialog extends Window {
|
|||
|
||||
});
|
||||
} else {
|
||||
UtilsGXT3
|
||||
.alert("Attention",
|
||||
"Select a codelist!");
|
||||
UtilsGXT3.alert("Attention", "Select a codelist!");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -306,11 +312,16 @@ public class CodelistSelectionDialog extends Window {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Error Retrieving Codelist",
|
||||
caught.getMessage());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3.alert("Error Retrieving Codelist",
|
||||
"Error retrieving codelist on server");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Error Retrieving Codelist",
|
||||
caught.getMessage());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3.alert("Error Retrieving Codelist",
|
||||
"Error retrieving codelist on server");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -332,13 +343,17 @@ public class CodelistSelectionDialog extends Window {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Error in setCodelistsPagingLoader",
|
||||
caught.getMessage());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3
|
||||
.alert("Error Retrieving Codelist",
|
||||
"Error error in retrieving the codelists during the initialization phase!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Error in setCodelistsPagingLoader",
|
||||
caught.getMessage());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3
|
||||
.alert("Error Retrieving Codelist",
|
||||
"Error error in retrieving the codelists during the initialization phase!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,8 +7,11 @@ import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProp
|
|||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -41,7 +44,7 @@ import com.sencha.gxt.widget.core.client.info.Info;
|
|||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ConnectCodelistDialog extends Window implements
|
||||
CodelistSelectionListener {
|
||||
|
@ -56,9 +59,9 @@ public class ConnectCodelistDialog extends Window implements
|
|||
protected ComboBox<ColumnData> comboColumnReferenceType = null;
|
||||
protected FieldLabel comboColumnReferenceTypeLabel;
|
||||
protected ListStore<ColumnData> storeComboColumnReferenceType;
|
||||
|
||||
|
||||
protected EventBus eventBus;
|
||||
|
||||
|
||||
private TextButton btnApply;
|
||||
private TextButton btnClose;
|
||||
|
||||
|
@ -256,11 +259,15 @@ public class ConnectCodelistDialog extends Window implements
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Error retrieving columns: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns on server!");
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Error retrieving columns: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns on server!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.progress;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -19,124 +22,128 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ChangeColumnTypeProgressDialog extends Window implements ChangeColumnTypeProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ChangeColumnTypeSession changeColumnTypeSession;
|
||||
protected EventBus eventBus;
|
||||
protected ChangeColumnTypeProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
public ChangeColumnTypeProgressDialog(ChangeColumnTypeSession changeColumnTypeSession, EventBus eventBus) {
|
||||
this.changeColumnTypeSession=changeColumnTypeSession;
|
||||
this.eventBus=eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Change Column Type Progress");
|
||||
|
||||
trId=null;
|
||||
|
||||
FramedPanel panel=new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok=new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar, new VerticalLayoutData(1,
|
||||
1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
|
||||
progressUpdater = new ChangeColumnTypeProgressUpdater();
|
||||
progressUpdater.addListener(new ChangeColumnTypeProgressBarUpdater(progressBar));
|
||||
public class ChangeColumnTypeProgressDialog extends Window implements
|
||||
ChangeColumnTypeProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ChangeColumnTypeSession changeColumnTypeSession;
|
||||
protected EventBus eventBus;
|
||||
protected ChangeColumnTypeProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
public ChangeColumnTypeProgressDialog(
|
||||
ChangeColumnTypeSession changeColumnTypeSession, EventBus eventBus) {
|
||||
this.changeColumnTypeSession = changeColumnTypeSession;
|
||||
this.eventBus = eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Change Column Type Progress");
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
trId = null;
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
FramedPanel panel = new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: "+trId.toString());
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok = new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
progressUpdater = new ChangeColumnTypeProgressUpdater();
|
||||
progressUpdater.addListener(new ChangeColumnTypeProgressBarUpdater(
|
||||
progressBar));
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: " + trId.toString());
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
this.trId = null;
|
||||
UtilsGXT3.alert("Error changing the column type", reason);
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
if(trId!=null){
|
||||
ChangeTableRequestEvent changeTableRequestEvent=
|
||||
new ChangeTableRequestEvent(ChangeTableRequestType.CHANGECOLUMNTYPE, trId,why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void updateInvocation() {
|
||||
if (trId != null) {
|
||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||
ChangeTableRequestType.CHANGECOLUMNTYPE, trId, why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void operationStopped(TRId trId, String reason, String details) {
|
||||
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
|
||||
+ ", " + details + "]");
|
||||
ok.setVisible(true);
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public class ChangeColumnTypeProgressUpdater extends Timer {
|
|||
|
||||
public void onFailure(Throwable caught) {
|
||||
cancel();
|
||||
|
||||
Log.error("Error retrieving the operation state",
|
||||
caught);
|
||||
String message = getStack(caught);
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.progress;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.DeleteColumnSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -19,125 +22,129 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class DeleteColumnProgressDialog extends Window implements DeleteColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected DeleteColumnSession deleteColumnSession;
|
||||
protected EventBus eventBus;
|
||||
protected DeleteColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
public DeleteColumnProgressDialog(DeleteColumnSession deleteColumnSession, EventBus eventBus) {
|
||||
this.deleteColumnSession=deleteColumnSession;
|
||||
this.eventBus=eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Delete Column Progress");
|
||||
|
||||
trId=null;
|
||||
|
||||
FramedPanel panel=new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok=new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar, new VerticalLayoutData(1,
|
||||
1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
|
||||
progressUpdater = new DeleteColumnProgressUpdater();
|
||||
progressUpdater.addListener(new DeleteColumnProgressBarUpdater(progressBar));
|
||||
public class DeleteColumnProgressDialog extends Window implements
|
||||
DeleteColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected DeleteColumnSession deleteColumnSession;
|
||||
protected EventBus eventBus;
|
||||
protected DeleteColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
public DeleteColumnProgressDialog(DeleteColumnSession deleteColumnSession,
|
||||
EventBus eventBus) {
|
||||
this.deleteColumnSession = deleteColumnSession;
|
||||
this.eventBus = eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Delete Column Progress");
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
trId = null;
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
FramedPanel panel = new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: "+trId.toString());
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok = new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
UtilsGXT3.alert("Error Deleting Column", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
if(trId!=null){
|
||||
ChangeTableRequestEvent changeTableRequestEvent=
|
||||
new ChangeTableRequestEvent(ChangeTableRequestType.DELETECOLUMN, trId,why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
});
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
progressUpdater = new DeleteColumnProgressUpdater();
|
||||
progressUpdater.addListener(new DeleteColumnProgressBarUpdater(
|
||||
progressBar));
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: " + trId.toString());
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLECURATION;
|
||||
this.trId = null;
|
||||
UtilsGXT3.alert("Error Deleting Column", reason);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void updateInvocation() {
|
||||
if (trId != null) {
|
||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||
ChangeTableRequestType.DELETECOLUMN, trId, why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId, String reason, String details) {
|
||||
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
|
||||
+ ", " + details + "]");
|
||||
ok.setVisible(true);
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.progress;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.LabelColumnSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -19,125 +22,130 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* LabelColumnProgressDialog is a Dialog that show progress of change the column label
|
||||
* LabelColumnProgressDialog is a Dialog that show progress of change the column
|
||||
* label
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class LabelColumnProgressDialog extends Window implements LabelColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected LabelColumnSession labelColumnSession;
|
||||
protected EventBus eventBus;
|
||||
protected LabelColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
public LabelColumnProgressDialog(LabelColumnSession labelColumnSession, EventBus eventBus) {
|
||||
this.labelColumnSession=labelColumnSession;
|
||||
this.eventBus=eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Change The Column Label Progress");
|
||||
|
||||
trId=null;
|
||||
|
||||
FramedPanel panel=new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok=new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar, new VerticalLayoutData(1,
|
||||
1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
|
||||
progressUpdater = new LabelColumnProgressUpdater();
|
||||
progressUpdater.addListener(new LabelColumnProgressBarUpdater(progressBar));
|
||||
public class LabelColumnProgressDialog extends Window implements
|
||||
LabelColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected LabelColumnSession labelColumnSession;
|
||||
protected EventBus eventBus;
|
||||
protected LabelColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
public LabelColumnProgressDialog(LabelColumnSession labelColumnSession,
|
||||
EventBus eventBus) {
|
||||
this.labelColumnSession = labelColumnSession;
|
||||
this.eventBus = eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Change The Column Label Progress");
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
trId = null;
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
FramedPanel panel = new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: "+trId.toString());
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok = new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
UtilsGXT3.alert("Error Changing The Column Label", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
if(trId!=null){
|
||||
ChangeTableRequestEvent changeTableRequestEvent=
|
||||
new ChangeTableRequestEvent(ChangeTableRequestType.CHANGECOLUMNLABEL, trId,why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
});
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
progressUpdater = new LabelColumnProgressUpdater();
|
||||
progressUpdater.addListener(new LabelColumnProgressBarUpdater(
|
||||
progressBar));
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: " + trId.toString());
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLECURATION;
|
||||
this.trId = null;
|
||||
UtilsGXT3.alert("Error Changing The Column Label", reason);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void updateInvocation() {
|
||||
if (trId != null) {
|
||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||
ChangeTableRequestType.CHANGECOLUMNLABEL, trId, why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void operationStopped(TRId trId, String reason, String details) {
|
||||
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
|
||||
+ ", " + details + "]");
|
||||
ok.setVisible(true);
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@ package org.gcube.portlets.user.td.columnwidget.client.progress;
|
|||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.batch.ReplaceBatchDialog;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -19,127 +22,132 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ReplaceBatchColumnProgressDialog is a Dialog that show progress of replace batch the column value
|
||||
* ReplaceBatchColumnProgressDialog is a Dialog that show progress of replace
|
||||
* batch the column value
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ReplaceBatchColumnProgressDialog extends Window implements ReplaceBatchColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ReplaceBatchDialog parent;
|
||||
protected EventBus eventBus;
|
||||
protected ReplaceBatchColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
public ReplaceBatchColumnProgressDialog(ReplaceBatchDialog parent, EventBus eventBus) {
|
||||
this.parent=parent;
|
||||
this.eventBus=eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Replace Batch Progress");
|
||||
|
||||
trId=null;
|
||||
|
||||
FramedPanel panel=new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok=new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar, new VerticalLayoutData(1,
|
||||
1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
|
||||
progressUpdater = new ReplaceBatchColumnProgressUpdater();
|
||||
progressUpdater.addListener(new ReplaceBatchColumnProgressBarUpdater(progressBar));
|
||||
public class ReplaceBatchColumnProgressDialog extends Window implements
|
||||
ReplaceBatchColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ReplaceBatchDialog parent;
|
||||
protected EventBus eventBus;
|
||||
protected ReplaceBatchColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
public ReplaceBatchColumnProgressDialog(ReplaceBatchDialog parent,
|
||||
EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
this.eventBus = eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Replace Batch Progress");
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
trId = null;
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
FramedPanel panel = new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: "+trId.toString());
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok = new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
UtilsGXT3.alert("Error Replacing The Column Value", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
if(trId!=null){
|
||||
ChangeTableRequestEvent changeTableRequestEvent=
|
||||
new ChangeTableRequestEvent(ChangeTableRequestType.COLUMNREPLACEBATCH, trId,why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
parent.hide();
|
||||
hide();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
});
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
progressUpdater = new ReplaceBatchColumnProgressUpdater();
|
||||
progressUpdater.addListener(new ReplaceBatchColumnProgressBarUpdater(
|
||||
progressBar));
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: " + trId.toString());
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLECURATION;
|
||||
this.trId = null;
|
||||
UtilsGXT3.alert("Error Replacing The Column Value", reason);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void updateInvocation() {
|
||||
if (trId != null) {
|
||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||
ChangeTableRequestType.COLUMNREPLACEBATCH, trId, why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
parent.hide();
|
||||
hide();
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId, String reason, String details) {
|
||||
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
|
||||
+ ", " + details + "]");
|
||||
ok.setVisible(true);
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@ package org.gcube.portlets.user.td.columnwidget.client.progress;
|
|||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.replace.ReplaceDialog;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -19,127 +22,132 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ReplaceColumnProgressDialog is a Dialog that show progress of replace the column value
|
||||
* ReplaceColumnProgressDialog is a Dialog that show progress of replace the
|
||||
* column value
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ReplaceColumnProgressDialog extends Window implements ReplaceColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ReplaceDialog parent;
|
||||
protected EventBus eventBus;
|
||||
protected ReplaceColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
public ReplaceColumnProgressDialog(ReplaceDialog replaceDialog, EventBus eventBus) {
|
||||
this.parent=replaceDialog;
|
||||
this.eventBus=eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Replace The Column Value Progress");
|
||||
|
||||
trId=null;
|
||||
|
||||
FramedPanel panel=new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok=new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
v.add(progressBar, new VerticalLayoutData(1,
|
||||
1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
|
||||
progressUpdater = new ReplaceColumnProgressUpdater();
|
||||
progressUpdater.addListener(new ReplaceColumnProgressBarUpdater(progressBar));
|
||||
public class ReplaceColumnProgressDialog extends Window implements
|
||||
ReplaceColumnProgressListener {
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
protected String WIDTH = "400px";
|
||||
protected String HEIGHT = "120px";
|
||||
protected ReplaceDialog parent;
|
||||
protected EventBus eventBus;
|
||||
protected ReplaceColumnProgressUpdater progressUpdater;
|
||||
protected TextButton ok;
|
||||
protected TRId trId;
|
||||
private ChangeTableWhy why;
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
public ReplaceColumnProgressDialog(ReplaceDialog replaceDialog,
|
||||
EventBus eventBus) {
|
||||
this.parent = replaceDialog;
|
||||
this.eventBus = eventBus;
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(true);
|
||||
setModal(true);
|
||||
setHeadingText("Replace The Column Value Progress");
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
trId = null;
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
FramedPanel panel = new FramedPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyBorder(false);
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: "+trId.toString());
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
|
||||
ok = new TextButton("OK");
|
||||
ok.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
updateInvocation();
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
UtilsGXT3.alert("Error Replacing The Column Value", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
if(trId!=null){
|
||||
ChangeTableRequestEvent changeTableRequestEvent=
|
||||
new ChangeTableRequestEvent(ChangeTableRequestType.COLUMNREPLACE, trId,why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
parent.hide();
|
||||
hide();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
});
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
panel.add(v);
|
||||
panel.addButton(ok);
|
||||
add(panel);
|
||||
|
||||
progressUpdater = new ReplaceColumnProgressUpdater();
|
||||
progressUpdater.addListener(new ReplaceColumnProgressBarUpdater(
|
||||
progressBar));
|
||||
|
||||
progressUpdater.addListener(this);
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
show();
|
||||
ok.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationUpdate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void operationComplete(TRId trId) {
|
||||
Log.debug("Operation Complete return: " + trId.toString());
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLEUPDATED;
|
||||
updateInvocation();
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
why=ChangeTableWhy.TABLECURATION;
|
||||
this.trId = null;
|
||||
UtilsGXT3.alert("Error Replacing The Column Value", reason);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void updateInvocation() {
|
||||
if (trId != null) {
|
||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||
ChangeTableRequestType.COLUMNREPLACE, trId, why);
|
||||
eventBus.fireEvent(changeTableRequestEvent);
|
||||
}
|
||||
parent.hide();
|
||||
hide();
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId, String reason, String details) {
|
||||
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
|
||||
+ ", " + details + "]");
|
||||
ok.setVisible(true);
|
||||
this.trId = trId;
|
||||
why = ChangeTableWhy.TABLECURATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationGeneratingView() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationValidate(float elaborated) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.replace;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSelectionDialog;
|
||||
|
@ -10,9 +9,12 @@ import org.gcube.portlets.user.td.columnwidget.client.progress.ReplaceColumnProg
|
|||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||
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.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnSession;
|
||||
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.CellData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
|
@ -58,10 +60,9 @@ public class ReplacePanel extends FramedPanel implements
|
|||
protected CellData cellData;
|
||||
protected ReplaceDialog parent;
|
||||
protected ColumnData column;
|
||||
|
||||
|
||||
|
||||
protected DimensionRow dimensionRow;
|
||||
|
||||
|
||||
protected ReplaceColumnSession replaceColumnSession;
|
||||
private ComboBox<DimensionRow> comboDimensionType;
|
||||
private FieldLabel comboDimensionTypeLabel;
|
||||
|
@ -80,7 +81,7 @@ public class ReplacePanel extends FramedPanel implements
|
|||
this.cellData = cellData;
|
||||
this.trId = trId;
|
||||
this.eventBus = eventBus;
|
||||
dimensionRow=null;
|
||||
dimensionRow = null;
|
||||
Log.debug("ReplacePanel:[" + trId + ", CellData:" + cellData + "]");
|
||||
initPanel();
|
||||
retrieveColumn();
|
||||
|
@ -99,21 +100,26 @@ public class ReplacePanel extends FramedPanel implements
|
|||
new AsyncCallback<ColumnData>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("Error retrieving column: "
|
||||
+ caught.getMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
caught.getMessage());
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Error retrieving column: "
|
||||
+ caught.getMessage());
|
||||
UtilsGXT3.alert("Error retrieving column",
|
||||
caught.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(ColumnData result) {
|
||||
Log.debug("Retrived column: " + result);
|
||||
column = result;
|
||||
|
||||
if (result.isViewColumn() ) {
|
||||
isDimension=true;
|
||||
|
||||
if (result.isViewColumn()) {
|
||||
isDimension = true;
|
||||
createForDimension();
|
||||
} else {
|
||||
isDimension=false;
|
||||
isDimension = false;
|
||||
create();
|
||||
}
|
||||
}
|
||||
|
@ -123,23 +129,23 @@ public class ReplacePanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
protected void create() {
|
||||
if(column.getDataTypeName().compareTo("Date") == 0){
|
||||
if (column.getDataTypeName().compareTo("Date") == 0) {
|
||||
valueDate = new DateField();
|
||||
Date d = null;
|
||||
DateTimeFormat sdf= DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
Log.debug("Date value: "+cellData.getValue());
|
||||
DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
Log.debug("Date value: " + cellData.getValue());
|
||||
try {
|
||||
d = sdf.parse(cellData.getValue());
|
||||
} catch (Exception e) {
|
||||
Log.error("Unparseable using " + sdf);
|
||||
}
|
||||
if(d!=null){
|
||||
if (d != null) {
|
||||
valueDate.setValue(d);
|
||||
}
|
||||
valueDate.setReadOnly(true);
|
||||
|
||||
replaceValueDate = new DateField();
|
||||
|
||||
|
||||
} else {
|
||||
value = new TextField();
|
||||
value.setValue(cellData.getValue());
|
||||
|
@ -147,8 +153,7 @@ public class ReplacePanel extends FramedPanel implements
|
|||
|
||||
replaceValue = new TextField();
|
||||
}
|
||||
|
||||
|
||||
|
||||
btnApply = new TextButton("Replace");
|
||||
btnApply.setIcon(ResourceBundle.INSTANCE.replace());
|
||||
btnApply.setIconAlign(IconAlign.RIGHT);
|
||||
|
@ -183,14 +188,15 @@ public class ReplacePanel extends FramedPanel implements
|
|||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
if(column.getDataTypeName().compareTo("Date") == 0){
|
||||
v.add(new FieldLabel(valueDate, "Value"), new VerticalLayoutData(1, -1));
|
||||
v.add(new FieldLabel(replaceValueDate, "Replace"), new VerticalLayoutData(
|
||||
1, -1));
|
||||
if (column.getDataTypeName().compareTo("Date") == 0) {
|
||||
v.add(new FieldLabel(valueDate, "Value"), new VerticalLayoutData(1,
|
||||
-1));
|
||||
v.add(new FieldLabel(replaceValueDate, "Replace"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
} else {
|
||||
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
|
||||
v.add(new FieldLabel(replaceValue, "Replace"), new VerticalLayoutData(
|
||||
1, -1));
|
||||
v.add(new FieldLabel(replaceValue, "Replace"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
}
|
||||
v.add(flowButton, new VerticalLayoutData(-1, 36,
|
||||
new Margins(5, 2, 5, 2)));
|
||||
|
@ -268,17 +274,17 @@ public class ReplacePanel extends FramedPanel implements
|
|||
|
||||
protected void replaceValue() {
|
||||
String rValue;
|
||||
|
||||
if(column.getDataTypeName().compareTo("Date") == 0){
|
||||
Date d=replaceValueDate.getCurrentValue();
|
||||
if(d==null){
|
||||
|
||||
if (column.getDataTypeName().compareTo("Date") == 0) {
|
||||
Date d = replaceValueDate.getCurrentValue();
|
||||
if (d == null) {
|
||||
UtilsGXT3.alert("Attention", "Insert a valid replace value");
|
||||
return;
|
||||
} else{
|
||||
} else {
|
||||
Long data = d.getTime();
|
||||
rValue = data.toString();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
rValue = replaceValue.getCurrentValue();
|
||||
if (rValue == null || rValue.isEmpty()) {
|
||||
|
@ -288,17 +294,17 @@ public class ReplacePanel extends FramedPanel implements
|
|||
String checkedValue = checkTypeData(rValue);
|
||||
if (checkedValue == null || checkedValue.isEmpty()) {
|
||||
UtilsGXT3.alert("Attention",
|
||||
"Insert a valid replace value for this column");
|
||||
"Insert a valid replace value for this column");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
callReplaceValue(rValue);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void replaceValueForDimension() {
|
||||
Log.debug("Current Dimension Row in combo: "+dimensionRow);
|
||||
Log.debug("Current Dimension Row in combo: " + dimensionRow);
|
||||
if (dimensionRow == null) {
|
||||
UtilsGXT3.alert("Attention", "Select a valid value");
|
||||
} else {
|
||||
|
@ -316,7 +322,7 @@ public class ReplacePanel extends FramedPanel implements
|
|||
} else {
|
||||
if (column.getDataTypeName().compareTo("Date") == 0) {
|
||||
Date d = null;
|
||||
DateTimeFormat sdf= DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
try {
|
||||
d = sdf.parse(value.getValue());
|
||||
} catch (Exception e) {
|
||||
|
@ -360,7 +366,7 @@ public class ReplacePanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
protected void callReplaceValue(String rValue) {
|
||||
Log.debug("callRepalceValue is Dimension: "+isDimension);
|
||||
Log.debug("callRepalceValue is Dimension: " + isDimension);
|
||||
if (isDimension) {
|
||||
replaceColumnSession = new ReplaceColumnSession(
|
||||
value.getCurrentValue(), rValue, trId, column,
|
||||
|
@ -384,13 +390,18 @@ public class ReplacePanel extends FramedPanel implements
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("Error submitting replace column value: "
|
||||
+ caught.getMessage() + " " + caught.getCause());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3.alert(
|
||||
"Error submitting replace column value",
|
||||
caught.getMessage());
|
||||
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Error submitting replace column value: "
|
||||
+ caught.getMessage() + " "
|
||||
+ caught.getCause());
|
||||
caught.printStackTrace();
|
||||
UtilsGXT3.alert(
|
||||
"Error submitting replace column value",
|
||||
caught.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -434,7 +445,7 @@ public class ReplacePanel extends FramedPanel implements
|
|||
@Override
|
||||
public void selectedDimensionRow(DimensionRow dimRow) {
|
||||
Log.debug("Selected dimension row: " + dimRow);
|
||||
dimensionRow=dimRow;
|
||||
dimensionRow = dimRow;
|
||||
comboDimensionType.setValue(dimRow);
|
||||
}
|
||||
|
||||
|
@ -442,15 +453,15 @@ public class ReplacePanel extends FramedPanel implements
|
|||
public void abortedDimensionRowSelection() {
|
||||
Log.debug("Aborted");
|
||||
comboDimensionType.setValue(null);
|
||||
dimensionRow=null;
|
||||
dimensionRow = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failedDimensionRowSelection(String reason, String detail) {
|
||||
Log.debug("Failed: "+reason+" "+detail);
|
||||
Log.debug("Failed: " + reason + " " + detail);
|
||||
comboDimensionType.setValue(null);
|
||||
dimensionRow=null;
|
||||
dimensionRow = null;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue