Using XML Stream rules, you can add items to the menu structure of the Developer portal. Your menu choices appear in the Tools > Add-ons menu group.
Don't confuse this facility, which extends the Tools menu on the Developer portal, with the general-purpose menu bar control used in composite portals. The XML Stream rules for both facilities follow the same syntax, but the menu bar is for user portals, not the Developer portal. For the menu bar, see Harness, section, and flow action rules — Adding a menu bar.
Process Commander builds the menus that a developer
experiences from four sets of XML Stream rules. All have
@baseclass
as the first key part. At runtime,
stream processing evaluates JSP tags to produce the menu
structure displayed in a portal.
Menus
as the
third key part. For example, the XML Stream rule named
@baseclass.DeveloperFileMenu.Menu defines the
File menu in the Developer portal. (The Developer menu rules
are final.)MenuItem
as the third key part. For example, the
XML Stream rule @baseclass.MyProfile.MenuItem defines
the operation of the Edit > My Profile menu
option.MenuAddon
as the third key part. For example,
you can define a menu add-on through an XML Stream rule named
@baseclass.SearchGoogle.MenuItem.An add-on menu XML Stream rule defines a (well-formed) XML fragment, not an entire document. The simple structure is:
<Item Value="myvalue" Caption="mycaption" onClick="function" />
where:
onClick()
target references a JavaScript
function in the standard text file rules
webwb.DesktopWrapperAPI.js or — for
advanced cases —
webwb.MenuActionHandlers.js, or an HTML fragment
rule identified in the Menu HTML Fragment
field on the Options tab of the
Portal form.The XML Stream rule may contain JSP tags such as <pega:when >, <pega:reference > and <pega:include >. Menus may contain submenus up to five levels deep.
Four features make this simple structure flexible and powerful:
<pega:include >
and <pega:when
>
to make the menu option depend on clipboard
values.An XML Stream rule named @baseclass.MarthasFavorites.MenuItem contains the following XML code:
<Item
Value="MarthasFavorites"
Caption="Martha report "
onClick="showListInWindow('Data-Rule-Summary',
'MJFavorite','true',Refresh')"
/>
When the developer selects Tools > Addons >
Martha Report, the JavaScript function
showListInWindow()
executes the list view report
named Data-Rule-Summary.MJFavorite.ALL and displays the
resulting report output.
@baseclass
as the
first key part and MenuItem
as the final key
part.Call the JavaScript function showListInWindow() to present a list view report. Call the JavaScript function openUrlInWindow() to execute an activity.
See Pega Developer Network article PRKB-25061 How to extend the Developer portal menus.
Version 5.4 introduces the add-on approach presented above. If you built customized Developer portal menus in older versions, your customizations are unlikely to work in V5.4. Revise them by following the instructions in this topic.
stream processing | |
About JavaServer Pages
tags
About Portal rules About XML Stream rules |