[kune-commits] r1557 - in trunk/src: main/java/cc/kune/common/client/ui main/java/cc/kune/core/client/events main/java/cc/kune/domain/finders main/java/cc/kune/hspace/client main/java/cc/kune/wave/client/inboxcount main/webapp test/java/cc/kune/core/server/integration

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Wed Oct 12 13:44:25 CEST 2011


Author: vjrj_
Date: 2011-10-12 13:44:25 +0200 (Wed, 12 Oct 2011)
New Revision: 1557

Added:
   trunk/src/main/java/cc/kune/core/client/events/InboxUnreadUpdatedEvent.java
Modified:
   trunk/src/main/java/cc/kune/common/client/ui/DottedTabPanel.java
   trunk/src/main/java/cc/kune/domain/finders/ContentFinder.java
   trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
   trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.ui.xml
   trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java
   trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPanel.java
   trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
   trunk/src/main/webapp/ws.html
   trunk/src/test/java/cc/kune/core/server/integration/StatsServiceTest.java
Log:
CLOSED - # 132: Global public stats 
http://kune.ourproject.org/issues/ticket/132

Modified: trunk/src/main/java/cc/kune/common/client/ui/DottedTabPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/DottedTabPanel.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/common/client/ui/DottedTabPanel.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -31,7 +31,15 @@
     return tabPanel.getWidgetIndex(view.asWidget());
   }
 
+  public void insertTab(final IsWidget view, final int beforeIndex) {
+    tabPanel.insert(view.asWidget(), new DottedTab(), beforeIndex);
+  }
+
   public void removeTab(final IsWidget view) {
     tabPanel.remove(view.asWidget());
   }
+
+  public void selectTab(final int index) {
+    tabPanel.selectTab(index);
+  }
 }

