[kune-commits] r1602 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions/conditions src/main/java/cc/kune/common/client/utils src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/sitebar src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/client/sn/actions src/main/java/cc/kune/core/client/sn/actions/conditions src/main/java/cc/kune/core/client/sn/actions/registry src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/rpc src/main/resources src/test/java/cc/kune/selenium src/test/java/cc/kune/selenium/chat src/test/java/cc/kune/selenium/general src/test/java/cc/kune/selenium/login src/test/java/cc/kune/selenium/spaces src/test/java/cc/kune/selenium/tools

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Nov 11 19:50:05 CET 2011


Author: vjrj_
Date: 2011-11-11 19:50:03 +0100 (Fri, 11 Nov 2011)
New Revision: 1602

Added:
   trunk/src/main/java/cc/kune/common/client/utils/MetaUtils.java
   trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java
   trunk/src/test/java/cc/kune/selenium/SeleniumConf.java
   trunk/src/test/java/cc/kune/selenium/SeleniumConstants.java
Removed:
   trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java
   trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java
   trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
Modified:
   trunk/CREDITS
   trunk/INSTALL
   trunk/TODO
   trunk/src/main/java/cc/kune/chat/client/ChatClient.java
   trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
   trunk/src/main/java/cc/kune/chat/client/ChatParts.java
   trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
   trunk/src/main/resources/kune.properties
   trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
   trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
   trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
   trunk/src/test/java/cc/kune/selenium/general/EntityHeaderPageObject.java
   trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
   trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
   trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
   trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
   trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
   trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java
   trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java
Log:
NEW - # 144: Resolve some i18n typos (sizes, no translated, etc) 
http://kune.ourproject.org/issues/ticket/144
CLOSED - # 89: Include a way to invite/add someone to a group (again) 
http://kune.ourproject.org/issues/ticket/89

Some dependencies removed. More work in tests...

Modified: trunk/CREDITS
===================================================================
--- trunk/CREDITS	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/CREDITS	2011-11-11 18:50:03 UTC (rev 1602)
@@ -24,5 +24,6 @@
 * Daniel Jiménez for the initial help and coordination
 * Johnattan Rupire, William Austen Bradbury and Rana Hassan for their web contributions and 
 translations
+* Bastien Guerry for his French translation
 * and <URL:http://ourproject.org> and again <URL:http://xsto.info> and 
 <URL:http://iepala.es> for sharing with us their resources

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/INSTALL	2011-11-11 18:50:03 UTC (rev 1602)
@@ -271,6 +271,13 @@
 
 After the section 'Run the server for the first time' you'll be able to use the password of the admin user of the kune instalation (specified in kune.properties), or other admin new users you want to register using kune and configure in the authorizedUsernames attribute.
 
+=== Configure your DNS for your XMPP service correctly ===
+
+You have to configure your DNS domain adding SRV records for your XMPP services. This permit that your XMPP server comunicates with other similar servers correctly. You should follow:
+http://jabberd.org/1.4/doc/adminguide#dnssrv
+and:
+http://www.google.com/support/a/bin/answer.py?answer=34143
+
 ==Appendix B: Apache configuration sample==
 
 Enable this modules:

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/TODO	2011-11-11 18:50:03 UTC (rev 1602)
@@ -13,7 +13,6 @@
 
 * SHORT-TERM (URGENT)
 ** TODO multi uploader
-*** Some links
 http://code.google.com/p/gwt-plupload/
 http://www.plupload.com/example_all_runtimes.php
 http://gxt-multiupload-demo.appspot.com/
@@ -369,6 +368,19 @@
 
 To determine how much memory you can spare for Java, try this: stop your Java process; run free -m; subtract the 'used' value from the "-/+ cache" row from the total memory allocated to your server and then subtract another 'just in case' margin of about 10% of your total server memory.  The number you come up with is a rough indicator of the largest -Xmx setting you can use on your server.
 * MID-TERM
+** Try to reuse welcome message to anonymous users in GWave:
+Welcome to Google Wave
+
+You are looking at a wave that someone thought you'd be interested in. Google Wave helps you communicate and work together with richly formatted text, photos, videos and more. It lets you all stay on the same page.
+Quick tips
+
+    Move to the next unread blip. Try spacebar. 
+    Edit any blip in the wave.Try ctrl-e. 
+    Reply to any blip. Try shift-enter or double click text. 
+    Reply to any blip. Hover over the bottom of a blip and click the blue bar. 
+    Add someone else to this wave, using an email address or their Wave address. 
+
+Sign in to Google Wave
 ** Study mozilla web apps:
 https://apps.mozillalabs.com/
 ** Menubar submenus problem

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClient.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,22 +19,18 @@
  */
 package cc.kune.chat.client;
 
+import cc.kune.core.client.sn.SimpleContactManager;
+
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 import com.calclab.emite.xep.muc.client.Room;
 
