Author: thomas.heute(a)jboss.com
Date: 2007-11-30 08:47:54 -0500 (Fri, 30 Nov 2007)
New Revision: 9217
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
Log:
JBPORTAL-1830 New user properties (locale) set by the user is not immediately used by the
portal
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-11-30
12:25:13 UTC (rev 9216)
+++
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-11-30
13:47:54 UTC (rev 9217)
@@ -29,19 +29,29 @@
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import javax.portlet.PortletRequest;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portal.common.p3p.P3PConstants;
import org.jboss.portal.common.text.FastURLDecoder;
+import org.jboss.portal.core.aspects.server.UserInterceptor;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.User;
+import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portlet.JBossActionRequest;
import org.jboss.portlet.JBossActionResponse;
@@ -235,6 +245,20 @@
FacesContext.getCurrentInstance().addMessage("status", new
FacesMessage(bundle.getString("IDENTITY_EDIT_PROFILE_ERROR")));
log.error("",e);
}
+
+ // Removing user properties caching so that the changes are immediately available
+ ActionInvocation rInvocation =
(ActionInvocation)((PortletRequest)ctx.getExternalContext().getRequest()).getAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
+ rInvocation.setAttribute(ServerInvocation.PRINCIPAL_SCOPE,
UserInterceptor.PROFILE_KEY, null);
+ rInvocation.setAttribute(ServerInvocation.PRINCIPAL_SCOPE,
UserInterceptor.USER_KEY, null);
+
+ // JSR crap is also keeping a reference to a previous locale...
+ // Let's fix that for this portlet only
+ Object propertyValue =
uiUser.getAttribute().getValue("locale").getObject();
+ if (propertyValue != null)
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setLocale(new
Locale(propertyValue.toString()));
+ }
+
this.resetWindowState(ctx);
return "start";
}
@@ -261,6 +285,7 @@
{
ctx.addMessage("status", new
FacesMessage(bundle.getString("IDENTITY_EDIT_CHANGE_PASSWORD_ERROR")));
}
+
this.resetWindowState(ctx);
return "status";
}
Show replies by date