You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Brice Lambi <br...@gmail.com> on 2006/06/15 18:39:35 UTC

User attributes

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?

Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
The problem with using the UserManager, it is not JSR 168.  The guide says
that I can use jetspeed-portlet.xml to map the jetspeed attributes to the
jsr 168 attributes, but it looks like the only way to get those attributes
is to use the user manager portlet to create them.


On 6/16/06, arker statis <ar...@gmail.com> wrote:
>
> 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 <br...@gmail.com> 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.htmland
> > 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?
> >
> >
>
>

Re: User attributes

Posted by arker statis <ar...@gmail.com>.
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 <br...@gmail.com> 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?
>
>

RE: User attributes

Posted by Ruben Fragoso <ru...@tap.pt>.
Np =) have fub ;)

-----Original Message-----
From: Brice Lambi [mailto:bricelambi@gmail.com] 
Sent: segunda-feira, 19 de Junho de 2006 22:38
To: Jetspeed Users List
Subject: Re: User attributes


I feel like a smart one ;) getRemoteUser is all I needed.  Thanks Ruben!
That is even part of the portlet API.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: User attributes

Posted by Aaron Evans <aa...@gmail.com>.
Not to mention it is part of the servlet API!

On 6/19/06, Brice Lambi <br...@gmail.com> wrote:
> I feel like a smart one ;) getRemoteUser is all I needed.  Thanks Ruben!
> That is even part of the portlet API.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
I feel like a smart one ;) getRemoteUser is all I needed.  Thanks Ruben!
That is even part of the portlet API.

Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
I did receive the portlet, what I noticed is that you were looking up user
information based on an email request paramter.  Looking at it a second
time, I still do not see where you call the getRemoteUser method, but I will
look more closely.  Thanks!

Brice


On 6/19/06, Ruben Fragoso <ru...@tap.pt> wrote:
>
> Yes there is. Use the getRemoteUser() method of the PortletRequest object.
> Did you not received the portlet that i sent you?
>
> Best Regards
>
> Ruben Fragoso
>
>
>
> -----Original Message-----
> From: Brice Lambi [mailto:bricelambi@gmail.com]
> Sent: segunda-feira, 19 de Junho de 2006 22:05
> To: Jetspeed Users List
> Subject: Re: User attributes
>
>
> Spending more time with this and reading what you guys have said again,
> there is no way to get the current user name.  I've looked at the
> UserManager interface, but this is only useful if you have a username to
> begin with.  So the only way to make the username available is to manually
> set an attribute using the admin portlets?
>
> If this is true, it seems like a draw-back in the implementation.  It
> seems
> like a common procedure to let users make their own accounts and have that
> username availble to the applications running without administrator
> interference.  I find it hard to believe that I am the first person to
> require this functionality.  So I MUST be missing something, I've accepted
> that I might not be able to stay within JSR 168, but it must be possible
> (without changing the jetspeed code).
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

RE: Passing values from

Posted by Ruben Fragoso <ru...@tap.pt>.
Try using the OutputStreamWriter Java Class, that is how i do mine

-----Original Message-----
From: Tushar Kapadi [mailto:tkapadi@serenecorp.com] 
Sent: segunda-feira, 19 de Junho de 2006 23:09
To: Jetspeed Users List
Subject: Passing values from


Hello,

We have our third party applications which we would like to use as portlets.
How can we pass parameters (user values) from Portlet to the custom build
application? 

Any document on that would be really appreciated.

Thanks,
--Tushar



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Passing values from

Posted by Tushar Kapadi <tk...@serenecorp.com>.
Hello,

We have our third party applications which we would like to use as
portlets. How can we pass parameters (user values) from Portlet to the
custom build application? 

Any document on that would be really appreciated.

Thanks,
--Tushar



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: User attributes

Posted by Ruben Fragoso <ru...@tap.pt>.
Yes there is. Use the getRemoteUser() method of the PortletRequest object.
Did you not received the portlet that i sent you?

