|
|
|
[
Permlink
| « Hide
]
Eric Dalquist [06/Feb/09 04:55 PM]
I believe this is fixed in trunk right now
Reopening this bug on behalf of Aaron Brown. Please see his comments for additional details.
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. 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. 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. 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.
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> Unassigning as it is an open bug that anyone could pick up.
Fixed by aliasing the userName parameter to the USER_NAME parameter.
| |||||||||||||||||||||||||||||||||||||||||||||||