Added: trunk/src/main/java/cc/kune/core/client/events/InboxUnreadUpdatedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/InboxUnreadUpdatedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/InboxUnreadUpdatedEvent.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -0,0 +1,91 @@
+package cc.kune.core.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class InboxUnreadUpdatedEvent extends GwtEvent<InboxUnreadUpdatedEvent.InboxUnreadUpdatedHandler> {
+
+  public interface HasInboxUnreadUpdatedHandlers extends HasHandlers {
+    HandlerRegistration addInboxUnreadUpdatedHandler(InboxUnreadUpdatedHandler handler);
+  }
+
+  public interface InboxUnreadUpdatedHandler extends EventHandler {
+    public void onInboxUnreadUpdated(InboxUnreadUpdatedEvent event);
+  }
+
+  private static final Type<InboxUnreadUpdatedHandler> TYPE = new Type<InboxUnreadUpdatedHandler>();
+
+  public static void fire(final HasHandlers source, final int count, final boolean greater) {
+    source.fireEvent(new InboxUnreadUpdatedEvent(count, greater));
+  }
+
+  public static Type<InboxUnreadUpdatedHandler> getType() {
+    return TYPE;
+  }
+
+  int count;
+  boolean greater;
+
+  protected InboxUnreadUpdatedEvent() {
+    // Possibly for serialization.
+  }
+
+  public InboxUnreadUpdatedEvent(final int count, final boolean greater) {
+    this.count = count;
+    this.greater = greater;
+  }
+
+  @Override
+  protected void dispatch(final InboxUnreadUpdatedHandler handler) {
+    handler.onInboxUnreadUpdated(this);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (getClass() != obj.getClass()) {
+      return false;
+    }
+    final InboxUnreadUpdatedEvent other = (InboxUnreadUpdatedEvent) obj;
+    if (count != other.count) {
+      return false;
+    }
+    if (greater != other.greater) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public Type<InboxUnreadUpdatedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public int getCount() {
+    return count;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + new Integer(count).hashCode();
+    hashCode = (hashCode * 37) + new Boolean(greater).hashCode();
+    return hashCode;
+  }
+
+  public boolean isGreater() {
+    return greater;
+  }
+
+  @Override
+  public String toString() {
+    return "InboxUnreadUpdatedEvent[" + count + "," + greater + "]";
+  }
+}

Modified: trunk/src/main/java/cc/kune/domain/finders/ContentFinder.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/finders/ContentFinder.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/domain/finders/ContentFinder.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -64,11 +64,25 @@
   public List<Content> lastModifiedContents(@MaxResults final int limit,
       @Named("status") final ContentStatus status);
 
-  @Finder(query = "FROM Content c WHERE " + "((c.container.owner.id IN (SELECT ed.id FROM "
-      + "c.container.owner.socialNetwork.accessLists.editors.list AS ed WHERE ed.id = :groupid)) OR"
-      + "(c.container.owner.id IN (SELECT ad.id FROM "
-      + "c.container.owner.socialNetwork.accessLists.admins.list AS ad WHERE ad.id = :groupid)))"
+  @Finder(query = "FROM Content c WHERE " + "((:groupid IN (SELECT ed.id FROM "
+      + "c.container.owner.socialNetwork.accessLists.editors.list AS ed)) OR"
+      + "(:groupid IN (SELECT ad.id FROM "
+      + "c.container.owner.socialNetwork.accessLists.admins.list AS ad)))"
       + "ORDER BY c.modifiedOn DESC", returnAs = ArrayList.class)
   public List<Content> lastModifiedContentsInUserGroup(@MaxResults final int limit,
       @Named("groupid") Long groupId);
+
+  // @Finder(query = "FROM Content c WHERE " +
+  // "(c.container.owner.id IN (SELECT ad.id"
+  // + "FROM Group ad WHERE ad.id IN (SELECT ad.id "
+  // +
+  // "FROM ad.socialNetwork.accessLists.admins.list adm WHERE adm.id = :groupid)) OR "
+  // + "(c.container.owner.id IN (SELECT ed.id" +
+  // "FROM Group ed WHERE ed.id IN (SELECT ed.id "
+  // +
+  // "FROM ed.socialNetwork.accessLists.editors.list eds WHERE eds.id = :groupid))))"
+  // + "ORDER BY c.modifiedOn DESC", returnAs = ArrayList.class)
+  // public List<Content> lastModifiedContentsInUserGroup(@MaxResults final int
+  // limit,
+  // @Named("groupid") Long groupId);
 }

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -6,6 +6,7 @@
 
 import cc.kune.common.client.ui.DottedTabPanel;
 import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.state.SiteTokens;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.ContentSimpleDTO;
 import cc.kune.core.shared.dto.GroupDTO;
@@ -13,11 +14,13 @@
 import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.hspace.client.HSpacePresenter.HSpaceView;
 
+import com.calclab.emite.core.client.packet.TextUtils;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Hyperlink;
 import com.google.gwt.user.client.ui.InlineLabel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
@@ -39,6 +42,7 @@
   private final FileDownloadUtils downUtils;
   @UiField
   FlowPanel globalStats;
+  private final RootPanel globalStatsParent;
   @UiField
   public Label globalStatsTitle;
   @UiField
@@ -49,6 +53,7 @@
   public InlineLabel globalStatsTotalUsersCount;
   @UiField
   public InlineLabel globalStatsTotalUsersTitle;
+  private final RootPanel groupStatsParent;
   @UiField
   public FlowPanel lastActivityInYourGroup;
   @UiField
@@ -72,6 +77,9 @@
 
   private final DottedTabPanel tabPanel;
 
+  @UiField
+  public Hyperlink unreadInYourInbox;
+
   private final Widget widget;
 
   @Inject
@@ -86,14 +94,13 @@
     lastGroupsTitle.setText(i18n.t("Latest created groups"));
     lastPublishedContentsTitle.setText(i18n.t("Latest publications"));
     lastActivityInYourGroupTitle.setText(i18n.t("Latest activity in your groups"));
-    tabPanel = new DottedTabPanel("465px", "200px");
+    tabPanel = new DottedTabPanel("440px", "200px");
     tabPanel.addTab(lastGroupsPanel);
-    // tabPanel.addTab(lastActivityPanel);
     tabPanel.addTab(lastPublishedPanel);
     globalStats.removeFromParent();
-
-    final RootPanel globalStatsParent = RootPanel.get(K_HOME_GLOBAL_STATS);
-    final RootPanel groupStatsParent = RootPanel.get(K_HOME_GROUP_STATS);
+    unreadInYourInbox.setTargetHistoryToken(SiteTokens.WAVEINBOX);
+    globalStatsParent = RootPanel.get(K_HOME_GLOBAL_STATS);
+    groupStatsParent = RootPanel.get(K_HOME_GROUP_STATS);
     if (globalStatsParent != null) {
       globalStatsParent.add(globalStats);
     }
@@ -110,7 +117,7 @@
 
   private String format(final Long modifiedOn, final String name) {
     final String modOn = DateUtils.getInstance().formatPastDate(modifiedOn);
-    return modOn + " ~ " + name;
+    return TextUtils.ellipsis(modOn + " ~ " + name, 50);
   }
 
   @Override
@@ -124,6 +131,16 @@
   }
 
   @Override