Best Regards

Ruben Fragoso



-----Original Message-----
From: Brice Lambi [mailto:bricelambi@gmail.com] 
Sent: segunda-feira, 19 de Junho de 2006 22:05
To: Jetspeed Users List
Subject: Re: User attributes


Spending more time with this and reading what you guys have said again,
there is no way to get the current user name.  I've looked at the
UserManager interface, but this is only useful if you have a username to
begin with.  So the only way to make the username available is to manually
set an attribute using the admin portlets?

If this is true, it seems like a draw-back in the implementation.  It seems
like a common procedure to let users make their own accounts and have that
username availble to the applications running without administrator
interference.  I find it hard to believe that I am the first person to
require this functionality.  So I MUST be missing something, I've accepted
that I might not be able to stay within JSR 168, but it must be possible
(without changing the jetspeed code).


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
Spending more time with this and reading what you guys have said again,
there is no way to get the current user name.  I've looked at the
UserManager interface, but this is only useful if you have a username to
begin with.  So the only way to make the username available is to manually
set an attribute using the admin portlets?

If this is true, it seems like a draw-back in the implementation.  It seems
like a common procedure to let users make their own accounts and have that
username availble to the applications running without administrator
interference.  I find it hard to believe that I am the first person to
require this functionality.  So I MUST be missing something, I've accepted
that I might not be able to stay within JSR 168, but it must be possible
(without changing the jetspeed code).

Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
I'm sorry, I guess I asked the same question again ;)  What I really would
like to know is how I could automate the process of defining a user
attribute.  What tables should I look at in the database, I would like to
automate the process outside of the portal.

Thanks,
Brice


On 6/16/06, Brice Lambi <br...@gmail.com> wrote:
>
> What are the custom and portal-defined property names?  Are the
> portal-defined properties like the user.name.given and such defined in the
> spec, or are those the custom properties?  How can I use
> jetspeed-portlet.xml to map the user's logon id to user.name or any other
> property defined in the spec?
>
>
>
>
> On 6/16/06, David Sean Taylor < david@bluesunrise.com> wrote:
> >
> > You have to populate the user attributes on a per user basis.
> > The User Management portlet is one way to do this.
> > Another solution that we are working: an import program for user
> > information
> >
> > The jetspeed-portlet.xml is there for mapping custom property names to
> > portal-defined property names.
> >
> > Brice Lambi 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.htmland
> > > 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?
> > >
> >
> >
> > --
> > David Sean Taylor
> > Bluesunrise Software
> > david@bluesunrise.com
> > [office] +01 707 773-4646
> > [mobile] +01 707 529 9194
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>

Re: User attributes

Posted by Brice Lambi <br...@gmail.com>.
What are the custom and portal-defined property names?  Are the
portal-defined properties like the user.name.given and such defined in the
spec, or are those the custom properties?  How can I use
jetspeed-portlet.xml to map the user's logon id to user.name or any other
property defined in the spec?



On 6/16/06, David Sean Taylor <da...@bluesunrise.com> wrote:
>
> You have to populate the user attributes on a per user basis.
> The User Management portlet is one way to do this.
> Another solution that we are working: an import program for user
> information
>
> The jetspeed-portlet.xml is there for mapping custom property names to
> portal-defined property names.
>
> Brice Lambi 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.htmland
> > 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?
> >
>
>
> --
> David Sean Taylor
> Bluesunrise Software
> david@bluesunrise.com
> [office] +01 707 773-4646
> [mobile] +01 707 529 9194
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: User attributes

Posted by David Sean Taylor <da...@bluesunrise.com>.
You have to populate the user attributes on a per user basis.
The User Management portlet is one way to do this.
Another solution that we are working: an import program for user information

The jetspeed-portlet.xml is there for mapping custom property names to 
portal-defined property names.

Brice Lambi 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?
> 


-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org