Custom Menu Actions – Specifically Doc Info

September 4, 2008

In the oracle forums today a question came up about how to add custom actions to the menus in the actions drop downs for the Content Information page (sometimes called the Doc Info page). I wanted to dive into this a little more because in 10gR3 the way the developers crafted the menus is much more extensible. It is very nice. Somebody should get a raise.

Look at the dynamic html include named docinfo_menus_setup in the std_page.htm file. The menus are crafted as a result set, which makes adding to the menus very easy. Also, at the end of the code they perform an include on something named custom_docinfo_menus_setup and this is key. Let's look at how we might override this include to add some of our own custom actions:

<@dynamichtml custom_docinfo_menus_setup@>
  <$include super.custom_docinfo_menus_setup$>
  <$exec rsAppendNewRow("PageMenusData")$>
  <$PageMenusData.nodeId = "JAVASCRIPT_ALERT"$>
  <$PageMenusData.parentId = "CONTENT_ACTIONS"$>
  <$PageMenusData.label = "JavaScript Alert"$>
  <$PageMenusData.type = "item"$>
  <$PageMenusData.href = "javascript: alert('JavaScript Alert!'); void 0;"$>
  <$PageMenusData.loadOrder = 150$>
  <$exec rsAppendNewRow("PageMenusData")$>
  <$PageMenusData.nodeId = "CORE_CONTENT_ONLY"$>
  <$PageMenusData.parentId = "CONTENT_ACTIONS"$>
  <$PageMenusData.label = "Visit"$>
  <$PageMenusData.type = "item"$>
  <$PageMenusData.href = ""$>
  <$PageMenusData.loadOrder = 170$>

This will add two menu actions to the doc info page content actions menu. One of which will simply pop up a JavaScript alert and the other one will take you to this blog. That sounds pretty straight forward, but what are all these properties? Let's learn a bit more about two of them, parentId and loadOrder.

The collection of menus on the page are known as PageMenusData. Technically there are three menus within this. The bar going across the page (HEADER_MENU) is the first menu, and the second two menus (CONTENT_ACTIONS & EMAIL) hang off of that bar.

As you look through the docinfo_menus_setup include you see these menu names or id's in action and you can start to piece together how the menu structure is crafted. Our custom actions have been "joined" to the CONTENT_ACTIONS menu by setting that menu id as the parent id for our menu nodes.

Load order is also one of the more interesting points. Supplying specifically planned load orders allows you to control where in the menu your node is displayed. And SOMEBODY at Oracle/Stellent was paying attention because the load order for the default set of actions items generally increments by units of ten. This means they left some space in there for us to get our custom actions in between out of the box actions if we find the need.

Here is an example component you can download and adjust to play around with this functionality.

Doc Info Custom Actions

© 2020 Jason Stortz (version 20200607-210013)