+  public HasText getUnreadInYourInbox() {
+    return unreadInYourInbox;
+  }
+
+  @Override
+  public void setInboxUnreadVisible(final boolean visible) {
+    unreadInYourInbox.setVisible(visible);
+  }
+
+  @Override
   public void setLastContentsOfMyGroup(final List<ContentSimpleDTO> lastContentsOfMyGroupsList) {
     lastActivityInYourGroup.clear();
     for (final ContentSimpleDTO content : lastContentsOfMyGroupsList) {
@@ -152,26 +169,33 @@
     for (final ContentSimpleDTO content : lastPublishedContentsList) {
       final GroupContentHomeLink link = linkProv.get();
       final StateToken token = content.getStateToken();
-      link.setValues(downUtils.getLogoImageUrl(token.copy().clearDocument().clearFolder()),
-          format(content.getModifiedOn(), content.getName()), token.toString());
+      link.setValues(
+          downUtils.getLogoImageUrl(token.copy().clearDocument().clearFolder()),
+          format(content.getModifiedOn(),
+              "(" + content.getStateToken().getGroup() + ") " + content.getName()), token.toString());
       lastPublishedContents.add(link);
     }
   }
 
   @Override
   public void setStatsVisible(final boolean visible) {
-    globalStats.setVisible(visible);
-    tabPanel.setVisible(visible);
+    if (globalStatsParent != null) {
+      globalStatsParent.setVisible(visible);
+    }
+    if (groupStatsParent != null) {
+      groupStatsParent.setVisible(visible);
+    }
   }
 
   @Override
   public void setUserGroupsActivityVisible(final boolean visible) {
     final boolean isAttached = tabPanel.getWidgetIndex(lastActivityPanel) != -1;
     if (visible && !isAttached) {
-      tabPanel.addTab(lastActivityPanel);
+      tabPanel.insertTab(lastActivityPanel, 0);
     } else if (!visible && isAttached) {
       tabPanel.removeTab(lastActivityPanel);
     }
+    tabPanel.selectTab(0);
   }
 
 }

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.ui.xml	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.ui.xml	2011-10-12 11:44:25 UTC (rev 1557)
@@ -21,6 +21,10 @@
         <g:InlineLabel ui:field="globalStatsTotalUsersCount"
           addStyleNames="{style.padl} k-home-em-text"/>
       </g:FlowPanel>
+      <g:FlowPanel>
+      <g:Hyperlink ui:field="unreadInYourInbox"
+          addStyleNames="k-home-group-inbox-link k-home-normal-text"/>
+          </g:FlowPanel>
     </g:FlowPanel>
     <g:FlowPanel ui:field="lastGroupsPanel">
       <g:Label ui:field="lastGroupsTitle" styleName="k-home-title"/>

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -21,6 +21,7 @@
 
 import java.util.List;
 
+import cc.kune.core.client.events.InboxUnreadUpdatedEvent;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.UserSignInOrSignOutEvent;
@@ -28,6 +29,7 @@
 import cc.kune.core.shared.dto.ContentSimpleDTO;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.HomeStatsDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.HasText;
@@ -50,6 +52,10 @@
 
     HasText getGlobalStatsTotalUsersCount();
 
+    HasText getUnreadInYourInbox();
+
+    void setInboxUnreadVisible(boolean visible);
+
     void setLastContentsOfMyGroup(List<ContentSimpleDTO> lastContentsOfMyGroupsList);
 
     void setLastGroups(List<GroupDTO> lastGroups);
@@ -58,28 +64,47 @@
 
     void setStatsVisible(boolean visible);
 
