Insert dynamic table HTML/JSP code
Use Rational Application Developer to code the dynamic table in the Personalized Offers portlet JSP. Export the project as a web archive (WAR) file. Open the HCL Digital Experience Administration page for Portlet Management and update the web module that contains the Personalized Offers portlet.
Before you begin this procedure, ensure that you created a content spot.
-
Open Rational Application Developer and open Pers_OffersPortalView.jsp in edit mode.
-
Insert the following code at the end of the JSP page:
<HR> Here are all your personalized offers: <br> <% try { pers_offers.Pzn_offers[] items = offersSpot.getRuleContent(); pers_offers.Pzn_offers item = items[0]; // throws an exception if empty. %> <TABLE WIDTH="100%"> <TBODY> <% for (int i = 0, c = 0; ; ) { if (c == 0) { %> <TR bgcolor="e7e7e7"><% } else { %> <TR><% } %> <TD><%= item.getTitle() %>: <%= item.getDetails() %> </TD> </TR><% c = c == 0 ? 1 : 0; i++; try { item = items[i]; } catch (java.lang.ArrayIndexOutOfBoundsException _e0) { break; } } %> </TBODY> </TABLE><% } catch (java.lang.ArrayIndexOutOfBoundsException _e0) { %><FONT>There are no current articles to display. </FONT><% } %>
-
Save and close the file. Verify no errors other than exception handling errors.
-
Export the project as a war file. Close Rational Application Developer.
-
Log in to HCL Portal as wpsadmin. Click the Administration menu icon. Then, click Portlet Management > Web Modules.
-
Click Update to update the web module.
-
Complete the installation process by using the newly created war file.
You can now modify the resource collection properties for Pzn_Offers_User.