Reference Guide

Table Of Contents
def.addView('hmTab')
};
}(SKI));
Now create a script that adds a menu entry to the navigation panel so the hm view is accessible
from the SDN Controller’s GUI. Create the file hm-ui/src/main/webapp/js/hm-nav.js with the
content from the following hm-nav.js listing. Use hm-nav.js to add as many entries in the navigation
panel as the application needs; there is just one JavaScript file dealing with the navigation panel.
hm-nav.js:
// JSLint directive...
/*global $: false, SKI: false */
(function (api) {
'use strict';
var f = api.fn, // general functions API
nav = api.nav; // navigation model API
f.trace('including hm-nav.js');
// Adds a new category and a new item
nav.insertCategoryAfter('c-tasks', 'c-hm', [
nav.item('n-hm-task’, ‘hmTask', 'square')
]);
// Add a new item to an existing category
nav.insertItemsBefore('n-exportLogs', {
nav.item('n-hm-task', 'hmTask', 'square')
]);
}(SKI));
Plain text is not used in the previous two listing. In order to display text in the views define
properties files which contain text identified by keys. This allows for localizing the applications; see
GUI on page 59 for details on how the localization infrastructure works on the SKI framework.
Next, create the properties files to define the text that the previous two listing reference by their
key. Create one properties file for each view.
When adding the Switchesview to the framework in hm.js, name it hm(Highlighted in the
hm.js listing), thus the associated properties file must have the same name. Create the file hm-
ui/src/main/resources/com/hp/hm/ui/lion/hm.properties with the content from the following
hm.properties listing. Title and icon keys are reserved keys automatically used by the framework to
set the view’s title and icon. For more information see GUI on page 59 for details about available
icons and how define custom icons.
hm.properties:
title = Health Monitor Title
199