From 17e289dc61cbfe37606891ed884c43d50be888c6 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 18 Jul 2014 18:02:05 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@98824 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ColumnMappingPanel.java | 7 +++- .../client/TabResourcesSelectionCard.java | 36 +++++++++++++++++- .../client/UnionWizardTD.java | 37 +------------------ 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java index fa0da92..0493391 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java @@ -71,6 +71,7 @@ public class ColumnMappingPanel extends ContentPanel { * @param res */ public ColumnMappingPanel(ColumnMappingCard parent, ResourceBundle res) { + super(); this.res = res; this.parent = parent; thisPanel = this; @@ -83,6 +84,8 @@ public class ColumnMappingPanel extends ContentPanel { protected void init() { setHeaderVisible(false); + //setBodyBorder(false); + setBodyStyle("backgroundColor:#DFE8F6;"); //new Resizable(this, Dir.E, Dir.SE, Dir.S); //Important: fixed rendering of widgets forceLayoutOnResize = true; @@ -130,9 +133,11 @@ public class ColumnMappingPanel extends ContentPanel { vPanel.setScrollMode(ScrollMode.AUTO); vPanel.setAdjustForScroll(true); + vPanel.add(horiz, new VerticalLayoutData(1, -1, new Margins(1,1,1,10))); vPanel.add(container, new VerticalLayoutData(1, -1, new Margins(1,1,1,10))); - + + add(vPanel); forceLayout(); diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java index 7329ad3..b7573a3 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java @@ -1,9 +1,13 @@ 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.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.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.type.SessionExpiredType; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; @@ -177,9 +181,37 @@ public class TabResourcesSelectionCard extends WizardCard { tabResource.setTrId(table.getTrId()); unionSession.setUnionTabularResource(tabResource); Log.debug("UnionSession: " + unionSession); - goNext(); + retriveCurrentTabularResourceInfo(); } + + + protected void retriveCurrentTabularResourceInfo(){ + TDGWTServiceAsync.INSTANCE + .getTabResourceInformation(unionSession.getTrId(), new AsyncCallback() { + + public void onSuccess(TabResource result) { + Log.info("Retrived TR: " + result.getTrId()); + unionSession.setCurrentTabularResource(result); + goNext(); + } + + 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() { try { Log.info("NextCard ColumnMappingCard"); @@ -192,5 +224,5 @@ public class TabResourcesSelectionCard extends WizardCard { Log.error("goNext: " + e.getLocalizedMessage()); } } - + } diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java index 1f10161..bdafd33 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java @@ -1,17 +1,10 @@ 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.shared.exception.TDGWTSessionExpiredException; -import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; 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.type.SessionExpiredType; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; import com.allen_sauer.gwt.log.client.Log; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.web.bindery.event.shared.EventBus; /** @@ -42,40 +35,12 @@ public class UnionWizardTD extends WizardWindow { this.trId = trId; unionSession = new UnionSession(); unionSession.setTrId(trId); - - retriveTabularResourceMinInfo(); - } - - protected void retriveTabularResourceMinInfo(){ - TDGWTServiceAsync.INSTANCE - .getTabResourceInformation(trId, new AsyncCallback() { - - public void onSuccess(TabResource result) { - Log.info("Retrived TR: " + result.getTrId()); - unionSession.setCurrentTabularResource(result); - } - - public void onFailure(Throwable caught) { - if (caught instanceof TDGWTSessionExpiredException) { - eventBus.fireEvent(new SessionExpiredEvent( - SessionExpiredType.EXPIREDONSERVER)); - } else { - UtilsGXT3.alert("Error", - "Error retrienving information on current tabular resource: "); - } - } - - }); - } - - protected void callCard(){ TabResourcesSelectionCard tabResourcesSelection = new TabResourcesSelectionCard( unionSession); addCard(tabResourcesSelection); tabResourcesSelection.setup(); + } - - } \ No newline at end of file