Skeleton for the ovsdb-ui feature 88/20288/5
authorMaxime Millette-Coulombe <mmcoulombe@inocybe.com>
Wed, 10 Jun 2015 20:27:26 +0000 (16:27 -0400)
committerMaxime Millette-Coulombe <mmcoulombe@inocybe.com>
Tue, 16 Jun 2015 17:53:23 +0000 (13:53 -0400)
Folders structure and basic files to create and add a external
module on DLUX. It also include a CRUD implementation of
the southbounds REST API.

Change-Id: If48eb4d055db3b91529e76e75503aa4c68b0c6a3
Signed-off-by: Maxime Millette-Coulombe <mmcoulombe@inocybe.com>
18 files changed:
commons/parent/pom.xml
features/ovsdb/pom.xml
features/ovsdb/src/main/features/features.xml
ovsdb-ui/bundle/pom.xml [new file with mode: 0644]
ovsdb-ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml [new file with mode: 0644]
ovsdb-ui/module/pom.xml [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/index.tpl.html [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.controller.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.module.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.services.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.controller.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.css [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.module.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.services.js [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/root.tpl.html [new file with mode: 0644]
ovsdb-ui/module/src/main/resources/ovsdb/spec/ovsdb.spec.js [new file with mode: 0644]
ovsdb-ui/pom.xml [new file with mode: 0644]
pom.xml

index 18a83e0d939b77e01158cbff2309fe912de14b84..c9c7ee12e3dc1754d518b8c4b3309b2541b1dc27 100644 (file)
@@ -102,6 +102,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <httpcomponents.version>4.2.1</httpcomponents.version>
     <portlet.version>2.0</portlet.version>
     <powermock.version>1.5.2</powermock.version>
+    <ovsdb.ui.version>0.1.0-SNAPSHOT</ovsdb.ui.version>
+    <dlux.loader.version>0.3.0-SNAPSHOT</dlux.loader.version>
+    <dlux.core.version>0.3.0-SNAPSHOT</dlux.core.version>
   </properties>
 
   <dependencyManagement>
@@ -343,6 +346,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         <artifactId>powermock-core</artifactId>
         <version>${powermock.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.ovsdb</groupId>
+        <artifactId>ovsdb-ui</artifactId>
+        <version>${ovsdb.ui.version}</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
index aedc3e3320149286db972f6121ffa5622e870bd5..e69008352b478e411bf781e9202521d63862719f 100644 (file)
@@ -62,6 +62,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <openflowplugin.version>0.2.0-SNAPSHOT</openflowplugin.version>
     <sal.version>0.10.0-SNAPSHOT</sal.version>
     <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+    <dlux.core.version>0.3.0-SNAPSHOT</dlux.core.version>
+    <ovsdb.ui.version>0.1.0-SNAPSHOT</ovsdb.ui.version>
   </properties>
 
   <dependencyManagement>
@@ -313,6 +315,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>ovsdb-ui-bundle</artifactId>
+      <version>${ovsdb.ui.version}</version>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>southbound-features</artifactId>
index ffe52774907f99c30cd284e614b7671394f2548e..aea37b92a769086845f6992f3844a63be7ddde69 100644 (file)
@@ -73,4 +73,8 @@
     <configfile finalname="etc/opendaylight/karaf/netvirt-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt/${project.version}/xml/config</configfile>
     <configfile finalname="etc/opendaylight/karaf/netvirt-providers-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-providers/${project.version}/xml/config</configfile>
   </feature>
+  <feature name="odl-ovsdb-ui" description="OpenDaylight :: OVSDB :: DLUX Integration Plugin" version='${ovsdb.ui.version}'>
+    <feature version="${dlux.core.version}">odl-dlux-core</feature>
+    <bundle>mvn:org.opendaylight.ovsdb/ovsdb-ui-bundle/${ovsdb.ui.version}</bundle>
+  </feature>
 </features>
diff --git a/ovsdb-ui/bundle/pom.xml b/ovsdb-ui/bundle/pom.xml
new file mode 100644 (file)
index 0000000..2b95d82
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Inocybe Technologies, and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.ovsdb</groupId>
+        <artifactId>commons</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+        <relativePath>../../commons/parent</relativePath>
+    </parent>
+
+    <artifactId>ovsdb-ui-bundle</artifactId>
+    <version>${ovsdb.ui.version}</version>
+    <packaging>bundle</packaging>
+    <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
+    <licenses>
+        <license>
+            <name>Eclipse Public License v1.0</name>
+            <url>http://www.eclipse.org/legal/epl-v10.html</url>
+        </license>
+    </licenses>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+        <tag>HEAD</tag>
+        <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+    </scm>
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.dlux</groupId>
+            <artifactId>loader</artifactId>
+            <version>${dlux.loader.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.ovsdb</groupId>
+          <artifactId>ovsdb-ui-module</artifactId>
+          <version>${ovsdb.ui.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <resources>
+          <resource>
+            <directory>target/generated-resources</directory>
+          </resource>
+          <resource>
+            <directory>src/main/resources</directory>
+         </resource>
+        </resources>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>unpack-loader-resources</id>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <phase>generate-resources</phase>
+                <configuration>
+               <artifactItems>
+                   <artifactItem>
+                      <groupId>org.opendaylight.ovsdb</groupId>
+                      <artifactId>ovsdb-ui-module</artifactId>
+                      <version>${ovsdb.ui.version}</version>
+                      <overWrite>true</overWrite>
+                      <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
+                  <excludes>META-INF\/**, ovsdb\/spec\/**, ovsdb\/mocks\/**</excludes>
+                  <ignorePermissions>false</ignorePermissions>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.3</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Import-Package>org.osgi.service.http,
+                                        org.osgi.framework;version="1.0.0",
+                                        org.opendaylight.dlux.loader,
+                                        org.slf4j
+                        </Import-Package>
+                    <Export-Package></Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/ovsdb-ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/ovsdb-ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml
new file mode 100644 (file)
index 0000000..fdaafda
--- /dev/null
@@ -0,0 +1,19 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <reference id="httpService" availability="mandatory" activation="eager" interface="org.osgi.service.http.HttpService"/>
+    <reference id="loader" availability="mandatory" activation="eager" interface="org.opendaylight.dlux.loader.DluxModuleLoader"/>
+
+    <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.opendaylight.dlux.loader.DluxModule">
+        <property name="httpService" ref="httpService"/>
+        <property name="loader" ref="loader"/>
+        <property name="moduleName" value="ovsdb"/>
+        <property name="url" value="/src/app/ovsdb"/>
+        <property name="directory" value="/ovsdb"/>
+        <property name="requireJs" value="app/ovsdb/ovsdb.module"/>
+        <property name="angularJs" value="app.ovsdb"/>
+        <property name="cssDependencies">
+            <list>
+                <value>src/app/ovsdb/ovsdb.css</value>
+            </list>
+        </property>
+    </bean>
+</blueprint>
diff --git a/ovsdb-ui/module/pom.xml b/ovsdb-ui/module/pom.xml
new file mode 100644 (file)
index 0000000..a56816a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Inocybe Technologies, and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.ovsdb</groupId>
+        <artifactId>commons</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+        <relativePath>../../commons/parent</relativePath>
+    </parent>
+
+    <artifactId>ovsdb-ui-module</artifactId>
+    <version>${ovsdb.ui.version}</version>
+    <packaging>jar</packaging>
+    <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
+    <licenses>
+        <license>
+            <name>Eclipse Public License v1.0</name>
+            <url>http://www.eclipse.org/legal/epl-v10.html</url>
+        </license>
+    </licenses>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+        <tag>HEAD</tag>
+        <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+    </scm>
+</project>
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/index.tpl.html b/ovsdb-ui/module/src/main/resources/ovsdb/index.tpl.html
new file mode 100644 (file)
index 0000000..3aec420
--- /dev/null
@@ -0,0 +1,14 @@
+<!--\r
+ * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+-->\r
+\r
+<div class="form-group">\r
+  <span>In progress</span>\r
+  <div id="errorMessage" class="alert alert-danger" role="alert">\r
+      {{err.message}}\r
+  </div>\r
+</div>\r
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.controller.js b/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.controller.js
new file mode 100644 (file)
index 0000000..1cca4f3
--- /dev/null
@@ -0,0 +1,3 @@
+define([], function() {
+  
+});
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.module.js b/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.module.js
new file mode 100644 (file)
index 0000000..f68d28b
--- /dev/null
@@ -0,0 +1,12 @@
+define([], function() {
+  var ovsdb = angular.module('app.ovsdb', []);
+
+  ovsdb.register = {
+    controller: ovsdb.controller,
+    service: ovsdb.service,
+    factory: ovsdb.factory
+  };
+
+  return ovsdb;
+
+})
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.services.js b/ovsdb-ui/module/src/main/resources/ovsdb/mocks/ovsdb.services.js
new file mode 100644 (file)
index 0000000..1cca4f3
--- /dev/null
@@ -0,0 +1,3 @@
+define([], function() {
+  
+});
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.controller.js b/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.controller.js
new file mode 100644 (file)
index 0000000..5982a06
--- /dev/null
@@ -0,0 +1,39 @@
+/*\r
+ * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+define(['jquery', 'app/ovsdb/ovsdb.module','app/ovsdb/ovsdb.services'], function($, ovsdb) {\r
+  'use strict';\r
+\r
+  var RootOvsdbCtrl = function($rootScope) {\r
+      $rootScope['section_logo'] = 'logo_ovsdb';\r
+  };\r
+  RootOvsdbCtrl.$inject = ['$rootScope'];\r
+\r
+  var BaseOvsdbCtrl = function($scope) {\r
+      $scope['err'] = {\r
+        "message": "",\r
+        "tag": "",\r
+        "type": ""\r
+      };\r
+\r
+      $scope.showError = function() {\r
+        $('#errorMessage').fadeIn().delay(3000).fadeOut();\r
+      };\r
+  };\r
+  BaseOvsdbCtrl.$inject = ['$scope'];\r
+\r
+  var OvsdbCtrl = function($scope, TopologyNetworkSvc) {\r
+      BaseOvsdbCtrl.call(this, $scope);\r
+\r
+  };\r
+  OvsdbCtrl.$inject = ['$scope', 'TopologyNetworkSvc'];\r
+  OvsdbCtrl.prototype = Object.create(BaseOvsdbCtrl.prototype);\r
+\r
+  ovsdb.register.controller('RootOvsdbCtrl', RootOvsdbCtrl);\r
+  ovsdb.register.controller('OvsdbCtrl', OvsdbCtrl);\r
+});\r
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.css b/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.css
new file mode 100644 (file)
index 0000000..4f7c162
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+*/
+
+#errorMessage {
+    display:none;
+}
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.module.js b/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.module.js
new file mode 100644 (file)
index 0000000..d9cbb5f
--- /dev/null
@@ -0,0 +1,61 @@
+/*\r
+ * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+define(['angularAMD', 'app/routingConfig', 'Restangular', 'angular-translate', 'angular-translate-loader-static-files', 'app/core/core.services', 'common/config/env.module'], function(ng) {\r
+  'use strict';\r
+\r
+  var ovsdb = angular.module('app.ovsdb', ['app.core', 'pascalprecht.translate', 'ui.router.state', 'restangular', 'config']);\r
+  ovsdb.register = ovsdb; // for unit test\r
+\r
+  ovsdb.config(function($stateProvider, $compileProvider, $controllerProvider, $provide, NavHelperProvider) {\r
+    ovsdb.register = {\r
+      controller : $controllerProvider.register,\r
+      directive : $compileProvider.directive,\r
+      factory : $provide.factory,\r
+      service : $provide.service\r
+\r
+    };\r
+\r
+    NavHelperProvider.addControllerUrl('src/app/ovsdb/ovsdb.controller.js');\r
+    NavHelperProvider.addToMenu('Ovsdb', {\r
+     "link" : "#/ovsdb/index",\r
+     "active" : "main.ovsdb.*",\r
+     "title" : "OVSDB",\r
+     "icon" : "icon-sitemap",\r
+     "page" : {\r
+        "title" : "OVSDB",\r
+        "description" : "OVSDB"\r
+     }\r
+    });\r
+\r
+    var access = routingConfig.accessLevels;\r
+    $stateProvider.state('main.ovsdb', {\r
+      url: 'ovsdb',\r
+      abstract: true,\r
+      views : {\r
+        'content' : {\r
+          templateUrl: 'src/app/ovsdb/root.tpl.html',\r
+          controller: 'RootOvsdbCtrl'\r
+        }\r
+      }\r
+    });\r
+\r
+    $stateProvider.state('main.ovsdb.index', {\r
+      url: '/index',\r
+      access: access.admin,\r
+      views: {\r
+        '': {\r
+          templateUrl: 'src/app/ovsdb/index.tpl.html',\r
+          controller: 'OvsdbCtrl'\r
+        }\r
+      }\r
+    });\r
+  });\r
+\r
+  return ovsdb;\r
+});\r
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.services.js b/ovsdb-ui/module/src/main/resources/ovsdb/ovsdb.services.js
new file mode 100644 (file)
index 0000000..c144f78
--- /dev/null
@@ -0,0 +1,147 @@
+/*\r
+ * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+define(['app/ovsdb/ovsdb.module'],function(ovsdb) {\r
+  'use strict';\r
+\r
+  ovsdb.register.factory('TopologyNetworkRestangular', function(Restangular, ENV) {\r
+    return Restangular.withConfig(function(RestangularConfig) {\r
+      RestangularConfig.setBaseUrl(ENV.getBaseURL("AD_SAL"));\r
+    });\r
+  });\r
+\r
+  ovsdb.register.factory('TopologyNetworkSvc', function(TopologyNetworkRestangular) {\r
+    var svc = {\r
+      base: function(name) {\r
+        return TopologyNetworkRestangular.one('restconf', name).one('network-topology:network-topology');\r
+      },\r
+      data : null\r
+    };\r
+\r
+    svc.getCurrentData = function() {\r
+      return svc.data;\r
+    };\r
+\r
+    svc.getTopologiesIds = function() {\r
+      svc.data = svc.base('operational').getList();\r
+      return svc.data;\r
+    };\r
+\r
+    svc.getConfigNode = function(topologyId, nodeId) {\r
+      return svc.base('config').one('topology', topologyId).one('node', nodeId).get();\r
+    };\r
+\r
+    svc.addConfigNode = function(topologyId, nodeId, data) {\r
+      return svc.base('config').one('topology', topologyId).one('node').put(nodeId, data);\r
+    };\r
+\r
+    svc.addConfigBridge = function(topologyId, nodeId, data) {\r
+        return svc.base('config').one('topology', topologyId).put(nodeId, data);\r
+    };\r
+\r
+    svc.removeConfigNode = function(topologyId, nodeId) {\r
+      return svc.base('config').one('topology', topologyId).one('node', nodeId).remove();\r
+    };\r
+\r
+    svc.addTerminationPointConfig = function(topologyId, nodeId, terminationId, data) {\r
+      return svc.base('config').one('topology', topologyId).one('node', nodeId).one('termination-point').put(terminationId, data);\r
+    };\r
+\r
+    svc.getTerminationPointConfig = function(topologyId, nodeId, terminationId) {\r
+      return svc.base('config').one('topology', topologyId).one('node', nodeId).one('termination-point', terminationId).get();\r
+    };\r
+\r
+    svc.removeTerminationPointConfig = function(topologyId, nodeId, terminationId) {\r
+      return svc.base('config').one('topology', topologyId).one('node', nodeId).one('termination-point', terminationId).remove();\r
+    };\r
+    return svc;\r
+  });\r
+\r
+\r
+  ovsdb.register.factory('TopologyNetworkFactory', function() {\r
+\r
+    var factory = {\r
+        createOvsdbNodeObject: function(nodeId, nodePort, nodeRemoteIp) {\r
+            return {\r
+                "network-topology:node": [\r
+                    {\r
+                        "node-id": nodeId,\r
+                        "connection-info": {\r
+                            "ovsdb:remote-port": nodePort,\r
+                            "ovsdb:remote-ip": nodeRemoteIp\r
+                        }\r
+                    }\r
+                ]\r
+            };\r
+        },\r
+        createConfigNode: function(nodeId, bridgeName,datapathId, protocolEntries, controllerEntries, managedBy) {\r
+            var configNode = {\r
+                "network-topology:node": [\r
+                    {\r
+                        "node-id": nodeId,\r
+                        "ovsdb:bridge-name": bridgeName,\r
+                        "ovsdb:datapath-id": datapathId,\r
+                        "ovsdb:protocol-entry": [ ],\r
+                        "ovsdb:controller-entry": [ ],\r
+                        "ovsdb:managed-by": managedBy\r
+                    }\r
+                ]\r
+            };\r
+\r
+            for (var protocolEntry in protocolEntries) {\r
+                configNode[0]['ovsdb:protocal-entry'].push({\r
+                    "protocol": protocolEntry\r
+                });\r
+            }\r
+\r
+            for (var controllerEntry in controllerEntries) {\r
+                configNode[0]['ovsdb:controller-entry'].push({\r
+                    "protocol" : controllerEntry\r
+                });\r
+            }\r
+\r
+            return configNode;\r
+\r
+        },\r
+        createEndPoint: function(ovsdb_options, name, interface_type, tp_id, vlan_tag, trunks, vlan_mode) {\r
+            var termination_point = {\r
+                "network-topology:termination-point": [\r
+                    {\r
+                        "ovsdb:options": [ ],\r
+                        "ovsdb:name": name,\r
+                        "ovsdb:interface-type": interface_type,\r
+                        "tp-id": tp_id,\r
+                        "vlan-tag": vlan_tag,\r
+                        "trunks": [ ],\r
+                        "vlan-mode":vlan_mode\r
+                    }\r
+                ]\r
+            };\r
+\r
+            for (var ovsdb_option in ovsdb_options) {\r
+                   termination_point[0]['ovsdb:options'].push({\r
+                        "ovsdb:option": ovsdb_option.option,\r
+                        "ovsdb:value" : ovsdb_option.value\r
+                   });\r
+            }\r
+\r
+            for (var trunk in trunks) {\r
+                termination_point[0]['trunks'].push({\r
+                    "trunk":trunk\r
+                });\r
+            }\r
+\r
+            return termination_point;\r
+        }\r
+    };\r
+\r
+    return factory;\r
+\r
+  });\r
+\r
+});\r
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/root.tpl.html b/ovsdb-ui/module/src/main/resources/ovsdb/root.tpl.html
new file mode 100644 (file)
index 0000000..1340df5
--- /dev/null
@@ -0,0 +1,8 @@
+<!--
+* Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<div class="main" ui-view></div>
diff --git a/ovsdb-ui/module/src/main/resources/ovsdb/spec/ovsdb.spec.js b/ovsdb-ui/module/src/main/resources/ovsdb/spec/ovsdb.spec.js
new file mode 100644 (file)
index 0000000..713b9a6
--- /dev/null
@@ -0,0 +1,7 @@
+define(['ovsdb/ovsdb.controller'], function() {
+  describe('A fake test', function() {
+    it('Should be retuning true', function() {
+      expect(true).toBe(true);
+    });
+  });
+});
diff --git a/ovsdb-ui/pom.xml b/ovsdb-ui/pom.xml
new file mode 100644 (file)
index 0000000..a0d3601
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Inocybe Technologies, and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.ovsdb</groupId>
+    <artifactId>commons</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../commons/parent</relativePath>
+  </parent>
+
+  <artifactId>ovsdb-ui</artifactId>
+  <name>ovsdb-ui</name>
+  <packaging>pom</packaging>
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
+  <modules>
+    <module>module</module>
+    <module>bundle</module>
+  </modules>
+</project>
diff --git a/pom.xml b/pom.xml
index b3a86e855322a886af6286e7a4d9f97446757707..28bda5d94801381871c1f286521709cdc5508318 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -51,6 +51,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <modules>
     <!-- Parent POM files -->
     <module>commons</module>
+
     <module>features</module>
     <module>karaf</module>
     <!-- OVSDB Components -->
@@ -64,6 +65,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <module>plugin-shell</module>
     <module>schemas</module>
     <module>utils</module>
+    <module>ovsdb-ui</module>
     <!-- Integration Tests -->
     <module>integrationtest</module>
   </modules>