diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java index a854995..3b13e8d 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java @@ -40,6 +40,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @@ -63,6 +64,14 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("TDGWTService") public interface TDGWTService extends RemoteService { + /** + * Get informations on the current user + * + * @return + * @throws TDGWTServiceException + */ + public String hello() throws TDGWTServiceException; + /** * Get informations on the current tabular resource * diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java index 8680ebd..446e7b1 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java @@ -54,6 +54,8 @@ public interface TDGWTServiceAsync { public static TDGWTServiceAsync INSTANCE = (TDGWTServiceAsync) GWT .create(TDGWTService.class); + void hello(AsyncCallback callback); + void createTabularResource(TabResource tabResource,AsyncCallback callback); void getTabResourceInformation(AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index f71acc6..d8fd40e 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -149,6 +149,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements protected static SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd HH:mm"); + + /** + * + * {@inheritDoc} + */ + @Override + public String hello() throws TDGWTServiceException { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getAslSession(session); + String user = aslSession.getUsername(); + return user; + } + /** * * {@inheritDoc} @@ -2999,4 +3012,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } + + }