Skip to main content

Digital Transformation

The Power of WebSphere Portal Personalization

Personalization (PZN) in WebSphere Portal is one of its most powerful yet overlooked capabilities.  I am surprised how often it is not even considered for everyday scenarios and instead complex custom code is written .  Personalization is often for viewed as simply selecting content from Web Content Management (WCM) based on site areas and matching the content categories with LDAP attributes for a logged in user.  While this is useful, PZN can be used for so much more. PZN rules can be written against any java accessible object (known as an Application Object) making it quite straight forward to write rules against information returned from a web service, database, or any connected system for that matter.

One of my favorite PZN capabilities are visibility rules.  These have nothing to do with content but instead allow selective showing and hiding of portlets and pages based on rules.  I have used this extensively in production portals and it works perfectly.  For example, let’s look at a scenario where an employee intranet has a portlet which allows users to view paycheck stubs online.  In this scenario suppose the portlet needs to retrieve information from a legacy mainframe which is offline between 2 am and 4 am each night.  One solution might be to put code in the portlet which inspects the times or captures the failed connections and gracefully handle the error and display a maintenance downtime message.  Now this will work very well but requires custom code and that code will execute every time the page is accessed.

There is a better way.  Let’s look at how simple it is to solve this scenario in minutes with out of the box personalization visibility rules and no custom code.

1) First create a content portlet which has a nice maintenance downtime message.  This could be in portal’s Web Content Management (WCM) or whatever facility you choose to create content.
2) Create 2 personalization visibility rules as shown below.  The first will “show a page or portlet” between the hours of 2 am and 4 am.  The second will “hide a page or portlet”  between the same hours.

WebSphere Portal Personalization Hide Portlet Rule

WebSphere Portal Personalization Hide Portlet Rule

WebSphere Portal Personalization Show Portlet Rule

WebSphere Portal Personalization Show Portlet Rule

 

3) Now add the content portlet created in the first step to the same page that the paycheck stub portlet is on and apply the visibility rules as shown below.

Page Layout Configuration

Personalizaton Rule Configuration on Page Layout

Presto!  You now have a way to implemnt graceful downtime meesages with no custom code at all.   Furthermore, it is much more scallable since when a visibility rule indicates to portal that a page or portlet should be hidden, no code in that portlet (or the portlets on a hidden page) even execute.

Thoughts on “The Power of WebSphere Portal Personalization”

  1. This is a great blog. Do you have other references to WebSphere Portal personalization that you can point me to? We are in the process of identifying best practices in this area and are looking for ideas that can help guide us.

    Thanks,
    Scot.

  2. Scott,

    Off hand I don’t have specific material although I can point you to the case study for Blue Cross Blue Shield of Florida at IBM’s recent Web Experience Conference. Their Member Portal is highly customized and performs well. Do you have access to the case study from the session download?

  3. Julia Passynkova

    How to redirect user to “Not authorized” page if a requested page is hidden? Right now the portal redirects user to the first page under Context Root that is accessible to the user. The same page is used for other purposes such as: session timeout, invalid page…. We need to show a message that user doesn’t have permission to access the requested page. Any idea how to do it?

  4. Glenn Kline Post author

    One way I have implemented this in the past is to have two different links which have two different mutually exclusive personalization rules assigned. The first (access allowed) operates as normal. The other link (access denied) has the same label but actually links to a not authorized page.

  5. Julia Passynkova

    Hi Glenn,

    I actually just tried it and it works. After that I tried to export the page with PNZ and I do not see any trace of it in XMLAccess. All our pages are created via xmlaccess and it will be a big issue to make all personalization manually. Do you know how to automate PNZ creation? Thanks a lot.

  6. Glenn Kline Post author

    XMLAccess page exports should include all references to assigned personalization rules. You can also edit the xml to add the references and import as well.

  7. Hi Glenn,
    I need to provide the option to create/update the Visibility rules for Site Admins. These Site Admins will have access to a limited set of Pages. I assigned “Administrator” role for these Site Admins to the pages that he have access to. But Create New rule is disabled for him. I’m able to do that using a user in wpsadmins group.

  8. Have you ever thought about writing an e-book or guest authoring on other sites? I have a blog based on the same information you discuss and would love to have you share some stories/information. I know my viewers would enjoy your work. If you’re even remotely interested, feel free to shoot me an e mail.

  9. When the Personalization engine tries to get the value from session, the following error message is getting displayed.

    00000052 CmQueryCallba W com.ibm.websphere.query.callbacks.CmQueryCallback buildCategoryCondition Category value ” does not match any category resource in repository.

    I created a content C1 and tagged it with a Category , TEST_VALUE

    I want the content C1 to be displayed if the value in the session equals TEST_VALUE

    The Business Rule is as follows

    Select Web Content
    whose Location is libName and
    whose Category is exactly current Session.http_key or
    whose Category is exactly current Session.portlet_key

    The value of both http_key and portlet_key is TEST_VALUE.

    I created a portlet and set the value into httpsession using the key http_key = TEST_VALUE
    and set value into portlet session as portlet_key = TEST_VALUE

    When I preview the business rule, I get the above mentioned error message as
    “Category value ” does not match any category resource in repository”

    When I tried to access the same key from another portlet in a different portal page, I get the value, TEST_VALUE.

    Can anyone throw some ideas.Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Glenn Kline

Area Vice President, Custom Development and Mobile Solutions

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram