Before I begin, let me point out – this tip is specific to 11g. For an explanation of how to do this sort of thing in 10g, click here.
If you’ve read Kyle’s post on modifying the navigation menus in UCM 11g, you have a pretty good understanding of how to add your own custom links to the menu interface in UCM 11g using the new Dynamic Data tables. But what if your goal is to conditionally hide the default Standard Search and Standard Check-in links? It could be because you have created your own profiles to handle the search and check-in experience, and while you don’t want the clutter and possible confusion the default links could introduce to your users, you’d like to keep them around for admins. I’ll explain how this can be done by creating a simple Custom Component that restricts the Standard Search and Standard Check-in menu links to admins. I’ve created an example custom component called ‘CustomMenuLinks’ that does this, available for download at the bottom of this post.
If you look at the std_nav.idoc file you’ll see your standard links in the CoreMenuItems data table. The Standard Search link can be found in the linkData of the SEARCH item, and for Standard Check-in, the NEW_CHECK_IN item.
Scrolling down further in std_nav.idoc, we can see that the flags controlling visibility of menu items are configured in the CoreMenuItemsFlags data table. To restrict a menu item to admins only, it’s as easy as adding a row with an id and flags pair. In fact, there are other flag values you can apply to menu items depending on the specific behavior you want – check the documentation for all the possibilities. At first glance it seems that adding rows for SEARCH and NEW_CHECK_IN with the corresponding flags value ‘isAdmin’ will do the job, however it is a little bit trickier than that.
CoreMenuItems SEARCH and NEW_CHECK_IN are actually more than just links. Scroll back up to the CoreMenuItemRelationships data table and you will find them referenced as parent items of the MY_PERSONAL_SEARCHES_LIST and MY_PERSONAL_CHECKINS_LIST items, respectively. These “lists” are in fact placeholders for your profile-specific search and check-in links. Setting their parents only accessible to admins would also restrict all profile-specific search and check-in links to admins, which isn’t what we want.
What you can do is create a simple custom component that makes the following changes to CoreMenuItems, CoreMenuItemRelationships and CoreMenuItemsFlags data tables:
- Add new items for standard search and check-in, having their own labels but linkType and linkData use the values specified for SEARCH and NEW_CHECK_IN.
- Update the SEARCH and NEW_CHECK_IN items to leave their linkType and linkData values blank as the actual links themselves will be served by the new items. (You’ll need to specify mergeBlanks to ensure your empty values will be merged into the table)
- In the CoreMenuItemRelationships table, configure SEARCH and NEW_CHECK_IN as parents of your new standard search and check-in links.
- Finally, you can now add flags for your standard search and check-in links to the CoreMenuItemsFlags data table to restrict them to admins only.
To download this example custom component, click here. It consists of the below (that’s it!):
<?commatable mergeKey="id" mergeBlanks?>
id, label, linkType, linkData
SEARCH, wwSearch, ,
STANDARD_SEARCH, Standard Search, cgi, IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=STANDARD_QUERY_PAGE
NEW_CHECK_IN, wwNewCheckIn, ,
STANDARD_CHECK_IN, Standard Check-In, cgi, IdcService=CHECKIN_NEW_FORM
parentId, id, loadOrder
SEARCH, STANDARD_SEARCH, 1000
NEW_CHECK_IN, STANDARD_CHECK_IN, 1000