[kune-commits] r1393 - in trunk: . src/main/java/cc/kune/core/client/sitebar/spaces src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/properties src/main/java/cc/kune/wave/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun May 15 20:10:09 CEST 2011


Author: vjrj_
Date: 2011-05-15 20:10:08 +0200 (Sun, 15 May 2011)
New Revision: 1393

Modified:
   trunk/pom.xml
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
   trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
Log:
Incomplete - task : kune properties as parameter 
And others minor fixes (wave reconnection checks session)

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/pom.xml	2011-05-15 18:10:08 UTC (rev 1393)
@@ -522,12 +522,8 @@
         </exclusion>
       </exclusions>
     </dependency>
-<!--  <dependency>
-      <groupId>org.testng</groupId>
-      <artifactId>testng</artifactId>
-      <version>5.14</version>
-      <scope>test</scope>
-    </dependency> -->
+    <!-- <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId>
+      <version>5.14</version> <scope>test</scope> </dependency> -->
     <!-- If you want to start a selenium server, you will need the following
       dependency: -->
     <!-- <dependency> -->
@@ -745,6 +741,11 @@
           <commandlineArgs>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001</commandlineArgs>
           <systemProperties>
             <systemProperty>
+              <key>kune.config</key>
+              <!-- <value>/src/main/resources/kune.properties</value> -->
+              <value>kune.properties</value>
+            </systemProperty>
+            <systemProperty>
               <key>wave.server.config</key>
               <value>src/main/resources/wave-server.properties</value>
             </systemProperty>

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-05-15 18:10:08 UTC (rev 1393)
@@ -54,7 +54,7 @@
   public SpaceSelectorViewImpl(final GSpaceArmor armor, final I18nTranslationService i18n,
       final WsArmorResources res) {
     armor.getSitebar().insert(uiBinder.createAndBindUi(this), 0);
-    homeButton.setVisible(false);
+    // homeButton.setVisible(false);
     Tooltip.to(homeButton, i18n.t("Your home page in this site"));
     Tooltip.to(userButton, i18n.t("User space: it shows a list of all your documents and contents "
         + "in which you participate"));

Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-05-15 18:10:08 UTC (rev 1393)
@@ -19,6 +19,7 @@
  */
 package cc.kune.core.server;
 
+import org.apache.commons.configuration.SystemConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -67,17 +68,20 @@
   private final Module configModule;
 
   public KuneRackModule() {
-    this("development", "kune.properties", null);
+    this("development", null);
   }
 
-  public KuneRackModule(final String jpaUnit, final String propertiesFileName, final Scope sessionScope) {
+  public KuneRackModule(final String jpaUnit, final Scope sessionScope) {
 
+    final SystemConfiguration sysConf = new SystemConfiguration();
+    final String kuneConfig = sysConf.getString("kune.config");
+
     configModule = new AbstractModule() {
       @Override
       public void configure() {
         install(FinderRegistry.init(new JpaPersistModule(jpaUnit)));
         bindInterceptor(Matchers.any(), new NotInObject(), new LoggerMethodInterceptor());
-        bindConstant().annotatedWith(PropertiesFileName.class).to(propertiesFileName);
+        bindConstant().annotatedWith(PropertiesFileName.class).to(kuneConfig);
         if (sessionScope != null) {
           bindScope(SessionScoped.class, sessionScope);
         }

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java	2011-05-15 18:10:08 UTC (rev 1393)
@@ -171,7 +171,7 @@
     initSocialNetwork(userGroup, userGroup);
 
     final String title = i18n.t("[%s] Bio", user.getName());
-    final String body = "<h1>" + title + "</h1>" + i18n.t("This user has not written its biography yet");
+    final String body = i18n.t("This user has not written its biography yet");
     try {
       initGroup(user, userGroup, wantPersonalHomepage ? serverToolRegistry.getToolsForUserKeys()
           : ServerToolRegistry.emptyToolList, title, body);

Modified: trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java	2011-05-15 18:10:08 UTC (rev 1393)
@@ -24,7 +24,6 @@
 import java.text.MessageFormat;
 import java.util.Properties;
 
-
 import cc.kune.core.server.ServerException;
 
 import com.google.inject.Inject;
@@ -32,43 +31,46 @@
 
 @Singleton
 public class KunePropertiesDefault implements KuneProperties {
-    private Properties properties;
-    private final String fileName;
+  private final String fileName;
+  private Properties properties;
 
-    @Inject
-    public KunePropertiesDefault(@PropertiesFileName final String fileName) {
-        this.fileName = fileName;
-        try {
-            properties = new Properties();
-            InputStream input = getInputStream(fileName);
-            properties.load(input);
-        } catch (IOException e) {
-            String msg = MessageFormat.format("Couldn't open property file {0}", fileName);
-            throw new ServerException(msg, e);
-        }
-
+  @Inject
+  public KunePropertiesDefault(@PropertiesFileName final String fileName) {
+    this.fileName = fileName;
+    try {
+      properties = new Properties();
+      final InputStream input = getInputStream(fileName);
+      properties.load(input);
+    } catch (final IOException e) {
+      final String msg = MessageFormat.format("Couldn't open property file {0}", fileName);
+      throw new ServerException(msg, e);
     }
 
-    public String get(final String key) {
-        String value = properties.getProperty(key);
-        if (value == null) {
-            throw new ServerException("PROPERTY: " + key + " not defined in " + fileName);
-        }
-        return value;
-    }
+  }
 
-    public String get(final String key, final String defaultValue) {
-        String value = properties.getProperty(key);
-        return value != null ? value : defaultValue;
+  @Override
+  public String get(final String key) {
+    final String value = properties.getProperty(key);
+    if (value == null) {
+      throw new ServerException("PROPERTY: " + key + " not defined in " + fileName);
     }
+    return value;
+  }
 
-    private InputStream getInputStream(final String fileName) {
-        InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
-        if (input == null) {
-            String msg = MessageFormat.format("Properties file: ''{0}'' not found", fileName);
-            throw new ServerException(msg);
-        }
-        return input;
+  @Override
+  public String get(final String key, final String defaultValue) {
+    final String value = properties.getProperty(key);
+    return value != null ? value : defaultValue;
+  }
+
+  private InputStream getInputStream(final String fileName) {
+    final InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(
+        fileName);
+    if (input == null) {
+      final String msg = MessageFormat.format("Properties file: ''{0}'' not found", fileName);
+      throw new ServerException(msg);
     }
+    return input;
+  }
 
 }

Modified: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2011-05-15 15:21:25 UTC (rev 1392)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2011-05-15 18:10:08 UTC (rev 1393)
@@ -28,6 +28,7 @@
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.actions.ui.descrip.IconLabelDescriptor;
 import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.sitebar.SitebarActionsPresenter;
 import cc.kune.core.client.sn.actions.SessionAction;
 import cc.kune.core.client.state.Session;
@@ -43,14 +44,23 @@
     public WaveStatusAction(final Session session, final I18nTranslationService i18n) {
       super(session, true);
       ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
+        private void goOnline() {
+          putValue(Action.NAME, i18n.t("Online"));
+          putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-online");
+          NotifyUser.hideProgress();
+        }
+
         @Override
         public void onNetworkStatus(final NetworkStatusEvent event) {
           switch (event.getStatus()) {
           case CONNECTED:
           case RECONNECTED:
-            putValue(Action.NAME, i18n.t("Online"));
-            putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-online");
-            NotifyUser.hideProgress();
+            session.check(new AsyncCallbackSimple<Void>() {
+              @Override
+              public void onSuccess(final Void result) {
+                goOnline();
+              }
+            });
             break;
           case DISCONNECTED:
             NotifyUser.showProgress(i18n.t("Connecting"));




More information about the kune-commits mailing list