-    void setUserGroupsActivityVisible(boolean logged);
+    void setUserGroupsActivityVisible(boolean visible);
   }
 
   @Inject
   public HSpacePresenter(final Session session, final EventBus eventBus, final HSpaceView view,
-      final HSpaceProxy proxy, final Provider<ClientStatsServiceAsync> statsService) {
+      final HSpaceProxy proxy, final Provider<ClientStatsServiceAsync> statsService,
+      final I18nTranslationService i18n) {
     super(eventBus, view, proxy);
+    eventBus.addHandler(InboxUnreadUpdatedEvent.getType(),
+        new InboxUnreadUpdatedEvent.InboxUnreadUpdatedHandler() {
+          @Override
+          public void onInboxUnreadUpdated(final InboxUnreadUpdatedEvent event) {
+            final int total = event.getCount();
+            if (total > 0 && session.isLogged()) {
+              getView().getUnreadInYourInbox().setText(
+                  total == 1 ? i18n.t("One recent conversation unread") : i18n.t(
+                      "[%d] recent conversations unread", total));
+              getView().setInboxUnreadVisible(true);
+            } else {
+              getView().setInboxUnreadVisible(false);
+            }
+          }
+        });
     final AsyncCallbackSimple<HomeStatsDTO> callback = new AsyncCallbackSimple<HomeStatsDTO>() {
       @Override
       public void onSuccess(final HomeStatsDTO result) {
         getView().getGlobalStatsTotalGroupsCount().setText(result.getTotalGroups().toString());
         getView().getGlobalStatsTotalUsersCount().setText(result.getTotalUsers().toString());
         getView().setLastGroups(result.getLastGroups());
+        getView().setLastPublishedContents(result.getLastPublishedContents());
+        getView().setStatsVisible(true);
         final List<ContentSimpleDTO> lastContentsOfMyGroups = result.getLastContentsOfMyGroups();
-        final boolean myGroupsHasActivity = lastContentsOfMyGroups != null
+        final boolean logged = session.isLogged();
+        final boolean myGroupsHasActivity = logged && lastContentsOfMyGroups != null
             && lastContentsOfMyGroups.size() > 0;
+        // NotifyUser.info("" + lastContentsOfMyGroups.size(), true);
         if (myGroupsHasActivity) {
           getView().setLastContentsOfMyGroup(lastContentsOfMyGroups);
         }
         getView().setUserGroupsActivityVisible(myGroupsHasActivity);
-        getView().setLastPublishedContents(result.getLastPublishedContents());
-        getView().setStatsVisible(true);
+        getView().setInboxUnreadVisible(logged);
       }
     };
     session.onUserSignInOrSignOut(true, new UserSignInOrSignOutHandler() {

Modified: trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPanel.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPanel.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -46,8 +46,8 @@
   @Override
   public void setTotal(final int total) {
     count.setText(String.valueOf(total));
-    tooltip.setText(total == 1 ? i18n.t("One conversation unread") : i18n.t("[%d] conversations unread",
-        total));
+    tooltip.setText(total == 1 ? i18n.t("One recent conversation unread") : i18n.t(
+        "[%d] recent conversations unread", total));
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -7,6 +7,7 @@
 import org.waveprotocol.box.webclient.search.Search;
 import org.waveprotocol.box.webclient.search.Search.Listener;
 
+import cc.kune.core.client.events.InboxUnreadUpdatedEvent;
 import cc.kune.core.client.events.NewUserRegisteredEvent;
 import cc.kune.core.client.events.SndClickEvent;
 import cc.kune.core.client.state.Session;
@@ -132,9 +133,11 @@
     view.setTotal(total);
     final boolean show = session.isLogged() && total != Search.UNKNOWN_SIZE && total > 0;
     view.showCount(show);
-    if (show && total > currentTotal) {
+    final boolean greater = total > currentTotal;
+    if (show && greater) {
       sendNoticeToUser();
     }
+    InboxUnreadUpdatedEvent.fire(eventBus, total, greater);
     currentTotal = total;
   }
 

Modified: trunk/src/main/webapp/ws.html
===================================================================
--- trunk/src/main/webapp/ws.html	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/main/webapp/ws.html	2011-10-12 11:44:25 UTC (rev 1557)
@@ -5,8 +5,8 @@
 <title>Kune</title>
 
 <script type="text/javascript" language="javascript"
-	src="ws/ws.nocache.js"></script>
-<!-- 
+    src="ws/ws.nocache.js"></script>
+<!--
 We will use this string for mention this site in messages like: "Thanks for joining this site"
 Your can use another string and the message will looks like "Thanks for joining example.org"
  -->
@@ -32,229 +32,236 @@
 <meta name="hablar.height" content="400px" />
 <link rel="shortcut icon" href="ws/favicon.ico" />
 <link rel="stylesheet" type="text/css"
-	href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
+    href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
 <!-- FIXME: make something local -->
 <script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
 <script>
-	WebFont.load({
-		google : {
-			families : [ 'Ubuntu' ]
-		}
-	});
+  WebFont.load({
+    google : {
+      families : [ 'Ubuntu' ]
+    }
+  });
 </script>
 <link
-	href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
-	rel='stylesheet' type='text/css'>
+    href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
+    rel='stylesheet' type='text/css'>
 <!-- <link href='http://fonts.googleapis.com/css?family=Inconsolata'
   rel='stylesheet' type='text/css'> -->
 <link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-all.css">
 <link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-gray.css">
 <link type="text/css" rel="stylesheet"
-	href="ws/gxt-custom/css/gxt-op-common.css">
+    href="ws/gxt-custom/css/gxt-op-common.css">
 <link type="text/css" rel="stylesheet" href="ws/kune-hablar.css">
 <link type="text/css" rel="stylesheet" href="ws/kune-chat.css">
 <link type="text/css" rel="stylesheet" href="ws/kune-common.css">
 <link type="text/css" rel="stylesheet"
-	href="ws/fontface/ubuntufontface.css">
+    href="ws/fontface/ubuntufontface.css">
 <link type="text/css" rel="stylesheet" href="ws/kune-message.css">
 <link type="text/css" rel="stylesheet"
-	href="others/splash/style/permalink.css">
+    href="others/splash/style/permalink.css">
 <link type="text/css" rel="stylesheet"
-	href="others/splash/style/stuff.css">
+    href="others/splash/style/stuff.css">
 <link type="text/css" rel="stylesheet"
-	href="others/splash/style/main.css">
+    href="others/splash/style/main.css">
 <link type="text/css" rel="stylesheet" href="ws/ws.css">
 <script type="text/javascript" src="others/splash/js/gadget.js"></script>
 <script type="text/javascript" src="others/splash/js/rpc.js"></script>
 <script type="text/javascript" src="others/splash/js/common_client.js"></script>
 <script type="text/javascript"
-	src="others/splash/js/permalink_client.js"></script>
+    src="others/splash/js/permalink_client.js"></script>
 <script type="text/javascript"
-	src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
+    src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
 
 <style type="text/css">
 body {
-	background-color: white;
-	color: black;
-	font-family: 'Ubuntu', Arial;
-	font-size: small;
-	overflow: hidden;
+  background-color: white;
+  color: black;
+  font-family: 'Ubuntu', Arial;
+  font-size: small;
+  overflow: hidden;
 }
 
 #kuneloading {
-	position: absolute;
-	left: 2%;
-	top: 2%;
-	z-index: 20001;
-	height: auto;
-	border: solid 2px #ccc;
-	-moz-border-radius: 10px;
-	-webkit-border-radius: 10px;
-	border-radius: 10px;
-	background-color: white;
+  position: absolute;
+  left: 2%;
+  top: 2%;
+  z-index: 20001;
+  height: auto;
+  border: solid 2px #ccc;
+  -moz-border-radius: 10px;
+  -webkit-border-radius: 10px;
+  border-radius: 10px;
+  background-color: white;
 }
 
 #kuneloading a {
-	color: #225588;
+  color: #225588;
 }
 
 #kuneloading .kuneloading-indicator {
-	color: #444;
-	font: bold 13px tahoma, arial, helvetica;
-	padding: 3px 3px 8px;
-	margin: 0;
-	height: auto;
+  color: #444;
+  font: bold 13px tahoma, arial, helvetica;
+  padding: 3px 3px 8px;
+  margin: 0;
+  height: auto;
 }
 
 #kuneloading-msg {
-	font: normal 10px arial, tahoma, sans-serif;
+  font: normal 10px arial, tahoma, sans-serif;
 }
 
 #k-home-prewrap {
