Tuesday, July 19, 2016

Add the portlet session bean to the Personalization engine

Add the portlet session bean to the Personalization engine
Register the session bean with the Personalization engine. To enable the Personalization engine to leverage data in session bean:
  1. Export the session bean class as a jar file with full class path.
  2. Copy it to <wp>/pzn/v6.0/collections directory on the WebSphere Portal machine.
  3. Restart WebSphere Portal server to load the jar file.
To register the session bean with Personalization:
  1. Create an application object in Personalization.
  2. Session key and class name are required fields for the creation of the application object
  3. Specify the fully qualified class name
Note: Visibility rule uses caching per session so if the visibility rule is meant to use dynamic data, the results will not change based on the dynamic data. To implement visibility rule on dynamic data you need to disable caching.

Same thing can be done using object cache, we can update values in object cache from application and the stored values can be read from the custom pzn SelfInitializationApplicationObject implementation class.

Different technique can be also used to hide the portlet i.e. portlet eventing.

Hide portlet through external class (SelfInitializationApplicationObject): http://wpcertification.blogspot.com/2011/01/how-to-show-or-hide-portal-or-portlet.html

Issue discussed on setting Personalization Attributes from Portlets:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014177630