• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

About usage of Portlet Preference and Portletconfig

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

what is difference between portletPreference and portletConfig objects.





Thanks,
prakash
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This should help you on PortletPreferences.
 
siva prakash
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks reddy,

I have gone thru that page, after that only i got this doubt, why we need this porletpreference object instead of portletconfig







Thnaks,
prakash
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow! You're joking, right?

Portlet preferences are user specific. A PortletPreference keeps information about a specific user.

PortletConfig is almost the exact same thing as the ServletConfig. It allows for setting a property that is common to ALL instances of that portlet.

So, if I have a CaliforniaStateTaxPortlet, I can set the tax rate to say, 6%, so everyone using that portlet would get their tax calculated at 6%. Someone might set their income in PortletPreferences. I set my income to $45,000. You set yours to $145,000. Someone else sets theirs to $200,000. That would be set in PortletPreferences - everyone has their own. But what is the tax rate for all of us? Well, it's still 6%.

Now, what if the tax rate goes down in California to 5%. Yea, I know that would never happen, but lets pretend. Well, you make ONE CHANGE in the PortletConfig, and it effects EVERYONE. I now pay 5%, you pay 5%, she pays 5%. BUT, our income hasn't changed in our PortletPreferences - it's completely unique to the user.

There's a HUGE, HUGE difference.

Here's the free tutorial on portlet development you absolutely need to see to understand the configuration objects:

Understanding the JSR168 Portlet Config Objects: PortletContext, PortletConfig, PortletPreferences, etc


Now, ask me about PortletContext..........

-Cameron McKenzie
[ August 09, 2007: Message edited by: Cameron McKenzie ]
 
Amarender Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have gone thru that page, after that only i got this doubt, why we need this porletpreference object instead of portletconfig



PortletPreference object is NEVER a substitute for PortletConfig.
So, there is never the question of using PortletPreference INSTEAD OF PortletConfig.

Please go through the portlet API once again. You will realise how unique these two objects are.

cheers
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic