[kune-commits] r1780 - in trunk/src/main/java/cc/kune/core: client client/i18n client/sitebar server

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun Mar 25 17:05:48 CEST 2012


Author: vjrj_
Date: 2012-03-25 17:05:47 +0200 (Sun, 25 Mar 2012)
New Revision: 1780

Added:
   trunk/src/main/java/cc/kune/core/client/i18n/I18n.java
Modified:
   trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
   trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java
   trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
Log:
I18n Static. Session expiration adjusts.

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2012-03-25 11:53:17 UTC (rev 1779)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2012-03-25 15:05:47 UTC (rev 1780)
@@ -53,6 +53,7 @@
 import cc.kune.core.client.groups.newgroup.NewGroupPanel;
 import cc.kune.core.client.groups.newgroup.NewGroupPresenter;
 import cc.kune.core.client.groups.newgroup.NewGroupView;
+import cc.kune.core.client.i18n.I18n;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.init.AppStarter;
 import cc.kune.core.client.init.AppStarterDefault;
@@ -141,10 +142,15 @@
     bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
     bind(RootPresenter.class).asEagerSingleton();
     bind(ProxyFailureHandler.class).to(DefaultProxyFailureHandler.class).in(Singleton.class);
+
     s(I18nUITranslationService.class);
     bind(HasRTL.class).to(I18nUITranslationService.class);
     bind(I18nTranslationService.class).to(I18nUITranslationService.class).in(Singleton.class);
+    s(I18n.class);
+    requestStaticInjection(I18n.class);
+
     bind(GlobalShortcutRegister.class).to(DefaultGlobalShortcutRegister.class).in(Singleton.class);
+
     s(AnonUsersManager.class);
 
     // DnD

Added: trunk/src/main/java/cc/kune/core/client/i18n/I18n.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18n.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18n.java	2012-03-25 15:05:47 UTC (rev 1780)
@@ -0,0 +1,47 @@
+package cc.kune.core.client.i18n;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class I18n {
+
+  @Inject
+  private static I18nUITranslationService i18n;
+
+  public static boolean isRTL() {
+    return i18n.isRTL();
+  }
+
+  public static String t(final String text) {
+    return i18n.t(text);
+  }
+
+  public static String t(final String text, final Integer... args) {
+    return i18n.t(text, args);
+  }
+
+  public static String t(final String text, final Long... args) {
+    return i18n.t(text, args);
+  }
+
+  public static String t(final String text, final String... args) {
+    return i18n.t(text, args);
+  }
+
+  public static String tWithNT(final String text, final String noteForTranslators) {
+    return i18n.tWithNT(text, noteForTranslators);
+  }
+
+  public static String tWithNT(final String text, final String noteForTranslators, final Integer... args) {
+    return i18n.tWithNT(text, noteForTranslators, args);
+  }
+
+  public static String tWithNT(final String text, final String noteForTranslators, final Long... args) {
+    return i18n.tWithNT(text, noteForTranslators, args);
+  }
+
+  public static String tWithNT(final String text, final String noteForTranslators, final String... args) {
+    return i18n.tWithNT(text, noteForTranslators, args);
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java	2012-03-25 11:53:17 UTC (rev 1779)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java	2012-03-25 15:05:47 UTC (rev 1780)
@@ -5,11 +5,12 @@
 import cc.kune.common.client.actions.ui.descrip.MenuSeparatorDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuShowAction;
 import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
 import cc.kune.common.shared.utils.Url;
 import cc.kune.core.client.events.MyGroupsChangedEvent;
 import cc.kune.core.client.events.UserSignInOrSignOutEvent;
 import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
+import cc.kune.core.client.i18n.I18n;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.sitebar.SitebarGroupsLink.SitebarNewGroupAction;
@@ -33,8 +34,7 @@
   private final SitebarActions siteOptions;
 
   @Inject
-  public MyGroupsMenu(final I18nTranslationService i18n,
-      final Provider<ClientFileDownloadUtils> downloadProvider, final CoreResources res,
+  public MyGroupsMenu(final Provider<ClientFileDownloadUtils> downloadProvider, final CoreResources res,
       final Session session, final GotoGroupAction gotoGroupAction,
       final SitebarNewGroupAction newGroupAction, final SitebarActions siteOptions,
       final GlobalShortcutRegister global, final MenuShowAction menuShowAction, final EventBus eventBus) {
@@ -48,8 +48,8 @@
     setStyles("k-no-backimage, k-btn-sitebar");
     this.downloadProvider = downloadProvider;
     this.gotoGroupAction = gotoGroupAction;
-    withText(i18n.t("Your groups"));
-    withToolTip(i18n.t("See your groups or create a new one"));
+    withText(I18n.t("Your groups"));
+    withToolTip(I18n.t("See your groups or create a new one"));
     withIcon(res.arrowdownsitebar());
     withShortcut("Alt+G", global);
     eventBus.addHandler(MyGroupsChangedEvent.getType(),
@@ -72,7 +72,7 @@
   private void addPartipationToMenu(final GroupDTO group) {
     final MenuItemDescriptor participant = new MenuItemDescriptor(gotoGroupAction);
     participant.setTarget(group);
-    participant.withText(group.getLongName()).withIcon(
+    participant.withText(TextUtils.ellipsis(group.getLongName(), 26)).withIcon(
         new Url(downloadProvider.get().getGroupLogo(group))).setParent(this, true);
   }
 

Modified: trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSessionManager.java	2012-03-25 11:53:17 UTC (rev 1779)
+++ trunk/src/main/java/cc/kune/core/server/UserSessionManager.java	2012-03-25 15:05:47 UTC (rev 1780)
@@ -22,6 +22,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import org.eclipse.jetty.server.session.HashSessionManager;
+
 import cc.kune.core.server.manager.UserManager;
 import cc.kune.core.server.notifier.UsersOnline;
 import cc.kune.domain.User;
@@ -38,9 +40,14 @@
   private final Provider<UserSession> userSessionProv;
 
   @Inject
-  public UserSessionManager(final UserManager manager, final Provider<UserSession> userSessionProv) {
+  public UserSessionManager(final UserManager manager, final Provider<UserSession> userSessionProv,
+      final org.eclipse.jetty.server.SessionManager jettySessionManager) {
     this.manager = manager;
     this.userSessionProv = userSessionProv;
+    final HashSessionManager hSessionManager = (HashSessionManager) jettySessionManager;
+    hSessionManager.setMaxInactiveInterval(-1);
+    hSessionManager.setUsingCookies(true);
+    hSessionManager.setSavePeriod(5);
     // For now the implementation of this can be very inaccurate (if we
     // login/logout several times with different clients) and not scalable
     // (stored in a MAP). Possible fix, to use jabber status




More information about the kune-commits mailing list