History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-2235
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Arlo White
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
uPortal

USER_NAME stylesheet parameter is not populated in universality.xml

Created: 12/Dec/08 02:59 PM   Updated: 01/Jul/09 02:15 PM
Component/s: None
Affects Version/s: 3.1.0-M1, 3.1.0-M2, 3.1.0, 3.1.1
Fix Version/s: 3.2.0-RC1, 3.1.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
The USER_NAME parameter is not populated. It's used by the welcome template in components.xsl

 All   Comments   Work Log   Change History      Sort Order:
Eric Dalquist [06/Feb/09 04:55 PM]
I believe this is fixed in trunk right now

Christopher J. Holdorph [26/Jun/09 01:41 PM]
Reopening this bug on behalf of Aaron Brown. Please see his comments for additional details.

Aaron Brown [26/Jun/09 01:58 PM]
The primary universality layout file (universality.xsl) includes many params with default values that are overridden by the rendering pipleline when the XSL is used on an XML file. "USER_NAME" is one of these parameters, which (in version 3.1.1) holds a default value of "Guest User". However, this value is never overridden in the java, so the user is always "Guest User", no matter what.

In practice, the only way to render the user's name alongside the Log Out link is to use the CLogin channel which has another way to retrieve that data. I believe USER_NAME should be set somewhere in the rendering pipeline (perhaps StaticRenderingPipeline.java ?) so the data is available to the main XSL. This will have the side effect of allowing the "welcome" template to operate correctly, too, since it depends on this XSL parameter to show the users's full name.

This missing parameter may be a symptom of a larger problem - I haven't tested them all, but there may be other XSL parameters that could/should be set, too.


Arlo White [26/Jun/09 02:14 PM]
This parameter is populated in a vanilla deploy of 3.1.1. However, in our branch it still doesn't work. We suspected it had to do with the personDirectoryContext.xml configuration. However, after adding the usernameAttributeProvider bean and playing with other Person Directory settings we still couldn't get this parameter to be populated.

Since it works in a vanilla install, I think it's a configuration issue not a code one. So the question is where does the USER_NAME parameter come from? This needs to be documented in the manual once the question is answered.


Aaron Brown [26/Jun/09 04:29 PM]
I disagree - I don't think that value is populated in an out-of-the-box implementation of 3.1.1. I just tried a fresh, empty deployment with only one change: I added a line to universality.xml to show the value of $USER_NAME in the footer. Even after logging in, I'm still "Guest User".

The vanilla install of uPortal only shows the correct display name in the Log Out section, which is rendered by the CLogin channel, not by the master layout xsl. CLogin knows how to get the display name, but universality.xsl remains ignorant of it.


Arlo White [26/Jun/09 06:12 PM]
You're correct. When I tested before I was still using login.channel instead of the welcome template in universality.xsl. This parameter is not being populated.

Eric Dalquist [29/Jun/09 01:44 PM]
This looks like a bug.

org.jasig.portal.layout.dlm.providers.ThemeParamInjector injects a variable named "userName" but as pointed out here the XSL uses the value USER_NAME

A quick fix would be to replace the USER_NAME param in universality.xsl with:

<xsl:param name="userName">Guest User</xsl:param>
<xsl:param name="USER_NAME"><xsl:value-of select="$userName"/></xsl:param>


Eric Dalquist [29/Jun/09 01:44 PM]
Unassigning as it is an open bug that anyone could pick up.

Eric Dalquist [01/Jul/09 02:15 PM]
Fixed by aliasing the userName parameter to the USER_NAME parameter.