-public interface ChatClient {
+public interface ChatClient extends SimpleContactManager {
   public static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
 
-  void addNewBuddy(String shortName);
-
-  void chat(String shortName);
-
   void chat(XmppURI jid);
 
   void doLogin();
 
-  boolean isBuddy(String shortName);
-
   boolean isBuddy(XmppURI jid);
 
   boolean isLoggedIn();

Modified: trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -25,6 +25,7 @@
 import cc.kune.common.client.ExtendedGinModule;
 import cc.kune.core.client.avatar.MediumAvatarDecorator;
 import cc.kune.core.client.avatar.SmallAvatarDecorator;
+import cc.kune.core.client.sn.SimpleContactManager;
 
 public class ChatGinModule extends ExtendedGinModule {
   /*
@@ -38,6 +39,7 @@
     bind(SmallAvatarDecorator.class).to(SmallAvatarDecoratorImpl.class);
     bind(MediumAvatarDecorator.class).to(MediumAvatarDecoratorImpl.class);
     s(ChatClient.class, ChatClientDefault.class);
+    s(SimpleContactManager.class, ChatClient.class);
     s(ChatOptions.class);
     s(ChatSitebarActions.class);
     s(AddAsBuddieHeaderButton.class);

Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -28,8 +28,6 @@
 import cc.kune.chat.client.actions.StartChatWithMemberAction;
 import cc.kune.chat.client.actions.StartChatWithThisBuddyAction;
 import cc.kune.chat.client.actions.StartChatWithThisPersonAction;
-import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
-import cc.kune.chat.client.actions.conditions.IsNotBuddieCondition;
 import cc.kune.chat.shared.ChatConstants;
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.PropertyChangeEvent;
@@ -38,10 +36,12 @@
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sn.GroupSNPresenter;
+import cc.kune.core.client.sn.actions.conditions.IsBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAGroupCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateEditableCondition;
 import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
+import cc.kune.core.client.sn.actions.conditions.IsNotBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
 import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
 import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;

Deleted: trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.chat.client.actions.conditions;
-
-import cc.kune.chat.client.ChatClient;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
-import cc.kune.common.client.errors.UIException;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.UserSimpleDTO;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
- at Singleton
-public class IsBuddieCondition implements GuiAddCondition {
-
-  private final ChatClient chatClient;
-  private final Session session;
-
-  @Inject
-  public IsBuddieCondition(final Session session, final ChatClient chatClient) {
-    this.chatClient = chatClient;
-    this.session = session;
-  }
-
-  private boolean isBuddie(final String targetName) {
-    return chatClient.isBuddy(targetName);
-  }
-
-  private boolean isThisGroupInRoster(final GuiActionDescrip descr) {
-    final String targetName = ((GroupDTO) descr.getTarget()).getShortName();
-    return isBuddie(targetName);
-  }
-
-  private boolean isThisPersonInRoster(final GuiActionDescrip descr) {
-    final String targetName = ((UserSimpleDTO) descr.getTarget()).getShortName();
-    return isBuddie(targetName);
-  }
-
-  @Override
-  public boolean mustBeAdded(final GuiActionDescrip descr) {
-    if (session.isNotLogged()) {
-      return false;
-    }
-    if (descr.getTarget() instanceof UserSimpleDTO) {
-      return isThisPersonInRoster(descr);
-    } else if (descr.getTarget() instanceof GroupDTO) {
-      return isThisGroupInRoster(descr);
-    } else {
-      throw new UIException("Unsupported target");
-    }
-  }
-}

Deleted: trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.chat.client.actions.conditions;
-
-import cc.kune.chat.client.ChatClient;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.core.client.state.Session;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
- at Singleton
-public class IsNotBuddieCondition extends IsBuddieCondition {
-
-  @Inject
-  public IsNotBuddieCondition(final Session session, final ChatClient chatClient) {
-    super(session, chatClient);
-  }
-
-  @Override
-  public boolean mustBeAdded(final GuiActionDescrip descr) {
-    return !super.mustBeAdded(descr);
-  }
-
-}

Added: trunk/src/main/java/cc/kune/common/client/utils/MetaUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/MetaUtils.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/MetaUtils.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,31 @@
+package cc.kune.common.client.utils;
+
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.MetaElement;
+import com.google.gwt.dom.client.NodeList;
+
+public class MetaUtils {
+
+  /**
+   * Get the value of meta information writen in the html page. The meta
+   * information is a html tag with name of meta usually placed inside the the
+   * head section with two attributes: id and content. For example:
+   * 
+   * <code>&lt;meta name="name" value="userName" /&gt;</code>
+   * 
+   * @param id
+   *          the 'id' value of the desired meta tag
+   * @return the value of the attribute 'content' or null if not found
+   */
+  public static String get(final String name) {
+    final NodeList<Element> tags = Document.get().getElementsByTagName("meta");
+    for (int i = 0; i < tags.getLength(); i++) {
+      final MetaElement metaTag = ((MetaElement) tags.getItem(i));
+      if (metaTag.getName().equals(name)) {
+        return metaTag.getContent();
+      }
+    }
+    return null;
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -28,6 +28,7 @@
 
 import cc.kune.common.client.log.Log;
 import cc.kune.common.client.utils.Location;
+import cc.kune.common.client.utils.MetaUtils;
 import cc.kune.common.client.utils.Pair;
 import cc.kune.common.client.utils.TextUtils;
 import cc.kune.common.client.utils.WindowUtils;
@@ -38,7 +39,6 @@
 import cc.kune.core.shared.dto.I18nLanguageDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
-import com.calclab.emite.browser.client.PageAssist;
 import com.google.gwt.core.client.Scheduler;
 import com.google.gwt.core.client.Scheduler.RepeatingCommand;
 import com.google.gwt.event.shared.EventBus;
@@ -52,6 +52,7 @@
   private String currentLanguageCode;
   private final Set<Pair<String, String>> earlyTexts;
   private final I18nServiceAsync i18nService;
+  private boolean isLangInProperties;
   private final KuneConstants kuneConstants;
   private HashMap<String, String> lexicon;
   private final Session session;
@@ -69,10 +70,19 @@
     Log.info("Workspace starting with language: " + currentLocale.getLocaleName() + ", isRTL: "
         + LocaleInfo.getCurrentLocale().isRTL() + ", translated langs: "
         + Arrays.toString(LocaleInfo.getAvailableLocaleNames()));
-
     earlyTexts = new HashSet<Pair<String, String>>();
 
     i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
+
+      private boolean isInConstantProperties(final I18nLanguageDTO currentLang) {
+        for (final String lang : LocaleInfo.getAvailableLocaleNames()) {
+          if (lang.equals(currentLang.getCode())) {
+            return true;
+          }
+        }
+        return false;
+      }
+
       @Override
       public void onFailure(final Throwable caught) {
         Log.error("Workspace adaptation to your language failed: " + caught.getMessage());
@@ -83,6 +93,7 @@
         currentLang = result;
         currentLanguageCode = currentLang.getCode();
         session.setCurrentLanguage(currentLang);
+        isLangInProperties = isInConstantProperties(currentLang);
         i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
           @Override
           public void onFailure(final Throwable caught) {
@@ -93,7 +104,8 @@
           public void onSuccess(final HashMap<String, String> result) {
             lexicon = result;
             session.setCurrentLanguage(currentLang);
-            Log.info("Workspace adaptation to language: " + currentLang.getEnglishName());
+            Log.info("Workspace adaptation to language: " + currentLang.getEnglishName() + ", isRTL: "
+                + currentLang.getDirection());
             eventBus.fireEvent(new I18nReadyEvent());
           }
         });
@@ -114,6 +126,7 @@
           }
         });
       }
