SDN Controller Programming Guide

61
var f = api.fn, // general functions API
nav = api.nav; // navigation model API
// Add a new item to an existing category
nav.insertItemsAfter('n-audits', [
nav.item('n-my-view', 'my-view')
]);
}(SKI));
Directory: /myapp/src/main/webapp
File: my-app.js
Purpose: defines the view content, handling the SKI framework life-cycle events.
UI Extension JavaScript View implementation:
(function (api) {
'use strict';
//framework APIs
var f = api.fn, //general API
def = api.def, //application definition API
t = api.lib.htmlTags,
wgt = api.lib.widgetFactory,
v = api.view; //view API
// create my content
function myAppCreate(view) {
// return my DOM content structure
}
// load my content
function myAppLoad(view) {
// update my DOM content from my ajax success call
}
def.addView('my-view', {
create: myAppCreate,
load: myAppLoad,
});
}(SKI));
(function (api) {
'use strict';
//framework APIs
var f = api.fn, //general API
def = api.def, //application definition API
t = api.lib.htmlTags,
wgt = api.lib.widgetFactory,
v = api.view; //view API
// create my content
function myAppCreate(view) {
// return my DOM content structure