This document is an exploration in using WCM Menu component personalization (without the need for the legacy LDAP Connector). I have written this document in response to an inquiry by one of my clients who have requested to learn more about how this can work. Hopefully, the document will prove useful to others as well.

Let's get started by examining the following Menu. This is created with a WCM menu component that is configured to retrieve all published documents from two different site areas.

Right now, I've got nothing configured for Menu Component Personalization; we're going to do that together so you can see how it works. What you can see in this menu is that I have a total of four published documents being pulled from two different Site Areas - just a simple 'run-of-the-mill' menu. What I want to do first is show you how we can personalize this menu so that only two out of the four documents show to a given user.

How it's going to work

When you install WCM,it creates a special attribute for each user called WCM:CATEGORIES. This attribute exists in the Portal's database, not your LDAP directory. WebSphere automatically associates this attribute to the user from LDAP or whatever user repository you have configured. If you want to see that this attribute is really in the system, here is a simple check you can perform yourself:

Special WCM: attributes; see for yourself...

  1. Deploy the out-of-the-box People Search portlet to a page.
  2. Click on the portlet's Configure icon (the wrench)
  3. Under Shared Elements, click the hyperlink for Configuration Basics
  4. Scroll down to the bottom of the attribute list. You should actually see three WCM related attributes:
    • WCM:CATEGORIES
    • WCM:KEYWORDS
    • WCM:USERDATA

You can also find these attributes already configured to be visible to WMM if you look in your WMM configuration files. In \PortalServer\wmm. For example, in wmmLAAttributes.xml, you should see the following:

<attributeMap wmmAttributeName="WCM:CATEGORIES"
                pluginAttributeName="WCM:CATEGORIES"
                applicableMemberTypes="Person"
                dataType="Object"
                classname="java.util.List"
                multiValued="true"/>
<attributeMap wmmAttributeName="WCM:KEYWORDS"
                pluginAttributeName="WCM:KEYWORDS"
                applicableMemberTypes="Person"
                dataType="Object"
                classname="java.util.List"
                multiValued="true"/>
<attributeMap wmmAttributeName="WCM:USERDATA"
                pluginAttributeName="WCM:USERDATA"
                applicableMemberTypes="Person"
                dataType="Object"
                classname="java.util.HashMap"
                multiValued="true"/>

Following is a cropped screenshot from the People Search portlet configuration view. See the special WCM related attributes?

Note

Don't bother selecting these attributes for display in the People Search portlet; I already tried and nothing displays. This is probably because (as you can see in the People Search portlet) the value type for these three attributes is Object instead of String or some other known datatype.

Let's make it work

OK, so let's personalize our menu now. We'll need some Taxonomy Categories to use as tags that will go both in the WCM:CATEGORIES attribute and also as tags on documents. Take a look at the simple taxonomy I am going to use for this exploration:

Now, I'm adventurous, so I intend to use Test Category 2A and Test Category 2B because they are nested the deepest and I am curious what that might show us later. First, I will tag two out of the four published documents. To achieve this, I simply edit the documents in WCM and add the categories to the documents in the Pofile -> Categories section of the edit form. If I look at the Menu's output just after tagging the documents, I will still see all four documents. I need to configure the Menu component to match the user's categories with the category tags on documents. Here's how I do that:

  • Edit the Menu component
  • Check the Results must match all Categories item in the form.
  • For Matching Profile Search Rules select the Current User Categories search rule.
Note

Don't let the term 'search rule' confuse you when it comes to Menu components in WCM. This has absolutely nothing to do with the kind of content search you'd use for the portal overall (e.g. a search engine such as Verity, or OmniFind, or even the default portal search). Think of Menus in WCM like little mini search engines. They are just returning results from their particular configuration, but this is only for creating menus and lists of links; it's not the 'BIG' search.

Now, look at the output of my Menu...

The Menu is configured to match the categories on content to all of the categories assigned to a user. Two of the documents are not displaying because they aren't tagged at all. But what about the two documents that I tagged? Why aren't they showing? I've assigned the categories to documents, but I haven't associated any categories to the user. Let's do that now through the WCM administration interface. Here's how:

  • In WCM, select Site Management -> Category Management
  • Click the User Profile button
  • Search for a known user (for example, I search 'Cody' to get to my personal user object, 'Cody Burleson')
  • Check the box next to the user name and then click the OK button
  • Now you have a simple form that allows you to select categories for this user. When you submit the form, those categories will be written to the user's special WCM:CATEGORIES attribute that we saw earlier. For my example, I am adding the same two categories that I tagged two of my documents with. If it works, then I should see two documents in the Menu.

Drumroll please...

CRAP! DOH! Arggggh!

It didn't work! My menu is still empty...which is not at all what I expected....

That's OK. I think it's important to document some of the failures so that I can also document the troubleshooting process that I use. Maybe that can then help you understand how you might also troubleshoot when you run into similar snags.

The first thing, of course, that I will do is verify that the documents are tagged with the categories, the Menu component is configured properly, and that the user profile has the categories. That's basically what should comprise the working assembly:

  • The user must have the categories in their WCM:CATEGORIES attribute
  • The content documents youy want to display to the user must be tagged with the appropriate categories.
  • The Menu Component must be configured to use the Categories search rule

Oh, I got it!

While just typing the above, it occurred to me what is wrong. Remember in the Menu configuration, I selected "Results must match all Categories"? Then, I associated two categories with the user. Well, I only tagged each of my two documents with one category. I told the menu to display documents only when ALL the categories in the user's profile match what's tagged on the document. It's a one-to-one mapping. It's simple...I just need to add the other category tag to each of my two documents.

Let's have that drumroll again, please...

COOL! Now what?

Now we see that we are able to personalize Menu Components using WCM:CATEGORIES user profile attribute, Category tags (on documents), and a particular configuration on Menu Components. In older versions of WCM, you had to have the LDAP Connector (custom component) in place to make this possible. But I just executed all of this on my WebSphere Portal 5.1.0.2 instance with no LDAP connector in place. So we know how Menu Component Personalization works! We can celebrate our small success with a beer, but we bess not get hammered yet... there is still a problem...

Obviously, it's not acceptable to have end-users go into the WCM administration interface to associate categories with themselves. And, it's also not acceptable to have an administrator do it on behalf of a gazillion users! So, how do the software designers expect us to leverage this mechanism in a real-world situation?

There are two solutions:

1. WCM supports the use of Taxonomy Components configured as form elements that will automatically add submitted selections to the end-user's WCM:CATEGORIES attribute. This method is great for implementing a subcription model where you allow the end-user to subscribe to one or many of various categories.
2. If you want to automatically map user LDAP attributes to WCM categories at run-time, you must implement the Dynamic Mapper. See \PortalServer\wcm\samples\DynamicMapper for a starting point.

  Name Size Creator (Last Modifier) Creation Date Last Mod Date Comment  
GIF File wcmAttributes.gif 4 kB Cody Burleson Jul 02, 2007 Jul 02, 2007  
GIF File testTaxonomy.gif 4 kB Cody Burleson Jul 02, 2007 Jul 02, 2007  
GIF File personalizedMenu.gif 4 kB Cody Burleson Jul 02, 2007 Jul 02, 2007  
GIF File newsMenu.gif 8 kB Cody Burleson Jul 02, 2007 Jul 02, 2007  
GIF File emptyMenu.gif 1 kB Cody Burleson Jul 02, 2007 Jul 02, 2007  

Labels:

Enter labels to add to this page:
Wait Image 
Tip: Looking for a label? Just start typing.