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
This commit is contained in:
Giancarlo Panichi 2014-07-18 18:02:05 +00:00 committed by Giancarlo Panichi
parent 83a4cf7fe7
commit 17e289dc61
3 changed files with 41 additions and 39 deletions

View File

@ -71,6 +71,7 @@ public class ColumnMappingPanel extends ContentPanel {
* @param res * @param res
*/ */
public ColumnMappingPanel(ColumnMappingCard parent, ResourceBundle res) { public ColumnMappingPanel(ColumnMappingCard parent, ResourceBundle res) {
super();
this.res = res; this.res = res;
this.parent = parent; this.parent = parent;
thisPanel = this; thisPanel = this;
@ -83,6 +84,8 @@ public class ColumnMappingPanel extends ContentPanel {
protected void init() { protected void init() {
setHeaderVisible(false); setHeaderVisible(false);
//setBodyBorder(false);
setBodyStyle("backgroundColor:#DFE8F6;");
//new Resizable(this, Dir.E, Dir.SE, Dir.S); //new Resizable(this, Dir.E, Dir.SE, Dir.S);
//Important: fixed rendering of widgets //Important: fixed rendering of widgets
forceLayoutOnResize = true; forceLayoutOnResize = true;
@ -130,9 +133,11 @@ public class ColumnMappingPanel extends ContentPanel {
vPanel.setScrollMode(ScrollMode.AUTO); vPanel.setScrollMode(ScrollMode.AUTO);
vPanel.setAdjustForScroll(true); vPanel.setAdjustForScroll(true);
vPanel.add(horiz, new VerticalLayoutData(1, -1, new Margins(1,1,1,10))); 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))); vPanel.add(container, new VerticalLayoutData(1, -1, new Margins(1,1,1,10)));
add(vPanel); add(vPanel);
forceLayout(); forceLayout();

View File

@ -1,9 +1,13 @@
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.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.type.SessionExpiredType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
@ -177,9 +181,37 @@ public class TabResourcesSelectionCard extends WizardCard {
tabResource.setTrId(table.getTrId()); tabResource.setTrId(table.getTrId());
unionSession.setUnionTabularResource(tabResource); unionSession.setUnionTabularResource(tabResource);
Log.debug("UnionSession: " + unionSession); Log.debug("UnionSession: " + unionSession);
goNext(); retriveCurrentTabularResourceInfo();
} }
protected void retriveCurrentTabularResourceInfo(){
TDGWTServiceAsync.INSTANCE
.getTabResourceInformation(unionSession.getTrId(), new AsyncCallback<TabResource>() {
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() { protected void goNext() {
try { try {
Log.info("NextCard ColumnMappingCard"); Log.info("NextCard ColumnMappingCard");
@ -192,5 +224,5 @@ public class TabResourcesSelectionCard extends WizardCard {
Log.error("goNext: " + e.getLocalizedMessage()); Log.error("goNext: " + e.getLocalizedMessage());
} }
} }
} }

View File

@ -1,17 +1,10 @@
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.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.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.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
/** /**
@ -42,40 +35,12 @@ public class UnionWizardTD extends WizardWindow {
this.trId = trId; this.trId = trId;
unionSession = new UnionSession(); unionSession = new UnionSession();
unionSession.setTrId(trId); unionSession.setTrId(trId);
retriveTabularResourceMinInfo();
}
protected void retriveTabularResourceMinInfo(){
TDGWTServiceAsync.INSTANCE
.getTabResourceInformation(trId, new AsyncCallback<TabResource>() {
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( TabResourcesSelectionCard tabResourcesSelection = new TabResourcesSelectionCard(
unionSession); unionSession);
addCard(tabResourcesSelection); addCard(tabResourcesSelection);
tabResourcesSelection.setup(); tabResourcesSelection.setup();
} }
} }