From 2c2eca622f46cd6284dbcdd4ff647a32d7666d01 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 28 Nov 2014 17:59:24 +0000 Subject: [PATCH] Minor update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-mainbox-widget@101782 82a268e6-3cf1-43bd-a215-b396298e98cf --- MainBox.launch | 33 ++++++- pom.xml | 37 +++++--- .../user/td/mainboxwidget/MainBox.gwt.xml | 14 +-- .../td/mainboxwidget/client/MainBoxEntry.java | 89 ++++++++++++++----- .../user/td/mainboxwidget/MainBox.gwt.xml | 32 ++++--- 5 files changed, 155 insertions(+), 50 deletions(-) diff --git a/MainBox.launch b/MainBox.launch index 06aae53..7d0485c 100644 --- a/MainBox.launch +++ b/MainBox.launch @@ -1,6 +1,10 @@ + + + + @@ -8,9 +12,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/pom.xml b/pom.xml index 95c232a..f54c2d5 100644 --- a/pom.xml +++ b/pom.xml @@ -46,15 +46,14 @@ config - - + + 2.6.1 3.3.2 - 3.1.1 - + 3.1.1 + ${env.KEYS} @@ -78,15 +77,23 @@ 1.0.1 runtime + + org.gcube.common + home-library + + + + com.google.gwt gwt-servlet ${gwtVersion} + provided com.google.gwt @@ -94,6 +101,8 @@ ${gwtVersion} + + com.sencha.gxt @@ -101,30 +110,34 @@ ${gxtVersion} + + + org.gcube.core common-scope-maps [1.0.2-SNAPSHOT,2.0.0-SNAPSHOT) - provided + compile + org.gcube.portal custom-portal-handler - provided + org.gcube.applicationsupportlayer aslcore - provided + org.gcube.applicationsupportlayer accesslogger - provided + @@ -134,7 +147,7 @@ org.gcube.data.analysis.tabulardata service-client-impl [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) - provided + @@ -236,6 +249,7 @@ compile resources + @@ -351,4 +365,5 @@ + war diff --git a/src/main/java/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml b/src/main/java/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml index 82938a4..8ef11a9 100644 --- a/src/main/java/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml +++ b/src/main/java/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml @@ -2,7 +2,7 @@ - + @@ -21,10 +21,7 @@ /> --> - - - - + @@ -32,5 +29,12 @@ + + + + diff --git a/src/main/java/org/gcube/portlets/user/td/mainboxwidget/client/MainBoxEntry.java b/src/main/java/org/gcube/portlets/user/td/mainboxwidget/client/MainBoxEntry.java index 3cf3512..830e29f 100644 --- a/src/main/java/org/gcube/portlets/user/td/mainboxwidget/client/MainBoxEntry.java +++ b/src/main/java/org/gcube/portlets/user/td/mainboxwidget/client/MainBoxEntry.java @@ -1,6 +1,8 @@ package org.gcube.portlets.user.td.mainboxwidget.client; -import org.gcube.portlets.user.td.mainboxwidget.client.rpc.TabularDataServiceAsync; +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; +import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo; import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; @@ -22,33 +24,81 @@ import com.sencha.gxt.widget.core.client.container.Viewport; */ public class MainBoxEntry implements EntryPoint { protected static final String JSP_TAG_ID = "tdp"; - + private TRId trId; + private TabResource tabResource; public void onModuleLoad() { - - TabularDataServiceAsync.INSTANCE.hello(new AsyncCallback() { - - @Override - public void onSuccess(String result) { - loadDataView(); - - } + // For example Tabular Resource 7 and table 402 + //trId = new TRId("58", TabResourceType.STANDARD, "1283"); + //trId = new TRId("77", TabResourceType.STANDARD, "1560"); + trId = new TRId("80", TabResourceType.STANDARD, "1757"); + + + + TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback() { @Override public void onFailure(Throwable caught) { + Log.error("Error in hello(): "+caught); caught.printStackTrace(); + } + @Override + public void onSuccess(UserInfo result) { + Log.debug("Hello "+result); + retrieveTabularResource(); + } + }); + + + } + + public void retrieveTabularResource(){ + + TDGWTServiceAsync.INSTANCE.getTabResourceInformation(trId, new AsyncCallback() { + + + + @Override + public void onFailure(Throwable caught) { + Log.error("Error in retrieveTabularResource(): "+caught); + caught.printStackTrace(); + + } + + @Override + public void onSuccess(TabResource result) { + Log.debug("TabResource Retrieved: "+result); + tabResource=result; + addInSession(); + + } + }); + } + + public void addInSession(){ + TDGWTServiceAsync.INSTANCE.setTabResource(tabResource,new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.error("Error in addInSession(): "+caught); + caught.printStackTrace(); + + } + + @Override + public void onSuccess(Void result) { + Log.debug("TabResource Set"); + loadDataView(); + } }); + } protected void loadDataView() { - // For example Tabular Resource 7 and table 402 - TRId trId1 = new TRId("220", TabResourceType.STANDARD, "3555"); - TRId trId2 = new TRId("219", TabResourceType.STANDARD, "3507"); - TRId trId3 = new TRId("168", TabResourceType.STANDARD, "2165"); - + EventBus eventBus = new SimpleEventBus(); try { @@ -59,16 +109,9 @@ public class MainBoxEntry implements EntryPoint { UIStateEvent uiStateEvent1 = new UIStateEvent(UIStateType.TR_OPEN); - uiStateEvent1.setTrId(trId1); + uiStateEvent1.setTrId(trId); eventBus.fireEvent(uiStateEvent1); - UIStateEvent uiStateEvent2 = new UIStateEvent(UIStateType.TR_OPEN); - uiStateEvent2.setTrId(trId2); - eventBus.fireEvent(uiStateEvent2); - - UIStateEvent uiStateEvent3 = new UIStateEvent(UIStateType.TR_OPEN); - uiStateEvent3.setTrId(trId3); - eventBus.fireEvent(uiStateEvent3); Log.info("MainBoxPanel Added:" + mainBoxPanel); } catch (Throwable e) { diff --git a/src/main/resources/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml index 0c70986..18ff188 100644 --- a/src/main/resources/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/td/mainboxwidget/MainBox.gwt.xml @@ -5,32 +5,44 @@ - + - + - + - - - - - + + - + + + + + + + + +