-	margin-top: -22px;
+  margin-top: -22px;
 }
 
 #k-home-wrapper {
-	margin-left: auto;
-	margin-right: auto;
-	position: relative;
-	width: 665px;
-	min-width: 320px;
+  margin-left: auto;
+  margin-right: auto;
+  position: relative;
+  width: 665px;
+  min-width: 320px;
 }
 
 #k-home-ini { /*   clear: both; */
-	font-size: 20px;
-	color: #69312f;
-	text-align: justify;
-	/*   padding: 27px 0; */
-	/*   line-height: 1.3em; */
+  font-size: 20px;
+  color: #69312f;
+  text-align: justify;
+  /*   padding: 27px 0; */
+  /*   line-height: 1.3em; */
 }
 
 #k-home-ini a {
-	color: #803000;
-	font-weight: bold;
+  color: #803000;
+  font-weight: bold;
 }
 
 #k-home-ini strong {
-	font-weight: bold;
+  font-weight: bold;
 }
 
 #k-home-table {
-	display: block;
+  display: block;
 }
 
 #k-home-header {
-	display: table-row;
-	float: right;
+  display: table-row;
+  float: right;
 }
 
 #k-home-intro {
-	display: table-row;
+  display: table-row;
 }
 
 #k-home-footer {
-	display: table-row;
-	font-size: 14px;
-	text-align: right;
-	color: #8a5050;
+  display: table-row;
+  font-size: 14px;
+  text-align: right;
+  color: #8a5050;
 }
 
 #k-home-logo {
