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 Andy Benjamin <an...@hotmail.com> on 2003/04/09 01:32:51 UTC
Customization
Greetings all,
I have a question about design and personalization. I noticed that the
weather portlet has the ability for the user to enter a city and it appears
that the city and state is stored past the session (which obviously means
that it must be persisted somewhere). My question is if I want to do a
similar thing with a jsp based portlet do I have to create a table in the
database and then store that information manually or does Jetspeed have
hooks or some API that grabs all a user's personalized data and makes it
available to the portlet? Thanks.
Andy
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
Re: Customization
Posted by Anandkumar Ayyachamy <an...@eself.com>.
check this class BaseJetspeedUser in the API docs to see if there are
some methods to
incorporate additional user properties.
Andy Benjamin wrote:
> Greetings all,
>
> I have a question about design and personalization. I noticed that
> the weather portlet has the ability for the user to enter a city and
> it appears that the city and state is stored past the session (which
> obviously means that it must be persisted somewhere). My question is
> if I want to do a similar thing with a jsp based portlet do I have to
> create a table in the database and then store that information
> manually or does Jetspeed have hooks or some API that grabs all a
> user's personalized data and makes it available to the portlet? Thanks.
>
> Andy
>
>
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------------------------------------------------
> 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: Customization
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Tuesday, April 8, 2003, at 04:32 PM, Andy Benjamin wrote:
> Greetings all,
>
> I have a question about design and personalization. I noticed that
> the weather portlet has the ability for the user to enter a city and
> it appears that the city and state is stored past the session (which
> obviously means that it must be persisted somewhere). My question is
> if I want to do a similar thing with a jsp based portlet do I have to
> create a table in the database and then store that information
> manually or does Jetspeed have hooks or some API that grabs all a
> user's personalized data and makes it available to the portlet?
> Thanks.
>
Take a look at the Weather Portlet's source code, in the WeatherAction:
public void doUpdate(RunData data, Context context)
{
String city = (String)
data.getParameters().getString("weather_city");
String state = (String)
data.getParameters().getString("weather_state");
String style = (String)
data.getParameters().getString("weather_style");
String station = (String)
data.getParameters().getString("weather_station");
String cityInfo = getCityInfo(city, state, station);
if (cityInfo != null)
{
VelocityPortlet portlet = (VelocityPortlet)
context.get("portlet");
context.put("weather_city_info", cityInfo);
portlet.setAttribute("weather_city_info", cityInfo, data);
<-------------- this will persist the attribute to PSML
if (style == null || style.equals(""))
{
style = "infobox";
}
context.put("weather_style", style);
portlet.setAttribute("weather_style", style, data);
}
}
Similarly, you can get the attribute from PSML
String style =
portlet.getAttribute("weather_style",null,rundata);
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org