Author: thomas.heute(a)jboss.com
Date: 2008-06-24 08:40:58 -0400 (Tue, 24 Jun 2008)
New Revision: 11127
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/component/portlet/JSFUserContext.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
Log:
- Fix for WSRP
- Fixing UserContext implementations
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java 2008-06-24
11:44:59 UTC (rev 11126)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java 2008-06-24
12:40:58 UTC (rev 11127)
@@ -320,7 +320,7 @@
PortletInfo info = controllerContext.getPortletInfo(windowName);
//
- if (info != null)
+ if (info != null && info.getNavigation() != null)
{
Map<String, String[]> publicNavigationalState = new HashMap<String,
String[]>();
for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters())
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java 2008-06-24
11:44:59 UTC (rev 11126)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java 2008-06-24
12:40:58 UTC (rev 11127)
@@ -22,13 +22,14 @@
******************************************************************************/
package org.jboss.portal.core.controller.portlet;
+import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.common.invocation.Scope;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.server.ServerInvocation;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -50,13 +51,14 @@
private final Map<String, String> profile;
/** . */
- private Map<String, Object> attributes;
+ private AttributeResolver principalAttributeResolver;
public ControllerUserContext(ControllerContext controllerContext)
{
this.invocation = controllerContext.getServerInvocation();
this.user = controllerContext.getUser();
this.profile = controllerContext.getUserProfile();
+ this.principalAttributeResolver =
controllerContext.getAttributeResolver(Scope.PRINCIPAL_SCOPE);
}
public String getId()
@@ -86,21 +88,12 @@
public Object getAttribute(String arg0)
{
- if (attributes != null)
- {
- return attributes.get(arg0);
- }
- return null;
+ return principalAttributeResolver.getAttribute(arg0);
}
public void setAttribute(String arg0, Object arg1)
{
- if (attributes == null)
- {
- attributes = new HashMap<String, Object>();
- }
- attributes.put(arg0, arg1);
-
+ principalAttributeResolver.setAttribute(arg0, arg1);
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/component/portlet/JSFUserContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/component/portlet/JSFUserContext.java 2008-06-24
11:44:59 UTC (rev 11126)
+++
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/component/portlet/JSFUserContext.java 2008-06-24
12:40:58 UTC (rev 11127)
@@ -22,16 +22,16 @@
******************************************************************************/
package org.jboss.portal.faces.component.portlet;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.spi.UserContext;
-
-import javax.faces.context.FacesContext;
-
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.spi.UserContext;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -42,9 +42,6 @@
/** . */
private final FacesContext faces;
- /** . */
- private Map<String, Object> attributes;
-
public JSFUserContext(FacesContext faces)
{
this.faces = faces;
@@ -69,22 +66,15 @@
{
return Tools.toList(faces.getExternalContext().getRequestLocales());
}
-
+
public Object getAttribute(String arg0)
{
- if (attributes != null)
- {
- return attributes.get(arg0);
- }
- return null;
+ throw new NotYetImplemented();
}
public void setAttribute(String arg0, Object arg1)
{
- if (attributes == null)
- {
- attributes = new HashMap<String, Object>();
- }
- attributes.put(arg0, arg1);
+ throw new NotYetImplemented();
}
+
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-06-24
11:44:59 UTC (rev 11126)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-06-24
12:40:58 UTC (rev 11127)
@@ -24,6 +24,8 @@
package org.jboss.portal.wsrp;
import static org.jboss.portal.common.p3p.P3PConstants.*;
+
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.wsrp.core.Contact;
import org.jboss.portal.wsrp.core.EmployerInfo;
@@ -291,20 +293,12 @@
public Object getAttribute(String arg0)
{
- if (attributes != null)
- {
- return attributes.get(arg0);
- }
- return null;
+ throw new NotYetImplemented();
}
public void setAttribute(String arg0, Object arg1)
{
- if (attributes == null)
- {
- attributes = new HashMap<String, Object>();
- }
- attributes.put(arg0, arg1);
+ throw new NotYetImplemented();
}
}
}
Show replies by date