+
     });
   }
 
@@ -141,6 +154,8 @@
    *          String value of the new locale to go to.
    */
   private native void changeLocale(String newLocale)
+  // FIXME: this now does not works correctly with hosted mode (and also give
+  // some "Opss" in server side)
   /*-{
 		// Uncomment the "debugger;" line to see how to set debug statements in JSNI code
 		// When in web mode, if your browser has a JavaScript debugger attached, it will
@@ -194,13 +209,39 @@
 
   public String getSiteCommonName() {
     if (siteCommonName == null) {
-      // FIXME: remove this dependency with PageAssist (emite)
-      final String meta = PageAssist.getMeta("kune.default.site.commonname");
+      final String meta = MetaUtils.get("kune.default.site.commonname");
       siteCommonName = (meta == null ? t("this site") : t(meta));
     }
     return siteCommonName;
   }
 
+  private String getTransFromBD(final String text, final String noteForTranslators,
+      final String encodeText) {
+    if (lexicon == null) {
+      Log.warn("i18n not initialized: " + text);
+      earlyTexts.add(Pair.create(text, noteForTranslators));
+      Log.warn("i18n pending translations: " + earlyTexts.size());
+      return text;
+    }
+    String translation = lexicon.get(encodeText);
+    if (lexicon.containsKey(encodeText)) {
+      if (translation == UNTRANSLATED_VALUE) {
+        // Not translated but in db, return text
+        translation = encodeText;
+      }
+    } else {
+      // Not translated and not in db, make a petition for translation
+      if (session.isLogged()) {
+        save(text, noteForTranslators);
+        lexicon.put(encodeText, UNTRANSLATED_VALUE);
+      } else {
+        earlyTexts.add(Pair.create(text, noteForTranslators));
+      }
+      translation = encodeText;
+    }
+    return decodeHtml(translation);
+  }
+
   private void save(final String text, final String noteForTranslators) {
     i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, noteForTranslators,
         new AsyncCallback<String>() {
@@ -244,32 +285,17 @@
       return text;
     }
     final String encodeText = TextUtils.escapeHtmlLight(text);
-    try {
-      return kuneConstants.getString(I18nUtils.convertMethodName(text + " " + noteForTranslators));
-    } catch (final MissingResourceException e) {
-      if (lexicon == null) {
-        Log.warn("i18n not initialized: " + text);
-        earlyTexts.add(Pair.create(text, noteForTranslators));
-        Log.warn("i18n pending translations: " + earlyTexts.size());
-        return text;
+
+    if (isLangInProperties) {
+      // The db translations now are in properties files (more stable)
+      try {
+        return kuneConstants.getString(I18nUtils.convertMethodName(text + " " + noteForTranslators));
+      } catch (final MissingResourceException e) {
+        // Ok this concrete translation is not jet available, we use DB
+        return getTransFromBD(text, noteForTranslators, encodeText);
       }
-      String translation = lexicon.get(encodeText);
-      if (lexicon.containsKey(encodeText)) {
-        if (translation == UNTRANSLATED_VALUE) {
-          // Not translated but in db, return text
-          translation = encodeText;
-        }
-      } else {
-        // Not translated and not in db, make a petition for translation
-        if (session.isLogged()) {
-          save(text, noteForTranslators);
-          lexicon.put(encodeText, UNTRANSLATED_VALUE);
-        } else {
-          earlyTexts.add(Pair.create(text, noteForTranslators));
-        }
-        translation = encodeText;
-      }
-      return decodeHtml(translation);
+    } else {
+      return getTransFromBD(text, noteForTranslators, encodeText);
     }
   }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -123,7 +123,7 @@
 
   @ProxyEvent
   public void onAppStart(final AppStartEvent event) {
-    OPTIONS_MENU.putValue(Action.NAME, i18n.t("Options"));
+    OPTIONS_MENU.putValue(Action.NAME, i18n.t("More"));
     OPTIONS_MENU.putValue(Action.SMALL_ICON, res.arrowdownsitebar());
     OPTIONS_MENU.setStyles("k-no-backimage, k-btn-sitebar");
     OPTIONS_MENU.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);

Added: trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn;
+
+public interface SimpleContactManager {
+
+  void addNewBuddy(String shortName);
+
+  void chat(String shortName);
+
+  boolean isBuddy(String shortName);
+
+}

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,7 +19,6 @@
  */
 package cc.kune.core.client.sn.actions;
 
