The following example demonstrates how to add a Corporate Policy action as the final menu selection in the Options menu. This custom action navigates the agent to the corporate policy panel stack.

  1. Create an OptionsPolicyNavAction. The following example creates an OptionsPolicyNavAction, in the /atg/svc/agent/ui/directory of your custom application. Because there are already five menu items that are identified with sort priorities of 100 to 500, setting the sortPriority of this new NavAction to 600 will identify it as the sixth menu item, or the last menu option in the list. This example also implements a JavaScript function call to the policy.jsp file:

    $class=atg.svc.agent.ui.NavAction
    $scope=window

    id=optionsPolicyNavAction

    sortPriority=600
    #controls if this action is available. If not, it will not be included in
    #the UI.
    available=true

    #use this property to assign a specific security access right to this
    #action. If the agent doesn't have this right, it will not be included in
    #the UI.
    #accessRight=

    environmentTools=/atg/svc/agent/environment/EnvironmentTools

    resourceBundleName=mycompany.myapp.ui.Resources
    labelResourceKey=navitem.options.action.policy.label

    javaScriptFunctionCallTemplate=atg.commerce.csr.openPanelStackWithTab
    ('myPolicyPanelStack','commerceTab')

  2. Modify the OptionsNavActionFactory file to include your new NavAction within the list. The following OptionsNavActionFactory example shows that an OptionsPolicyNavAction has been added to the list of actions available. Add the following properties file to the configuration layer to append the new action to the /atg/svc/agent/ui/OptionsNavActionFactory:

    actions+=\
            /atg/svc/agent/ui/OptionsPolicyNavAction

  3. Ensure that your resource bundle file contains the necessary references to your new action. The following example resource file, which we defined in Step 1 as mycompany.myapp.ui.Resources, defines the label resources used by the new NavAction:

    # options
    navitem.options.item.label=Options
    navitem.options.action.label=Options
    navitem.options.action.tooltip=Log Out, Preferences and Documentation
    navitem.options.action.logout.label=Log Out
    navitem.options.action.logoutagent.label=Log Out: {0}
    navitem.options.action.preferences.label=Preferences
    navitem.options.action.documentation.label=Documentation
    navitem.options.action.about.label=About
    navitem.options.action.shortcuts.label=Shortcuts
    navitem.options.action.policy.label=Corporate Policies

    This adds the Corporate Policies menu label to the Options menu. When the agent selects this menu option, the myPolicyPanelStack will be displayed.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices