onModuleLoad()
.
+ */
+public class NewsFeed implements EntryPoint {
+
+ private final String UNIQUE_DIV = "newsfeedDIV";
+ final PageBusAdapter pageBusAdapter = new PageBusAdapter();
+ NewsFeedPanel mainPanel;
+ /**
+ * This is the entry point method.
+ */
+ public void onModuleLoad() {
+ mainPanel = new NewsFeedPanel();
+ resize();
+ RootPanel.get(UNIQUE_DIV).add(mainPanel);
+
+ Window.addResizeHandler(new ResizeHandler() {
+ public void onResize(ResizeEvent event) {
+ int width = RootPanel.get(UNIQUE_DIV).getOffsetWidth();
+ mainPanel.setWidth(""+width);
+ }
+ });
+
+ ClientFeed notification = new ClientFeed();
+ //Subscribe to message and associate subsequent receptions with custom subscriber data
+ try
+ {
+ pageBusAdapter.PageBusSubscribe("org.gcube.portal.databook.shared", null, null, notification, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
+ }
+ catch (PageBusAdapterException e1)
+ {
+ e1.printStackTrace();
+ }
+
+ pageBusAdapter.addPageBusSubscriptionCallbackListener(new PageBusListener() {
+ public void onPageBusSubscriptionCallback(PageBusEvent event) {
+ // translate JavaScript message contents and subscriber data to their Java equivalents
+ try {
+ ClientFeed feed = (ClientFeed)event.getMessage((Jsonizer)GWT.create(ClientFeedJsonizer.class));
+ mainPanel.addJustAddedFeed(feed);
+
+ } catch (PageBusAdapterException e) {
+ e.printStackTrace();
+ }
+ }
+ public String getName() {
+ return null;
+ }
+ });
+
+
+ }
+
+ private void resize() {
+ int width = RootPanel.get(UNIQUE_DIV).getOffsetWidth();
+ mainPanel.setWidth(""+width);
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java
new file mode 100644
index 0000000..0dd334c
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsService.java
@@ -0,0 +1,41 @@
+package org.gcube.portlets.user.newsfeed.client;
+
+import java.util.ArrayList;
+
+import org.gcube.portal.databook.shared.Comment;
+import org.gcube.portal.databook.shared.Like;
+import org.gcube.portal.databook.shared.UserInfo;
+import org.gcube.portlets.user.newsfeed.shared.EnhancedFeed;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+/**
+ * The client side stub for the RPC service.
+ */
+@RemoteServiceRelativePath("newsServlet")
+public interface NewsService extends RemoteService {
+ ArrayListNewsService
.
+ */
+public interface NewsServiceAsync {
+
+ void getAllUpdateUserFeeds(AsyncCallback
+ |
+
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+ |
+
+ |
+
"GwtTest*"
naming pattern exclude them from running with
+ * surefire during the test phase.
+ *
+ * If you run the tests using the Maven command line, you will have to
+ * navigate with your browser to a specific url given by Maven.
+ * See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html
+ * for details.
+ */
+public class GwtTestNewsFeed extends GWTTestCase {
+
+ /**
+ * Must refer to a valid module that sources this class.
+ */
+ public String getModuleName() {
+ return "org.gcube.portlets.user.newsfeed.NewsFeedJUnit";
+ }
+
+ /**
+ * Tests the FieldVerifier.
+ */
+ public void testFieldVerifier() {
+
+ }
+
+ /**
+ * This test will send a request to the server using the greetServer method in
+ * GreetingService and verify the response.
+ */
+ public void testGreetingService() {
+ }
+
+
+}
diff --git a/src/test/resources/org/gcube/portlets/user/newsfeed/NewsFeedJUnit.gwt.xml b/src/test/resources/org/gcube/portlets/user/newsfeed/NewsFeedJUnit.gwt.xml
new file mode 100644
index 0000000..0f93997
--- /dev/null
+++ b/src/test/resources/org/gcube/portlets/user/newsfeed/NewsFeedJUnit.gwt.xml
@@ -0,0 +1,7 @@
+
+