-import cc.kune.chat.client.ChatClient;
 import cc.kune.common.client.actions.AbstractExtendedAction;
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
@@ -28,6 +27,7 @@
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.sitebar.search.EntitySearchPanel;
 import cc.kune.core.client.sitebar.search.OnEntitySelectedInSearch;
+import cc.kune.core.client.sn.SimpleContactManager;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.google.inject.Inject;
@@ -38,7 +38,7 @@
 
   @Inject
   public AddNewBuddiesAction(final I18nTranslationService i18n, final CoreResources res,
-      final AddBuddieSearchPanel searchPanel, final ChatClient chatClient) {
+      final AddBuddieSearchPanel searchPanel, final SimpleContactManager contactsManager) {
     this.searchPanel = searchPanel;
     putValue(Action.NAME, i18n.t("Add a new buddy"));
     putValue(Action.SMALL_ICON, res.addGreen());
@@ -54,7 +54,7 @@
 
               @Override
               public void onSuccess() {
-                chatClient.addNewBuddy(shortName);
+                contactsManager.addNewBuddy(shortName);
                 NotifyUser.info("Added as buddy in your contacts. If your buddie adds you also, it will be visible in your network");
               }
             });

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,11 +19,11 @@
  */
 package cc.kune.core.client.sn.actions;
 
-import cc.kune.chat.client.ChatClient;
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.PropertyChangeEvent;
 import cc.kune.common.client.actions.PropertyChangeListener;
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.sn.SimpleContactManager;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateChangedEvent;
 import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
@@ -38,7 +38,8 @@
 
   @Inject
   public WriteToBuddyHeaderButton(final WriteToAction writeToAction, final EntityHeader entityHeader,
-      final StateManager stateManager, final Session session, final ChatClient chatEngine) {
+      final StateManager stateManager, final Session session,
+      final SimpleContactManager simpleContactManager) {
     final ButtonDescriptor button = new ButtonDescriptor(writeToAction);
     // button.setVisible(false);
     button.withText("Write to your buddy");
@@ -60,7 +61,7 @@
         final GroupDTO group = state.getGroup();
         final String groupName = group.getShortName();
         final boolean imLogged = session.isLogged();
-        final boolean isBuddie = chatEngine.isBuddy(groupName);
+        final boolean isBuddie = simpleContactManager.isBuddy(groupName);
         if (imLogged && group.isPersonal() && isBuddie
             && !session.getCurrentUser().getShortName().equals(groupName)) {
           button.setTarget(group);

Copied: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java (from rev 1597, trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions.conditions;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
+import cc.kune.common.client.errors.UIException;
+import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsBuddieCondition implements GuiAddCondition {
+
+  private final Session session;
+  private final SimpleContactManager simpleContactManager;
+
+  @Inject
+  public IsBuddieCondition(final Session session, final SimpleContactManager simpleContactManager) {
+    this.simpleContactManager = simpleContactManager;
+    this.session = session;
+  }
+
+  private boolean isBuddie(final String targetName) {
+    return simpleContactManager.isBuddy(targetName);
+  }
+
+  private boolean isThisGroupInRoster(final GuiActionDescrip descr) {
+    final String targetName = ((GroupDTO) descr.getTarget()).getShortName();
+    return isBuddie(targetName);
+  }
+
+  private boolean isThisPersonInRoster(final GuiActionDescrip descr) {
+    final String targetName = ((UserSimpleDTO) descr.getTarget()).getShortName();
+    return isBuddie(targetName);
+  }
+
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    if (session.isNotLogged()) {
+      return false;
+    }
+    if (descr.getTarget() instanceof UserSimpleDTO) {
+      return isThisPersonInRoster(descr);
+    } else if (descr.getTarget() instanceof GroupDTO) {
+      return isThisGroupInRoster(descr);
+    } else {
+      throw new UIException("Unsupported target");
+    }
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java (from rev 1597, trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions.conditions;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsNotBuddieCondition extends IsBuddieCondition {
+
+  @Inject
+  public IsNotBuddieCondition(final Session session, final SimpleContactManager contactManager) {
+    super(session, contactManager);
+  }
+
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    return !super.mustBeAdded(descr);
+  }
+
+}

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,7 +19,6 @@
  */
 package cc.kune.core.client.sn.actions.registry;
 
-import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
 import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -30,6 +29,7 @@
 import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
 import cc.kune.core.client.sn.actions.RemoveMemberAction;
 import cc.kune.core.client.sn.actions.WriteToAction;
+import cc.kune.core.client.sn.actions.conditions.IsBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
 import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
 import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,7 +19,6 @@
  */
 package cc.kune.core.client.sn.actions.registry;
 
-import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
 import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -30,6 +29,7 @@
 import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
 import cc.kune.core.client.sn.actions.RemoveMemberAction;
 import cc.kune.core.client.sn.actions.WriteToAction;
+import cc.kune.core.client.sn.actions.conditions.IsBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
 import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
 import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -50,6 +50,7 @@
 @SuppressWarnings("serial")
 public class UserSNConfActions extends AbstractSNActionsRegistry {
 
+  public static final String ADD_BUDDIE_BTN = "user-sn-add-buddie-btn";
   public static final MenuDescriptor OPTIONS_MENU = new MenuDescriptor();
   public static final SubMenuDescriptor VISIBILITY_SUBMENU = new SubMenuDescriptor();
 
@@ -76,7 +77,7 @@
 
     final ButtonDescriptor addBuddieBtn = new ButtonDescriptor(addNewBuddiesAction);
 
-    addImpl(addBuddieBtn.withStyles("k-no-backimage"));
+    addImpl(addBuddieBtn.withStyles("k-no-backimage").withId(ADD_BUDDIE_BTN));
 
     stateManager.onStateChanged(true, new StateChangedHandler() {
       @Override

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -19,7 +19,6 @@
  */
 package cc.kune.core.client.sn.actions.registry;
 
-import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
 import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -32,6 +31,7 @@
 import cc.kune.core.client.sn.actions.UnJoinFromThisGroupAction;
 import cc.kune.core.client.sn.actions.WriteToAction;
 import cc.kune.core.client.sn.actions.conditions.ImPartOfGroupCondition;
+import cc.kune.core.client.sn.actions.conditions.IsBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
 import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
 import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -167,7 +167,6 @@
 
   @Override
   public String setTranslation(final Long id, final String translation) throws DefaultException {
-
     final I18nTranslation trans = super.find(id);
     if (trans != null) {
       // Don't permit to translate the def language

Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -240,7 +240,9 @@
     } catch (final ToolNotFoundException e) {
       throw new ContentNotFoundException();
     } catch (final NoDefaultContentException e) {
-      return mapper.map(stateService.createNoHome(user, token.getGroup()), StateNoContentDTO.class);
+      return mapper.map(
+          stateService.createNoHome(user, token.hasNothing() ? user.getShortName() : token.getGroup()),
+          StateNoContentDTO.class);
     }
   }
 

Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/main/resources/kune.properties	2011-11-11 18:50:03 UTC (rev 1602)
@@ -50,7 +50,7 @@
 
 # Translation
 # Currently, we only manage the translations of the proper kune sofware from our demo, so in other kune sites we disable the translator
-kune.ui-translator.enabled = false
+kune.ui-translator.enabled = true
 
 ### Other params
 

Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -24,6 +24,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.openqa.selenium.Alert;
 import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.WebDriver;
@@ -48,7 +49,6 @@
 import cc.kune.selenium.spaces.HomeSpacePageObject;
 import cc.kune.selenium.spaces.SpacesPageObject;
 import cc.kune.selenium.spaces.UserSpacePageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -58,8 +58,8 @@
   public static final Injector INJECTOR = Guice.createInjector(new SeleniumModule());
 
   private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
-  public static boolean mustCloseFinally = true;
-  private final String baseUrl;
+  public static boolean mustCloseFinally = false;
+  private String baseUrl;
   protected final ChatPageObject chat;
   protected final EntityHeaderPageObject entityHeader;
   protected final GroupSpacePageObject groupSpace;
@@ -73,10 +73,23 @@
   private final WebDriver webdriver;
 
   public KuneSeleniumDefaults() {
-    // baseUrl = "http://kune.beta.iepala.es/?locale=en#";
-    // baseUrl =
-    // "http://127.0.0.1:8888/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:9997#";
-    baseUrl = "http://beta.eurosur.org/#";
+    final String localeParam = "?locale=" + SeleniumConf.LANG;
+    switch (SeleniumConf.SITE) {
+    case demo:
+      baseUrl = "http://kune.beta.iepala.es/" + localeParam + "#";
+      break;
+    case localhost:
+      baseUrl = "http://127.0.0.1:8888/" + localeParam + "&log_level=INFO&gwt.codesvr=127.0.0.1:9997#";
+      break;
+    case eurosur:
+      baseUrl = "http://beta.eurosur.org/" + localeParam + "#";
+      break;
+    case kunecc:
+      baseUrl = "http://kune.cc/" + localeParam + "#";
+      break;
+    default:
+      break;
+    }
     injector = INJECTOR;
     webdriver = injector.getInstance(WebDriver.class);
     login = injector.getInstance(LoginPageObject.class);
@@ -99,6 +112,12 @@
     PageFactory.initElements(locator, groupSpace);
   }
 
+  public void answerOnNextPrompt(final String answer) {
+    final Alert alert = webdriver.switchTo().alert();
+    alert.sendKeys(answer);
+    alert.accept();
+  }
+
   @BeforeMethod
   public void beforeMethods(final ITestContext context) {
   }

Added: trunk/src/test/java/cc/kune/selenium/SeleniumConf.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumConf.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumConf.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium;
+
+public final class SeleniumConf {
+
+  public enum Driver {
+    chrome, firefox
+  }
+
+  public enum Lang {
+    en, es
+  }
+
+  public enum Site {
+    demo, eurosur, kunecc, localhost
+  }
+
+  public static final Driver DRIVER = Driver.firefox;
+  /* Configure this for use other lang, site, or driver */
+  public static final Lang LANG = Lang.en;
+  public static final Site SITE = Site.localhost;
+  public static final int TIMEOUT = 25;
+
+  SeleniumConf() {
+    // Final class
+  }
+}

Copied: trunk/src/test/java/cc/kune/selenium/SeleniumConstants.java (from rev 1597, trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumConstants.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumConstants.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium;
+
+public final class SeleniumConstants {
+
+  public static final String FIREFOX_PROFILE_NAME = "selenium";
+  public static final String GWTDEV = "gwt-debug-";
+
+  public static final String INPUT = "-input";
+  /* Configure this for use other lang, site, or driver */
+  public static final String USER_EMAIL = "admin at example.org";
+  public static final String USER_LONGNAME = "Administrator";
+  public static final String USER_PASSWD = "easyeasy";
+  public static final String USER_SHORNAME = "admin";
+
+  SeleniumConstants() {
+    // Final class
+  }
+}

Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -39,7 +39,6 @@
 import cc.kune.selenium.login.LoginPageObject;
 import cc.kune.selenium.login.RegisterPageObject;
 import cc.kune.selenium.spaces.SpacesPageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
 
 import com.google.inject.Singleton;
 
@@ -47,15 +46,23 @@
 
   @Override
   protected void configure() {
-    // final RemoteWebDriver driver = createChromeDriver();
-    final WebDriver driver = creatFirefoxDriver();
+    WebDriver driver;
+    switch (SeleniumConf.DRIVER) {
+    case chrome:
+      driver = createChromeDriver();
+      break;
+    case firefox:
+    default:
+      driver = creatFirefoxDriver();
+      break;
+    }
     final EventFiringWebDriver wrap = new EventFiringWebDriver(driver);
     wrap.register(new CustomWebDriverEventListener());
 
     bind(WebDriver.class).toInstance(wrap);
 
     bind(ElementLocatorFactory.class).toInstance(
-        new AjaxElementLocatorFactory(wrap, SeleniumConstants.TIMEOUT));
+        new AjaxElementLocatorFactory(wrap, SeleniumConf.TIMEOUT));
 
     // Page Objects here!
     bind(LoginPageObject.class).in(Singleton.class);
@@ -67,10 +74,18 @@
     final ResourceBundle english = ResourceBundle.getBundle("TestConstants", Locale.ENGLISH);
     final ResourceBundle spanish = ResourceBundle.getBundle("TestConstants", new Locale("es"));
     Locale.setDefault(Locale.ENGLISH);
-    bind(ResourceBundle.class).toInstance(spanish);
+    switch (SeleniumConf.LANG) {
+    case es:
+      bind(ResourceBundle.class).toInstance(spanish);
+      break;
+    case en:
+    default:
+      bind(ResourceBundle.class).toInstance(english);
+      break;
+    }
+
   }
 
-  @SuppressWarnings("unused")
   private RemoteWebDriver createChromeDriver() {
     // http://code.google.com/p/selenium/wiki/ChromeDriver
     System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");

Modified: trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -25,7 +25,7 @@
 
 import cc.kune.chat.client.ChatClient;
 import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 import com.calclab.hablar.core.client.Idify;

Modified: trunk/src/test/java/cc/kune/selenium/general/EntityHeaderPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/general/EntityHeaderPageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/general/EntityHeaderPageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -24,7 +24,7 @@
 
 import cc.kune.core.client.ws.entheader.EntityTextLogo;
 import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 public class EntityHeaderPageObject extends PageObject {
 

Modified: trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -7,7 +7,7 @@
 import cc.kune.core.client.sitebar.SitebarSignInLink;
 import cc.kune.core.client.sitebar.SitebarSignOutLink;
 import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 public class AbstractLoginObject extends PageObject {
   @FindBy(id = SeleniumConstants.GWTDEV + SitebarSignInLink.SITE_SIGN_IN)

Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -26,7 +26,7 @@
 import cc.kune.core.client.auth.AnonUsersManager;
 import cc.kune.core.client.auth.SignInForm;
 import cc.kune.core.client.auth.SignInPanel;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 public class LoginPageObject extends AbstractLoginObject {
 

Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -26,7 +26,7 @@
 import cc.kune.core.client.auth.Register;
 import cc.kune.core.client.auth.RegisterForm;
 import cc.kune.core.client.auth.RegisterPanel;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 public class RegisterPageObject extends AbstractLoginObject {
 

Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -24,8 +24,8 @@
 
 import cc.kune.core.client.state.SiteTokens;
 import cc.kune.selenium.KuneSeleniumTest;
+import cc.kune.selenium.SeleniumConstants;
 import cc.kune.selenium.SeleniumUtils;
-import cc.kune.selenium.tools.SeleniumConstants;
 
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 
@@ -47,36 +47,52 @@
     login.assertIsConnectedAs(prefix);
     entityHeader.waitForEntityTitle(longName + prefix);
     register.getWelcomeMsg().click();
-    // home space
-    showTitleSlide(t("Home space (your welcome page)"),
-        t("Here you can see a summary of your activity in this site"));
-    spaces.homeBtn().click();
+
+    // // home space
+    // showTitleSlide(t("Home space (your welcome page)"),
+    // t("Here you can see a summary of your activity in this site"));
+    // spaces.homeBtn().click();
+    // sleep(2000);
+    // homeSpace.getSndStats().click();
+    // sleep(2000);
+    // homeSpace.getTrdStats().click();
+    // sleep(2000);
+    //
+    // // user space
+    // showTitleSlide(t("User space (your Inbox)"),
+    // t("contents in which you participate"));
+    // showTooltip(spaces.userBtn());
+    // spaces.userBtn().click();
+    // showMsg(t("You can see this like an advanced email system..."));
+    // userSpace.getFirstWave().click();
+    // sleep(2000);
+    // userSpace.getNewWave().click();
+    // showMsg(t("where you can compose personal messages..."));
+    // showMsg(t("but also create contents to publish later"));
+    // userSpace.rootBlipText().sendKeys(t("Congratulations for your report\n\n"));
+    // sleep(1000);
+    // userSpace.getCursive().click();
+    // userSpace.rootBlipText().sendKeys(
+    // t("Hi there, Just to say that I like") +
+    // t("a lot your last report\n\n"));
+    // sleep(1000);
+    // userSpace.getCursive().click();
+    // userSpace.rootBlipText().sendKeys(t("Best\n\nJane"));
+    // sleep(3000);
+    // userSpace.getRootEdit().click();
+    // userSpace.getAddParcipant().click();
+    // answerOnNextPrompt("admin");
+    // sleep(5000);
+
+    // group space
+    showTitleSlide(t("Your personal public space"), t("here you can have your blog, etc"));
+    spaces.groupBtn().click();
+    groupSpace.addBuddieBtn().click();
+    groupSpace.searchEntitiesTextBox().sendKeys("admin\n");
+    groupSpace.searchEntitiesOk().click();
+    groupSpace.firstAvatarOfGroup().click();
     sleep(2000);
-    homeSpace.getSndStats().click();
-    sleep(2000);
-    homeSpace.getTrdStats().click();
-    sleep(2000);
 
-    // user space
-    showTitleSlide(t("User space (your Inbox)"), t("contents in which you participate"));
-    showTooltip(spaces.userBtn());
-    spaces.userBtn().click();
-    showMsg(t("You can see this like an advanced email system..."));
-    userSpace.getFirstWave().click();
-    sleep(2000);
-    userSpace.getNewWave().click();
-    showMsg(t("where you can compose personal messages..."));
-    showMsg(t("but also create contents to publish later"));
-    userSpace.rootBlipText().sendKeys(t("Congratulations for your report\n\n"));
-    sleep(1000);
-    userSpace.getCursive().click();
-    userSpace.rootBlipText().sendKeys(
-        t("Hi there, Just to say that I like") + t("a lot your last report\n\n"));
-    sleep(1000);
-    userSpace.getCursive().click();
-    userSpace.rootBlipText().sendKeys(t("Best\n\nJane"));
-    sleep(3000);
-    userSpace.getRootEdit().click();
     // chat
     showTitleSlide(t("Chat with your buddies"), t("compatible with gmail and similars"),
         SiteTokens.WAVEINBOX);

Modified: trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -22,10 +22,15 @@
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.FindBy;
 
+import cc.kune.core.client.sitebar.search.EntitySearchPanel;
+import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
 import cc.kune.selenium.PageObject;
+import cc.kune.selenium.SeleniumConstants;
 
 public class GroupSpacePageObject extends PageObject {
 
+  @FindBy(id = SeleniumConstants.GWTDEV + UserSNConfActions.ADD_BUDDIE_BTN)
+  private WebElement addBuddieBtn;
   @FindBy(xpath = "//div[2]/div/div[3]/div/span")
   private WebElement blogTool;
   @FindBy(xpath = "//div[2]/div/div[4]/div/span")
@@ -38,6 +43,10 @@
   private WebElement firstAvatarOfGroup;
   @FindBy(xpath = "//div[2]/div/div[5]/div/span")
   private WebElement listTool;
+  @FindBy(id = SeleniumConstants.GWTDEV + EntitySearchPanel.OK_ID)
+  private WebElement searchEntitiesOk;
+  @FindBy(id = SeleniumConstants.GWTDEV + EntitySearchPanel.ENTITY_SEARCH_TEXTBOX)
+  private WebElement searchEntitiesTextBox;
   @FindBy(xpath = "//div[3]/div/button")
   private WebElement socialNetOptions;
   @FindBy(xpath = "//div[2]/div/div[7]/div/span")
@@ -45,39 +54,51 @@
   @FindBy(xpath = "//div[2]/div/div[7]/div/span")
   private WebElement wikiTool;
 
-  public WebElement getBlogTool() {
+  public WebElement addBuddieBtn() {
+    return addBuddieBtn;
+  }
+
+  public WebElement blogTool() {
     return blogTool;
   }
 
-  public WebElement getChatTool() {
+  public WebElement chatTool() {
     return chatTool;
   }
 
-  public WebElement getDocTool() {
+  public WebElement docTool() {
     return docTool;
   }
 
-  public WebElement getEventTool() {
+  public WebElement eventTool() {
     return eventTool;
   }
 
-  public WebElement getFirstAvatarOfGroup() {
+  public WebElement firstAvatarOfGroup() {
     return firstAvatarOfGroup;
   }
 
-  public WebElement getListTool() {
+  public WebElement listTool() {
     return listTool;
   }
 
-  public WebElement getSocialNetOptions() {
+  public WebElement searchEntitiesOk() {
+    return searchEntitiesOk;
+  }
+
+  public WebElement searchEntitiesTextBox() {
+    return searchEntitiesTextBox;
+  }
+
+  public WebElement socialNetOptions() {
     return socialNetOptions;
   }
 
-  public WebElement getTaskTool() {
+  public WebElement taskTool() {
     return taskTool;
   }
 
-  public WebElement getWikiTool() {
+  public WebElement wikiTool() {
     return wikiTool;
   }
 

Modified: trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -24,7 +24,7 @@
 
 import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView;
 import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.SeleniumConstants;
+import cc.kune.selenium.SeleniumConstants;
 
 public class SpacesPageObject extends PageObject {
 

Modified: trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -27,6 +27,9 @@
 
 public class UserSpacePageObject extends PageObject {
 
+  @FindBy(xpath = "//span[2]/span")
+  private WebElement addParticipant;
+
   @FindBy(xpath = "//div[2]/div/div[2]/div[3]/div[4]")
   private WebElement cursive;
 
@@ -54,6 +57,10 @@
   public UserSpacePageObject() {
   }
 
+  public WebElement getAddParcipant() {
+    return addParticipant;
+  }
+
   public WebElement getCursive() {
     return cursive;
   }

Deleted: trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java	2011-11-11 02:57:03 UTC (rev 1601)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java	2011-11-11 18:50:03 UTC (rev 1602)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.tools;
-
-public final class SeleniumConstants {
-  public static final String FIREFOX_PROFILE_NAME = "selenium";
-  public static final String GWTDEV = "gwt-debug-";
-  public static final String INPUT = "-input";
-  public static final int TIMEOUT = 25;
-  public static final String USER_EMAIL = "admin at example.org";
-  public static final String USER_LONGNAME = "Administrator";
-  public static final String USER_PASSWD = "easyeasy";
-  public static final String USER_SHORNAME = "admin";
-
-  SeleniumConstants() {
-    // Final class
-  }
-}




More information about the kune-commits mailing list