-	margin: 50px 0 22px 0;
+  margin: 50px 0 22px 0;
 }
 
 #k-home-summary {
-	font-size: 28px;
-	color: #dd8a3d;
-	font-weight: bold;
-	white-space: nowrap;
+  font-size: 28px;
+  color: #dd8a3d;
+  font-weight: bold;
+  white-space: nowrap;
 }
 
 #k-home-summary li {
-	padding-left: 41px;
-	background-repeat: no-repeat;
-	background-position: 0 .2em;
-	line-height: 45px;
+  padding-left: 41px;
+  background-repeat: no-repeat;
+  background-position: 0 .2em;
+  line-height: 45px;
 }
 
 #k-home-body { /* display: table-row;*/
-	clear: both;
-	display: block;
+  clear: both;
+  display: block;
 }
 
 #k-home-left,#k-home-summary-left {
-	display: table-cell;
+  display: table-cell;
 }
 
 #k-home-left {
-	float: left;
+  float: left;
 }
 
 #k-home-right,#k-home-summary-right {
-	display: table-cell;
-	text-align: right;
-	padding-left: 20px;
+  display: table-cell;
+  text-align: right;
+  padding-left: 20px;
 }
 
 #k-home-summary-right {
-	padding-top: 42px;
-	vertical-align: bottom;
+  padding-top: 42px;
+  vertical-align: bottom;
 }
 
-#k-home-right {
-	white-space: nowrap;
-	vertical-align: top;
-	padding-top: 20px;
-	float: right;
+#k-home-right { /*   white-space: nowrap; */
+  vertical-align: top;
+  padding-top: 20px;
+  /*   float: right; */
 }
 
 #k-home-group-stats {
-	color: #c87137;
+  color: #c87137;
 }
 
 #k-home-global-stats {
-	
+
 }
 
 .k-home-title {
-	color: #c87137;
-	font-size: 18px;
-	font-weight: bold;
-	padding-top: 10px;
-	/*   clear: both; */
+  color: #c87137;
+  font-size: 18px;
+  font-weight: bold;
+  padding-top: 10px;
+  /*   clear: both; */
 }
 
 .k-home-normal-text {
-	color: #8a5050;
-	font-size: 16px;
+  color: #8a5050;
+  font-size: 16px;
 }
 
 .k-home-em-text {
-	color: #8a5050;
-	font-size: 18px;
-	font-weight: bold;
+  color: #8a5050;
+  font-size: 18px;
+  font-weight: bold;
 }
 
 .k-home-group-cnt-icon {
-	float: left;
+  float: left;
 }
 
+.k-home-group-inbox-link {
+
+}
+
+.k-home-group-inbox-link a {
+  color: green;
+}
+
 .k-home-group-cnt-link {
-	float: left;
+  float: left;
 }
 
 .k-home-group-cnt-link a {
-	color: #8a5050;
-	padding-left: 10px;
+  color: #8a5050;
+  padding-left: 10px;
 }
 
 .k-home-group-stats-item {
-	clear: both;
-	/*   line-height: 1.2em; */
+  clear: both;
+  /*   line-height: 1.2em; */
 }
 
 .banner {
-	margin: 30px;
+  margin: 30px;
 }
 </style>
 <!--[if IE 6]>
@@ -262,97 +269,97 @@
 <![endif]-->
 </head>
 <body>
