Author: liem_nguyen
Date: 2010-01-31 22:07:46 -0500 (Sun, 31 Jan 2010)
New Revision: 1475
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
Log:
GTNPORTAL-530 - Don't change language of user when edit language of user in User and
Groups management
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-01-31
18:40:19 UTC (rev 1474)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-02-01
03:07:46 UTC (rev 1475)
@@ -19,12 +19,13 @@
package org.exoplatform.organization.webui.component;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.Query;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -72,12 +73,10 @@
private static final String[] USER_ACTION = {"ViewUserInfo",
"DeleteUser"};
- private final static List<SelectItemOption<String>> OPTIONS_ =
Collections.unmodifiableList(Arrays.asList(
- new SelectItemOption<String>(USER_NAME, USER_NAME),
- new SelectItemOption<String>(LAST_NAME, LAST_NAME),
- new SelectItemOption<String>(FIRST_NAME, FIRST_NAME),
- new SelectItemOption<String>(EMAIL, EMAIL)
- ));
+ private final static List<SelectItemOption<String>> OPTIONS_ =
+ Collections.unmodifiableList(Arrays.asList(new
SelectItemOption<String>(USER_NAME, USER_NAME),
+ new SelectItemOption<String>(LAST_NAME, LAST_NAME), new
SelectItemOption<String>(FIRST_NAME, FIRST_NAME),
+ new SelectItemOption<String>(EMAIL, EMAIL)));
private Query lastQuery_;
@@ -95,6 +94,21 @@
search(new Query());
}
+ /**
+ * @see
org.exoplatform.webui.core.UIComponent#processRender(org.exoplatform.webui.application.WebuiRequestContext)
+ */
+ @Override
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+ int curPage = grid_.getUIPageIterator().getCurrentPage();
+ if (lastQuery_ == null)
+ lastQuery_ = new Query();
+ search(lastQuery_);
+ grid_.getUIPageIterator().setCurrentPage(curPage);
+ grid_.getUIPageIterator().getCurrentPageData();
+ super.processRender(context);
+ }
+
public void setUserSelected(String userName)
{
userSelected_ = userName;
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-01-31
18:40:19 UTC (rev 1474)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-02-01
03:07:46 UTC (rev 1475)
@@ -19,18 +19,25 @@
package org.exoplatform.organization.webui.component;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.services.organization.UserProfileHandler;
+import org.exoplatform.services.resources.LocaleConfig;
+import org.exoplatform.services.resources.LocaleConfigService;
import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIFormInputContainer;
import org.exoplatform.webui.form.UIFormInputSet;
import org.exoplatform.webui.form.UIFormTabPane;
@@ -111,6 +118,29 @@
return;
}
uiUserInfo.getChild(UIUserProfileInputSet.class).save(service,
uiUserInfo.getUserName(), false);
+
+ if (uiUserInfo.getUserName().equals(event.getRequestContext().getRemoteUser()))
+ {
+ UserProfileHandler hanlder = service.getUserProfileHandler();
+ UserProfile userProfile =
hanlder.findUserProfileByName(event.getRequestContext().getRemoteUser());
+ String language = userProfile.getAttribute("user.language");
+
+ UIPortalApplication uiApp = Util.getUIPortalApplication();
+ if (language == null || language.trim().length() < 1)
+ return;
+ LocaleConfigService localeConfigService =
+ event.getSource().getApplicationComponent(LocaleConfigService.class);
+ LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
+ if (localeConfig == null)
+ localeConfig = localeConfigService.getDefaultLocaleConfig();
+ uiApp.setLocale(localeConfig.getLocale());
+ uiApp.setOrientation(localeConfig.getOrientation());
+ uiApp.localizeNavigations();
+
+ Util.getPortalRequestContext().addUIComponentToUpdateByAjax(
+ uiApp.findFirstComponentOfType(UIWorkingWorkspace.class));
+ Util.getPortalRequestContext().setFullRender(true);
+ }
}
}
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-01-31
18:40:19 UTC (rev 1474)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-02-01
03:07:46 UTC (rev 1475)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.organization;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserProfile;
import org.exoplatform.services.organization.UserProfileHandler;
@@ -27,7 +28,6 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
@@ -150,15 +150,15 @@
LocaleConfig config = i.next();
Locale locale = config.getLocale();
displayName = locale.getDisplayName(currentLocale);
- language = locale.getDisplayLanguage(currentLocale);
+ language = locale.getLanguage();
country = locale.getCountry();
if (country != null && country.length() > 0)
{
- displayLanguage = language + " (" +
locale.getDisplayCountry(currentLocale) + ")";
+ displayLanguage = displayName + " (" +
locale.getDisplayCountry(currentLocale) + ")";
}
else
{
- displayLanguage = language;
+ displayLanguage = displayName;
}
option = new SelectItemOption<String>(displayLanguage, language,
displayName);
if (language.equals(selectedLang))
Show replies by date