SDN Controller Programming Guide
168
<dependency>
<groupId>com.hp.sdn</groupId>
<artifactId>sdn-adm-rs-misc</artifactId>
<version>${sdn.version}</version>
</dependency>
<dependency>
<groupId>com.hp.sdn</groupId>
<artifactId>sdn-adm-rs-misc</artifactId>
<version>${sdn.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.hp.util</groupId>
<artifactId>hp-util-skis</artifactId>
<version>${hp-util.version}</version>
</dependency>
The second parameter (“com/hp/hm/ui”) of the super(…) call in the constructor of the
UIExtension.java listing specifies the location of the two files the framework uses to integrate the
views: css.hml and js.html. These files act as links to the application’s cascading style sheets [41]
and the application’s JavaScript files respectively. Create the files hm-
ui/src/main/resources/com/hp/hm/ui/css.html and hm-
ui/src/main/resources/com/hp/hm/ui/js.html with the content from the following UIExtension
css.html listing and the following UIExtension js.html listing.
UIExtension css.html:
<link href="/sdn/ui/hm/css/hm.css" rel="stylesheet">
UIExtension js.html :
<script src="/sdn/ui/hm/js/hm-nav.js"></script>
<script src="/sdn/ui/hm/js/hm-switches.js"></script>
The prefix “sdn/ui/hm” used in the UIExtension css.html listing and the UIExtension js.html listing
must match the web.context.path property from the hm-ui/pom.xml to generate .war listing under
Module Configuration below. The rest of the path (“…/css/hm.css”, “…/js/hm-nav.js” and
“…/js/hm-switches.js”) is determined by the structure of the hm-ui/src/main/webapp directory.
Module Configuration
The SDN Controller GUI is based on the HP SKI framework which uses JavaScript [40] as the
underlying technology. Thus, similarly to the RESTful web services module (hm-rs), the user interface
module (hm-ui) is deployed as a web application; and thus the module’s output must be a web
application archive (.war file) [36].
This section describes the configuration changes needed to do to the sample application so the
hm-ui module is properly deployed.
Create a place holder hm-ui/src/main/webapp/WEB-INF/web.xml file with the content from the
following UI Module Web Application (web.xml) listing.
UI Module Web Application (web.xml):