SDN Controller Programming Guide
165
NOTE
The tool offered by the HP VAN SDN Controller SDK that generates the RSdoc takes the
Javadoc [22] to generate the REST API documentation as illustrated in Figure 11. Therefore,
it is mandatory to write Javadoc for the REST APIs (In general, production code classes
should be properly documented). If a REST API method does not contain Javadoc, the
entire REST API won’t be included in the RSDoc.
Creating GUI
The following information describes the process of creating user interfaces using the HP SKI
framework and integrating such views to the HP VAN SDN Controller GUI. For more information
see GUI on page 52.
Creating Views
The SKI framework uses JavaScript [40] as the underlying technology, thus the views are Dynamic-
HTML based. Start by creating the application’s cascading style sheets [41]. Create the file hm-
ui/src/main/webapp/css/hm.css with the content from the following hm.css listing. This example
uses a very simple cascading style sheet, however any style desired can be created and as many
style sheets as needed.
hm.css:
.hm-message-style {
background-color: red;
}
Now create a view to display the Open Flow Switches. This example shows a tool bar button that
updates the view’s content with the “Hello World” message when it is pressed (see SKI Framework
- Overview on page 52 to find a SKI reference application that provides examples of SKI widgets).
Create the file hm-ui/src/main/webapp/js/hm-switches.js with the content from the following
listing, hm-switches.js. Create one JavaScript file for each view in the application.
hm-switches.js:
// JSLint directive...
/*global $: false*/
(function (api) {
'use strict';
//framework APIs
var f = api.fn, //general API
def = api.def, //application definition API
v = api.view; //view API
f.trace('including hm-switches.js');
// Create a view with a toolbar button
function load(view) {
v.setToolbar(def.tbButton(view.mkId('btn'),