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 "Bryan K. Cantwell" <br...@comcast.net> on 2004/02/20 04:42:59 UTC

Session Information

I am new to JetSpeed and am wondering what if any information is available in session 
variables? And if none could the logon process be a good place to put a value into the 
session (like the userID)?

Thanks from a Newb


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


How to retain session data while logging in to Jetspeed 1.4?

Posted by Santhosh Nair <na...@mayur.znetsystems.com>.
Hi,

I have a shopping cart type application developed in Jetspeed 1.4. When any
user accesses the page for the first time, user-id anon is assumed in
Jetspeed.  In my application, the user adds items to his shopping cart and
chooses to check out. My application requests to login and register before
checkout.

Jetspeed portal looses all the session details during a user login.  This
also cleares the session contents of my shopping application - requiring the
user to repeat the shoping process.

Is there any solution to this problem? Any help?

Thanks and Regards,
Santhosh Nair
santhosh.nair@newgsystem.com
http://www.newgsystem.com



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


Re: Session Information

Posted by Stijn de Witt <St...@chello.nl>.
Bryan K. Cantwell wrote:
"moving code over from another application that is keyed to a User_id which
I can get by querying for the User_id where it matches the username from the
JetSpeed taglib request for username."

So you can get to the User_id dynamically, you don't need any external
information right? So why do you want to then store it in the session? Just
for performance reasons? If that is the case, you could make some class
whose only job it is to fetch the User_id. This class would then first
attempt to fetch the User_Id from the session, and only if that failed, make
the database request. It would then store the result in the session for
later re-use, ensuring as little accesses to the database as possible.

-Stijn


----- Original Message -----
From: "Bryan K. Cantwell" <br...@comcast.net>
To: "'Jetspeed Users List'" <je...@jakarta.apache.org>
Sent: Friday, February 20, 2004 10:29 AM
Subject: RE: Session Information


> What I am really trying to find is where I can sneak code like this in
> so that it is impossible to NOT have my session variable set. I am
> moving code over from another application that is keyed to a User_id
> which I can get by querying for the User_id where it matches the
> username from the JetSpeed taglib request for username. Then I can set a
> session variable that holds the UID for the rest of my apps... I can't
> seem hit on the correct place include this
>
>
>
> -----Original Message-----
> From: Robin Antony [mailto:robin.antony@newgsystem.com]
> Sent: Friday, February 20, 2004 3:56 PM
> To: Jetspeed Users List
> Subject: Re: Session Information
>
> Hi,
> If you are asking for commands on how to put and get values from the
> session
> objects then this is what I am using.
> User currentUser = rundata.getUser();
> currentUser.setTemp("username", "xyz"); // to set values
> string username = currentUser.getTemp("username") // to get values.
> This excample uses the turbine user object as the session object. Don't
> forget to import your
> import org.apache.turbine.om.security.User;
>
> Hope this is what you were looking for.
> Cheers,
> Robin Antony
> New G System Pte Ltd
> www.newgsystem.com
>
>
> ----- Original Message -----
> From: "Bryan K. Cantwell" <br...@comcast.net>
> To: <je...@jakarta.apache.org>
> Sent: Thursday, February 19, 2004 7:42 PM
> Subject: Session Information
>
>
> > I am new to JetSpeed and am wondering what if any information is
> available
> in session
> > variables? And if none could the logon process be a good place to put
> a
> value into the
> > session (like the userID)?
> >
> > Thanks from a Newb
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>


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


RE: Session Information

Posted by "Bryan K. Cantwell" <br...@comcast.net>.
What I am really trying to find is where I can sneak code like this in
so that it is impossible to NOT have my session variable set. I am
moving code over from another application that is keyed to a User_id
which I can get by querying for the User_id where it matches the
username from the JetSpeed taglib request for username. Then I can set a
session variable that holds the UID for the rest of my apps... I can't
seem hit on the correct place include this 



-----Original Message-----
From: Robin Antony [mailto:robin.antony@newgsystem.com] 
Sent: Friday, February 20, 2004 3:56 PM
To: Jetspeed Users List
Subject: Re: Session Information

Hi,
If you are asking for commands on how to put and get values from the
session
objects then this is what I am using.
User currentUser = rundata.getUser();
currentUser.setTemp("username", "xyz"); // to set values
string username = currentUser.getTemp("username") // to get values.
This excample uses the turbine user object as the session object. Don't
forget to import your
import org.apache.turbine.om.security.User;

Hope this is what you were looking for.
Cheers,
Robin Antony
New G System Pte Ltd
www.newgsystem.com


----- Original Message ----- 
From: "Bryan K. Cantwell" <br...@comcast.net>
To: <je...@jakarta.apache.org>
Sent: Thursday, February 19, 2004 7:42 PM
Subject: Session Information


> I am new to JetSpeed and am wondering what if any information is
available
in session
> variables? And if none could the logon process be a good place to put
a
value into the
> session (like the userID)?
>
> Thanks from a Newb
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


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



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


Re: Session Information

Posted by Robin Antony <ro...@newgsystem.com>.
Hi,
If you are asking for commands on how to put and get values from the session
objects then this is what I am using.
User currentUser = rundata.getUser();
currentUser.setTemp("username", "xyz"); // to set values
string username = currentUser.getTemp("username") // to get values.
This excample uses the turbine user object as the session object. Don't
forget to import your
import org.apache.turbine.om.security.User;

Hope this is what you were looking for.
Cheers,
Robin Antony
New G System Pte Ltd
www.newgsystem.com


----- Original Message ----- 
From: "Bryan K. Cantwell" <br...@comcast.net>
To: <je...@jakarta.apache.org>
Sent: Thursday, February 19, 2004 7:42 PM
Subject: Session Information


> I am new to JetSpeed and am wondering what if any information is available
in session
> variables? And if none could the logon process be a good place to put a
value into the
> session (like the userID)?
>
> Thanks from a Newb
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


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


Re: Session Information

Posted by Stijn de Witt <St...@chello.nl>.
----- Original Message -----
From: "Bryan K. Cantwell" <br...@comcast.net>
To: <je...@jakarta.apache.org>
Sent: Friday, February 20, 2004 4:42 AM
Subject: Session Information


> I am new to JetSpeed and am wondering what if any information is available
in session
> variables? And if none could the logon process be a good place to put a
value into the
> session (like the userID)?
>
> Thanks from a Newb

About your userID, this is probably the ID into some USER table you have in
the database right?
I would try to connect 'your' users to those of turbine. When you login,
Turbine 'activates' a certain user automatically and you can get to this
information in the portlet action. You could then relate this information to
your user tables using a simple link table in your database:

userID    |   userName
1         |   admin
2         |   turbine
3         |   guest

This way, you store as little information in the session as possible and
you'll be able to combine information from your own user database (which
probably contains things like addresses, phone numbers and sales records) to
that of turbine (which contains information about the users permissions and
the last login date, for example).

-Stijn



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