Modifying Navigation Menus in UCM 11g

UCM Custom Navigation Menus

In UCM 11g, the way the navigation menus are constructed are done differently now.  In the past, this was handled with a navbuilder API in Javascript that allowed for menu choices to be manipulated with commands such as:

navBuilder.addChildNodeTo('ADMINISTRATION', 'item', 'id==FUNCTIONA', 'label==Function A'), 'url=='+httpCgiPath+'?IdcService=FUNCTIONA');

Well, in 11g that method has been deprecated in favor of a new method.   This new method takes advantage of a new data table construct in 11g Idoc Script called Dynamic Data Tables.  These allow you to create tables of data in Idoc Script and dynamically change them as opposed to the static table definitions.  This is useful for data that changes frequently and may be user specific...like the navigation menu.  I won't go into detail on Dynamic Data Tables here, but you can read up more about them in the Oracle Fusion Middleware Developer's Guide for Oracle Universal Content Management 11g Release 1 (11.1.1)

So for the example above, the code would now look like this in the custom component's resource file:

<@dynamicdata CoreMenuItems@>
id, label, linkType, linkData
FUNCTIONA, Function A, cgi, IdcService=FUNCTIONA
<@end@>


<@dynamicdata CoreMenuItemRelationships@>
parentId, id, loadOrder
ADMINISTRATION, FUNCTIONA, 1000
<@end@>

Then you can add some additional information to the menu such as any flags/conditions on when it should be shown and any image to be displayed with it in the Trays view.

<@dynamicdata CoreMenuItemsFlags@>
id, flags
FUNCTIONA, isAdmin
<@end@>


<@dynamicdata CoreMenuItemsImages@>
id, image, imageOpen
FUNCTIONA, ScsPageItem.gif,
<@end@>

To help get you started, I've posted a sample component that gives an example of these methods and includes a readme.html that goes into detail on the different options that are possible.

Comments:

Thanks Kyle for this useful post, I was just looking for a way to do hide my menu (made in the new structure) from non admins!

Posted by Fabian Scherpenzeel on May 19, 2011 at 02:39 AM CDT #

Hello Kyle,
Thanks for this very useful information. But I am not able to download the sample component. Is it possible to make the component available for download which would be really helpful.

Thanks again!!

Posted by guest on July 12, 2011 at 12:52 AM CDT #

Can you explain why you are unable to download the sample component? I just verified the link resolves to the Oracle sample code site (www.samplecode.oracle.com) and the attachments link to MenuExample.zip does work.

Thanks,
-Kyle

Posted by guest on July 13, 2011 at 02:58 AM CDT #

How do you add your login username to the UCM Menu Bar?

Posted by Tom on August 03, 2011 at 09:07 AM CDT #

Hi Kyle,

Thanks for this information!
I'm trying to download the sample component, but the browser returns a error message, informing that is not possible to connect to the server. Could you verify the link or upload the component in another server?

Thanks!

Posted by guest on November 07, 2011 at 01:47 AM CST #

Sorry about that. Our code samples site has been moved. You can get this sample plus others from this page: http://www.oracle.com/technetwork/indexes/samplecode/webcenter-content-samples-1352729.html

Thanks,
-Kyle

Posted by Kyle Hatlestad on November 08, 2011 at 01:28 AM CST #

id, flags
FUNCTIONA, isAdmin

How can this part of the code be modified to check a user's access based on account permissions? For example, if I have a user who belongs to a "comms" account, I usually use

if userHasAccessToAccount("comms",7)...

to conditionally show them things. This doesn't seem to work in the context above.

Is there a way to write custom flags instead of relying on isAdmin, isSysmanager, isContributor?

Thanks!

Posted by guest on December 13, 2012 at 11:09 AM CST #

To be more conditional for the menus, you can add your own flags and then insert the logic within the navigation_filter_rset_menu_item resource. For example, in the dynamic data for the menu items, it might look like:

id, flags
FUNCTIONA, hasAccessToAccountX

Then in the navigation_filter_rset_menu_item resource, you could add the following condition:

<$if not tmpDeleteRow and flags$>
<$if flags like "*hasAccessToAccountX*" and (not isTrue(userHasAccessToAccount("AccountX", 1)))$>
<$tmpDeleteRow = 1$>
<$endif$>
<$endif$>

So if the user does not have access to that account, the tmpDeleteRow is called and it removes that menu item.

Posted by Kyle Hatlestad on December 17, 2012 at 02:03 PM CST #

Thank you Kyle, Great post and working as expected for me .

Posted by chandra on February 04, 2013 at 03:28 PM CST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today