Author: bdaw
Date: 2008-04-16 10:12:51 -0400 (Wed, 16 Apr 2008)
New Revision: 10607
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
Log:
JBPORTAL-1991 - use cached user profile
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2008-04-16
13:13:50 UTC (rev 10606)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2008-04-16
14:12:51 UTC (rev 10607)
@@ -40,6 +40,7 @@
import org.jboss.portal.core.model.portal.content.WindowRendition;
import org.jboss.portal.core.theme.PageRendition;
import org.jboss.portal.core.theme.WindowContextFactory;
+import org.jboss.portal.core.aspects.server.UserInterceptor;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
@@ -50,6 +51,7 @@
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeService;
import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.server.ServerInvocation;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -57,6 +59,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
/**
* Render a full page.
@@ -163,9 +166,21 @@
// Name is not bound anymore, it could happen during a shutdown, we
don't do anything
}
- //
- String themeId = (String)userProfileModule.getProperty(user,
User.INFO_USER_THEME);
+ // If its possible use cachec user profile to obtain theme
+ Map profile =
(Map)getContext().getAttribute(ServerInvocation.PRINCIPAL_SCOPE,
UserInterceptor.PROFILE_KEY);
+
+ String themeId = null;
+
+ if (profile == null)
+ {
+ themeId = (String)userProfileModule.getProperty(user,
User.INFO_USER_THEME);
+ }
+ else
+ {
+ themeId = (String)profile.get(User.INFO_USER_THEME);
+ }
+
if (themeId != null)
{
theme = themeService.getThemeById(themeId);
Show replies by date