Fixed Final and Lock error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@100236 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-09-26 16:15:38 +00:00 committed by Giancarlo Panichi
parent a933413393
commit 2871b486f7
7 changed files with 160 additions and 188 deletions

View File

@ -4,8 +4,8 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping;
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
import org.gcube.portlets.user.td.unionwizardwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;

View File

@ -4,18 +4,19 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; 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.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping;
import org.gcube.portlets.user.td.unionwizardwidget.client.custom.IconButton; import org.gcube.portlets.user.td.unionwizardwidget.client.custom.IconButton;
import org.gcube.portlets.user.td.unionwizardwidget.client.properties.ColumnDataProperties; import org.gcube.portlets.user.td.unionwizardwidget.client.properties.ColumnDataProperties;
import org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle; import org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle;
import org.gcube.portlets.user.td.unionwizardwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; 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.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle; import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
@ -158,11 +159,18 @@ public class ColumnMappingPanel extends ContentPanel {
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
Log.debug("Error retrieving source columns: " if (caught instanceof TDGWTIsLockedException) {
+ caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
UtilsGXT3 UtilsGXT3.alert("Error Locked",
.alert("Error retrieving source columns", caught.getLocalizedMessage());
"Error retrieving source columns on server!");
} else {
Log.debug("Error retrieving source columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving source columns",
"Error retrieving source columns on server!");
}
} }
} }
@ -189,11 +197,18 @@ public class ColumnMappingPanel extends ContentPanel {
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
Log.debug("Error retrieving union columns: " if (caught instanceof TDGWTIsLockedException) {
+ caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
UtilsGXT3 UtilsGXT3.alert("Error Locked",
.alert("Error retrieving union columns", caught.getLocalizedMessage());
"Error retrieving union columns on server!");
} else {
Log.debug("Error retrieving union columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving union columns",
"Error retrieving union columns on server!");
}
} }
} }
@ -321,8 +336,9 @@ public class ColumnMappingPanel extends ContentPanel {
.toString()) == 0)) { .toString()) == 0)) {
storeComboUnionColumn.add(col); storeComboUnionColumn.add(col);
} else { } else {
if (col.getDataTypeName().compareTo(selectedSourceColumn if (col.getDataTypeName().compareTo(
.getDataTypeName())==0) { selectedSourceColumn
.getDataTypeName()) == 0) {
storeComboUnionColumn.add(col); storeComboUnionColumn.add(col);
} else { } else {
@ -462,8 +478,9 @@ public class ColumnMappingPanel extends ContentPanel {
.toString()) == 0)) { .toString()) == 0)) {
storeComboUnionColumn.add(col); storeComboUnionColumn.add(col);
} else { } else {
if (col.getDataTypeName().compareTo(selectedSourceColumn if (col.getDataTypeName().compareTo(
.getDataTypeName())==0) { selectedSourceColumn
.getDataTypeName()) == 0) {
storeComboUnionColumn.add(col); storeComboUnionColumn.add(col);
} else { } else {

View File

@ -1,14 +1,15 @@
package org.gcube.portlets.user.td.unionwizardwidget.client; package org.gcube.portlets.user.td.unionwizardwidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; 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.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
import org.gcube.portlets.user.td.unionwizardwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; 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.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.event.logical.shared.SelectionEvent; import com.google.gwt.event.logical.shared.SelectionEvent;
@ -33,13 +34,15 @@ public class TabResourcesSelectionCard extends WizardCard {
this.unionSession = unionSession; this.unionSession = unionSession;
thisCard = this; thisCard = this;
tabResourcesSelectionPanel = new TabResourcesSelectionPanel(thisCard,res); tabResourcesSelectionPanel = new TabResourcesSelectionPanel(thisCard,
res);
tabResourcesSelectionPanel tabResourcesSelectionPanel
.addSelectionHandler(new SelectionHandler<TabResource>() { .addSelectionHandler(new SelectionHandler<TabResource>() {
public void onSelection(SelectionEvent<TabResource> event) { public void onSelection(SelectionEvent<TabResource> event) {
unionSession.setUnionTabularResource(tabResourcesSelectionPanel unionSession
.setUnionTabularResource(tabResourcesSelectionPanel
.getSelectedItem()); .getSelectedItem());
getWizardWindow().setEnableNextButton(true); getWizardWindow().setEnableNextButton(true);
} }
@ -58,7 +61,7 @@ public class TabResourcesSelectionCard extends WizardCard {
public void execute() { public void execute() {
Log.debug("TabResourcesSelectionCard Call sayNextCard"); Log.debug("TabResourcesSelectionCard Call sayNextCard");
retrieveLastTable(); retrieveLastTable();
} }
}; };
@ -80,17 +83,13 @@ public class TabResourcesSelectionCard extends WizardCard {
getWizardWindow().setPreviousButtonCommand(sayPreviousCard); getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(false); getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(true); getWizardWindow().setEnableBackButton(true);
} }
protected void retrieveLastTable() { protected void retrieveLastTable() {
getWizardWindow().setEnableNextButton(false); getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(false); getWizardWindow().setEnableBackButton(false);
TDGWTServiceAsync.INSTANCE.getLastTable(unionSession TDGWTServiceAsync.INSTANCE.getLastTable(unionSession
.getUnionTabularResource().getTrId(), .getUnionTabularResource().getTrId(),
new AsyncCallback<TableData>() { new AsyncCallback<TableData>() {
@ -130,7 +129,7 @@ public class TabResourcesSelectionCard extends WizardCard {
if (mb.getHideButton() == mb.getButtonById(PredefinedButton.YES if (mb.getHideButton() == mb.getButtonById(PredefinedButton.YES
.name())) { .name())) {
callDeleteLastTable(); callDeleteLastTable();
} else if (mb.getHideButton() == mb } else if (mb.getHideButton() == mb
.getButtonById(PredefinedButton.NO.name())) { .getButtonById(PredefinedButton.NO.name())) {
getWizardWindow().setEnableNextButton(true); getWizardWindow().setEnableNextButton(true);
@ -142,28 +141,49 @@ public class TabResourcesSelectionCard extends WizardCard {
mb.show(); mb.show();
} }
protected void callDeleteLastTable(){ protected void callDeleteLastTable() {
Log.debug("Delete TR:" + unionSession.getUnionTabularResource() Log.debug("Delete TR:"
.getTrId()); + unionSession.getUnionTabularResource().getTrId());
TDGWTServiceAsync.INSTANCE.removeTabularResource(unionSession.getUnionTabularResource() TDGWTServiceAsync.INSTANCE.removeTabularResource(unionSession
.getTrId(), .getUnionTabularResource().getTrId(),
new AsyncCallback<Void>() { new AsyncCallback<Void>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
AlertMessageBox d = new AlertMessageBox("Error", if (caught instanceof TDGWTSessionExpiredException) {
"Error on delete TabResource: " getEventBus()
+ caught.getLocalizedMessage()); .fireEvent(
d.addHideHandler(new HideHandler() { new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
public void onHide(HideEvent event) { } else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
getWizardWindow().setEnableNextButton(true); getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(true); getWizardWindow().setEnableBackButton(true);
} else {
AlertMessageBox d = new AlertMessageBox(
"Error",
"Error on delete TabResource: "
+ caught.getLocalizedMessage());
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
getWizardWindow().setEnableNextButton(
true);
getWizardWindow().setEnableBackButton(
true);
}
});
d.show();
} }
}); }
d.show();
} }
public void onSuccess(Void result) { public void onSuccess(Void result) {
@ -174,7 +194,6 @@ public class TabResourcesSelectionCard extends WizardCard {
}); });
} }
protected void updateConnectedTRInfo(TableData table) { protected void updateConnectedTRInfo(TableData table) {
TabResource tabResource = unionSession.getUnionTabularResource(); TabResource tabResource = unionSession.getUnionTabularResource();
@ -184,45 +203,52 @@ public class TabResourcesSelectionCard extends WizardCard {
retriveCurrentTabularResourceInfo(); retriveCurrentTabularResourceInfo();
} }
protected void retriveCurrentTabularResourceInfo() {
TDGWTServiceAsync.INSTANCE.getTabResourceInformation(
unionSession.getTrId(), new AsyncCallback<TabResource>() {
public void onSuccess(TabResource result) {
protected void retriveCurrentTabularResourceInfo(){ Log.info("Retrived TR: " + result.getTrId());
TDGWTServiceAsync.INSTANCE unionSession.setCurrentTabularResource(result);
.getTabResourceInformation(unionSession.getTrId(), new AsyncCallback<TabResource>() { goNext();
}
public void onSuccess(TabResource result) { public void onFailure(Throwable caught) {
Log.info("Retrived TR: " + result.getTrId()); if (caught instanceof TDGWTSessionExpiredException) {
unionSession.setCurrentTabularResource(result); getEventBus()
goNext(); .fireEvent(
} new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(true);
} else {
UtilsGXT3
.alert("Error",
"Error retrienving information on current tabular resource: ");
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(true);
}
}
}
public void onFailure(Throwable caught) { });
if (caught instanceof TDGWTSessionExpiredException) {
getEventBus().fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
UtilsGXT3.alert("Error",
"Error retrienving information on current tabular resource: ");
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(true);
}
}
});
} }
protected void goNext() { protected void goNext() {
try { try {
Log.info("NextCard ColumnMappingCard"); Log.info("NextCard ColumnMappingCard");
ColumnMappingCard columnSelectionCard = new ColumnMappingCard( ColumnMappingCard columnSelectionCard = new ColumnMappingCard(
unionSession); unionSession);
getWizardWindow().addCard( getWizardWindow().addCard(columnSelectionCard);
columnSelectionCard);
getWizardWindow().nextCard(); getWizardWindow().nextCard();
} catch (Throwable e) { } catch (Throwable e) {
Log.error("goNext: " + e.getLocalizedMessage()); Log.error("goNext: " + e.getLocalizedMessage());
} }
} }
} }

View File

@ -5,12 +5,14 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; 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.TabResource;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; 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.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle; import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
@ -37,7 +39,6 @@ import com.sencha.gxt.data.shared.loader.ListLoader;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding; import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox;
import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
@ -107,7 +108,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
protected void init() { protected void init() {
setHeaderVisible(false); setHeaderVisible(false);
//new Resizable(this, Dir.E, Dir.SE, Dir.S); // new Resizable(this, Dir.E, Dir.SE, Dir.S);
} }
@ -216,7 +217,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
contextMenu = new Menu(); contextMenu = new Menu();
MenuItem deleteTRItem = new MenuItem("Delete"); MenuItem deleteTRItem = new MenuItem("Delete");
deleteTRItem.setId("DeleteTR"); deleteTRItem.setId("DeleteTR");
deleteTRItem.setIcon(org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle.INSTANCE.delete()); deleteTRItem
.setIcon(org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle.INSTANCE
.delete());
deleteTRItem.addSelectionHandler(new SelectionHandler<Item>() { deleteTRItem.addSelectionHandler(new SelectionHandler<Item>() {
@Override @Override
@ -270,17 +273,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else { } else {
Log.debug("Error retrieving tabular resource: " Log.debug("Error retrieving tabular resource: "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
UtilsGXT3
AlertMessageBox d = new AlertMessageBox("Error!", .alert("Error!",
"Error retrieving tabular resources on server!"); "Error retrieving tabular resources on server!");
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
//
}
});
d.show();
} }
callback.onFailure(caught); callback.onFailure(caught);
} }
@ -345,18 +340,24 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
new AsyncCallback<Void>() { new AsyncCallback<Void>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
AlertMessageBox d = new AlertMessageBox("Error", if (caught instanceof TDGWTSessionExpiredException) {
"Error on delete TabResource: " parent.getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error on delete TabResource: "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
d.addHideHandler(new HideHandler() { UtilsGXT3.alert("Error",
"Error on delete TabResource: "
public void onHide(HideEvent event) { + caught.getLocalizedMessage());
} }
}); }
d.show();
} }
public void onSuccess(Void result) { public void onSuccess(Void result) {
@ -365,5 +366,4 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
}); });
} }
} }

View File

@ -4,6 +4,8 @@
package org.gcube.portlets.user.td.unionwizardwidget.client; package org.gcube.portlets.user.td.unionwizardwidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
@ -20,13 +22,10 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlexTable;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer; import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign; import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
/** /**
* *
@ -106,11 +105,24 @@ public class UnionOperationInProgressCard extends WizardCard implements
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
showErrorAndHide( if (caught instanceof TDGWTIsLockedException) {
"Error in Union", Log.error(caught.getLocalizedMessage());
"An error occured in union: " showErrorAndHide("Error Locked",
+ caught.getLocalizedMessage(), caught.getLocalizedMessage(), caught);
caught.getStackTrace().toString(), caught); } else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Final",
caught.getLocalizedMessage(),
caught);
} else {
showErrorAndHide(
"Error in Union",
"An error occured in union: "
+ caught.getLocalizedMessage(),
caught);
}
}
} }
} }
}); });
@ -177,12 +189,8 @@ public class UnionOperationInProgressCard extends WizardCard implements
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
AlertMessageBox d = new AlertMessageBox("Error in Union", reason); showErrorAndHide("Error in Union", reason, caught);
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
}
});
d.show();
} }
forceLayout(); forceLayout();
} }

View File

@ -1,28 +0,0 @@
package org.gcube.portlets.user.td.unionwizardwidget.client.utils;
import com.sencha.gxt.widget.core.client.box.MessageBox;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class InfoMessageBox extends MessageBox {
/**
* Creates a message box with an info icon and the specified title and
* message.
*
* @param title
* the message box title
* @param message
* the message displayed in the message box
*/
public InfoMessageBox(String title, String message) {
super(title, message);
setIcon(ICONS.info());
}
}

View File

@ -1,51 +0,0 @@
package org.gcube.portlets.user.td.unionwizardwidget.client.utils;
import com.google.gwt.user.client.Element;
import com.sencha.gxt.core.client.dom.XElement;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class UtilsGXT3 {
public static void mask(Element element) {
XElement el = element.<XElement> cast();
el.mask("Loading...");
}
public static void umask(Element element) {
element.<XElement> cast().unmask();
}
public static void alert(String title, String message) {
final AlertMessageBox d = new AlertMessageBox(title, message);
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
}
});
d.show();
}
public static void info(String title, String message) {
final InfoMessageBox d = new InfoMessageBox(title, message);
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
}
});
d.show();
}
}