-	<!-- Banner for wave errors -->
-	<div class="banner" id="banner"></div>
-	<!-- Autocomplete user/pass -->
-	<form method="post" action="javascript:void(0)" style="display: none">
-		<input type="text" id="address" name="address" value="" /> <input
-			type="password" id="password" name="password" value="" /> <input
-			type="submit" value="Login" id="login" /> <input type="submit"
-			class="wiab le button" name="signIn" id="signIn" value="Sign in">
-	</form>
-	<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
-	<noscript>
-		<div
-			style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
-			Your web browser must have JavaScript enabled in order for this
-			application to display correctly.</div>
-	</noscript>
-	<iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
-	<iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
-	<div id="kuneinitialcurtain"></div>
-	<div id="kuneloading">
-		<div class="kuneloading-indicator">
-			<img src="ws/images/kune-anim-g.gif" width="35" height="35"
-				alt="kune-loading"
-				style="margin-right: 3px; float: left; vertical-align: top;" />kune&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
-			<span id="kuneloading-msg">Starting...</span>
-		</div>
-	</div>
-	<div id="k-home-prewrap">
-		<div id="k-home-wrapper">
-			<!-- This id is required for kune (you can create a different .html but preserve this id) -->
-			<div id="k-home-table">
-				<div id="k-home-header"></div>
-				<!-- div home-header -->
-				<div id="k-home-intro">
-					<div id="k-home-summary-left">
-						<div id="k-home-logo">
-							<img src="ws/logo-big-home.png" alt="" />
-						</div>
-						<div id="k-home-summary">
-							<ul>
-								<li
-									style="background-image: url(ws/images/kune-intro-user.png);">Comunicate
-									with others</li>
-								<li
-									style="background-image: url(ws/images/kune-intro-group.png);">Work
-									in collaboration</li>
-								<li
-									style="background-image: url(ws/images/kune-intro-world.png);">And
-									share with the world</li>
-							</ul>
-						</div>
-						<!-- k-home-summary -->
-					</div>
-					<!-- k-home-summary-left -->
-					<div id="k-home-summary-right">
-						<div id="k-home-ini">
-							Welcome! This site is a Kune node. Kune, which means "together"
-							in esperanto, it's a network of interconnected sites like this
-							one, where you can <strong>communicate, share,
-								collaborate with others and create your web spaces easily</strong>. <a
-								href="#signin">Join!</a>
-						</div>
-						<!--  div home-ini -->
-						<!-- k-home-summary-right -->
-					</div>
-					<!-- div home-header -->
-				</div>
-				<div id="k-home-body">
-					<div id="k-home-left">
-						<div id="k-home-group-stats" style="display: none;">
-							<!-- This id is optional for kune (you can create a different .html and preserve this id if you want this stats) -->
-						</div>
-						<!-- div home-group-stats -->
-					</div>
-					<!-- div k-home-left -->
-					<div id="k-home-right">
-						<div id="k-home-global-stats" style="display: none;">
-							<!-- This id is optinal for kune (you can create a different .html but preserve this id if you want this stats) -->
-						</div>
-					</div>
-					<!-- div k-home-right -->
-				</div>
-				<!-- div k-home-body -->
-				<!--                 <div id="k-home-footer" style="display: none;"> -->
-				<!--                 </div> -->
-				<!-- div k-home-footer -->
-			</div>
-			<!-- div home-table -->
-		</div>
-		<!-- home-wrapper -->
-	</div>
-	<!-- home-prewrap -->
+    <!-- Banner for wave errors -->
+    <div class="banner" id="banner"></div>
+    <!-- Autocomplete user/pass -->
+    <form method="post" action="javascript:void(0)" style="display: none">
+        <input type="text" id="address" name="address" value="" /> <input
+            type="password" id="password" name="password" value="" /> <input
+            type="submit" value="Login" id="login" /> <input type="submit"
+            class="wiab le button" name="signIn" id="signIn" value="Sign in">
+    </form>
+    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+    <noscript>
+        <div
+            style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+            Your web browser must have JavaScript enabled in order for this
+            application to display correctly.</div>
+    </noscript>
+    <iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
+    <iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
+    <div id="kuneinitialcurtain"></div>
+    <div id="kuneloading">
+        <div class="kuneloading-indicator">
+            <img src="ws/images/kune-anim-g.gif" width="35" height="35"
+                alt="kune-loading"
+                style="margin-right: 3px; float: left; vertical-align: top;" />kune&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+            <span id="kuneloading-msg">Starting...</span>
+        </div>
+    </div>
+    <div id="k-home-prewrap">
+        <div id="k-home-wrapper">
+            <!-- This id is required for kune (you can create a different .html but preserve this id) -->
+            <div id="k-home-table">
+                <div id="k-home-header"></div>
+                <!-- div home-header -->
+                <div id="k-home-intro">
+                    <div id="k-home-summary-left">
+                        <div id="k-home-logo">
+                            <img src="ws/logo-big-home.png" alt="" />
+                        </div>
+                        <div id="k-home-summary">
+                            <ul>
+                                <li
+                                    style="background-image: url(ws/images/kune-intro-user.png);">Comunicate
+                                    with others</li>
+                                <li
+                                    style="background-image: url(ws/images/kune-intro-group.png);">Work
+                                    in collaboration</li>
+                                <li
+                                    style="background-image: url(ws/images/kune-intro-world.png);">And
+                                    share with the world</li>
+                            </ul>
+                        </div>
+                        <!-- k-home-summary -->
+                    </div>
+                    <!-- k-home-summary-left -->
+                    <div id="k-home-summary-right">
+                        <div id="k-home-ini">
+                            Welcome! This site is a Kune node. Kune, which means
+                            "together" in esperanto, it's a network of interconnected
+                            sites like this one, where you can <strong>communicate,
+                                share, collaborate with others and create your web
+                                spaces easily</strong>. <a href="#signin">Join!</a>
+                        </div>
+                        <!--  div home-ini -->
+                        <!-- k-home-summary-right -->
+                    </div>
+                    <!-- div home-header -->
+                </div>
+                <div id="k-home-body">
+                    <div id="k-home-left">
+                        <div id="k-home-group-stats" style="display: none;">
+                            <!-- This id is optional for kune (you can create a different .html and preserve this id if you want this stats) -->
+                        </div>
+                        <!-- div home-group-stats -->
+                    </div>
+                    <!-- div k-home-left -->
+                    <div id="k-home-right">
+                        <div id="k-home-global-stats" style="display: none;">
+                            <!-- This id is optinal for kune (you can create a different .html but preserve this id if you want this stats) -->
+                        </div>
+                    </div>
+                    <!-- div k-home-right -->
+                </div>
+                <!-- div k-home-body -->
+                <!--                 <div id="k-home-footer" style="display: none;"> -->
+                <!--                 </div> -->
+                <!-- div k-home-footer -->
+            </div>
+            <!-- div home-table -->
+        </div>
+        <!-- home-wrapper -->
+    </div>
+    <!-- home-prewrap -->
 </body>
 </html>

