From 62dd65bc02ae0c7489281166e0aa7b649abaa1f3 Mon Sep 17 00:00:00 2001 From: Christian Pape Date: Mon, 20 Apr 2015 14:27:26 +0200 Subject: [PATCH] Introduced option to select dashboard implementation in opennms.properties --- .../src/main/filtered/etc/opennms.properties | 10 ++ .../webapp/WEB-INF/dispatcher-servlet.xml | 11 -- opennms-webapp/src/main/webapp/dashboard.jsp | 125 +++++++++++++++--- .../src/main/webapp/legacy-dashboard.jsp | 92 ------------- .../src/main/webapp/surveillance-box.jsp | 94 ++++++++----- .../src/main/webapp/surveillance-view.jsp | 69 +++++++--- 6 files changed, 232 insertions(+), 169 deletions(-) delete mode 100644 opennms-webapp/src/main/webapp/legacy-dashboard.jsp diff --git a/opennms-base-assembly/src/main/filtered/etc/opennms.properties b/opennms-base-assembly/src/main/filtered/etc/opennms.properties index 371aed839f14..98ab8ce31c2d 100644 --- a/opennms-base-assembly/src/main/filtered/etc/opennms.properties +++ b/opennms-base-assembly/src/main/filtered/etc/opennms.properties @@ -598,3 +598,13 @@ org.opennms.jasperReportsVersion=5.6.1 # even if none of the problematic services appears in any package. If you create custom # services, you may need to add them to this list. excludeServiceMonitorsFromRemotePoller=DHCP,NSClient,RadiusAuth,XMP + +# ###### DASHBOARD/SURVEILLANCE VIEW IMPLEMENTATION ###### +# OpenNMS provides two different dashboard/surveillance view implementations. The GWT +# variant is the original. Later, the UI was rewitten using the VAADIN framework. So, the +# two valid options fpr this option are 'vaadin' or 'gwt'. The VAADIN implementation is +# the default one. Please note that the GWT version is deprecated and will be removed in +# future versions. +#org.opennms.dashboard.implementation=gwt + + diff --git a/opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml b/opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml index 8d3ad3fdeebf..99337ad07635 100644 --- a/opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml +++ b/opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml @@ -346,11 +346,6 @@ - - - - - @@ -428,12 +423,6 @@ - - - - - - diff --git a/opennms-webapp/src/main/webapp/dashboard.jsp b/opennms-webapp/src/main/webapp/dashboard.jsp index e9676cf1dfe9..a7414e461163 100644 --- a/opennms-webapp/src/main/webapp/dashboard.jsp +++ b/opennms-webapp/src/main/webapp/dashboard.jsp @@ -29,27 +29,116 @@ --%> -<%@page language="java" - contentType="text/html" - session="true" - %> - - - - - - - - +<%@page language="java" contentType="text/html" session="true" %> + +<%-- +/******************************************************************************* + * Check org.opennms.dashboard.implementation for selected implementation * + *******************************************************************************/ +--%> <% - String viewName = ""; + String dashboardImplementation = System.getProperty("org.opennms.dashboard.implementation", "vaadin").trim(); - if (request.getParameterMap().containsKey("viewName")) { - viewName = "&viewName=" + request.getParameter("viewName"); - } + if (!"gwt".equals(dashboardImplementation)) { %> - - + <%-- + /******************************************************************************* + * Include VAADIN implementation * + *******************************************************************************/ + --%> + + + + + + + + + + <% + String viewName = ""; + + if (request.getParameterMap().containsKey("viewName")) { + viewName = "&viewName=" + request.getParameter("viewName"); + } + %> + + + + + +<% } else { %> + + <%-- + /******************************************************************************* + * Include GWT implementation * + *******************************************************************************/ + --%> + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+ + + +<% } %> + diff --git a/opennms-webapp/src/main/webapp/legacy-dashboard.jsp b/opennms-webapp/src/main/webapp/legacy-dashboard.jsp deleted file mode 100644 index bb924d7718db..000000000000 --- a/opennms-webapp/src/main/webapp/legacy-dashboard.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%-- -/******************************************************************************* - * This file is part of OpenNMS(R). - * - * Copyright (C) 2002-2014 The OpenNMS Group, Inc. - * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. - * - * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. - * - * OpenNMS(R) is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * OpenNMS(R) is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with OpenNMS(R). If not, see: - * http://www.gnu.org/licenses/ - * - * For more information contact: - * OpenNMS(R) Licensing - * http://www.opennms.org/ - * http://www.opennms.com/ - *******************************************************************************/ - ---%> - -<%@page language="java" contentType="text/html" session="true" %> - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
- - diff --git a/opennms-webapp/src/main/webapp/surveillance-box.jsp b/opennms-webapp/src/main/webapp/surveillance-box.jsp index 0b4370b675e5..c51dff95fd45 100644 --- a/opennms-webapp/src/main/webapp/surveillance-box.jsp +++ b/opennms-webapp/src/main/webapp/surveillance-box.jsp @@ -29,49 +29,83 @@ --%> -<%@page language="java" - contentType="text/html" - session="true" - %> +<%@page language="java" contentType="text/html" session="true" %> + +<%-- +/******************************************************************************* + * Check org.opennms.dashboard.implementation for selected implementation * + *******************************************************************************/ +--%> <% - String viewName = ""; + String dashboardImplementation = System.getProperty("org.opennms.dashboard.implementation", "vaadin").trim(); - if (request.getParameterMap().containsKey("viewName")) { - viewName = "&viewName=" + request.getParameter("viewName"); - } + if (!"gwt".equals(dashboardImplementation)) { %> - - } +
+ +
- window.addEventListener("message", receiveMessage, false); +<% } else { %> - + <%-- + /******************************************************************************* + * Include GWT implementation * + *******************************************************************************/ + --%> -
+ + + + + + + + + +
- -
+<% } %> \ No newline at end of file diff --git a/opennms-webapp/src/main/webapp/surveillance-view.jsp b/opennms-webapp/src/main/webapp/surveillance-view.jsp index 7974dfb6f0a0..9c0ea82346f6 100644 --- a/opennms-webapp/src/main/webapp/surveillance-view.jsp +++ b/opennms-webapp/src/main/webapp/surveillance-view.jsp @@ -29,28 +29,61 @@ --%> -<%@page language="java" - contentType="text/html" - session="true" - %> - - - - - - - - +<%@page language="java" contentType="text/html;charset=UTF-8" session="true" %> + +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + +<%-- +/******************************************************************************* + * Check org.opennms.dashboard.implementation for selected implementation * + *******************************************************************************/ +--%> <% - String viewName = ""; + String dashboardImplementation = System.getProperty("org.opennms.dashboard.implementation", "vaadin").trim(); - if (request.getParameterMap().containsKey("viewName")) { - viewName = "&viewName=" + request.getParameter("viewName"); - } + if (!"gwt".equals(dashboardImplementation)) { %> + <%-- + /******************************************************************************* + * Include VAADIN implementation * + *******************************************************************************/ + --%> + + + + + + + + + + <% + String viewName = ""; + + if (request.getParameterMap().containsKey("viewName")) { + viewName = "&viewName=" + request.getParameter("viewName"); + } + %> + + + + + +<% } else { %> + + <%-- + /******************************************************************************* + * Include GWT implementation * + *******************************************************************************/ + --%> + + + +<% } %> - -