Skip to main content
Version: 4.4.0

Menu definition

Navigation menu for an AWE application is defined in XML files. The two menu XML files are:

  • public.xml: Contains the public screens (those who can be accessed without log into the system).
  • private.xml: Screens inside the log protection
info

Note: All menu XML descriptors are defined at menu folder. View project structure for more info.

The menu files must have the following skeleton:

<menu screen="[initial-screen]" context="[default-context]" default-action="[default-action]">
</menu>
AttributeUseTypeDescriptionValues
screenRequiredStringIs the default screen that will be showed at beginning
contextOptionalStringIs the context where all the options will be launched (if an specific context is not defined)See contexts
default-actionOptionalStringIs the action that all the options will call (if an specific action is not defined)

There is a new tag too to define the position, and the menu type inside a screen: menu-container:

<menu-container type="[orientation]"/>

Where [orientation] can be vertical or horizontal. Another way to change the menu type is selecting the initial menu screen in private.xml file:

<menu screen="HomHor"…

For horizontal menu

<menu screen="HomVer"…

For vertical menu

Contexts

The context attribute defines where are the options defined inside the menu going to be launched. There are several defined context which can be used depending on the menu type:

Context pathMenuDescription
screenpublicUseful for a single login page without menu
screen/public/homepublicThis context is used when the main page must have a menu. In this case the parameter screen.configuration.home must not be empty, as this will be the screen showed inside the menu. The menu container initial screen will be the one defined on the menu screen attribute
screen/private/homeprivateThis context will be used when logging on application. In this case the parameter screen.configuration.information must not be empty, as this will be the screen showed inside the private menu (when the user and the profile haven't any initial screen definition). The menu container initial screen will be the one defined on the menu screen attribute

Options structure

This is a set of options skeleton code:

<option module="[module]" name="[Option name]" label="[Option label] icon="[Icon option]">
<option name="[Option name]" label="[Option label]" screen="[Screen name]"/>
---
</option>
---
<option/>

Inside the tools option there are a set of options, some of them are 'invisible'. It is necessary to define all the screen the user can access, because if a screen is not defined in the menu it will not be accessible to any user. Also, you can add options inside options, making a multilevel menu.

AttributeUseTypeDescriptionValues
nameRequiredStringIs the option name, which is used in the profile files and AweScrRes to restrict an option access. If a parent option is restricted, all children are restricted too
screenOptionalStringDescribes the screen that will be accessed when the user clicks on the option
labelOptionalStringIs a literal which contains the option nameNote: You can use i18n files (locales)
moduleOptionalStringDefines the module name. Now you can set different menu options for each moduleThese module names must be configured in table AweMod and it must be the session variable module
separatorOptionalBooleanIf set to true, the option is converted into a separator lineDefault value is false
iconOptionalStringDefines an icon which will be shown before the option labelYou can view the whole icon list here

Examples

<menu screen="home_horizontal" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation = "../../sch/menu.xsd" context="screen/home" default-action="screen">
<option name="information" screen="info" invisible="true" />
<option module="Inf" name="information_restricted" screen="info" invisible="true" />
<option module="Inf Changed" name="information_restricted_changed" screen="info" invisible="true" />
<option name="tools" label="MENU_TOOLS" icon="wrench">
<option name="themes" label="MENU_TOOLS_THEMES" screen="Thm" icon="picture-o"/>
<option name="new_theme" screen="ThmNew" invisible="true" />
<option name="update_theme" screen="ThmUpd" invisible="true" />
<option name="view_theme" screen="ThmViw" invisible="true" />
<option name="security" label="MENU_TOOLS_SECURITY" icon="unlock-alt">
<option name="screen_access" label="MENU_TOOLS_SCREENS_ACCESS" screen="ScrAccRes" icon="eye-slash"/>
<option name="encrypt_tools" label="MENU_TOOLS_SCREEN_ENCRYPT" screen="ScrEncTxt" icon="lock"/>
</option>
</option>
<option name="HlpSep" separator="true"/>
<option name="help" label="MENU_HELP" icon="question-circle">
<option name="user_help" label="MENU_USER_HELP" screen="Hlp" icon="question"/>
<option name="application_help" label="MENU_HELP_APPLICATION" screen="AppHlp" icon="question"/>
<option name="application_info" label="MENU_APP_INF" screen="ViwAppInf" icon="info"/>
</option>
</menu>