Hiding the Standard Check-In and Standard Search menu items

On 3 separate comment threads on my blog, I've had people asking how to hide the Standard Check-In and Standard Search menu items in UCM/URM navigation.  Given that it seems to be a popular topic, I thought I would cover it here.

Out of the box, UCM does not give you a way to hide these menu choices.  There aren't any secret configuration flags or tricks you can do with Idoc Script to get them to disappear.  You need to have a custom component to do it.   But the good thing is the code to do it is pretty minor.  And because the menus changed between 10g and 11g, the code is slightly different between the two.  But I'll cover both here.

In both cases, you want to modify the 'custom_finish_layout_init' resource. As the name implies, this is what gets called at the end of the JavaScript processing of the page layout and where we can insert our menu changes.  As best practice, you first want to include a 'super.' call to the resource to load any previously modified versions of the resource:

 <$include super.custom_finish_layout_init$>

The next portion depends upon the version you are running.  On 10g, the code would look like:

navBuilder.deleteItem("MY_PERSONAL_SEARCHES_<$dpSearchCount$>");
navBuilder.deleteItem("MY_PERSONAL_CHECKINS_<$dpCheckinCount$>");

And that's it!  Just deploy your component and your menu choices should be gone.  Of course, you can always go beyond that and show the menus if the user is an admin or such.  Or hide just one or the other based on configuration entries.

In 11g, the code would look like:

var searchmenu= YAHOO.widget.MenuManager.getMenu("MENU_A_SEARCH");
var searchmenuitems=searchmenu.getItems();
    <$if isComponentEnabled("RecordsManagement")$>
        <$lenghthCount="2"$>
    <$else$>
        <$lenghthCount="1"$>
    <$endif$>
navBuilder.deleteItem("MY_PERSONAL_SEARCHES_" + (searchmenuitems.length-<$lenghthCount$>));

var checkinmenu= YAHOO.widget.MenuManager.getMenu("MENU_A_NEW_CHECK_IN");
var checkinmenuitems=checkinmenu.getItems();
navBuilder.deleteItem("MY_PERSONAL_CHECKINS_" + (checkinmenuitems.length-1));

In this case, there isn't an Idoc variable that is maintaining a count anymore.  So it has to be calculated through the MenuManager.

For a pre-built version of the component, I have one available on our sample code site.  It has logic to detect if you are on 11g or 10g and apply the appropriate command to delete the menu items, so it can be used in either version.

Comments:

I'm on 11g, so I took a different route and accomplished this via simple Dynamic Data Table changes in a custom component. This may be helpful for others on 11g as well. Thanks Kyle, your blog is packed with useful information!

http://ecmtech.wordpress.com/2011/08/28/conditionally-hide-the-standard-search-and-standard-check-in-links-in-oracle-ucm-11g/

Posted by guest on August 28, 2011 at 04:56 PM CDT #

I m new to Oracle Site Studio & Content server and i have to implement search on the site which i have created using Oracle Site Studio designer 11g so can any one please help me out regarding that.

Thanks

Regards

Vijay Kumar

Posted by guest on October 10, 2011 at 02:47 AM CDT #

Hey Vijay,

For an open forum for questions and answers, I'd recommend subscribing to the WebCenter Content Users Group on Yahoo. Because of the history of the product, it's identified as [intradoc_users] - http://tech.groups.yahoo.com/group/intradoc_users/

Thanks,
-Kyle

Posted by guest on October 11, 2011 at 04:18 AM CDT #

Hi Kyle,

Great component and works on web UI, but DIS still showing the standard profile in the drop down list. I want to remove that.

I did some changes to your resource to exclude users from admin group:
<$if isTrue(HideStandardCheckin) and not userHasRole("admin") $>

Cheers, Rosita

Posted by guest on January 18, 2012 at 01:15 PM CST #

Hey Rosita,

Unfortunately, I don't know of a way to hide it there because the DIS client is not customizable that way. But if your goal is to keep users from using it, you could have a Rule defined which excludes all of the fields for non-admins. That way if users happen to select it, it won't actually work for them and force them to pick an actual profile.

Thanks,
-Kyle

Posted by Kyle Hatlestad on January 19, 2012 at 07:27 AM CST #

hi Kyle, When making these changes for the menu items, is there a way something like configuration variable, so that the menu items quickly appear avoiding a restart of the server.

Thanks,
Ramesh

Posted by Ramesh Salla on August 31, 2012 at 03:13 AM CDT #

Hey Ramesh,

You could surround the delete functions with an "if" check to evaluate before deleting them.

<$if not isTrue(ShowStandardProfiles)$>
<...code from above...>
<$endif$>

Then in your URL, you just append '&ShowStandardProfiles=1' and the page should then show them.

Thanks,
-Kyle

Posted by Kyle Hatlestad on August 31, 2012 at 08:34 AM CDT #

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