Modified: trunk/src/test/java/cc/kune/core/server/integration/StatsServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/StatsServiceTest.java	2011-10-11 12:07:21 UTC (rev 1556)
+++ trunk/src/test/java/cc/kune/core/server/integration/StatsServiceTest.java	2011-10-12 11:44:25 UTC (rev 1557)
@@ -21,11 +21,14 @@
 
 import static org.junit.Assert.assertTrue;
 
+import java.util.List;
+
 import org.junit.Before;
 import org.junit.Test;
 
 import cc.kune.core.server.stats.HomeStats;
 import cc.kune.core.server.stats.StatsService;
+import cc.kune.domain.Content;
 import cc.kune.domain.finders.GroupFinder;
 
 import com.google.inject.Inject;
@@ -40,6 +43,10 @@
   private void checkStats(final HomeStats homeStats) {
     assertTrue(homeStats.getTotalGroups() > 0);
     assertTrue(homeStats.getTotalUsers() > 0);
+    assertTrue(homeStats.getLastGroups().size() > 0);
+    assertTrue(homeStats.getLastPublishedContents().size() > 0);
+    final List<Content> lastContentsOfMyGroups = homeStats.getLastContentsOfMyGroups();
+    assertTrue(lastContentsOfMyGroups == null || lastContentsOfMyGroups.size() > 0);
   }
 
   @Transactional
@@ -50,9 +57,13 @@
 
   @Test
   public void testBasicStats() {
-    HomeStats homeStats = statsService.getHomeStats();
+    final HomeStats homeStats = statsService.getHomeStats();
     checkStats(homeStats);
-    homeStats = statsService.getHomeStats(groupFinder.findByShortName(getDefSiteShortName()));
+  }
+
+  @Test
+  public void testLoggedStats() {
+    final HomeStats homeStats = statsService.getHomeStats(groupFinder.findByShortName(getSiteAdminShortName()));
     checkStats(homeStats);
   }
 




More information about the kune-commits mailing list