Develop a personalized portlet
Overview
We will develop a portlet that uses personalization rules and content spots to display personal news based on user attributes.
Portlets
- Front Page
Portlet Description Internal News Display internal YourCo news for the user. Displays YourCo news after clicking on link General News Display external worldwide news articles for users. Messages to GeneralNewsDetails upon clicking upon one of the links UserInfo Display the current user's information. Used in rules to target content throughout the website to the particular preferences of users. This user information can be modified using the edit feature.
- Partners Page
Portlet Description Products Display products for the current user. Messages to the PartnersDetails upon clicking upon one of the links. Promotions Run rule targeting information in the portlet to the user's preferences. The promotions portlet also demonstrates running a campaign and the splitting of rules within a campaign. In this case, between March 1 and April 16, 2005 the Tax Season campaign will run. Within this campaign, one content spot is filled with 2 distinct rules, Get Tax Season Promotions and Get 3 Promotions about IRAs. Get Tax Season Promotions will be run 70% of the time and Get 3 Promotions about IRAs the remaining 30%.
A second campaign is also running in the promotions spot between April 14 and April 15, 2005. This campaign has a higher priority than the Tax Season campaign so it will run at this time.
- Services Page
Portlet Description Services Display services that are offered to the user. Clicking on one of the services will display the details of the service. If logging is enabled, clicking on one of the services will log the fact that this particular type of service was selected by the user. Offers Display current offers for the user. Demonstrates calling an analysis bean from a rule.
Database
Personalization can use database content. This exercise uses the sample database that comes with the Personalization sample. The following tables are used:
PZN_USER User information, including profile attributes PZN_OFFERS Text for special offers categorized by customer type
Sample data from PZN_USER table
Primary key = USERNAME
FIRST_NAME LAST_NAME DEPARTMENT CUSTOMERTYPE USERNAME* Scott Green Loans Gold scott Tawana Streble Human Resources Platinum tawana Marge Roorda Human Resources Platinum marge Andy McPherson IT Titanium andy
Sample data from PZN_OFFERS table
Primary key = OFFER_ID
OFFER_ID* CUSTOMERTYPE TITLE DETAILS 1 Platinum 2nd House Mortgage Excellent Mortgage rates on beach house. 2 Gold Add other Cards Add other members of household to account. 3 Platinum ARM Mortgage 1/3 5.9% APR Mortgage for 27 years. 4 Titanium Free Checking Deluxe Free Checking with the attainment of a YourCo Financial Credit Card.
Notice the common element in these tables is the column CUSTOMERTYPE. This column is important when you invoke Personalization later in the exercise.
Procedure
- Prerequisites for the Personalization portlet exercise
- Install the Personalization sample and database
- Create the JSP file in RAD
- Create the Personalization content resource classes and content spot
- Create the Personalization user resource classes and content spot
- Finish coding the portlet JSP
- Export the WAR file and install the portlet
- Import Personalization Workspace resource collections
- Create a simple content rule
- Create a content spot
- Enhance the Personalized Portlet
- Insert dynamic table html/jsp code
- Modify resource collection properties
- Create the user profiler rule
- Create additional advanced rules
- Change content spot rule mapping
- Personalized List portlet
- Uninstall Personalization sample and database
Parent
Developing portlets