List of Sun Java System Portal Server 7 attribute list

Hi,

I tried to fetch the user information of the logged in user following the directions given in the JSR 168 specs. I tried fetching the last name of the user using the "user.name.family " user info attribute. But, I got a null.

After some Googling and repeated reading of the JSR 168 specs I concluded that the names listed in the spec are just indicative and the actual name that maps to a specific user information may change from server to server. Please tell me whether this assumption is correct?

If I am correct, then where can I find the list of user attribute names that the Sun Java System Portal Server 7 supports.

Below is my portlet.xml configuration snippet and the portlet code:

portet.xml

--

<user-attribute>

<description>User Last Name</description>

<name>user.name.family</name>

</user-attribute>

portlet code

--

Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);

String lastName = (userInfo!=null)? (String) userInfo.get搖ser.name.family? : 搉ot present?

Thanks in advance

Avishek

[1190 byte] By [Avisheka] at [2007-11-27 6:36:15]
# 1
My userinfo.properties file:preferredlocale=localepreferredtimezone=timezonecn=cnsn=lastnamegivenname=firstnameuid=usernamedistingushedname=dn
jbjonesjra at 2007-7-12 18:03:46 > top of Java-index,Web & Directory Servers,Portal Servers...
# 2

Please provide some more details on this. I mean to retrieve the user information what settings do in make in the portlet.xml. Also, this properties file you are talking about, where should i place it and how should I map it in my deployment descriptor. It would be greate if you can give the code of the portlet and the portlet.xml

Avisheka at 2007-7-12 18:03:46 > top of Java-index,Web & Directory Servers,Portal Servers...
# 3

no changes in portlet.xml. When you deploy to SPS7.X, there is an option to add in a userinfo.properties file (both psconsole and via cli). That is how you do it in Sun Portal Server 7.

Then, in my portlet code, I use this [note, trucated code snippet]:

public UserInfo(PortletRequest sbin) {

this.request = sbin;

this.userName = this.getUserInfo("username");

this.cn = this.getUserInfo("cn");

this.lastname = this.getUserInfo("lastname");

this.firstname = this.getUserInfo("firstname");

public String getUserInfo(String name) {

String temp = "";

try{

PortletPreferences portletPreferences = request.getPreferences();

Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);

temp = userInfo.get(name).toString();

}catch(Exception e) {

temp = name+" is not a valid attribute. Full error: "+e.getMessage();

}

return temp;

}

jbjonesjra at 2007-7-12 18:03:46 > top of Java-index,Web & Directory Servers,Portal Servers...
# 4
Thanks.This is really helpful. I implemented this and its working wonderfully.I just need one more help. Where can I find a list of the actual LDAP user attributes list supported by Sun Access Manager?
Avisheka at 2007-7-12 18:03:46 > top of Java-index,Web & Directory Servers,Portal Servers...
# 5
That is a bit more unknown. I found a list of the standard ldap objects, and then tried to see which worked and which didn't. Besides that, I can't give you much help. I would love to use some more of them as well.
jbjonesjra at 2007-7-12 18:03:46 > top of Java-index,Web & Directory Servers,Portal Servers...