Friday, April 10, 2009

Know how to remove the Minimize, Maximize and other options out of the portlet context menu in WebSphere Portal 6.0...

Working on my current project, I had a requirment to remove portlet context menus such has Maximize, Minimize, Move up, Move right etc from the Portlet Context Menu. Themes and skins in WebSphere Portal provide the framework for the UI, which includes page navigation, page layout, containers to hold portlet-rendered markup, and controls for user interaction. The title of the portlet as well as the portlet context menu are the part of the skin is rendering. Control.jsp in skin folder is basically responsile to render the portelt title and portlet Context menu. Following code in Control. jsp is responsible for portelt context menu


The URL generated from the code in listing 2 targets the JSP file that renders the portlet context menu, the themeTemplate attribute tells WebSphere Portal what JSP file to render, and the value in themeTemplate must match the file name of the JSP file excluding the file extension, which in our case is portletContextMenu.
Hence all the portlet menu items are from portletContextMenu.jsp inside themes folder.
Now to remove a particular portelt menu, look for the following code inside porteltContextMenu.jsp








You can delete the above code to remove Maximize portlet menu. Similarly other portlet menus can be removed. You can find code for portlet menus like Personalize, Edit_Default, Config, Maximize, Minimize, Help, Delete etc in portletContextMenu.jsp. Hence for removing any menu, you can just find the entry of that particular menu and can remove it.

If you have any better approach or any suggestions to improve this post, please leave a comment below.

No comments:

Post a Comment