Thursday, March 19, 2009

PortletPreferences in Websphere Portal

Here is more detailed info on PortletPreferences and how they are handled
http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/topic/com.ibm.wp.ent.doc/wps/adprflyrpltmd.html

Basically there 3 types of preferences


Administrator Preferences ( modifiable in CONFIG)
Shared Preferences (modifiable in EDIT)
Personalized Preferences (modifiable in all other modes)

Implementation:

Reading and saving these preferences depend on which mode you are in.
Modify the preferences accordingly. Example modify the Admin preferences in Config Mode, Modify the shared preferences in edit mode and modify the Personal preferences in VIEW and other modes.
All three preferences should be kept different...

Example:
If you want to implement a scenario where, for example, an administrator defines a part of a bookmark list that all users must see, and users can personalize the list by adding or removing their own entries, you need to use separate keys for administrator and user preferences and merge the values explicitly in the code.