Added SessionExpiredShow

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@95793 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-16 14:21:10 +00:00 committed by Giancarlo Panichi
parent 5ec8a3d7ac
commit ed0e9fdef3
14 changed files with 890 additions and 783 deletions

View File

@ -1,8 +1,7 @@
package org.gcube.portlets.user.td.tablewidget.client;
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.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.ChangeTableTypeProgressDialog;
@ -10,6 +9,8 @@ import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeElement;
import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeProperties;
import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeStore;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -29,11 +30,10 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
/**
*
* @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 ChangeTableTypePanel extends FramedPanel {
@ -51,8 +51,6 @@ public class ChangeTableTypePanel extends FramedPanel {
protected ComboBox<TableTypeElement> comboTableType;
protected TextButton change;
public ChangeTableTypePanel(TRId trId, EventBus eventBus) {
super();
this.trId = trId;
@ -67,9 +65,9 @@ public class ChangeTableTypePanel extends FramedPanel {
setHeaderVisible(false);
setBodyBorder(false);
TableTypeProperties props = GWT.create(TableTypeProperties.class);
ListStore<TableTypeElement> storeTableType = new ListStore<TableTypeElement>(props.id());
ListStore<TableTypeElement> storeTableType = new ListStore<TableTypeElement>(
props.id());
storeTableType.addAll(TableTypeStore.getTableTypes());
@ -80,14 +78,12 @@ public class ChangeTableTypePanel extends FramedPanel {
Log.trace("ComboTableType created");
comboTableType.setEmptyText("Select a Table Type...");
comboTableType.setItemId("ComboTableType");
comboTableType.setWidth("200px");
comboTableType.setEditable(false);
comboTableType.setTriggerAction(TriggerAction.ALL);
change = new TextButton("Change");
change.addSelectHandler(new SelectHandler() {
@ -101,10 +97,10 @@ public class ChangeTableTypePanel extends FramedPanel {
vl.setScrollMode(ScrollMode.AUTO);
vl.setAdjustForScroll(true);
vl.add(new FieldLabel(comboTableType, "Table Type"), new VerticalLayoutData(1,
-1));
vl.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
vl.add(new FieldLabel(comboTableType, "Table Type"),
new VerticalLayoutData(1, -1));
vl.add(change,
new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
add(vl);
show();
@ -115,7 +111,8 @@ public class ChangeTableTypePanel extends FramedPanel {
protected void onChangeTableType() {
TableTypeElement tableTypeElement = comboTableType.getCurrentValue();
if (tableTypeElement != null) {
changeTableTypeSession=new ChangeTableTypeSession(trId,tableTypeElement.getTableType());
changeTableTypeSession = new ChangeTableTypeSession(trId,
tableTypeElement.getTableType());
callChangeTableType();
} else {
UtilsGXT3.alert("Attention", "Select a table type!");
@ -123,41 +120,52 @@ public class ChangeTableTypePanel extends FramedPanel {
}
private void callChangeTableType() {
TDGWTServiceAsync.INSTANCE.startChangeTableType(
changeTableTypeSession, new AsyncCallback<Void>() {
TDGWTServiceAsync.INSTANCE.startChangeTableType(changeTableTypeSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Change The Table Type Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Changing The Table Type",
UtilsGXT3
.alert("Error Changing The Table Type",
"Error in invocation of Change Table Type operation!");
}
}
public void onSuccess(Void result) {
changeTableTypeProgressDialog= new ChangeTableTypeProgressDialog(changeTableTypeSession, eventBus);
changeTableTypeProgressDialog = new ChangeTableTypeProgressDialog(
changeTableTypeSession, eventBus);
}
});
}
protected void setCurrentType() {
TableTypeElement tElement=TableTypeStore.getTableTypeElement(table.getTypeName());
TableTypeElement tElement = TableTypeStore.getTableTypeElement(table
.getTypeName());
comboTableType.setValue(tElement);
}
private void load() {
TDGWTServiceAsync.INSTANCE.getTable(trId,
new AsyncCallback<TableData>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving table: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving table",caught.getMessage());
UtilsGXT3.alert("Error retrieving table",
caught.getMessage());
}
}
public void onSuccess(TableData result) {
@ -171,13 +179,9 @@ public class ChangeTableTypePanel extends FramedPanel {
}
public void update(TRId trId) {
this.trId = trId;
load();
}
}

View File

@ -1,11 +1,14 @@
package org.gcube.portlets.user.td.tablewidget.client;
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.clone.CloneTabularResourceSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -34,24 +37,29 @@ public class CloneTabularResource {
cloneTabularResourceSession, new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Clone Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Cloning Tabular Resource",
"Error in clone operation!");
}
}
public void onSuccess(TRId result) {
Log.info("TR Clone:" + result);
final ChangeTableRequestEvent event=new ChangeTableRequestEvent(ChangeTableRequestType.CLONETABULARRESOURCE,result,ChangeTableWhy.TABLEUPDATED);
final ChangeTableRequestEvent event = new ChangeTableRequestEvent(
ChangeTableRequestType.CLONETABULARRESOURCE,
result, ChangeTableWhy.TABLEUPDATED);
eventBus.fireEvent(event);
UtilsGXT3.info("Clone", "Clone Tabular Resource Succed");
UtilsGXT3
.info("Clone", "Clone Tabular Resource Succed");
}
});
}
}

View File

@ -1,9 +1,12 @@
package org.gcube.portlets.user.td.tablewidget.client.history;
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.history.RollBackSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.RollBackProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -26,11 +29,15 @@ public class HistoryDiscard {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving trId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {
@ -47,10 +54,15 @@ public class HistoryDiscard {
new AsyncCallback<RollBackSession>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error in discard: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in discard", "Error in discard");
UtilsGXT3.alert("Error in discard",
"Error in discard");
}
}
public void onSuccess(RollBackSession result) {

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
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.history.OpHistory;
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
@ -12,6 +13,8 @@ import org.gcube.portlets.user.td.tablewidget.client.progress.RollBackProgressDi
import org.gcube.portlets.user.td.tablewidget.client.properties.OpHistoryProperties;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -120,8 +123,8 @@ public class HistoryPanel extends FramedPanel {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<span title='"+value+"'>"
+ value + "</span>");
sb.appendHtmlConstant("<span title='" + value + "'>" + value
+ "</span>");
}
@ -133,8 +136,6 @@ public class HistoryPanel extends FramedPanel {
ColumnConfig<OpHistory, String> rollBackColumn = new ColumnConfig<OpHistory, String>(
props.date(), 40, "Undo");
ActionButtonCellNoFirst button = new ActionButtonCellNoFirst();
button.setIcon(ResourceBundle.INSTANCE.undo());
button.setTitle("Undo");
@ -151,8 +152,6 @@ public class HistoryPanel extends FramedPanel {
rollBackColumn.setCell(button);
List<ColumnConfig<OpHistory, ?>> l = new ArrayList<ColumnConfig<OpHistory, ?>>();
l.add(expander);
l.add(nameCol);
@ -233,11 +232,15 @@ public class HistoryPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error in rollback: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in rollback",
"Error in rollback");
}
}
public void onSuccess(Void result) {
@ -262,10 +265,15 @@ public class HistoryPanel extends FramedPanel {
new AsyncCallback<ArrayList<OpHistory>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error Retrieving History: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving history",
"Error retrieving history");
}
callback.onFailure(caught);
}
@ -288,11 +296,15 @@ public class HistoryPanel extends FramedPanel {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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,16 +22,16 @@ 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 ChangeTableTypeProgressDialog extends Window implements ChangeTableTypeProgressListener {
public class ChangeTableTypeProgressDialog extends Window implements
ChangeTableTypeProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
@ -39,7 +42,8 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
protected TRId trId;
private ChangeTableWhy why;
public ChangeTableTypeProgressDialog(ChangeTableTypeSession changeTableTypeSession, EventBus eventBus) {
public ChangeTableTypeProgressDialog(
ChangeTableTypeSession changeTableTypeSession, EventBus eventBus) {
this.changeTableTypeSession = changeTableTypeSession;
this.eventBus = eventBus;
setWidth(WIDTH);
@ -57,7 +61,6 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
@ -69,16 +72,16 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new ChangeTableTypeProgressUpdater();
progressUpdater.addListener(new ChangeTableTypeProgressBarUpdater(progressBar));
progressUpdater.addListener(new ChangeTableTypeProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
@ -106,16 +109,20 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
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;
UtilsGXT3.alert("Error Changing The Table Type", reason);
}
}
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.CHANGETABLETYPE, trId,why);
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.CHANGETABLETYPE, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
@ -123,7 +130,8 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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,16 +22,16 @@ 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 DeleteRowsProgressDialog extends Window implements DeleteRowsProgressListener {
public class DeleteRowsProgressDialog extends Window implements
DeleteRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
@ -39,7 +42,8 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
protected TRId trId;
private ChangeTableWhy why;
public DeleteRowsProgressDialog(DeleteRowsSession deleteRowsSession, EventBus eventBus) {
public DeleteRowsProgressDialog(DeleteRowsSession deleteRowsSession,
EventBus eventBus) {
this.deleteRowsSession = deleteRowsSession;
this.eventBus = eventBus;
setWidth(WIDTH);
@ -57,7 +61,6 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
@ -69,16 +72,16 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DeleteRowsProgressUpdater();
progressUpdater.addListener(new DeleteRowsProgressBarUpdater(progressBar));
progressUpdater.addListener(new DeleteRowsProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
@ -107,16 +110,20 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
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;
UtilsGXT3.alert("Error Deleting Rows", reason);
}
}
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DELETEROWS, trId, why);
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DELETEROWS, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
@ -124,7 +131,8 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DuplicatesSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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,16 +22,16 @@ 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 DuplicatesRowsProgressDialog extends Window implements DuplicatesRowsProgressListener {
public class DuplicatesRowsProgressDialog extends Window implements
DuplicatesRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
@ -39,7 +42,8 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
protected TRId trId;
private ChangeTableWhy why;
public DuplicatesRowsProgressDialog(DuplicatesSession duplicatesSession, EventBus eventBus) {
public DuplicatesRowsProgressDialog(DuplicatesSession duplicatesSession,
EventBus eventBus) {
this.duplicatesSession = duplicatesSession;
this.eventBus = eventBus;
setWidth(WIDTH);
@ -57,7 +61,6 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
@ -69,16 +72,16 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DuplicatesRowsProgressUpdater();
progressUpdater.addListener(new DuplicatesRowsProgressBarUpdater(progressBar));
progressUpdater.addListener(new DuplicatesRowsProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
@ -106,15 +109,20 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
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;
UtilsGXT3.alert("Error Deleting Rows", reason);
}
}
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DUPLICATES, trId,why);
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DUPLICATES, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
@ -122,7 +130,8 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.tablewidget.client.rows.EditRowPanel;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -22,11 +25,12 @@ 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 EditRowProgressDialog extends Window implements EditRowProgressListener {
public class EditRowProgressDialog extends Window implements
EditRowProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
@ -55,7 +59,6 @@ public class EditRowProgressDialog extends Window implements EditRowProgressList
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
@ -67,14 +70,13 @@ public class EditRowProgressDialog extends Window implements EditRowProgressList
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new EditRowProgressUpdater();
progressUpdater.addListener(new EditRowProgressBarUpdater(progressBar));
@ -104,16 +106,20 @@ public class EditRowProgressDialog extends Window implements EditRowProgressList
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;
UtilsGXT3.alert("Error", reason);
}
}
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.EDITROW, trId,why);
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.EDITROW, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
parent.close();
@ -122,7 +128,8 @@ public class EditRowProgressDialog extends Window implements EditRowProgressList
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -22,11 +25,12 @@ 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 RollBackProgressDialog extends Window implements RollBackProgressListener {
public class RollBackProgressDialog extends Window implements
RollBackProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
@ -37,7 +41,8 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
protected TRId trId;
private ChangeTableWhy why;
public RollBackProgressDialog(RollBackSession rollBackSession, EventBus eventBus) {
public RollBackProgressDialog(RollBackSession rollBackSession,
EventBus eventBus) {
this.rollBackSession = rollBackSession;
this.eventBus = eventBus;
setWidth(WIDTH);
@ -55,7 +60,6 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
@ -67,16 +71,16 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new RollBackProgressUpdater();
progressUpdater.addListener(new RollBackProgressBarUpdater(progressBar));
progressUpdater
.addListener(new RollBackProgressBarUpdater(progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
@ -104,16 +108,20 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
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;
UtilsGXT3.alert("Error in RollBack", reason);
}
}
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DELETEROWS, trId,why);
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DELETEROWS, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
@ -121,7 +129,8 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;

View File

@ -3,9 +3,12 @@ package org.gcube.portlets.user.td.tablewidget.client.rows;
import java.util.ArrayList;
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.rows.DeleteRowsSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.DeleteRowsProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -37,25 +40,29 @@ public class DeleteRows {
}
protected void onDelete() {
TDGWTServiceAsync.INSTANCE.startDeleteRows(
deleteRowsSession, new AsyncCallback<Void>() {
TDGWTServiceAsync.INSTANCE.startDeleteRows(deleteRowsSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Delete Rows Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Delete Rows operation!");
}
}
public void onSuccess(Void result) {
deleteRowsProgressDialog= new DeleteRowsProgressDialog(deleteRowsSession, eventBus);
deleteRowsProgressDialog = new DeleteRowsProgressDialog(
deleteRowsSession, eventBus);
}
});
}
}

View File

@ -4,11 +4,14 @@ import java.util.ArrayList;
import java.util.List;
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.rows.DuplicatesSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.DuplicatesRowsProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.properties.ColumnDataProperties;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -147,20 +150,18 @@ public class DuplicatesRowsPanel extends FramedPanel {
};
validatesButton.addSelectHandler(validatesHandler);
FieldLabel columnsLabel = new FieldLabel(null, "Columns");
columnsLabel.getElement().applyStyles("font-weight:bold");
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
hBox.add(validatesButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
hBox.add(deleteButton, 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)));
}
@ -182,10 +183,15 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
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);
}
@ -203,8 +209,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
protected void onDeleteDuplicate() {
ArrayList<ColumnData> col = getSelectedItems();
if (col == null || col.size() < 1) {
UtilsGXT3.alert("Attention",
"Attention no column selected!");
UtilsGXT3.alert("Attention", "Attention no column selected!");
return;
}
duplicatesSession = new DuplicatesSession(trId, col,
@ -214,11 +219,16 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Delete Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Delete Duplicates operation!");
}
}
public void onSuccess(Void result) {
@ -230,12 +240,10 @@ public class DuplicatesRowsPanel extends FramedPanel {
}
protected void onValidatesDuplicate() {
ArrayList<ColumnData> col = getSelectedItems();
if (col == null || col.size() < 1) {
UtilsGXT3.alert("Attention",
"Attention no column selected!");
UtilsGXT3.alert("Attention", "Attention no column selected!");
return;
}
duplicatesSession = new DuplicatesSession(trId, col,
@ -245,11 +253,16 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Validates Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Validates Duplicates operation!");
}
}
public void onSuccess(Void result) {
@ -261,7 +274,4 @@ public class DuplicatesRowsPanel extends FramedPanel {
}
}

View File

@ -15,6 +15,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.EditRowSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.EditRowProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
@ -195,11 +197,15 @@ public class EditRowPanel extends FramedPanel {
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
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");
}
}
public void onSuccess(ArrayList<ColumnData> result) {
@ -588,18 +594,17 @@ public class EditRowPanel extends FramedPanel {
}
}
protected void callEditRow(EditRowSession editRowSession) {
final EditRowPanel panel = this;
TDGWTServiceAsync.INSTANCE.startEditRow(editRowSession,new AsyncCallback<Void>() {
TDGWTServiceAsync.INSTANCE.startEditRow(editRowSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.debug("EditRow: "
+ caught.getLocalizedMessage());
Log.debug("EditRow: " + caught.getLocalizedMessage());
if (caught instanceof TDGWTSessionExpiredException) {
UtilsGXT3.alert("Attention",caught.getLocalizedMessage());
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
UtilsGXT3.alert("Error",
"Error in operation invocation!");
@ -611,7 +616,6 @@ public class EditRowPanel extends FramedPanel {
panel, eventBus);
}
});
}

View File

@ -4,12 +4,15 @@ import java.util.ArrayList;
import java.util.List;
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.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.Validations;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabValidationsMetadata;
import org.gcube.portlets.user.td.tablewidget.client.properties.ValidationsProperties;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
@ -63,7 +66,6 @@ public class ValidationsTablePanel extends FramedPanel {
}
public ValidationsTablePanel(TRId trId, EventBus eventBus) {
super();
this.trId = trId;
@ -95,14 +97,13 @@ public class ValidationsTablePanel extends FramedPanel {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<span title='"+value+"'>"
+ value + "</span>");
sb.appendHtmlConstant("<span title='" + value + "'>" + value
+ "</span>");
}
});
ColumnConfig<Validations, Boolean> validCol = new ColumnConfig<Validations, Boolean>(
props.valid(), 28, "Valid");
validCol.setCell(new AbstractCell<Boolean>() {
@ -176,7 +177,6 @@ public class ValidationsTablePanel extends FramedPanel {
grid.getView().setAutoExpandColumn(descriptionCol);
grid.getView().setEmptyText("No validation");
add(grid, new MarginData(0));
onResize();
@ -190,11 +190,16 @@ public class ValidationsTablePanel extends FramedPanel {
new AsyncCallback<TabValidationsMetadata>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
}
callback.onFailure(caught);
}
@ -218,8 +223,6 @@ public class ValidationsTablePanel extends FramedPanel {
}
public void update() {
retrieveCurrentTR();
loader.load();
@ -230,16 +233,19 @@ public class ValidationsTablePanel extends FramedPanel {
loader.load();
}
protected void retrieveCurrentTR() {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {
@ -254,5 +260,4 @@ public class ValidationsTablePanel extends FramedPanel {
});
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
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.task.ValidationsTasksMetadata;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
@ -11,6 +12,8 @@ import org.gcube.portlets.user.td.tablewidget.client.validation.tree.BaseDto;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.FolderDto;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.TreeDataGenerator;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.ValidationDto;
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.sencha.gxt.widget.core.client.event.CollapseItemEvent.CollapseItemHandler;
import com.allen_sauer.gwt.log.client.Log;
@ -214,7 +217,6 @@ public class ValidationsTasksPanel extends FramedPanel {
tree.setColumnResize(true);
tree.getView().setAutoExpandColumn(cc1);
IconProvider<BaseDto> iconProvider = new IconProvider<BaseDto>() {
@Override
@ -257,7 +259,6 @@ public class ValidationsTasksPanel extends FramedPanel {
}
});
ToolBar toolBar = new ToolBar();
TextButton btnExpandAll = new TextButton();
@ -274,7 +275,6 @@ public class ValidationsTasksPanel extends FramedPanel {
});
toolBar.add(btnExpandAll);
TextButton btnCollapseAll = new TextButton();
// btnReload.setText("Expand All");
btnCollapseAll.setIcon(ResourceBundle.INSTANCE.expandAll12());
@ -289,15 +289,11 @@ public class ValidationsTasksPanel extends FramedPanel {
});
toolBar.add(btnCollapseAll);
con.add(toolBar, new VerticalLayoutData(1, -1));
con.add(tree, new VerticalLayoutData(1, -1));
add(con, new MarginData(0));
}
protected void retrieveValidations() {
@ -306,12 +302,16 @@ public class ValidationsTasksPanel extends FramedPanel {
new AsyncCallback<ValidationsTasksMetadata>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
}
}
public void onSuccess(ValidationsTasksMetadata result) {
@ -338,11 +338,15 @@ public class ValidationsTasksPanel extends FramedPanel {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {