[kune-commits] r1499 - in trunk/src: main/java/cc/kune/chat/client main/java/cc/kune/common/public main/java/cc/kune/core/client main/java/cc/kune/core/client/auth main/java/cc/kune/core/client/groups/newgroup main/java/cc/kune/core/client/rpcservices main/java/cc/kune/core/client/ui main/java/cc/kune/core/client/ws/entheader main/java/cc/kune/core/server main/java/cc/kune/core/server/mail main/java/cc/kune/core/server/manager main/java/cc/kune/core/server/manager/file main/java/cc/kune/core/server/manager/impl main/java/cc/kune/core/server/rpc main/java/cc/kune/core/shared/dto main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/options main/java/cc/kune/gspace/client/options/general main/java/cc/kune/gspace/client/options/logo test/java/cc/kune/core/server/integration test/java/cc/kune/core/server/integration/content test/java/cc/kune/core/server/integration/kuneservice test/java/cc/kune/core/server/integration/site test/java/cc/kune/core/server/integration/socialnet test/java/cc/kune/lists/server

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sat Aug 20 20:04:23 CEST 2011


Author: vjrj_
Date: 2011-08-20 20:04:22 +0200 (Sat, 20 Aug 2011)
New Revision: 1499

Added:
   trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java
   trunk/src/main/java/cc/kune/core/server/mail/
   trunk/src/main/java/cc/kune/core/server/mail/MailManager.java
   trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/
   trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneral.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralView.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneral.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneral.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
   trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java
Removed:
   trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java
Modified:
   trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
   trunk/src/main/java/cc/kune/common/public/kune-common.css
   trunk/src/main/java/cc/kune/core/client/CoreParts.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
   trunk/src/main/java/cc/kune/core/client/ui/DefaultForm.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeader.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
   trunk/src/main/java/cc/kune/core/server/manager/FileManager.java
   trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java
   trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
   trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
   trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
   trunk/src/main/java/cc/kune/core/shared/dto/UserDTO.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
   trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
   trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
   trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
   trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceIntegrationTest.java
   trunk/src/test/java/cc/kune/core/server/integration/kuneservice/GroupServiceTest.java
   trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
   trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java
   trunk/src/test/java/cc/kune/lists/server/ListsServiceTest.java
Log:
User/Group name change

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -39,6 +39,7 @@
   public ChatClientTool(final I18nTranslationService i18n, final ToolSelector toolSelector,
       final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
       final ChatResources res) {
+    // FIXME: change this in ChatConstants and in db via migration
     super(NAME, i18n.t("chatrooms"), toolSelector, cntCapRegistry, i18n, navResources);
     this.res = res;
     registerIcons();

Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css	2011-08-20 18:04:22 UTC (rev 1499)
@@ -134,7 +134,7 @@
 .k-dialog-outerp {
   background-color: #552200;
   border-top: 4px solid #000;
-  padding: 22px 4px 3px 4px;
+  /* padding: 22px 4px 3px 4px; */
 }
 
 .k-dialog-title {

Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -19,6 +19,8 @@
  */
 package cc.kune.core.client;
 
+import cc.kune.core.client.auth.UserFieldFactory;
+import cc.kune.core.client.groups.newgroup.GroupFieldFactory;
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
@@ -38,6 +40,8 @@
       final Provider<UserSNPresenter> buddiesAndParticipationPresenter,
       final Provider<GroupSNConfActions> groupMembersConfActions,
       final Provider<UserSNConfActions> userSNConfActions,
+      final Provider<UserFieldFactory> userFielFactory,
+      final Provider<GroupFieldFactory> groupFielFactory,
       final Provider<SiteUserOptionsPresenter> userOptions) {
     session.onAppStart(true, new AppStartHandler() {
       @Override
@@ -47,6 +51,8 @@
         groupMembersPresenter.get();
         buddiesAndParticipationPresenter.get();
         userOptions.get();
+        userFielFactory.get();
+        groupFielFactory.get();
       }
     });
   }

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -45,36 +45,18 @@
   private final TextField<String> emailRegField;
   private final TextField<String> longNameRegField;
   private final TextField<String> passwdRegField;
+
   private final TextField<String> shortNameRegField;
 
   public RegisterForm(final I18nTranslationService i18n, final Session session) {
     super.addStyleName("kune-Margin-Large-l");
 
-    shortNameRegField = new TextField<String>();
+    shortNameRegField = UserFieldFactory.createUserShortName(NICK_FIELD);
     shortNameRegField.setTabIndex(1);
-    shortNameRegField.setFieldLabel(i18n.t("Username"));
-    shortNameRegField.setName(NICK_FIELD);
-    shortNameRegField.setWidth(DEF_SMALL_FIELD_WIDTH);
-    shortNameRegField.setAllowBlank(false);
-    shortNameRegField.setMinLength(3);
-    shortNameRegField.setMaxLength(15);
-    shortNameRegField.setRegex("^[a-z0-9]+$");
-    shortNameRegField.getMessages().setMinLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameRegField.getMessages().setMaxLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameRegField.getMessages().setRegexText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameRegField.setValidationDelay(1000);
     add(shortNameRegField);
 
-    longNameRegField = new TextField<String>();
+    longNameRegField = UserFieldFactory.createUserLongName(LONGNAME_FIELD);
     longNameRegField.setTabIndex(2);
-    longNameRegField.setFieldLabel(i18n.t("Name"));
-    longNameRegField.setName(LONGNAME_FIELD);
-    longNameRegField.setWidth(DEF_FIELD_WIDTH);
-    longNameRegField.setAllowBlank(false);
-    longNameRegField.setMinLength(3);
-    longNameRegField.setMaxLength(50);
-    // longNameRegField.setValidationEvent(false);
-    longNameRegField.setId(LONGNAME_FIELD);
     add(longNameRegField);
 
     passwdRegField = new TextField<String>();

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -171,7 +171,7 @@
 
       final boolean wantHomepage = true;
 
-      final UserDTO user = new UserDTO(getView().getLongName(), getView().getShortName(),
+      final UserDTO user = new UserDTO(getView().getShortName(), getView().getLongName(),
           getView().getRegisterPassword(), getView().getEmail(), language, country, timezone, null,
           true, SubscriptionMode.manual, "blue");
       super.saveAutocompleteLoginData(getView().getShortName(), getView().getRegisterPassword());

Added: trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,51 @@
+package cc.kune.core.client.auth;
+
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.ui.DefaultForm;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class UserFieldFactory {
+
+  private static I18nTranslationService i18n;
+
+  public static TextField<String> createUserLongName(final String fieldId) {
+    final TextField<String> longNameRegField = new TextField<String>();
+    longNameRegField.setFieldLabel(i18n.t("Name"));
+    longNameRegField.setName(fieldId);
+    longNameRegField.setWidth(DefaultForm.DEF_FIELD_WIDTH);
+    longNameRegField.setAllowBlank(false);
+    longNameRegField.setMinLength(3);
+    longNameRegField.setMaxLength(50);
+    longNameRegField.setId(fieldId);
+    return longNameRegField;
+  }
+
+  public static TextField<String> createUserShortName(final String fieldId) {
+    final String minMaxText = i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15);
+    final TextField<String> field = new TextField<String>();
+    field.setFieldLabel(i18n.t("Username"));
+    field.setName(fieldId);
+    field.setId(fieldId);
+    field.setWidth(DefaultForm.DEF_SMALL_FIELD_WIDTH);
+    field.setAllowBlank(false);
+    field.setMinLength(3);
+    field.setMaxLength(15);
+    field.setRegex("^[a-z0-9]+$");
+    field.getMessages().setMinLengthText(minMaxText);
+    field.getMessages().setMaxLengthText(minMaxText);
+    field.getMessages().setRegexText(minMaxText);
+    field.setValidationDelay(1000);
+    return field;
+  }
+
+  @Inject
+  public UserFieldFactory(final I18nTranslationService i18n) {
+    UserFieldFactory.i18n = i18n;
+  }
+
+}

Added: trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,51 @@
+package cc.kune.core.client.groups.newgroup;
+
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.ui.DefaultForm;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class GroupFieldFactory {
+
+  private static I18nTranslationService i18n;
+
+  public static TextField<String> createUserLongName(final String fieldId) {
+    final TextField<String> field = new TextField<String>();
+    field.setFieldLabel(i18n.t("Long name"));
+    field.setName(fieldId);
+    field.setId(fieldId);
+    field.setWidth(DefaultForm.BIG_FIELD_WIDTH);
+    field.setAllowBlank(false);
+    field.setMinLength(3);
+    field.setMaxLength(50); /* Same in Group.java/longName */
+    field.setValidationDelay(1000);
+    return field;
+  }
+
+  public static TextField<String> createUserShortName(final String fieldId) {
+    final String minMaxText = i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15);
+    final TextField<String> field = new TextField<String>();
+    field.setFieldLabel(i18n.t("Short name"));
+    field.setName(fieldId);
+    field.setId(fieldId);
+    field.setWidth(175);
+    field.setMinLength(3);
+    field.setMaxLength(15); /* Same in Group.java/shortName */
+    field.setAllowBlank(false);
+    field.setRegex("^[a-z0-9]+$");
+    field.getMessages().setMinLengthText(minMaxText);
+    field.getMessages().setMaxLengthText(minMaxText);
+    field.getMessages().setRegexText(minMaxText);
+    field.setValidationDelay(1000);
+    return field;
+  }
+
+  @Inject
+  public GroupFieldFactory(final I18nTranslationService i18n) {
+    GroupFieldFactory.i18n = i18n;
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -25,7 +25,7 @@
 import cc.kune.common.client.ui.dialogs.BasicTopDialog;
 import cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder;
 import cc.kune.common.client.ui.dialogs.MessageToolbar;
-import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.ui.DefaultForm;
 import cc.kune.core.client.ui.DefaultFormUtils;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
@@ -44,7 +44,6 @@
 import com.gwtplatform.mvp.client.ViewImpl;
 
 public class NewGroupPanel extends ViewImpl implements NewGroupView {
-  private static final int BIG_FIELD_WIDTH = 280;
   public static final String CANCEL_BUTTON = "k-ngp-cancel-bt";
   public static final String CLOSED_GROUP_TYPE_ID = "k-ngp-type_of_group_closed";
   public static final String COMM_GROUP_TYPE_ID = "k-ngp-type_of_group_comm";
@@ -125,39 +124,19 @@
     // intro.setStyleName("k-form-intro");
     // form.add(intro);
 
-    shortNameField = new TextField<String>();
-    shortNameField.setValidationDelay(1000);
+    shortNameField = GroupFieldFactory.createUserShortName(SHORTNAME_FIELD);
     shortNameField.setTabIndex(1);
-    shortNameField.setFieldLabel(i18n.t("Short name"));
-    shortNameField.setName(SHORTNAME_FIELD);
-    shortNameField.setWidth(175);
-    shortNameField.setMinLength(3);
-    shortNameField.setMaxLength(15); /* Same in Group.java/shortName */
-    shortNameField.setAllowBlank(false);
-    shortNameField.setRegex("^[a-z0-9]+$");
-    shortNameField.getMessages().setMinLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameField.getMessages().setMaxLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameField.getMessages().setRegexText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15));
-    shortNameField.setValidationDelay(1000);
-
     form.add(shortNameField);
 
-    longNameField = new TextField<String>();
+    longNameField = GroupFieldFactory.createUserLongName(LONGNAME_FIELD);
     longNameField.setTabIndex(2);
-    longNameField.setFieldLabel(i18n.t("Long name"));
-    longNameField.setName(LONGNAME_FIELD);
-    longNameField.setWidth(BIG_FIELD_WIDTH);
-    longNameField.setAllowBlank(false);
-    longNameField.setMinLength(3);
-    longNameField.setMaxLength(50); /* Same in Group.java/longName */
-    longNameField.setValidationDelay(1000);
     form.add(longNameField);
 
     publicDescField = new TextArea();
     publicDescField.setTabIndex(3);
     publicDescField.setFieldLabel(i18n.t("Public description"));
     publicDescField.setName(PUBLICDESC_FIELD);
-    publicDescField.setWidth(BIG_FIELD_WIDTH);
+    publicDescField.setWidth(DefaultForm.BIG_FIELD_WIDTH);
     publicDescField.setAllowBlank(false);
     publicDescField.setMinLength(10);
     publicDescField.setMaxLength(255);
@@ -168,7 +147,7 @@
     tag1.setTabIndex(4);
     tag1.setFieldLabel(i18n.t("Group tags"));
     tag1.setName(TAGS_FIELD);
-    tag1.setWidth(BIG_FIELD_WIDTH);
+    tag1.setWidth(DefaultForm.BIG_FIELD_WIDTH);
     tag1.setAllowBlank(false);
     tag1.setTitle(i18n.t("type some keyword that define your group"));
     tag1.setValidationDelay(1000);

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -25,6 +25,7 @@
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 
 import com.google.gwt.user.client.rpc.RemoteService;
 import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@@ -51,4 +52,7 @@
 
   void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled);
 
+  StateAbstractDTO updateGroup(String userHash, StateToken token, GroupDTO groupDTO)
+      throws DefaultException;
+
 }

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -24,6 +24,7 @@
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
@@ -51,4 +52,7 @@
   void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled,
       AsyncCallback<Void> asyncCallback);
 
+  void updateGroup(String userHash, StateToken token, GroupDTO groupDTO,
+      AsyncCallback<StateAbstractDTO> callback);
+
 }

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -22,6 +22,7 @@
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
 import cc.kune.core.shared.dto.WaveClientParams;
@@ -32,20 +33,22 @@
 @RemoteServiceRelativePath("UserService")
 public interface UserService extends RemoteService {
 
-    void createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
+  void createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
 
-    String getUserAvatarBaser64(String userHash, StateToken userToken) throws DefaultException;
+  String getUserAvatarBaser64(String userHash, StateToken userToken) throws DefaultException;
 
-    UserInfoDTO login(String nickOrEmail, String passwd, String waveToken) throws DefaultException;
+  WaveClientParams getWaveClientParameters(String userHash);
 
-    void logout(String userHash) throws DefaultException;
+  UserInfoDTO login(String nickOrEmail, String passwd, String waveToken) throws DefaultException;
 
-    void onlyCheckSession(String userHash) throws DefaultException;
+  void logout(String userHash) throws DefaultException;
 
-    UserInfoDTO reloadUserInfo(String userHash) throws DefaultException;
+  void onlyCheckSession(String userHash) throws DefaultException;
 
-    void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility);
+  UserInfoDTO reloadUserInfo(String userHash) throws DefaultException;
 
-    WaveClientParams getWaveClientParameters(String userHash);
+  void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility);
 
+  StateAbstractDTO updateUser(String userHash, UserDTO user) throws DefaultException;
+
 }

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -21,6 +21,7 @@
 
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
 import cc.kune.core.shared.dto.WaveClientParams;
@@ -29,20 +30,23 @@
 
 public interface UserServiceAsync {
 
-    void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<Void> asyncCallback);
+  void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<Void> asyncCallback);
 
-    void getUserAvatarBaser64(String userHash, StateToken userToken, AsyncCallback<String> asyncCallback);
+  void getUserAvatarBaser64(String userHash, StateToken userToken, AsyncCallback<String> asyncCallback);
 
-    void getWaveClientParameters(String userHash, AsyncCallback<WaveClientParams> asyncCallback);
+  void getWaveClientParameters(String userHash, AsyncCallback<WaveClientParams> asyncCallback);
 
-    void login(String nickOrEmail, String passwd, String waveCookieValue, AsyncCallback<UserInfoDTO> asyncCallback);
+  void login(String nickOrEmail, String passwd, String waveCookieValue,
+      AsyncCallback<UserInfoDTO> asyncCallback);
 
-    void logout(String userHash, AsyncCallback<Void> asyncCallback);
+  void logout(String userHash, AsyncCallback<Void> asyncCallback);
 
-    void onlyCheckSession(String userHash, AsyncCallback<Void> asyncCallback);
+  void onlyCheckSession(String userHash, AsyncCallback<Void> asyncCallback);
 
-    void reloadUserInfo(String userHash, AsyncCallback<UserInfoDTO> asyncCallback);
+  void reloadUserInfo(String userHash, AsyncCallback<UserInfoDTO> asyncCallback);
 
-    void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility,
-            AsyncCallback<Void> asyncCallback);
+  void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility,
+      AsyncCallback<Void> asyncCallback);
+
+  void updateUser(String userHash, UserDTO user, AsyncCallback<StateAbstractDTO> callback);
 }

Modified: trunk/src/main/java/cc/kune/core/client/ui/DefaultForm.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/DefaultForm.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/ui/DefaultForm.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -36,122 +36,123 @@
 
 public class DefaultForm {
 
-    public static final int DEF_FIELD_LABEL_WITH = 75;
-    public static final int DEF_FIELD_WIDTH = 200;
-    public static final int DEF_MEDIUM_FIELD_WIDTH = 150;
-    public static final int DEF_SMALL_FIELD_WIDTH = 100;
-    public static final int DEF_XSMALL_FIELD_WIDTH = 50;
+  public static final int BIG_FIELD_WIDTH = 280;
+  public static final int DEF_FIELD_LABEL_WITH = 75;
+  public static final int DEF_FIELD_WIDTH = 200;
+  public static final int DEF_MEDIUM_FIELD_WIDTH = 150;
+  public static final int DEF_SMALL_FIELD_WIDTH = 100;
+  public static final int DEF_XSMALL_FIELD_WIDTH = 50;
 
-    private final FormPanel form;
+  private final FormPanel form;
 
-    public DefaultForm() {
-        this(HorizontalAlignment.LEFT);
-    }
+  public DefaultForm() {
+    this(HorizontalAlignment.LEFT);
+  }
 
-    public DefaultForm(final HorizontalAlignment buttonAlign) {
-        form = new FormPanel();
-        form.setFrame(true);
-        form.setPadding(10);
-        form.setBorders(false);
-        form.setLabelWidth(DEF_FIELD_LABEL_WITH);
-        form.setLabelAlign(LabelAlign.LEFT);
-        form.setButtonAlign(buttonAlign);
-        form.setHeaderVisible(false);
-    }
+  public DefaultForm(final HorizontalAlignment buttonAlign) {
+    form = new FormPanel();
+    form.setFrame(true);
+    form.setPadding(10);
+    form.setBorders(false);
+    form.setLabelWidth(DEF_FIELD_LABEL_WITH);
+    form.setLabelAlign(LabelAlign.LEFT);
+    form.setButtonAlign(buttonAlign);
+    form.setHeaderVisible(false);
+  }
 
-    public DefaultForm(final String title) {
-        this(title, HorizontalAlignment.LEFT);
-    }
+  public DefaultForm(final String title) {
+    this(title, HorizontalAlignment.LEFT);
+  }
 
-    public DefaultForm(final String title, final HorizontalAlignment buttonAlign) {
-        this(buttonAlign);
-        form.setTitle(title);
-    }
+  public DefaultForm(final String title, final HorizontalAlignment buttonAlign) {
+    this(buttonAlign);
+    form.setTitle(title);
+  }
 
-    public void add(final Field<?> field) {
-        form.add(field);
-    }
+  public void add(final Field<?> field) {
+    form.add(field);
+  }
 
-    public void add(final FieldSet fieldset) {
-        form.add(fieldset);
-    }
+  public void add(final FieldSet fieldset) {
+    form.add(fieldset);
+  }
 
-    public void add(final Label label) {
-        form.add(label);
-    }
+  public void add(final Label label) {
+    form.add(label);
+  }
 
-    public void add(final Widget widget) {
-        form.add(widget);
-    }
+  public void add(final Widget widget) {
+    form.add(widget);
+  }
 
-    public void addButton(final Button button) {
-        form.addButton(button);
-    }
+  public void addButton(final Button button) {
+    form.addButton(button);
+  }
 
-    public void addListener(final EventType eventType, final Listener<? extends BaseEvent> listener) {
-        form.addListener(eventType, listener);
-    }
+  public void addListener(final EventType eventType, final Listener<? extends BaseEvent> listener) {
+    form.addListener(eventType, listener);
+  }
 
-    public void addStyleName(final String cls) {
-        form.addStyleName(cls);
-    }
+  public void addStyleName(final String cls) {
+    form.addStyleName(cls);
+  }
 
-    public FormPanel getFormPanel() {
-        return form;
-    }
+  public FormPanel getFormPanel() {
+    return form;
+  }
 
-    public void insert(final int index, final Component component) {
-        form.insert(component, index);
-    }
+  public void insert(final int index, final Component component) {
+    form.insert(component, index);
+  }
 
-    public boolean isValid() {
-        return form.isValid();
-    }
+  public boolean isValid() {
+    return form.isValid();
+  }
 
-    public void removeStyleName(final String cls) {
-        form.removeStyleName(cls);
-    }
+  public void removeStyleName(final String cls) {
+    form.removeStyleName(cls);
+  }
 
-    public void reset() {
-        form.reset();
-    }
+  public void reset() {
+    form.reset();
+  }
 
-    public void setAutoHeight(final boolean autoHeight) {
-        form.setAutoHeight(autoHeight);
-    }
+  public void setAutoHeight(final boolean autoHeight) {
+    form.setAutoHeight(autoHeight);
+  }
 
-    public void setAutoWidth(final boolean autoWidth) {
-        form.setAutoWidth(autoWidth);
-    }
+  public void setAutoWidth(final boolean autoWidth) {
+    form.setAutoWidth(autoWidth);
+  }
 
-    public void setFrame(final boolean frame) {
-        form.setFrame(frame);
-    }
+  public void setFrame(final boolean frame) {
+    form.setFrame(frame);
+  }
 
-    public void setHeight(final int height) {
-        form.setHeight(height);
-    }
+  public void setHeight(final int height) {
+    form.setHeight(height);
+  }
 
-    public void setHideLabels(final boolean hide) {
-        form.setHideLabels(hide);
-    }
+  public void setHideLabels(final boolean hide) {
+    form.setHideLabels(hide);
+  }
 
-    public void setIconCls(final String iconCls) {
-        form.setIconStyle(iconCls);
-    }
+  public void setIconCls(final String iconCls) {
+    form.setIconStyle(iconCls);
+  }
 
-    public void setPadding(final int padding) {
-        form.setPadding(padding);
-    }
+  public void setPadding(final int padding) {
+    form.setPadding(padding);
+  }
 
-    public void setWidth(final int width) {
-        form.setWidth(width);
-    }
+  public void setWidth(final int width) {
+    form.setWidth(width);
+  }
 
-    public void validate() {
-        final List<Field<?>> fields = form.getFields();
-        for (final Field<?> field : fields) {
-            field.validate();
-        }
+  public void validate() {
+    final List<Field<?>> fields = form.getFields();
+    for (final Field<?> field : fields) {
+      field.validate();
     }
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeader.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeader.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeader.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -25,18 +25,13 @@
 
 public interface EntityHeader {
 
-    void addAction(GuiActionDescrip descriptor);
+  void addAction(GuiActionDescrip descriptor);
 
-    void addWidget(IsWidget widget);
+  void addWidget(IsWidget widget);
 
-    /**
-     * Refresh the logo from the group info in the client session
-     */
-    void refreshGroupLogo();
+  /**
+   * Reload the logo from the group reloaded from the server
+   */
+  void reloadGroupLogoImage();
 
-    /**
-     * Reload the logo from the group reloaded from the server
-     */
-    void reloadGroupLogoImage();
-
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -25,8 +25,8 @@
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent;
-import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent.CurrentLogoChangedHandler;
+import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent;
+import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent.CurrentEntityChangedHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.IsWidget;
@@ -85,9 +85,10 @@
         setGroupLogo(session.getCurrentState().getGroup());
       }
     });
-    eventBus.addHandler(CurrentLogoChangedEvent.getType(), new CurrentLogoChangedHandler() {
+    eventBus.addHandler(CurrentEntityChangedEvent.getType(), new CurrentEntityChangedHandler() {
       @Override
-      public void onCurrentLogoChanged(final CurrentLogoChangedEvent event) {
+      public void onCurrentLogoChanged(final CurrentEntityChangedEvent event) {
+        setGroupLogo(session.getCurrentState().getGroup());
         reloadGroupLogoImage();
       }
     });
@@ -104,11 +105,6 @@
   }
 
   @Override
-  public void refreshGroupLogo() {
-    setGroupLogo(session.getCurrentState().getGroup());
-  }
-
-  @Override
   public void reloadGroupLogoImage() {
     getView().reloadImage(session.getCurrentState().getGroup());
   }

Added: trunk/src/main/java/cc/kune/core/server/mail/MailManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailManager.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailManager.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,35 @@
+package cc.kune.core.server.mail;
+
+import cc.kune.core.server.mail.MailManagerDefault.FormatedString;
+
+public interface MailManager {
+
+  /**
+   * @param subject
+   *          the email subject
+   * @param body
+   *          the body of the email in html format
+   * @param from
+   *          the sender
+   * @param to
+   *          the recipients
+   * @return true if sender (also we can change this interface if it's more
+   *         useful to return other thing)
+   */
+  boolean sendHtml(FormatedString subject, FormatedString body, String from, String... to);
+
+  /**
+   * @param subject
+   *          the email subject
+   * @param body
+   *          the body of the email in text format
+   * @param from
+   *          the sender
+   * @param to
+   *          the recipient
+   * @return true if sender (also we can change this interface if it's more
+   *         useful to return other thing)
+   */
+  boolean sendPlain(FormatedString subject, FormatedString body, String from, String... to);
+
+}

Added: trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,34 @@
+package cc.kune.core.server.mail;
+
+public class MailManagerDefault implements MailManager {
+
+  public static class FormatedString {
+
+    private final String string;
+
+    public FormatedString(final String template, final Object... args) {
+      string = String.format(template, args);
+    }
+
+    public String getString() {
+      return string;
+    }
+  }
+
+  public MailManagerDefault(final String mailServer, final String otherConfigurableMailServerParams) {
+  }
+
+  @Override
+  public boolean sendHtml(final FormatedString subject, final FormatedString body, final String from,
+      final String... to) {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public boolean sendPlain(final FormatedString subject, final FormatedString body, final String from,
+      final String... to) {
+    // TODO Auto-generated method stub
+    return false;
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/server/manager/FileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/FileManager.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/FileManager.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -38,6 +38,13 @@
   File createFileWithSequentialName(String dir, String fileName) throws IOException;
 
   /**
+   * @param file
+   *          path
+   * @return returns true if exists
+   */
+  boolean exists(String file);
+
+  /**
    * @param dir
    *          the directory (use File.separator for dir delimiters)
    * @return true if and only if the directory was created, along with all
@@ -45,6 +52,8 @@
    */
   boolean mkdir(String dir);
 
+  boolean mv(String oldFile, String newFile);
+
   /**
    * @param dir
    *          the directory (use File.separator for dir delimiters)

Modified: trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -27,6 +27,7 @@
 import cc.kune.core.client.errors.GroupShortNameInUseException;
 import cc.kune.core.client.errors.UserMustBeLoggedException;
 import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.domain.Content;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;
@@ -37,8 +38,10 @@
 
   void changeWsTheme(User user, Group group, String theme) throws AccessViolationException;
 
-  void checkIfNamesAreInUse(String shortName, String longName);
+  void checkIfLongNameAreInUse(String shortName);
 
+  void checkIfShortNameAreInUse(String longName);
+
   void clearGroupBackImage(Group group);
 
   Group createGroup(Group group, User user, String publicDescrip) throws GroupShortNameInUseException,
@@ -77,4 +80,14 @@
 
   void setToolEnabled(User userLogged, String groupShortName, String toolName, boolean enabled);
 
+  /**
+   * @param groupId
+   *          the id of the Group to update
+   * @param groupDTO
+   *          the group with the name values to change (currently only changes
+   *          shortname & longname)
+   * @return returns the Group just persisted
+   */
+  Group update(Long groupId, GroupDTO groupDTO);
+
 }

Modified: trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -24,6 +24,7 @@
 import cc.kune.core.client.errors.I18nNotFoundException;
 import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.domain.User;
 import cc.kune.domain.utils.UserBuddiesData;
 
@@ -70,4 +71,13 @@
 
   void setSNetVisibility(User user, UserSNetVisibility visibility);
 
+  /**
+   * @param userId
+   *          the userId to change
+   * @param user
+   *          the userDTO with values to change
+   * @return the User after updated
+   */
+  User update(Long userId, UserDTO user);
+
 }

Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -47,11 +47,22 @@
   }
 
   @Override
+  public boolean exists(final String file) {
+    return new File(file).exists();
+  }
+
+  @Override
   public boolean mkdir(final String dir) {
     return new File(dir).mkdirs();
   }
 
   @Override
+  public boolean mv(final String oldPath, final String newPath) {
+    final File oldFile = new File(oldPath);
+    return oldFile.renameTo(new File(newPath));
+  }
+
+  @Override
   public boolean rm(final String dir, final String fileName) {
     final File file = new File(dir, fileName);
     return file.delete();

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-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -34,6 +34,7 @@
 import org.hibernate.exception.ConstraintViolationException;
 
 import cc.kune.core.client.errors.AccessViolationException;
+import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.client.errors.EmailAddressInUseException;
 import cc.kune.core.client.errors.GroupLongNameInUseException;
 import cc.kune.core.client.errors.GroupShortNameInUseException;
@@ -50,6 +51,7 @@
 import cc.kune.core.shared.domain.AdmissionType;
 import cc.kune.core.shared.domain.GroupListMode;
 import cc.kune.core.shared.domain.SocialNetworkVisibility;
+import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.GroupType;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.domain.AccessLists;
@@ -118,6 +120,20 @@
   }
 
   @Override
+  public void checkIfLongNameAreInUse(final String longName) {
+    if (finder.countByLongName(longName) != 0) {
+      throw new GroupLongNameInUseException();
+    }
+  }
+
+  @Override
+  public void checkIfShortNameAreInUse(final String shortName) {
+    if (finder.countByShortName(shortName) != 0) {
+      throw new GroupShortNameInUseException();
+    }
+  }
+
+  @Override
   public void clearGroupBackImage(final Group group) {
     final String file = group.getBackgroundImage();
     if (file != null) {
@@ -130,7 +146,8 @@
   @Override
   public Group createGroup(final Group group, final User user, final String publicDescrip)
       throws GroupShortNameInUseException, GroupLongNameInUseException, UserMustBeLoggedException {
-    checkIfNamesAreInUse(group.getShortName(), group.getLongName());
+    checkIfShortNameAreInUse(group.getShortName());
+    checkIfLongNameAreInUse(group.getLongName());
     final String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
     if (User.isKnownUser(user)) {
       GroupListMode publicVisibility = GroupListMode.EVERYONE;
@@ -311,13 +328,31 @@
     toolConfiguration.setEnabled(enabled);
   }
 
-  public void checkIfNamesAreInUse(final String shortName, final String longName) {
-    if (finder.countByShortName(shortName) != 0) {
-      throw new GroupShortNameInUseException();
+  @Override
+  public Group update(final Long groupId, final GroupDTO groupDTO) {
+    final Group group = find(groupId);
+    final String shortName = groupDTO.getShortName();
+    final String longName = groupDTO.getLongName();
+    if (!longName.equals(group.getLongName())) {
+      checkIfLongNameAreInUse(longName);
+      group.setLongName(longName);
     }
-    if (finder.countByLongName(longName) != 0) {
-      throw new GroupLongNameInUseException();
+    if (!shortName.equals(group.getShortName())) {
+      checkIfShortNameAreInUse(shortName);
+      final String oldDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION)
+          + FileUtils.groupToDir(group.getShortName());
+      final String newDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION)
+          + FileUtils.groupToDir(shortName);
+      if (fileManager.exists(oldDir)) {
+        if (fileManager.exists(newDir)) {
+          throw new DefaultException("Destination group directory exists");
+        }
+        fileManager.mv(oldDir, newDir);
+      }
+      group.setShortName(shortName);
     }
+    persist(group);
+    return group;
   }
 
 }

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -54,7 +54,9 @@
 import cc.kune.core.server.xmpp.ChatException;
 import cc.kune.core.server.xmpp.XmppManager;
 import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.domain.Group;
 import cc.kune.domain.I18nCountry;
 import cc.kune.domain.I18nLanguage;
 import cc.kune.domain.User;
@@ -107,6 +109,32 @@
     this.groupManager = groupManager;
   }
 
+  private void checkIfEmailAreInUse(final String email) {
+    if (userFinder.countByEmail(email) != 0) {
+      throw new EmailAddressInUseException();
+    }
+  }
+
+  private void checkIfLongNameAreInUse(final String longName) {
+    if (userFinder.countByLongName(longName) != 0) {
+      throw new GroupLongNameInUseException();
+    }
+    groupManager.checkIfLongNameAreInUse(longName);
+  }
+
+  private void checkIfNamesAreInUse(final String shortName, final String longName, final String email) {
+    checkIfShortNameAreInUse(shortName);
+    checkIfLongNameAreInUse(longName);
+    checkIfEmailAreInUse(email);
+  }
+
+  private void checkIfShortNameAreInUse(final String shortName) {
+    if (userFinder.countByShortName(shortName) != 0) {
+      throw new GroupShortNameInUseException();
+    }
+    groupManager.checkIfShortNameAreInUse(shortName);
+  }
+
   @Override
   public User createUser(final String shortName, final String longName, final String email,
       final String passwd, final String langCode, final String countryCode, final String timezone,
@@ -114,18 +142,9 @@
     I18nLanguage language;
     I18nCountry country;
     TimeZone tz;
-    if (userFinder.countByShortName(shortName) != 0) {
-      throw new GroupShortNameInUseException();
-    }
-    if (userFinder.countByLongName(longName) != 0) {
-      throw new GroupLongNameInUseException();
-    }
-    groupManager.checkIfNamesAreInUse(shortName, longName);
-    if (userFinder.countByEmail(email) != 0) {
-      throw new EmailAddressInUseException();
-    }
+    checkIfNamesAreInUse(shortName, longName, email);
     try {
-      language = languageManager.findByCode(langCode);
+      language = findLanguage(langCode);
       country = countryManager.findByCode(countryCode);
       tz = TimeZone.getTimeZone(timezone);
     } catch (final NoResultException e) {
@@ -191,6 +210,10 @@
     return userFinder.findByShortName(shortName);
   }
 
+  private I18nLanguage findLanguage(final String langCode) {
+    return languageManager.findByCode(langCode);
+  }
+
   public List<User> getAll() {
     return userFinder.getAll();
   }
@@ -301,4 +324,33 @@
     persist(user);
   }
 
+  @Override
+  public User update(final Long userId, final UserDTO userDTO) {
+    final User user = find(userId);
+    final String shortName = userDTO.getShortName();
+    final String longName = userDTO.getName();
+    final String email = userDTO.getEmail();
+    final Group userGroup = user.getUserGroup();
+    // We don't allow to change shortName because we cannot change shotNames in
+    // wave accounts
+    // if (!shortName.equals(user.getShortName())) {
+    // checkIfShortNameAreInUse(shortName);
+    // user.setShortName(shortName);
+    // userGroup.setShortName(shortName);
+    // }
+    if (longName != null && !longName.equals(user.getName())) {
+      checkIfLongNameAreInUse(longName);
+      user.setName(longName);
+      userGroup.setLongName(longName);
+    }
+    if (email != null && !email.equals(user.getEmail())) {
+      checkIfEmailAreInUse(email);
+      user.setEmail(email);
+    }
+    user.setLanguage(findLanguage(userDTO.getLanguage().getCode()));
+    persist(user);
+    groupManager.persist(userGroup);
+    return user;
+  }
+
 }

Modified: trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -19,6 +19,7 @@
  */
 package cc.kune.core.server.rpc;
 
+import cc.kune.core.client.errors.AccessViolationException;
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.client.rpcservices.GroupService;
 import cc.kune.core.server.UserSession;
@@ -35,10 +36,9 @@
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManagerDefault;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -46,9 +46,8 @@
 
 public class GroupRPC implements RPC, GroupService {
   private final ContentManager contentManager;
+  private final ContentRPC contentRPC;
   private final GroupManager groupManager;
-  private final I18nTranslationService i18n;
-  private final KuneWaveManagerDefault kuneWaveManager;
   private final Mapper mapper;
   private final ReservedWordsRegistry reserverdWords;
   private final Provider<UserSession> userSessionProvider;
@@ -56,15 +55,13 @@
   @Inject
   public GroupRPC(final Provider<UserSession> userSessionProvider, final GroupManager groupManager,
       final ContentManager contentManager, final Mapper mapper,
-      final KuneWaveManagerDefault kuneWaveManager, final I18nTranslationService i18n,
-      final ReservedWordsRegistry reserverdWords) {
+      final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
     this.userSessionProvider = userSessionProvider;
     this.groupManager = groupManager;
     this.contentManager = contentManager;
     this.mapper = mapper;
-    this.kuneWaveManager = kuneWaveManager;
-    this.i18n = i18n;
     this.reserverdWords = reserverdWords;
+    this.contentRPC = contentRPC;
   }
 
   @Override
@@ -161,4 +158,18 @@
     groupManager.setToolEnabled(getUserLogged(), groupToken.getGroup(), toolName, enabled);
   }
 
+  @Override
+  @Authenticated
+  @Transactional
+  @Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
+  public StateAbstractDTO updateGroup(final String userHash, final StateToken token,
+      final GroupDTO groupDTO) throws DefaultException {
+    final Group group = groupManager.findByShortName(token.getGroup());
+    final Long id = group.getId();
+    if (!id.equals(groupDTO.getId())) {
+      throw new AccessViolationException();
+    }
+    final Group updatedGroup = groupManager.update(id, groupDTO);
+    return contentRPC.getContent(userHash, token.setGroup(updatedGroup.getShortName()));
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -34,9 +34,6 @@
 import cc.kune.core.server.auth.ActionLevel;
 import cc.kune.core.server.auth.Authenticated;
 import cc.kune.core.server.auth.Authorizated;
-import cc.kune.core.server.auth.SessionService;
-import cc.kune.core.server.content.ContentManager;
-import cc.kune.core.server.manager.GroupManager;
 import cc.kune.core.server.manager.UserManager;
 import cc.kune.core.server.mapper.Mapper;
 import cc.kune.core.server.properties.ReservedWordsRegistry;
@@ -45,10 +42,10 @@
 import cc.kune.core.shared.domain.AccessRol;
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
 import cc.kune.core.shared.dto.WaveClientParams;
-import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;
 import cc.kune.wave.server.CustomWaveClientServlet;
@@ -60,12 +57,9 @@
 
 public class UserRPC implements RPC, UserService {
 
-  private final ContentManager contentManager;
-  private final GroupManager groupManager;
-  private final I18nTranslationService i18n;
+  private final ContentRPC contentRPC;
   private final Mapper mapper;
   private final ReservedWordsRegistry reserverdWords;
-  private final Provider<SessionService> sessionServiceProvider;
   private final UserInfoService userInfoService;
   private final UserManager userManager;
   private final Provider<UserSession> userSessionProvider;
@@ -74,25 +68,20 @@
   private final SessionManager waveSessionManager;
 
   @Inject
-  public UserRPC(final Provider<SessionService> sessionServiceProvider,
-      final Provider<UserSession> userSessionProvider, final UserManager userManager,
-      @Named(CoreSettings.USE_SOCKETIO) final Boolean useSocketIO, final GroupManager groupManager,
+  public UserRPC(final Provider<UserSession> userSessionProvider, final UserManager userManager,
+      @Named(CoreSettings.USE_SOCKETIO) final Boolean useSocketIO,
       final UserInfoService userInfoService, final Mapper mapper,
       final SessionManager waveSessionManager, final CustomWaveClientServlet waveClientServlet,
-      final I18nTranslationService i18n, final ContentManager contentManager,
-      final ReservedWordsRegistry reserverdWords) {
-    this.sessionServiceProvider = sessionServiceProvider;
+      final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
     this.userSessionProvider = userSessionProvider;
     this.userManager = userManager;
     this.useSocketIO = useSocketIO;
-    this.groupManager = groupManager;
     this.userInfoService = userInfoService;
     this.mapper = mapper;
     this.waveSessionManager = waveSessionManager;
     this.waveClientServlet = waveClientServlet;
-    this.i18n = i18n;
-    this.contentManager = contentManager;
     this.reserverdWords = reserverdWords;
+    this.contentRPC = contentRPC;
   }
 
   @Override
@@ -201,4 +190,16 @@
     }
     userManager.setSNetVisibility(user, visibility);
   }
+
+  @Override
+  @Authenticated
+  @Transactional
+  public StateAbstractDTO updateUser(final String userHash, final UserDTO user) throws DefaultException {
+    final Long id = getUserSession().getUser().getId();
+    if (!id.equals(user.getId())) {
+      throw new AccessViolationException();
+    }
+    final User userUpdated = userManager.update(id, user);
+    return contentRPC.getContent(userHash, userUpdated.getUserGroup().getStateToken());
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/shared/dto/UserDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/UserDTO.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/core/shared/dto/UserDTO.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -39,7 +39,7 @@
         this(null, null, null, null, null, null, null, null, true, null, null);
     }
 
-    public UserDTO(final String name, final String shortName, final String password, final String email,
+    public UserDTO(final String shortName, final String name, final String password, final String email,
             final I18nLanguageDTO language, final I18nCountryDTO country, final TimeZoneDTO timezone,
             final String avatar, final boolean publishRoster, final SubscriptionMode subscriptionMode,
             final String chatColor) {

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -53,6 +53,14 @@
 import cc.kune.gspace.client.options.UserOptionsPanel;
 import cc.kune.gspace.client.options.UserOptionsPresenter;
 import cc.kune.gspace.client.options.UserOptionsView;
+import cc.kune.gspace.client.options.general.GroupOptGeneral;
+import cc.kune.gspace.client.options.general.GroupOptGeneralPanel;
+import cc.kune.gspace.client.options.general.GroupOptGeneralPresenter;
+import cc.kune.gspace.client.options.general.GroupOptGeneralView;
+import cc.kune.gspace.client.options.general.UserOptGeneral;
+import cc.kune.gspace.client.options.general.UserOptGeneralPanel;
+import cc.kune.gspace.client.options.general.UserOptGeneralPresenter;
+import cc.kune.gspace.client.options.general.UserOptGeneralView;
 import cc.kune.gspace.client.options.license.GroupOptDefLicense;
 import cc.kune.gspace.client.options.license.GroupOptDefLicensePanel;
 import cc.kune.gspace.client.options.license.GroupOptDefLicensePresenter;
@@ -144,6 +152,8 @@
     s(GroupOptionsCollection.class);
     s(TranslatorTabsCollection.class);
 
+    s(GroupOptGeneral.class, GroupOptGeneralPresenter.class);
+    s(GroupOptGeneralView.class, GroupOptGeneralPanel.class);
     s(GroupOptDefLicense.class, GroupOptDefLicensePresenter.class);
     s(GroupOptDefLicenseView.class, GroupOptDefLicensePanel.class);
     s(GroupOptStyle.class, GroupOptStylePresenter.class);
@@ -153,6 +163,8 @@
     s(GroupOptTools.class, GroupOptToolsPresenter.class);
     s(GroupOptToolsView.class, GroupOptToolsPanel.class);
 
+    s(UserOptGeneral.class, UserOptGeneralPresenter.class);
+    s(UserOptGeneralView.class, UserOptGeneralPanel.class);
     s(UserOptDefLicense.class, UserOptDefLicensePresenter.class);
     s(UserOptDefLicenseView.class, UserOptDefLicensePanel.class);
     s(UserOptStyle.class, UserOptStylePresenter.class);

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -30,6 +30,8 @@
 import cc.kune.gspace.client.options.GroupOptionsCollection;
 import cc.kune.gspace.client.options.UserOptions;
 import cc.kune.gspace.client.options.UserOptionsCollection;
+import cc.kune.gspace.client.options.general.GroupOptGeneral;
+import cc.kune.gspace.client.options.general.UserOptGeneral;
 import cc.kune.gspace.client.options.license.GroupOptDefLicense;
 import cc.kune.gspace.client.options.license.UserOptDefLicense;
 import cc.kune.gspace.client.options.logo.GroupOptLogo;
@@ -57,10 +59,11 @@
       final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector,
       final Provider<NoHomePageViewer> noHome, final Provider<ContentViewerPresenter> docsViewer,
       final Provider<FolderViewerPresenter> folderViewer, final Provider<GroupOptions> go,
-      final Provider<UserOptions> uo, final Provider<GroupOptionsCollection> goc,
-      final Provider<UserOptionsCollection> uoc, final Provider<GroupOptDefLicense> gdl,
-      final Provider<GroupOptStyle> gps, final Provider<GroupOptLogo> gl,
-      final Provider<GroupOptTools> gtc, final Provider<UserOptDefLicense> udl,
+      final Provider<UserOptions> uo, final Provider<GroupOptionsCollection> gocProv,
+      final Provider<UserOptionsCollection> uocProv, final Provider<GroupOptGeneral> gg,
+      final Provider<GroupOptDefLicense> gdl, final Provider<GroupOptStyle> gps,
+      final Provider<GroupOptLogo> gl, final Provider<GroupOptTools> gtc,
+      final Provider<UserOptGeneral> ug, final Provider<UserOptDefLicense> udl,
       final Provider<UserOptStyle> ups, final Provider<UserOptLogo> ul,
       final Provider<UserOptTools> utc, final Provider<SitebarSearchPresenter> siteSearch,
       final Provider<SiteOptionsI18nTranslatorAction> transAction,
@@ -79,14 +82,18 @@
         noHome.get();
 
         // Add User & Groups Options
-        goc.get().add(gtc);
-        goc.get().add(gl);
-        goc.get().add(gps);
-        goc.get().add(gdl);
-        uoc.get().add(utc);
-        uoc.get().add(ul);
-        uoc.get().add(ups);
-        uoc.get().add(udl);
+        final GroupOptionsCollection goc = gocProv.get();
+        final UserOptionsCollection uoc = uocProv.get();
+        goc.add(gg);
+        goc.add(gtc);
+        goc.add(gl);
+        goc.add(gps);
+        goc.add(gdl);
+        uoc.add(ug);
+        uoc.add(utc);
+        uoc.add(ul);
+        uoc.add(ups);
+        uoc.add(udl);
 
         // Init
         go.get();

Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -25,9 +25,12 @@
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
 import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateChangedEvent;
 import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.UserSignOutEvent;
+import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
@@ -38,13 +41,15 @@
   private final I18nTranslationService i18n;
   private final CoreResources img;
   private ButtonDescriptor prefsItem;
+  private final Session session;
   private final StateManager stateManager;
   private GroupOptionsView view;
 
   @Inject
-  public GroupOptionsPresenter(final StateManager stateManager, final I18nTranslationService i18n,
-      final CoreResources img, final GroupOptionsView view) {
+  public GroupOptionsPresenter(final StateManager stateManager, final Session session,
+      final I18nTranslationService i18n, final CoreResources img, final GroupOptionsView view) {
     this.stateManager = stateManager;
+    this.session = session;
     this.i18n = i18n;
     this.img = img;
     init(view);
@@ -86,6 +91,12 @@
         }
       }
     });
+    session.onUserSignOut(false, new UserSignOutHandler() {
+      @Override
+      public void onUserSignOut(final UserSignOutEvent event) {
+        view.hide();
+      }
+    });
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -30,6 +30,8 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.UserSignInEvent;
 import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.state.UserSignOutEvent;
+import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.google.inject.Inject;
@@ -41,7 +43,6 @@
   private final Session session;
   private final StateManager stateManager;
   private final SiteUserOptions userOptions;
-  private UserOptionsView view;
 
   @Inject
   public UserOptionsPresenter(final Session session, final StateManager stateManager,
@@ -63,7 +64,6 @@
 
   private void init(final UserOptionsView view) {
     super.init(view);
-    this.view = view;
     final AbstractExtendedAction userPrefsAction = new AbstractExtendedAction() {
 
       @Override
@@ -74,6 +74,12 @@
         show();
       }
     };
+    session.onUserSignOut(false, new UserSignOutHandler() {
+      @Override
+      public void onUserSignOut(final UserSignOutEvent event) {
+        view.hide();
+      }
+    });
     userPrefsAction.putValue(Action.NAME, i18n.t("Your preferences"));
     userPrefsAction.putValue(Action.SMALL_ICON, res.prefs());
     final MenuItemDescriptor prefsItem = new MenuItemDescriptor(userPrefsAction);

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneral.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneral.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneral.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+public interface EntityOptGeneral {
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,103 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.common.client.ui.IconLabel;
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.ui.DefaultForm;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptionsView;
+
+import com.extjs.gxt.ui.client.event.BaseEvent;
+import com.extjs.gxt.ui.client.event.Events;
+import com.extjs.gxt.ui.client.event.Listener;
+import com.extjs.gxt.ui.client.widget.form.Field;
+import com.google.gwt.event.dom.client.ChangeHandler;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class EntityOptGeneralPanel extends DefaultForm implements EntityOptGeneralView {
+  private final MaskWidget maskWidget;
+  private final IconLabel tabTitle;
+
+  public EntityOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
+      final MaskWidget maskWidget) {
+    this.maskWidget = maskWidget;
+    tabTitle = new IconLabel(res.emblemSystem(), i18n.t("General"));
+    super.setWidth(EntityOptionsView.WIDTH);
+    super.setFrame(true);
+    super.getFormPanel().setLabelWidth(100);
+    super.addStyleName("k-overflow-y-auto");
+    final Label label = new Label();
+    label.setText(i18n.t("Here you can change this values:"));
+    label.addStyleName("kune-Margin-10-tb");
+    super.add(label);
+  }
+
+  @Override
+  public Widget asWidget() {
+    return super.getFormPanel();
+  }
+
+  @Override
+  public void clear() {
+    super.getFormPanel().removeAll();
+    super.reset();
+  }
+
+  private void doLayoutIfNeeded() {
+    if (super.getFormPanel().isRendered()) {
+      super.getFormPanel().layout();
+    }
+  }
+
+  @Override
+  public IsWidget getTabTitle() {
+    return tabTitle;
+  }
+
+  @Override
+  public void mask() {
+    maskWidget.mask(this);
+  }
+
+  @Override
+  public void setChangeHandler(final ChangeHandler changeHandler) {
+    final Listener<BaseEvent> listener = new Listener<BaseEvent>() {
+      @Override
+      public void handleEvent(final BaseEvent be) {
+        changeHandler.onChange(null);
+      }
+    };
+    for (@SuppressWarnings("rawtypes")
+    final Field field : super.getFormPanel().getFields()) {
+      // field.addListener(Events.Change, listener);
+      field.addListener(Events.Blur, listener);
+    }
+
+  }
+
+  @Override
+  public void unmask() {
+    maskWidget.unMask();
+  }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptions;
+import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent;
+
+import com.google.gwt.event.dom.client.ChangeEvent;
+import com.google.gwt.event.dom.client.ChangeHandler;
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.user.client.ui.IsWidget;
+
+public abstract class EntityOptGeneralPresenter {
+
+  private final EntityOptions entityOptions;
+  private final EventBus eventBus;
+  protected final I18nTranslationService i18n;
+  protected final Session session;
+  protected final StateManager stateManager;
+  protected EntityOptGeneralView view;
+
+  public EntityOptGeneralPresenter(final Session session, final StateManager stateManager,
+      final EventBus eventBus, final I18nTranslationService i18n, final EntityOptions entityOptions) {
+    this.session = session;
+    this.stateManager = stateManager;
+    this.eventBus = eventBus;
+    this.i18n = i18n;
+    this.entityOptions = entityOptions;
+  }
+
+  protected abstract boolean applicable();
+
+  public IsWidget getView() {
+    return view;
+  }
+
+  public void init(final EntityOptGeneralView view) {
+    this.view = view;
+    setState();
+    entityOptions.addTab(view, view.getTabTitle());
+    view.setChangeHandler(new ChangeHandler() {
+      @Override
+      public void onChange(final ChangeEvent event) {
+        updateInServer();
+      }
+    });
+  }
+
+  protected void reset() {
+    view.clear();
+    entityOptions.hideMessages();
+  }
+
+  protected void sendChangeEntityEvent() {
+    CurrentEntityChangedEvent.fire(eventBus);
+  }
+
+  protected abstract void setState();
+
+  protected abstract void updateInServer();
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralView.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralView.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -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.gspace.client.options.general;
+
+import cc.kune.gspace.client.options.EntityOptionsTabView;
+
+import com.google.gwt.event.dom.client.ChangeHandler;
+
+public interface EntityOptGeneralView extends EntityOptionsTabView {
+
+  void clear();
+
+  boolean isValid();
+
+  void mask();
+
+  void setChangeHandler(ChangeHandler changeHandler);
+
+  void unmask();
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneral.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneral.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneral.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+public interface GroupOptGeneral extends EntityOptGeneral {
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.groups.newgroup.GroupFieldFactory;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.google.inject.Inject;
+
+public class GroupOptGeneralPanel extends EntityOptGeneralPanel implements GroupOptGeneralView {
+
+  private static final String LONG_NAME_FIELD = "k-gogp-longname";
+  private static final String SHORT_NAME_FIELD = "k-gogp-shortname";
+  private final TextField<String> longName;
+  private final TextField<String> shortName;
+
+  @Inject
+  public GroupOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
+      final MaskWidget maskWidget) {
+    super(i18n, res, maskWidget);
+    shortName = GroupFieldFactory.createUserShortName(SHORT_NAME_FIELD);
+    longName = GroupFieldFactory.createUserLongName(LONG_NAME_FIELD);
+    add(shortName);
+    add(longName);
+  }
+
+  @Override
+  public String getLongName() {
+    return longName.getValue();
+  }
+
+  @Override
+  public String getShortName() {
+    return shortName.getValue();
+  }
+
+  @Override
+  public void setLongName(final String longName) {
+    this.longName.setValue(longName);
+  }
+
+  @Override
+  public void setShortName(final String shortName) {
+    this.shortName.setValue(shortName);
+  }
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,98 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.state.GroupChangedEvent;
+import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.GroupOptions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupOptGeneralPresenter extends EntityOptGeneralPresenter implements GroupOptGeneral {
+
+  private final Provider<GroupServiceAsync> groupService;
+  private final GroupOptGeneralView groupView;
+
+  @Inject
+  public GroupOptGeneralPresenter(final StateManager stateManager, final Session session,
+      final EventBus eventBus, final I18nTranslationService i18n, final GroupOptions entityOptions,
+      final Provider<GroupServiceAsync> groupService, final GroupOptGeneralView view) {
+    super(session, stateManager, eventBus, i18n, entityOptions);
+    this.groupService = groupService;
+    groupView = view;
+    init(view);
+    stateManager.onGroupChanged(true, new GroupChangedHandler() {
+      @Override
+      public void onGroupChanged(final GroupChangedEvent event) {
+        setState();
+      }
+    });
+  }
+
+  @Override
+  protected boolean applicable() {
+    return session.isCurrentStateAGroup();
+  }
+
+  @Override
+  public void init(final EntityOptGeneralView view) {
+    super.init(view);
+  }
+
+  @Override
+  protected void setState() {
+    final GroupDTO group = session.getCurrentState().getGroup();
+    groupView.setShortName(group.getShortName());
+    groupView.setLongName(group.getLongName());
+  }
+
+  @Override
+  protected void updateInServer() {
+    if (view.isValid()) {
+      NotifyUser.showProgress();
+      final GroupDTO group = session.getCurrentState().getGroup();
+      final StateToken token = group.getStateToken().copy();
+      group.setShortName(groupView.getShortName());
+      group.setLongName(groupView.getLongName());
+      groupService.get().updateGroup(session.getUserHash(), token, group,
+          new AsyncCallbackSimple<StateAbstractDTO>() {
+            @Override
+            public void onSuccess(final StateAbstractDTO result) {
+              NotifyUser.hideProgress();
+              stateManager.setRetrievedStateAndGo(result);
+              setState();
+              sendChangeEntityEvent();
+            }
+          });
+    }
+  }
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+public interface GroupOptGeneralView extends EntityOptGeneralView {
+
+  String getLongName();
+
+  String getShortName();
+
+  void setLongName(String longName);
+
+  void setShortName(String shortName);
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneral.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneral.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneral.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+public interface UserOptGeneral extends EntityOptGeneral {
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.auth.UserFieldFactory;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.google.inject.Inject;
+
+public class UserOptGeneralPanel extends EntityOptGeneralPanel implements UserOptGeneralView {
+
+  private static final String LONG_NAME_FIELD = "k-uogp-lname";
+  private final TextField<String> longName;
+
+  @Inject
+  public UserOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
+      final MaskWidget maskWidget) {
+    super(i18n, res, maskWidget);
+    longName = UserFieldFactory.createUserLongName(LONG_NAME_FIELD);
+    add(longName);
+  }
+
+  @Override
+  public String getLongName() {
+    return longName.getValue();
+  }
+
+  @Override
+  public void setLongName(final String longName) {
+    this.longName.setValue(longName);
+  }
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,96 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.UserServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.UserDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.UserOptions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UserOptGeneralPresenter extends EntityOptGeneralPresenter implements UserOptGeneral {
+
+  private final Provider<UserServiceAsync> userService;
+  private final UserOptGeneralView userView;
+
+  @Inject
+  public UserOptGeneralPresenter(final Session session, final StateManager stateManager,
+      final EventBus eventBus, final I18nTranslationService i18n, final UserOptions entityOptions,
+      final Provider<UserServiceAsync> userService, final UserOptGeneralView view) {
+    super(session, stateManager, eventBus, i18n, entityOptions);
+    this.userService = userService;
+    userView = view;
+    init(view);
+    session.onUserSignIn(true, new UserSignInHandler() {
+      @Override
+      public void onUserSignIn(final UserSignInEvent event) {
+        setState();
+      }
+    });
+  }
+
+  @Override
+  protected boolean applicable() {
+    return session.isLogged();
+  }
+
+  @Override
+  public void init(final EntityOptGeneralView view) {
+    super.init(view);
+  }
+
+  @Override
+  protected void setState() {
+    final UserSimpleDTO currentUser = session.getCurrentUser();
+    userView.setLongName(currentUser.getName());
+  }
+
+  @Override
+  protected void updateInServer() {
+    if (view.isValid()) {
+      NotifyUser.showProgress();
+      final UserSimpleDTO currentUser = session.getCurrentUser();
+      final UserDTO user = new UserDTO();
+      user.setId(currentUser.getId());
+      user.setName(userView.getLongName());
+      user.setLanguage(currentUser.getLanguage());
+      userService.get().updateUser(session.getUserHash(), user,
+          new AsyncCallbackSimple<StateAbstractDTO>() {
+            @Override
+            public void onSuccess(final StateAbstractDTO result) {
+              NotifyUser.hideProgress();
+              stateManager.setRetrievedStateAndGo(result);
+              sendChangeEntityEvent();
+            }
+          });
+    }
+  }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.gspace.client.options.general;
+
+public interface UserOptGeneralView extends EntityOptGeneralView {
+
+  String getLongName();
+
+  void setLongName(String longName);
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -0,0 +1,74 @@
+/*
+ *
+ * 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.gspace.client.options.logo;
+
+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 CurrentEntityChangedEvent extends GwtEvent<CurrentEntityChangedEvent.CurrentEntityChangedHandler> {
+
+  public interface CurrentEntityChangedHandler extends EventHandler {
+    public void onCurrentLogoChanged(CurrentEntityChangedEvent event);
+  }
+
+  public interface HasCurrentLogoChangedHandlers extends HasHandlers {
+    HandlerRegistration addCurrentLogoChangedHandler(CurrentEntityChangedHandler handler);
+  }
+
+  private static final Type<CurrentEntityChangedHandler> TYPE = new Type<CurrentEntityChangedHandler>();
+
+  public static void fire(final HasHandlers source) {
+    source.fireEvent(new CurrentEntityChangedEvent());
+  }
+
+  public static Type<CurrentEntityChangedHandler> getType() {
+    return TYPE;
+  }
+
+  public CurrentEntityChangedEvent() {
+  }
+
+  @Override
+  protected void dispatch(final CurrentEntityChangedHandler handler) {
+    handler.onCurrentLogoChanged(this);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    return super.equals(obj);
+  }
+
+  @Override
+  public Type<CurrentEntityChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  public int hashCode() {
+    return super.hashCode();
+  }
+
+  @Override
+  public String toString() {
+    return "CurrentLogoChangedEvent[" + "]";
+  }
+}

Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -1,74 +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.gspace.client.options.logo;
-
-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 CurrentLogoChangedEvent extends GwtEvent<CurrentLogoChangedEvent.CurrentLogoChangedHandler> {
-
-  public interface CurrentLogoChangedHandler extends EventHandler {
-    public void onCurrentLogoChanged(CurrentLogoChangedEvent event);
-  }
-
-  public interface HasCurrentLogoChangedHandlers extends HasHandlers {
-    HandlerRegistration addCurrentLogoChangedHandler(CurrentLogoChangedHandler handler);
-  }
-
-  private static final Type<CurrentLogoChangedHandler> TYPE = new Type<CurrentLogoChangedHandler>();
-
-  public static void fire(final HasHandlers source) {
-    source.fireEvent(new CurrentLogoChangedEvent());
-  }
-
-  public static Type<CurrentLogoChangedHandler> getType() {
-    return TYPE;
-  }
-
-  public CurrentLogoChangedEvent() {
-  }
-
-  @Override
-  protected void dispatch(final CurrentLogoChangedHandler handler) {
-    handler.onCurrentLogoChanged(this);
-  }
-
-  @Override
-  public boolean equals(final Object obj) {
-    return super.equals(obj);
-  }
-
-  @Override
-  public Type<CurrentLogoChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  @Override
-  public int hashCode() {
-    return super.hashCode();
-  }
-
-  @Override
-  public String toString() {
-    return "CurrentLogoChangedEvent[" + "]";
-  }
-}

Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -79,7 +79,7 @@
       if (response != null) {
         NotifyUser.info(response);
       }
-      CurrentLogoChangedEvent.fire(eventBus);
+      CurrentEntityChangedEvent.fire(eventBus);
     } else {
       onSubmitFailed(response);
     }

Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -42,8 +42,12 @@
   UserService userService;
 
   protected UserInfoDTO doLogin() throws DefaultException, IOException {
+    return doLogin(getSiteAdminShortName(), properties.getAdminPassword());
+  }
+
+  protected UserInfoDTO doLogin(final String nick, final String pass) throws IOException {
     waveLogin();
-    return userService.login(getSiteAdminShortName(), properties.getAdminPassword(), token);
+    return userService.login(nick, pass, token);
   }
 
   protected String doLoginWithDummyUser() throws DefaultException, IOException {
@@ -59,7 +63,11 @@
     return properties.getDefaultLicense();
   }
 
-  protected String getDefSiteGroupName() {
+  protected String getDefSiteLongName() {
+    return properties.getDefaultSiteName();
+  }
+
+  protected String getDefSiteShortName() {
     return properties.getDefaultSiteShortName();
   }
 

Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -147,7 +147,7 @@
   public void testAddWikiContent() throws Exception {
     doLogin();
 
-    final StateToken wikiToken = new StateToken(super.getDefSiteGroupName(), NAME);
+    final StateToken wikiToken = new StateToken(super.getDefSiteShortName(), NAME);
     final StateContainerDTO wiki = (StateContainerDTO) contentService.getContent(session.getHash(),
         wikiToken);
 

Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceIntegrationTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceIntegrationTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceIntegrationTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -36,7 +36,7 @@
     protected UserService userService;
 
     protected StateContentDTO getSiteDefaultContent() throws Exception {
-        final StateToken stateToken = new StateToken(getDefSiteGroupName());
+        final StateToken stateToken = new StateToken(getDefSiteShortName());
         final StateContentDTO content = (StateContentDTO) contentService.getContent(session.getHash(), stateToken);
         return content;
     }

Modified: trunk/src/test/java/cc/kune/core/server/integration/kuneservice/GroupServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/kuneservice/GroupServiceTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/kuneservice/GroupServiceTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -24,6 +24,8 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import cc.kune.core.client.errors.GroupLongNameInUseException;
+import cc.kune.core.client.errors.GroupShortNameInUseException;
 import cc.kune.core.client.errors.UserMustBeLoggedException;
 import cc.kune.core.client.rpcservices.GroupService;
 import cc.kune.core.server.UserSession;
@@ -31,6 +33,7 @@
 import cc.kune.core.server.integration.IntegrationTestHelper;
 import cc.kune.core.shared.domain.AdmissionType;
 import cc.kune.core.shared.domain.GroupListMode;
+import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.GroupType;
 import cc.kune.core.shared.dto.LicenseDTO;
@@ -91,6 +94,18 @@
     assertEquals(groupCreated.getGroupType(), GroupType.COMMUNITY);
   }
 
+  private GroupDTO createGroup(final String shortName, final String longName) {
+    final GroupDTO group = new GroupDTO(shortName, longName, GroupType.ORGANIZATION);
+
+    final LicenseDTO license = new LicenseDTO();
+    license.setShortName("by-sa-v3.0");
+    group.setDefaultLicense(license);
+    service.createNewGroup(session.getHash(), group, "Public desc", "tag1 tag2", null);
+    final Group groupCreated = groupFinder.findByShortName(shortName);
+    group.setId(groupCreated.getId());
+    return group;
+  }
+
   @Test(expected = Exception.class)
   public void createGroupNotLogged() throws Exception {
     final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative",
@@ -166,6 +181,22 @@
     assertEquals(0, groupCreated.getSocialNetwork().getAccessLists().getEditors().getList().size());
   }
 
+  @Test(expected = GroupLongNameInUseException.class)
+  public void createSameLongName() throws Exception {
+    doLogin();
+    final GroupDTO group = createGroup("ysei", "Yellow Submarine Environmental Initiative");
+    group.setLongName(getDefSiteLongName());
+    service.updateGroup(getHash(), group.getStateToken(), group);
+  }
+
+  @Test(expected = GroupShortNameInUseException.class)
+  public void createSameShortName() throws Exception {
+    doLogin();
+    final GroupDTO group = createGroup("ysei", "Yellow Submarine Environmental Initiative");
+    group.setShortName(getDefSiteShortName());
+    service.updateGroup(getHash(), new StateToken("ysei"), group);
+  }
+
   @Before
   public void init() {
     new IntegrationTestHelper(this);

Modified: trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -23,12 +23,15 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
+import java.io.IOException;
 import java.util.Iterator;
 import java.util.Set;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
+import cc.kune.core.client.errors.AccessViolationException;
 import cc.kune.core.client.errors.EmailAddressInUseException;
 import cc.kune.core.client.errors.GroupLongNameInUseException;
 import cc.kune.core.client.errors.GroupShortNameInUseException;
@@ -99,7 +102,7 @@
   @Test(expected = GroupLongNameInUseException.class)
   public void createUserExistingLongNameFails() throws Exception {
     assertNull(session.getUser().getId());
-    final UserDTO user = new UserDTO(properties.getAdminUserName(), "test", "123456",
+    final UserDTO user = new UserDTO("test", properties.getAdminUserName(), "123456",
         "example1234 at example.com", lang, country, timezone, null, true, SubscriptionMode.manual, "blue");
     userService.createUser(user, false);
   }
@@ -107,7 +110,7 @@
   @Test(expected = GroupShortNameInUseException.class)
   public void createUserExistingShortNameFails() throws Exception {
     assertNull(session.getUser().getId());
-    final UserDTO user = new UserDTO("test", properties.getAdminShortName(), "123456",
+    final UserDTO user = new UserDTO(properties.getAdminShortName(), "test", "123456",
         "example1234 at example.com", lang, country, timezone, null, true, SubscriptionMode.manual, "blue");
     userService.createUser(user, false);
   }
@@ -170,4 +173,51 @@
     assertEqualGroupLists(adminsGroupDTO, adminsGroup);
   }
 
+  @Test(expected = AccessViolationException.class)
+  public void updateAnotherUserFails() throws Exception {
+    assertNull(session.getUser().getId());
+    final UserDTO user = new UserDTO("test", "test", "123456", "example1234 at example.com", lang, country,
+        timezone, null, true, SubscriptionMode.manual, "blue");
+    userService.createUser(user, false);
+    // do login as admin
+    doLogin();
+    userService.updateUser(getHash(), user);
+  }
+
+  @Test
+  public void updatedUser() throws Exception {
+    updateUser("test2", "test2", "example1234-2 at example.com");
+  }
+
+  @Test(expected = EmailAddressInUseException.class)
+  public void updatedUserExistingEmailFails() throws Exception {
+    updateUser("test", "test", properties.getAdminEmail());
+  }
+
+  @Ignore
+  @Test(expected = GroupShortNameInUseException.class)
+  public void updatedUserExistingShortNameFails() throws Exception {
+    // We don't allow shortName change because we cannot change the name of a
+    // wave account (and waves)
+    updateUser(properties.getAdminShortName(), "test", "example1234 at example.com");
+  }
+
+  private void updateUser(final String shortName, final String longName, final String email)
+      throws IOException {
+    assertNull(session.getUser().getId());
+    final UserDTO user = new UserDTO("test", "test", "123456", "example1234 at example.com", lang, country,
+        timezone, null, true, SubscriptionMode.manual, "blue");
+    userService.createUser(user, false);
+    doLogin("test", "123456");
+    final UserDTO userChanged = new UserDTO(shortName, longName, "123456", email, lang, country,
+        timezone, null, true, SubscriptionMode.manual, "blue");
+    userChanged.setId(session.getUser().getId());
+    userService.updateUser(getHash(), userChanged);
+  }
+
+  @Test(expected = GroupLongNameInUseException.class)
+  public void updateUserExistingLongNameFails() throws Exception {
+    updateUser("test", properties.getAdminUserName(), "example1234 at example.com");
+  }
+
 }

Modified: trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -46,7 +46,7 @@
     @Before
     public void init() {
         new IntegrationTestHelper(this);
-        groupToken = new StateToken(getDefSiteGroupName());
+        groupToken = new StateToken(getDefSiteShortName());
     }
 
     @Test

Modified: trunk/src/test/java/cc/kune/lists/server/ListsServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/lists/server/ListsServiceTest.java	2011-08-17 01:33:52 UTC (rev 1498)
+++ trunk/src/test/java/cc/kune/lists/server/ListsServiceTest.java	2011-08-20 18:04:22 UTC (rev 1499)
@@ -41,7 +41,7 @@
     final UserInfoDTO userInfoDTO = doLogin();
     userGroup = userInfoDTO.getUserGroup();
     final StateAbstractDTO rootList = contentService.getContent(getHash(), new StateToken(
-        getDefSiteGroupName(), ListsConstants.ROOT_NAME));
+        getDefSiteShortName(), ListsConstants.ROOT_NAME));
     openList = listsService.createList(getHash(), rootList.getStateToken(), "test list", "", true);
     closeList = listsService.createList(getHash(), rootList.getStateToken(), "test list", "", false);
   }




More information about the kune-commits mailing list