In jetspeed-portlet.xml did you use "? I've notice you have to use only ' to
delimit services name,
for example
   <js:services>
       <js:service name='ApplicationServerManager'/>
       <js:service name='DeploymentManager'/>
       <js:service name='EntityAccessor'/>
       <js:service name='GroupManager'/>
       <js:service name='PageManager'/>
       <js:service name='PermissionManager'/>
       <js:service name='PortalAdministration'/>
       <js:service name='PortletFactory'/>
       <js:service name='PortalAdministration'/>
       <js:service name='PortletRegistryComponent'/>
       <js:service name='PortalStatistics'/>
       <js:service name='Profiler' />
       <js:service name='RoleManager'/>
       <js:service name='SearchComponent'/>
       <js:service name='SSO' />
       <js:service name='UserManager'/>
   </js:services>
Then you can use UserManager to access user's data

On 6/15/06, Brice Lambi <[EMAIL PROTECTED]> wrote:

I'm trying to get the user attributes, but the only way I can get it to
work
is by going into the user management portlet and manually adding a value.
I've read the guide at
http://portals.apache.org/jetspeed-2/guides/guide-user-attributes.html and
added the jetspeed-portlet.xml to my app, but the attributes are still
null.  There is a link on that page that is broken, it looks like it would
talk about jetspeed preferences, so I might be missing something.  I'm
just
trying to get the username of the current user.  Here is my
jetspeed-portlet.xml

<?xml version="1.0"?>
<portlet-app version="1.0"
   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
   xmlns:js="http://portals.apache.org/jetspeed";>
   <js:user-attribute-ref>
      <js:name>user-name</js:name>
      <js:name-link>user.name</js:name-link>
   </js:user-attribute-ref>
   <js:user-attribute-ref>
      <js:name>user-name-given</js:name>
      <js:name-link>user.name.given</js:name-link>
   </js:user-attribute-ref>
   <js:user-attribute-ref>
      <js:name>user-name-family</js:name>
      <js:name-link>user.name.family</js:name-link>
   </js:user-attribute-ref>
</portlet-app>


And I get the values with

Map map = (Map)request.getAttribute(PortletRequest.USER_INFO);
String username = (String)map.get("user.name");

What am I doing wrong?


Reply via email to