Add felix webconsole and link it off the admin web ui 89/1789/2
authorPrasanth Pallamreddy <ppallamr@cisco.com>
Tue, 1 Oct 2013 23:27:52 +0000 (16:27 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 10 Oct 2013 16:41:02 +0000 (16:41 +0000)
Change-Id: I8b26d95d0f6928f166df01a0e4655b123dd339a9
Signed-off-by: Prasanth Pallamreddy <ppallamr@cisco.com>
13 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/northbound/httpservice-bridge/pom.xml [new file with mode: 0644]
opendaylight/northbound/httpservice-bridge/src/main/resources/WEB-INF/web.xml [new file with mode: 0644]
opendaylight/web/osgi-brandfragment/pom.xml [new file with mode: 0644]
opendaylight/web/osgi-brandfragment/src/main/resources/META-INF/webconsole.properties [new file with mode: 0644]
opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/favicon.ico [new file with mode: 0644]
opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/logo.png [new file with mode: 0644]
opendaylight/web/root/src/main/resources/WEB-INF/jsp/main.jsp
opendaylight/web/root/src/main/resources/css/one.less
opendaylight/web/root/src/main/resources/img/logo_16.png [new file with mode: 0644]
opendaylight/web/root/src/main/resources/js/open.js
pom.xml

index 34d0f1f..223abcd 100644 (file)
         <artifactId>switchmanager</artifactId>
         <version>0.5.1-SNAPSHOT</version>
       </dependency>
+
+      <!-- equinox http service bridge -->
+      <dependency>
+        <groupId>org.eclipse.equinox.http</groupId>
+        <artifactId>servlet</artifactId>
+        <version>1.0.0-v20070606</version>
+      </dependency>
+      <!-- felix webconsole -->
+      <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.webconsole</artifactId>
+        <version>4.2.0</version>
+        <!-- the all bundle includes all the necessary plugins -->
+        <classifier>all</classifier>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
index 905e3a4..a11f93b 100644 (file)
       <artifactId>topology.web</artifactId>
       <version>${controller.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>osgi-brandfragment.web</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
 
     <!--  Neutron -->
 
       <artifactId>networkconfig.bridgedomain.northbound</artifactId>
       <version>${networkconfig.bridgedomain.northbound.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>httpservice-bridge</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
 
     <!-- Debug and logging -->
 
       <groupId>org.eclipse.persistence</groupId>
       <artifactId>org.eclipse.persistence.antlr</artifactId>
     </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.equinox.http</groupId>
+      <artifactId>servlet</artifactId>
+      <!--
+      <version>1.0.0-v20070606</version>
+      -->
+    </dependency>
+    <!-- felix webconsole -->
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.webconsole</artifactId>
+      <version>4.2.0</version>
+      <classifier>all</classifier>
+      <!-- the all bundle includes all the necessary plugins -->
+    </dependency>
+
     <!-- Third parties from opendaylight released -->
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
diff --git a/opendaylight/northbound/httpservice-bridge/pom.xml b/opendaylight/northbound/httpservice-bridge/pom.xml
new file mode 100644 (file)
index 0000000..37e8df1
--- /dev/null
@@ -0,0 +1,42 @@
+<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.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.1-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+
+  <artifactId>httpservice-bridge</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <description>HttpService bridge web application</description>
+  <packaging>bundle</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.4.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Export-Package>
+            </Export-Package>
+            <Import-Package>
+                javax.servlet,
+                javax.servlet.http,
+                org.eclipse.equinox.http.servlet,
+                org.opendaylight.controller.web,
+                org.osgi.framework,
+                org.osgi.service.http,
+                org.slf4j,
+            </Import-Package>
+            <Web-ContextPath>/controller/osgi</Web-ContextPath>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/opendaylight/northbound/httpservice-bridge/src/main/resources/WEB-INF/web.xml b/opendaylight/northbound/httpservice-bridge/src/main/resources/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..0622e90
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app
+  xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+  version="3.0">
+
+  <servlet>
+    <servlet-name>BridgeServlet</servlet-name>
+    <servlet-class>org.eclipse.equinox.http.servlet.HttpServiceServlet</servlet-class>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>BridgeServlet</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+
+  <security-constraint>
+    <web-resource-collection>
+      <web-resource-name>HttpService</web-resource-name>
+      <url-pattern>/*</url-pattern>
+    </web-resource-collection>
+    <auth-constraint>
+      <role-name>System-Admin</role-name>
+      <role-name>Network-Admin</role-name>
+    </auth-constraint>
+  </security-constraint>
+
+  <security-role>
+    <role-name>System-Admin</role-name>
+  </security-role>
+
+  <security-role>
+    <role-name>Network-Admin</role-name>
+  </security-role>
+
+  <login-config>
+    <auth-method>BASIC</auth-method>
+    <realm-name>opendaylight</realm-name>
+  </login-config>
+
+</web-app>
diff --git a/opendaylight/web/osgi-brandfragment/pom.xml b/opendaylight/web/osgi-brandfragment/pom.xml
new file mode 100644 (file)
index 0000000..a2dad7e
--- /dev/null
@@ -0,0 +1,32 @@
+<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.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.1-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+
+  <artifactId>osgi-brandfragment.web</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <description>OSGi management web application brand fragment</description>
+  <packaging>bundle</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.4.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Fragment-Host>org.apache.felix.webconsole</Fragment-Host>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/opendaylight/web/osgi-brandfragment/src/main/resources/META-INF/webconsole.properties b/opendaylight/web/osgi-brandfragment/src/main/resources/META-INF/webconsole.properties
new file mode 100644 (file)
index 0000000..566c43b
--- /dev/null
@@ -0,0 +1,10 @@
+webconsole.brand.name = OpenDaylight
+webconsole.product.name = OpenDaylight Controller
+webconsole.product.url = http://www.opendaylight.org/
+webconsole.product.image = /res/imgs/odl/logo.png
+webconsole.favicon = /res/imgs/odl/favicon.ico
+
+# webconsole.vendor.name = Linux Foundation
+# webconsole.vendor.url = http://www.linuxfoundation.org/
+# webconsole.vendor.image = /res/imgs/vendor.png
+# webconsole.stylesheet = /res/css/my.css
diff --git a/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/favicon.ico b/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/favicon.ico
new file mode 100644 (file)
index 0000000..59f0ec6
Binary files /dev/null and b/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/favicon.ico differ
diff --git a/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/logo.png b/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/logo.png
new file mode 100644 (file)
index 0000000..103520b
Binary files /dev/null and b/opendaylight/web/osgi-brandfragment/src/main/resources/res/imgs/odl/logo.png differ
index 4b0ce2d..5dfbc46 100644 (file)
@@ -74,6 +74,7 @@
      <ul class="dropdown-menu">
       <li><a href="#admin" id="admin" data-role="${role}"><div class="icon-users"></div> Users</a></li>
       <li><a href="#cluster" id="cluster"><div class="icon-cluster"></div>Cluster</a></li>
+      <li><a href="#osgi" id="osgi"><div class="icon-default"></div>OSGi</a></li>
       <li><a href="#save" id="save"><div class="icon-save"></div>Save</a></li>
       <li><a href="#logout" id="logout"><div class="icon-logout"></div> Logout</a></li>
      </ul>
index db9d763..e19733f 100644 (file)
                                .icon;
                                background-image: url('../img/topology_view_1033_16.png');
                        }
+                       .icon-default {
+                               .icon;
+                               background-image: url('../img/logo_16.png');
+                       }
                        .icon-save {
                                .icon;
                                background-image: url('../img/save_as_0106_16.png');
@@ -285,4 +289,4 @@ table {
        .help {
                display: none;
        }
-}
\ No newline at end of file
+}
diff --git a/opendaylight/web/root/src/main/resources/img/logo_16.png b/opendaylight/web/root/src/main/resources/img/logo_16.png
new file mode 100644 (file)
index 0000000..e9833ac
Binary files /dev/null and b/opendaylight/web/root/src/main/resources/img/logo_16.png differ
index 619edca..6a2efdb 100644 (file)
@@ -728,6 +728,11 @@ $("#logout").click(function() {
   location.href = "/logout";
 });
 
+// felix osgi runtime
+$("#osgi").click(function() {
+  window.open("/controller/osgi/system/console", '_newtab');
+});
+
 $.ajaxSetup({
   complete : function(xhr, textStatus) {
     var mime = xhr.getResponseHeader('Content-Type');
diff --git a/pom.xml b/pom.xml
index 4d0d2ee..4abcd81 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -89,6 +89,7 @@
     <module>opendaylight/web/devices</module>
     <module>opendaylight/web/troubleshoot</module>
     <module>opendaylight/web/topology</module>
+    <module>opendaylight/web/osgi-brandfragment</module>
 
     <!--  Neutron -->
     <module>opendaylight/networkconfiguration/neutron</module>
     <module>opendaylight/northbound/switchmanager</module>
     <module>opendaylight/northbound/containermanager</module>
     <module>opendaylight/northbound/networkconfiguration/bridgedomain</module>
+    <module>opendaylight/northbound/httpservice-bridge</module>
 
     <!-- Northbound integration tests -->
     <module>opendaylight/northbound/integrationtest</module>