From 1acfaa9e722b65612e9915056cdfc9c5c3c2de0f Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 30 Mar 2015 16:04:26 +0000 Subject: [PATCH] Minor Updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@113804 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 11 +++--- .../client/ColumnWidgetEntry.java | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7d23da2..c2266a5 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,7 @@ org.gcube.common home-library + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) org.gcube.core @@ -128,7 +129,7 @@ org.gcube.portlets.user tabular-data-gwt-service [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) - + provided @@ -136,7 +137,7 @@ org.gcube.portlets.user tabular-data-widget-common-event [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) - + provided @@ -144,7 +145,7 @@ org.gcube.portlets.user tabular-data-expression-widget [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) - + provided @@ -153,7 +154,7 @@ org.gcube.portlets.user tabular-data-widgetx-tdx-source [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) - + provided @@ -161,7 +162,7 @@ org.gcube.portlets.user tabular-data-monitor-widget [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) - + provided diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ColumnWidgetEntry.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ColumnWidgetEntry.java index f9979d3..41bfead 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ColumnWidgetEntry.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ColumnWidgetEntry.java @@ -3,11 +3,16 @@ package org.gcube.portlets.user.td.columnwidget.client; import org.gcube.portlets.user.td.columnwidget.client.create.AddColumnPanel; +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.user.UserInfo; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.SimpleEventBus; @@ -22,6 +27,11 @@ public class ColumnWidgetEntry implements EntryPoint { public void onModuleLoad() { + callHello(); + } + + protected void test(){ + EventBus eventBus= new SimpleEventBus(); TRId trId=new TRId("86",TabResourceType.STANDARD, "1159"); @@ -50,5 +60,33 @@ public class ColumnWidgetEntry implements EntryPoint { RootPanel.get().add(addColumnPanel); Log.info("Hello!"); + } + + + protected void callHello() { + TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.info("No valid user found: " + caught.getMessage()); + if (caught instanceof TDGWTSessionExpiredException) { + UtilsGXT3.alert("Error", "Expired Session"); + + } else { + UtilsGXT3.alert("Error", "No user found"); + } + } + + @Override + public void onSuccess(UserInfo result) { + + Log.info("Hello: " + result.getUsername()); + + } + + }); + + } + }