Commits

Anonymous committed ee2c19a Merge

Merge branch 'master' into TN-master

Comments (0)

Files changed (16)

core/schema/pom.xml

       <scope>test</scope>
     </dependency>
   </dependencies>
-  <!-- temporary, while building against liquibase snapshot -->
-  <repositories>
-    <repository>
-      <snapshots>
-        <enabled>true</enabled>
-        <updatePolicy>${updatePolicy}</updatePolicy>
-      </snapshots>
-      <releases>
-        <enabled>false</enabled>
-        <updatePolicy>${updatePolicy}</updatePolicy>
-      </releases>
-      <id>opennms-repo</id>
-      <name>OpenNMS Maven Repository</name>
-      <url>http://maven.opennms.org/content/groups/opennms.org-snapshot</url>
-    </repository>
-  </repositories>
 </project>

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/NodeMapsApplication.java

 
 package org.opennms.features.vaadin.nodemaps;
 
+import java.util.Map;
+
 import org.opennms.features.geocoder.GeocoderService;
 import org.opennms.features.vaadin.nodemaps.ui.OpenlayersWidgetComponent;
 import org.opennms.netmgt.dao.AlarmDao;
 
 import com.github.wolfie.refresher.Refresher;
 import com.vaadin.Application;
+import com.vaadin.terminal.ParameterHandler;
 import com.vaadin.ui.AbsoluteLayout;
 import com.vaadin.ui.Window;
 
 
         m_window = new Window("OpenNMS Node Maps");
         m_window.setContent(m_rootLayout);
+        m_window.addParameterHandler(new ParameterHandler() {
+            @Override
+            public void handleParameters(Map<String, String[]> parameters) {
+                if (parameters.containsKey("nodeId")) {
+                    int nodeId = parseInt(parameters.get("nodeId")[0], 0);
+                    if (nodeId > 0) {
+                        openlayers.setSingleNodeId(nodeId);
+                    }
+                } else {
+                    openlayers.setSingleNodeId(-1);
+                }
+            }
+        });
         setMainWindow(m_window);
 
         m_rootLayout.addComponent(openlayers, "top: 0px; left: 0px; right:0px; bottom:0px;");
         m_window.addComponent(refresher);
     }
 
+    public int parseInt(String intStr, int defaultValue) {
+        try {
+            return Integer.parseInt(intStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
 }

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/Alarm.java

-package org.opennms.features.vaadin.nodemaps.gwt.client;
-
-import java.util.Date;
-
-import com.google.gwt.core.client.JavaScriptObject;
-import com.vaadin.terminal.gwt.client.UIDL;
-
-public class Alarm extends JavaScriptObject {
-    protected Alarm() {}
-
-    public static final Alarm create(final UIDL uidl) {
-        final Alarm alarm = Alarm.create();
-
-        alarm.setNumberProperty("id", Integer.valueOf(uidl.getStringAttribute("id")));
-        alarm.setNumberProperty("nodeId", Integer.valueOf(uidl.getStringAttribute("nodeId")));
-        if (uidl.hasAttribute("ackTime")) {
-            alarm.setNumberProperty("ackTime", Long.valueOf(uidl.getStringAttribute("ackTime")));
-        }
-        if (uidl.hasAttribute("ackUser")) {
-            alarm.setStringProperty("ackUser", uidl.getStringAttribute("ackUser"));
-        }
-        alarm.setStringProperty("severityLabel", uidl.getStringAttribute("severityLabel"));
-        alarm.setNumberProperty("severity", Integer.valueOf(uidl.getStringAttribute("severity")));
-        alarm.setStringProperty("uei", uidl.getStringAttribute("uei"));
-        alarm.setStringProperty("logMsg", uidl.getStringAttribute("logMsg"));
-        if (uidl.hasAttribute("lastEventTime")) {
-            alarm.setNumberProperty("lastEventTime", Long.valueOf(uidl.getStringAttribute("lastEventTime")));
-        }
-
-        return alarm;
-    }
-
-    protected final native Integer getIntegerProperty(final String key) /*-{
-        return this[key];
-    }-*/;
-
-    protected final native Long getLongProperty(final String key) /*-{
-        return this[key];
-    }-*/;
-
-    protected final native String getStringProperty(final String key) /*-{
-        return this[key];
-    }-*/;
-
-    protected final native void setNumberProperty(final String key, final Number value) /*-{
-        this[key] = value;
-    }-*/;
-
-    protected final native void setStringProperty(final String key, final String value) /*-{
-        this[key] = value;
-    }-*/;
-
-    public static final Alarm create() {
-        return JavaScriptObject.createObject().cast();
-    }
-
-    public final Integer getId() {
-        return getIntegerProperty("id");
-    }
-
-    public final Integer getNodeId() {
-        return getIntegerProperty("nodeId");
-    }
-
-    public final Date getAckTime() {
-        final Long date = getLongProperty("ackTime");
-        return date == null? null : new Date(date);
-    }
-
-    public final String getAckUser() {
-        return getStringProperty("ackUser");
-    }
-
-    public final String getSeverityLabel() {
-        return getStringProperty("severityLabel");
-    }
-
-    public final Integer getSeverity() {
-        final Integer severity = getIntegerProperty("severity");
-        return severity == null? 0 : severity;
-    }
-
-    public final String getUei() {
-        return getStringProperty("uei");
-    }
-
-    public final String getLogMsg() {
-        return getStringProperty("logMsg");
-    }
-
-    public final Date getLastEventTime() {
-        final Long date = getLongProperty("lastEventTime");
-        return date == null? null : new Date(date);
-    }
-}

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/AlarmCollection.java

-package org.opennms.features.vaadin.nodemaps.gwt.client;
-
-import java.util.List;
-import java.util.Map;
-
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.JsArray;
-
-public class AlarmCollection extends JavaScriptObject {
-    protected AlarmCollection() {}
-
-    public static native final AlarmCollection create() /*-{
-        var alarmCollection = {};
-        alarmCollection.getHighestSeverityAlarm = function(nodeId) {
-            if (alarmCollection.hasOwnProperty(nodeId)) {
-                return alarmCollection[nodeId][0];
-            } else {
-                return null;
-            }
-        };
-        alarmCollection.getUnackedCount = function(nodeId) {
-            var count = 0;
-            if (alarmCollection.hasOwnProperty(nodeId)) {
-                var alarm;
-                for (var i = 0; i < alarmCollection[nodeId].length; i++) {
-                    alarm = alarmCollection[nodeId][i];
-                    if (!alarm.ackUser) {
-                        count++;
-                    }
-                }
-            }
-            return count;
-        };
-        return alarmCollection;
-    }-*/;
-
-    public static final AlarmCollection create(final Map<Integer, List<Alarm>> alarms) {
-        final AlarmCollection collection = AlarmCollection.create();
-
-        for (final Map.Entry<Integer,List<Alarm>> entry : alarms.entrySet()) {
-            for (final Alarm alarm : entry.getValue()) {
-                collection.addAlarm(entry.getKey(), alarm);
-            }
-        }
-
-        return collection;
-    }
-
-    protected final native void addAlarm(final int nodeId, final Alarm alarm) /*-{
-        if (!this.hasOwnProperty(nodeId)) {
-            this[nodeId] = [];
-        }
-        this[nodeId].push(alarm);
-    }-*/;
-
-    public final native JsArray<Alarm> getAlarms(final int nodeId) /*-{
-        if (this.hasOwnProperty(nodeId)) {
-            return this[nodeId];
-        } else {
-            return null;
-        }
-    }-*/;
-
-    public final native Alarm getHighestSeverityAlarm(final int nodeId) /*-{
-        return this.getHighestSeverityAlarm(nodeId);
-    }-*/;
-
-    public final native int getUnackedCount(final int nodeId) /*-{
-        return this.getUnackedCount(nodeId);
-    }-*/;
-}

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/GWTOpenlayersWidget.java

 
 package org.opennms.features.vaadin.nodemaps.gwt.client;
 
-import java.util.List;
-import java.util.Map;
-
 import org.opennms.features.vaadin.nodemaps.gwt.client.openlayers.FeatureCollection;
 import org.opennms.features.vaadin.nodemaps.gwt.client.openlayers.OnmsOpenLayersMap;
 import org.opennms.features.vaadin.nodemaps.gwt.client.openlayers.VectorLayer;
 
     private FeatureCollection m_features;
 
-    private AlarmCollection m_alarms;
-
     public GWTOpenlayersWidget() {
         super();
         m_div = Document.get().createDivElement();
     }
 
     private final native void initializeMap(final OnmsOpenLayersMap map) /*-{
-        var me = this;
-        var displayAllNodes = true;
-
-        var onPopupClose = function(evt) {
-            select.unselect(this.feature);
-        };
-
-        var getHighestSeverityAlarmForNode = function(nodeId) {
-            var alarms = me.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::m_alarms;
-            if (alarms) {
-                return alarms.getHighestSeverityAlarm(nodeId);
-            } else {
-                return null;
-            }
-        };
-
-        var getUnackedCount = function(nodeId) {
-            var alarms = me.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::m_alarms;
-            if (alarms) {
-                return alarms.getUnackedCount(nodeId);
-            } else {
-                return 0;
-            }
-        };
-
-        var onFeatureSelect = function(evt) {
-            feature = evt.feature;
-            var msg = "";
-            if (feature.cluster.length > 1) {
-                var nodes = [];
-                for ( var i = 0; i < feature.cluster.length; i++) {
-                    var n = feature.cluster[i].attributes;
-                    nodes.push(n.nodeLabel + "(" + n.ipAddress + ") : " + n.severityLabel);
-                }
-                msg = "<h2># of nodes: " + feature.cluster.length + " (" + getNumUnacked(feature)  + " Unacknowledged Alarms)</h2><ul><li>" + nodes.join("</li><li>") + "</li></ul>";
-            } else {
-                var n = feature.cluster[0].attributes;
-                var severity = getHighestSeverity(feature);
-                msg = "<h2>Node " + n.nodeLabel + "</h2>" + "<p>Node ID: " + n.nodeId + "</br>" + "Foreign Source: " + n.foreignSource + "</br>" + "Foreign ID: " + n.foreignId + "</br>" + "IP Address: " + n.ipAddress + "</br>" + "Status: " + severity + "</br></p>";
-            }
-            popup = new $wnd.OpenLayers.Popup.FramedCloud(
-                "nodePopup",
-                feature.geometry.getBounds().getCenterLonLat(),
-                new $wnd.OpenLayers.Size(100, 100), msg, null, false,
-                onPopupClose
-            );
-            feature.popup = popup;
-            popup.feature = feature;
-            map.addPopup(popup);
-        };
-
-        var getHighestSeverity = function(feature) {
-            if (!feature.cluster) return "Normal";
-            var severity = 0;
-            var severityLabel = "Normal";
-            for ( var i = 0; i < feature.cluster.length; i++) {
-                var n = feature.cluster[i].attributes;
-                var nodeId = parseInt(n.nodeId);
-                var alarm = getHighestSeverityAlarmForNode(nodeId);
-                if (alarm) {
-                    if (alarm.severity > severity) {
-                        severity = alarm.severity;
-                        severityLabel = alarm.severityLabel;
-                    }
-                }
-                if (severity == 7) {
-                    break;
-                }
-            }
-            return severityLabel;
-        };
-
-        var getNumUnacked = function(feature) {
-            if (!feature.cluster) return 0;
-            var count = 0;
-            for ( var i = 0; i < feature.cluster.length; i++) {
-                var nodeId = parseInt(feature.cluster[i].attributes.nodeId);
-                count += getUnackedCount(nodeId);
-            }
-            return count;
-        };
-
-        var onFeatureUnselect = function(evt) {
-            feature = evt.feature;
-            if (feature.popup) {
-                popup.feature = null;
-                map.removePopup(feature.popup);
-                feature.popup.destroy();
-                feature.popup = null;
-            }
-        }
-
-        var applyFilters = function(btn) {
-            btn.value = displayAllNodes ? 'Show All Nodes' : 'Show Down Nodes';
-            displayAllNodes = !displayAllNodes;
-            nodesLayer.redraw();
-        };
-
         var nodeFillColors = {
             Critical : "#F5CDCD",
             Major : "#FFD7CD",
                     pointRadius : "${radius}",
                     graphicName : "${shape}",
                     label : "${label}",
-                    display : "${display}",
                     fillColor : "${fillColor}",
                     fillOpacity : 0.8,
                     strokeColor : "${strokeColor}",
                         label : function(feature) {
                             return feature.cluster && feature.cluster.length > 1 ? feature.cluster.length : "";
                         },
-                        display : function(feature) {
-                            if (displayAllNodes) {
-                                return 'display';
-                            }
-                            // Display only nodes with availability < 100
-                            return getHighestSeverity(feature) == 'Normal' ? 'none' : 'display';
-                        },
                         // It depends on the calculated severity
                         strokeColor : function(feature) {
                             return nodeStrokeColors[getHighestSeverity(feature)];
 
         // Updating Nodes Layer
 
-        me.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::m_vectorLayer = nodesLayer;
-        me.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::updateFeatureLayer()();
+        this.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::m_vectorLayer = nodesLayer;
+        this.@org.opennms.features.vaadin.nodemaps.gwt.client.GWTOpenlayersWidget::updateFeatureLayer()();
         map.zoomToExtent(nodesLayer.getDataExtent());
+
+        function onPopupClose(evt) {
+            select.unselect(this.feature);
+        }
+
+        function onFeatureSelect(evt) {
+            feature = evt.feature;
+            var msg = "";
+            if (feature.cluster.length > 1) {
+                var nodes = [];
+                for ( var i = 0; i < feature.cluster.length; i++) {
+                    var n = feature.cluster[i].attributes;
+                    nodes.push(n.nodeLabel + "(" + n.ipAddress + ") : " + n.severityLabel);
+                }
+                msg = "<h2># of nodes: " + feature.cluster.length + " (" + getNumUnacked(feature)  + " Unacknowledged Alarms)</h2><ul><li>" + nodes.join("</li><li>") + "</li></ul>";
+            } else {
+                var n = feature.cluster[0].attributes;
+                msg = "<h2>Node " + n.nodeLabel + "</h2>" + "<p>Node ID: " + n.nodeId + "</br>" + "Foreign Source: " + n.foreignSource + "</br>" + "Foreign ID: " + n.foreignId + "</br>" + "IP Address: " + n.ipAddress + "</br>" + "Status: " + n.severityLabel + "</br></p>";
+            }
+            popup = new $wnd.OpenLayers.Popup.FramedCloud(
+                "nodePopup",
+                feature.geometry.getBounds().getCenterLonLat(),
+                new $wnd.OpenLayers.Size(100, 100), msg, null, false,
+                onPopupClose
+            );
+            feature.popup = popup;
+            popup.feature = feature;
+            map.addPopup(popup);
+        }
+
+        function getHighestSeverity(feature) {
+            if (!feature.cluster) return "Normal";
+            var severity = 0;
+            var severityLabel = "Normal";
+            for ( var i = 0; i < feature.cluster.length; i++) {
+                var n = feature.cluster[i].attributes;
+                if (n.severity && parseInt(n.severity) > severity) {
+                    severity = parseInt(n.severity);
+                    severityLabel = n.severityLabel;
+                }
+                if (severity == 7) {
+                    break;
+                }
+            }
+            return severityLabel;
+        }
+
+        function getNumUnacked(feature) {
+            if (!feature.cluster) return 0;
+            var count = 0;
+            for ( var i = 0; i < feature.cluster.length; i++) {
+                var n = feature.cluster[i].attributes;
+                if (n.unackedCount) count += parseInt(n.unackedCount);
+            }
+            return count;
+        }
+
+        function onFeatureUnselect(evt) {
+            feature = evt.feature;
+            if (feature.popup) {
+                popup.feature = null;
+                map.removePopup(feature.popup);
+                feature.popup.destroy();
+                feature.popup = null;
+            }
+        }
     }-*/;
 
     public void updateFeatureLayer() {
         return m_features;
     }
 
-    public void setFeatures(final FeatureCollection collection) {
+    public void setFeatureCollection(final FeatureCollection collection) {
         m_features = collection;
     }
 
-    public void setAlarms(final Map<Integer,List<Alarm>> alarms) {
-        m_alarms = AlarmCollection.create(alarms);
-    }
-
     private final native void destroyMap() /*-{
         map.destroy();
     }-*/;

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/VOpenlayersWidget.java

 
 package org.opennms.features.vaadin.nodemaps.gwt.client;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
 
 import org.opennms.features.vaadin.nodemaps.gwt.client.openlayers.FeatureCollection;
 import org.opennms.features.vaadin.nodemaps.gwt.client.openlayers.NodeFeature;
         final UIDL nodeUIDL = uidl.getChildByTagName("nodes");
 
         final FeatureCollection featureCollection = FeatureCollection.create();
+
         for (final Iterator<?> iterator = nodeUIDL.getChildIterator(); iterator.hasNext();) {
             final UIDL node = (UIDL) iterator.next();
-            final NodeFeature feature = NodeFeature.create(node).cast();
-            log(feature.asString());
-            featureCollection.add(feature);
-        }
-        setFeatures(featureCollection);
 
-        final UIDL alarmUIDL = uidl.getChildByTagName("alarms");
+            final float latitude = node.getFloatAttribute("latitude");
+            final float longitude = node.getFloatAttribute("longitude");
 
-        final Map<Integer,List<Alarm>> alarms = new HashMap<Integer,List<Alarm>>();
-        for (final Iterator<?> iterator = alarmUIDL.getChildIterator(); iterator.hasNext(); ) {
-            final UIDL uidlAlarm = (UIDL) iterator.next();
-            final Alarm alarm = Alarm.create(uidlAlarm);
-            addAlarm(alarms, alarm);
-        }
-        setAlarms(alarms);
+            final NodeFeature feature = NodeFeature.create(latitude, longitude).cast();
 
-        updateFeatureLayer();
-    }
+            for (final String key : new String[] { "severityLabel", "nodeLabel", "foreignSource", "foreignId", "ipAddress", "severity", "nodeId", "unackedCount" }) {
+                if (node.hasAttribute(key)) feature.putProperty(key, node.getStringAttribute(key));
+            }
+
+            log(feature.asString());
 
-    private void addAlarm(final Map<Integer, List<Alarm>> alarms, final Alarm alarm) {
-        final List<Alarm> alarmList;
-        final Integer nodeId = alarm.getNodeId();
-        if (alarms.containsKey(nodeId)) {
-            alarmList = alarms.get(nodeId);
-        } else {
-            alarmList = new ArrayList<Alarm>();
-            alarms.put(nodeId, alarmList);
+            featureCollection.add(feature);
         }
-        alarmList.add(alarm);
+
+        setFeatureCollection(featureCollection);
+        updateFeatureLayer();
     }
 }

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/openlayers/GeoJSONFeature.java

             "properties" : {},
             "geometry" : {
                 "type" : "Point",
-                "coordinates" : [ longitude, latitude ]
+                "coordinates" : [ latitude, longitude ]
             },
         };
     }-*/;
 
     public native final Float getLongitude() /*-{
-    return this.geometry.coordinates[0];
-}-*/;
-
-    public native final Float getLatitude() /*-{
         return this.geometry.coordinates[1];
     }-*/;
 
-    public native final String getProperty(final String key) /*-{
-    return this.properties[key];
-}-*/;
+    public native final Float getLatitude() /*-{
+        return this.geometry.coordinates[0];
+    }-*/;
 
     public native final void putProperty(final String key, final String value) /*-{
         this.properties[key] = value;
     }-*/;
 
+    public native final String getProperty(final String key) /*-{
+        return this.properties[key];
+    }-*/;
+
     public final String asString() {
         return "Feature[lat=" + getLatitude() + ",lon=" + getLongitude() + ",label=" + getProperty("nodeLabel") + "]";
     }

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/gwt/client/openlayers/NodeFeature.java

 package org.opennms.features.vaadin.nodemaps.gwt.client.openlayers;
 
-import com.vaadin.terminal.gwt.client.UIDL;
-
 public class NodeFeature extends GeoJSONFeature {
     protected NodeFeature() {}
 
-    public static NodeFeature create(final UIDL node) {
-        final float latitude = node.getFloatAttribute("latitude");
-        final float longitude = node.getFloatAttribute("longitude");
-
-        final NodeFeature me = GeoJSONFeature.create(latitude, longitude).cast();
+    protected native final String getAttribute(final String key) /*-{
+        return this[key];
+    }-*/;
 
-        for (final String key : new String[] { "nodeLabel", "foreignSource", "foreignId", "ipAddress", "nodeId" }) {
-            if (node.hasAttribute(key)) me.putProperty(key, node.getStringAttribute(key));
-        }
-
-        return me;
-    }
+    protected native final void setAttribute(final String key, final String value) /*-{
+        this[key] = value;
+    }-*/;
 
     public final Integer getNodeId() {
-        final String id = getProperty("nodeId");
+        final String id = getAttribute("nodeId");
         return id == null? null : Integer.valueOf(id);
     }
 
     public final String getNodeLabel() {
-        return getProperty("nodeLabel");
+        return getAttribute("nodeLabel");
     }
 
     public final String getForeignSource() {
-        return getProperty("foreignSource");
+        return getAttribute("foreignSource");
     }
 
     public final String getForeignId() {
-        return getProperty("foreignId");
+        return getAttribute("foreignId");
     }
     
     public final String getIpAddress() {
-        return getProperty("ipAddress");
+        return getAttribute("ipAddress");
+    }
+
+    public final String getSeverityLabel() {
+        return getAttribute("severityLabel");
+    }
+
+    public final Integer getSeverity() {
+        final String severity = getAttribute("severity");
+        return severity == null? null : Integer.valueOf(severity);
+    }
+
+    public final Integer getUnackedCount() {
+        final String count = getAttribute("unackedCount");
+        return count == null? 0 : Integer.valueOf(count);
     }
 }

features/vaadin-node-maps/src/main/java/org/opennms/features/vaadin/nodemaps/ui/OpenlayersWidgetComponent.java

 
 package org.opennms.features.vaadin.nodemaps.ui;
 
-import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
 
 import org.opennms.core.criteria.CriteriaBuilder;
 import org.opennms.core.utils.InetAddressUtils;
 
     private TransactionOperations m_transactionOperations;
 
+    private int singleNodeId = 0;
+
     public OpenlayersWidgetComponent() {
     }
 
         cb.alias("assetRecord", "asset");
         cb.orderBy("id");
 
-        final Set<Integer> nodeIds = new HashSet<Integer>();
+        if (singleNodeId > 0)
+            cb.eq("id", singleNodeId);
 
         target.startTag("nodes");
+
         for (final OnmsNode node : m_nodeDao.findMatching(cb.toCriteria())) {
-            addNode(target, node);
-            nodeIds.add(node.getId());
+            paintNode(target, node);
         }
         target.endTag("nodes");
-
-        target.startTag("alarms");
-
-        final CriteriaBuilder builder = new CriteriaBuilder(OnmsAlarm.class);
-        builder.alias("node", "node");
-        builder.in("node.id", nodeIds);
-        builder.ge("severity", OnmsSeverity.WARNING);
-        builder.orderBy("severity").desc();
-        builder.distinct();
-
-        for (final OnmsAlarm alarm : m_alarmDao.findMatching(builder.toCriteria())) {
-            addAlarm(target, alarm);
-        }
-        
-        target.endTag("alarms");
     }
 
-    void addNode(final PaintTarget target, final OnmsNode node) throws PaintException {
+    void paintNode(final PaintTarget target, final OnmsNode node) throws PaintException {
         final OnmsAssetRecord assets = node.getAssetRecord();
-
         if (assets != null && assets.getGeolocation() != null) {
             final OnmsGeolocation geolocation = assets.getGeolocation();
 
                 if (coordinates[0] != "-1" && coordinates[1] != "-1") {
                     target.startTag(node.getId().toString());
 
+                    CriteriaBuilder builder = new CriteriaBuilder(OnmsAlarm.class);
+                    builder.alias("node", "node");
+                    builder.eq("node.id", node.getId());
+                    builder.ge("severity", OnmsSeverity.WARNING);
+                    builder.orderBy("severity").desc();
+                    builder.limit(1);
+
+                    // first, get the highest severity alarm
+                    final List<OnmsAlarm> alarms = m_alarmDao.findMatching(builder.toCriteria());
+                    if (alarms.size() == 1) {
+                        final OnmsAlarm alarm = alarms.get(0);
+                        final OnmsSeverity severity = alarm.getSeverity();
+                        target.addAttribute("severityLabel", severity.getLabel());
+                        target.addAttribute("severity", severity.getId());
+                    } else {
+                        // assumes everything is OK
+                        target.addAttribute("severityLabel", OnmsSeverity.NORMAL.getLabel());
+                        target.addAttribute("severity", OnmsSeverity.NORMAL.getId());
+                    }
+
+                    builder = new CriteriaBuilder(OnmsAlarm.class);
+                    builder.alias("node", "node");
+                    builder.eq("node.id", node.getId());
+                    builder.ge("severity", OnmsSeverity.WARNING);
+                    builder.isNull("alarmAckTime");
+                    final int unackedCount = m_alarmDao.countMatching(builder.toCriteria());
+
                     // latitude/longitude, as floats
                     target.addAttribute("latitude", Float.valueOf(coordinates[0]));
                     target.addAttribute("longitude", Float.valueOf(coordinates[1]));
                     target.addAttribute("foreignSource", node.getForeignSource());
                     target.addAttribute("foreignId", node.getForeignId());
                     target.addAttribute("ipAddress", InetAddressUtils.str(node.getPrimaryInterface().getIpAddress()));
+                    target.addAttribute("unackedCount", String.valueOf(unackedCount));
 
                     target.endTag(node.getId().toString());
                 }
         }
     }
 
-    void addAlarm(final PaintTarget target, final OnmsAlarm alarm) throws PaintException {
-        target.startTag(alarm.getId().toString());
-
-        target.addAttribute("id", alarm.getId().toString());
-        target.addAttribute("nodeId", alarm.getNodeId().toString());
-        if (alarm.getAlarmAckTime() != null) target.addAttribute("ackTime", String.valueOf(alarm.getAlarmAckTime().getTime()));
-        if (alarm.getAlarmAckUser() != null) target.addAttribute("ackUser", alarm.getAlarmAckUser());
-        target.addAttribute("severityLabel", alarm.getSeverity().getLabel());
-        target.addAttribute("severity", String.valueOf(alarm.getSeverity().getId()));
-        target.addAttribute("uei", alarm.getUei());
-        target.addAttribute("logMsg", alarm.getLogMsg());
-        if (alarm.getLastEventTime() != null) target.addAttribute("lastEventTime", String.valueOf(alarm.getLastEventTime().getTime()));
-
-        target.endTag(alarm.getId().toString());
-    }
-
     public void setNodeDao(final NodeDao nodeDao) {
         m_nodeDao = nodeDao;
     }
     public void setTransactionOperation(final TransactionOperations tx) {
         m_transactionOperations = tx;
     }
+
+    public void setSingleNodeId(int nodeId) {
+        this.singleNodeId = nodeId;
+    }
 }

features/vaadin-node-maps/src/test/java/org/opennms/features/vaadin/nodemaps/ui/OpenlayersWidgetCompontentTest.java

 
 import org.easymock.EasyMock;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.Ignore;
 import org.opennms.features.geocoder.Coordinates;
 import org.opennms.features.geocoder.GeocoderService;
 import org.opennms.netmgt.dao.AlarmDao;
         
         EasyMock.replay(m_nodeDao, m_assetDao, m_geocoder, target);
 
-        m_component.addNode(target, node);
+        m_component.paintNode(target, node);
         
         EasyMock.verify(m_nodeDao, m_assetDao, m_geocoder, target);
     }

opennms-base-assembly/src/main/resources/contrib/qosdaemon/qos_example_configuration/opennms/web.xml

       <param-value>list</param-value>
     </init-param>    
   </servlet>
-  <servlet>
-    <servlet-name>filterVulnerability</servlet-name>
-    <servlet-class>org.opennms.web.vulnerability.VulnerabilityFilterServlet</servlet-class>
-  </servlet>  
   
   
   <servlet>
   	<url-pattern>/alarm/ticket/*</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
-    <servlet-name>filterVulnerability</servlet-name>
-    <url-pattern>/vulnerability/list</url-pattern>
-  </servlet-mapping>    
-  <servlet-mapping>
     <servlet-name>acknowledgeNotice</servlet-name>
     <url-pattern>/notification/acknowledge</url-pattern>
   </servlet-mapping>
     <location>/errors/sealingviolation.jsp</location>
   </error-page>
   <error-page>
-    <exception-type>org.opennms.web.vulnerability.VulnerabilityIdNotFoundException</exception-type>
-    <location>/errors/vulnerabilityidnotfound.jsp</location>
-  </error-page>  
-  <error-page>
     <exception-type>org.opennms.netmgt.model.events.EventProxyException</exception-type>
     <location>/errors/eventproxyexception.jsp</location>
   </error-page>  

opennms-webapp/src/main/java/org/opennms/web/asset/Asset.java

 
     protected String zip = "";
 
+    protected String geolocation = "";
+
     protected String building = "";
 
     protected String floor = "";
     }
 
     /**
+     * <p>Getter for the field <code>coordinates</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getGeolocation() {
+        return (this.geolocation);
+    }
+
+    /**
+     * <p>Setter for the field <code>geolocation</code>.</p>
+     *
+     * @param geolocation a {@link java.lang.String} object.
+     */
+    public void setGeolocation(String geolocation) {
+        if (geolocation != null) {
+            this.geolocation = geolocation;
+        } else {
+            this.geolocation = "";
+        }
+    }
+
+    /**
      * <p>Getter for the field <code>zip</code>.</p>
      *
      * @return a {@link java.lang.String} object.

opennms-webapp/src/main/java/org/opennms/web/asset/AssetModel.java

             Connection conn = Vault.getDbConnection();
             d.watch(conn);
 
-            PreparedStatement stmt = conn.prepareStatement("INSERT INTO ASSETS (nodeID,category,manufacturer,vendor,modelNumber,serialNumber,description,circuitId,assetNumber,operatingSystem,rack,slot,port,region,division,department,address1,address2,city,state,zip,building,floor,room,vendorPhone,vendorFax,userLastModified,lastModifiedDate,dateInstalled,lease,leaseExpires,supportPhone,maintContract,vendorAssetNumber,maintContractExpires,displayCategory,notifyCategory,pollerCategory,thresholdCategory,comment,username,password,enable,connection,autoenable,cpu,ram,storagectrl,hdd1,hdd2,hdd3,hdd4,hdd5,hdd6,numpowersupplies,inputpower,additionalhardware,admin,snmpcommunity,rackunitheight) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+            PreparedStatement stmt = conn.prepareStatement("INSERT INTO ASSETS (nodeID,category,manufacturer,vendor,modelNumber,serialNumber,description,circuitId,assetNumber,operatingSystem,rack,slot,port,region,division,department,address1,address2,city,state,zip,building,floor,room,vendorPhone,vendorFax,userLastModified,lastModifiedDate,dateInstalled,lease,leaseExpires,supportPhone,maintContract,vendorAssetNumber,maintContractExpires,displayCategory,notifyCategory,pollerCategory,thresholdCategory,comment,username,password,enable,connection,autoenable,cpu,ram,storagectrl,hdd1,hdd2,hdd3,hdd4,hdd5,hdd6,numpowersupplies,inputpower,additionalhardware,admin,snmpcommunity,rackunitheight,geolocation) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
             d.watch(stmt);
             stmt.setInt(1, asset.nodeId);
             stmt.setString(2, asset.category);
             stmt.setString(58, asset.admin);
             stmt.setString(59, asset.snmpcommunity);
             stmt.setString(60, asset.rackunitheight);
+            stmt.setString(61, asset.geolocation);
 
             stmt.execute();
         } finally {
             Connection conn = Vault.getDbConnection();
             d.watch(conn);
 
-            PreparedStatement stmt = conn.prepareStatement("UPDATE ASSETS SET category=?,manufacturer=?,vendor=?,modelNumber=?,serialNumber=?,description=?,circuitId=?,assetNumber=?,operatingSystem=?,rack=?,slot=?,port=?,region=?,division=?,department=?,address1=?,address2=?,city=?,state=?,zip=?,building=?,floor=?,room=?,vendorPhone=?,vendorFax=?,userLastModified=?,lastModifiedDate=?,dateInstalled=?,lease=?,leaseExpires=?,supportPhone=?,maintContract=?,vendorAssetNumber=?,maintContractExpires=?,displayCategory=?,notifyCategory=?,pollerCategory=?,thresholdCategory=?,comment=?, username=?, password=?,enable=?,connection=?,autoenable=?,cpu=?,ram=?,storagectrl=?,hdd1=?,hdd2=?,hdd3=?,hdd4=?,hdd5=?,hdd6=?,numpowersupplies=?,inputpower=?,additionalhardware=?,admin=?,snmpcommunity=?,rackunitheight=? WHERE nodeid=?");
+            PreparedStatement stmt = conn.prepareStatement("UPDATE ASSETS SET category=?,manufacturer=?,vendor=?,modelNumber=?,serialNumber=?,description=?,circuitId=?,assetNumber=?,operatingSystem=?,rack=?,slot=?,port=?,region=?,division=?,department=?,address1=?,address2=?,city=?,state=?,zip=?,building=?,floor=?,room=?,vendorPhone=?,vendorFax=?,userLastModified=?,lastModifiedDate=?,dateInstalled=?,lease=?,leaseExpires=?,supportPhone=?,maintContract=?,vendorAssetNumber=?,maintContractExpires=?,displayCategory=?,notifyCategory=?,pollerCategory=?,thresholdCategory=?,comment=?, username=?, password=?,enable=?,connection=?,autoenable=?,cpu=?,ram=?,storagectrl=?,hdd1=?,hdd2=?,hdd3=?,hdd4=?,hdd5=?,hdd6=?,numpowersupplies=?,inputpower=?,additionalhardware=?,admin=?,snmpcommunity=?,rackunitheight=?,geolocation=? WHERE nodeid=?");
             d.watch(stmt);
             stmt.setString(1, asset.category);
             stmt.setString(2, asset.manufacturer);
             stmt.setString(57, asset.admin);
             stmt.setString(58, asset.snmpcommunity);
             stmt.setString(59, asset.rackunitheight);
-            stmt.setInt(60, asset.nodeId);
+            stmt.setString(60, asset.geolocation);
+            stmt.setInt(61, asset.nodeId);
 
             stmt.execute();
         } finally {
             asset.setAdmin(rs.getString("admin"));
             asset.setSnmpcommunity(rs.getString("snmpcommunity"));
             asset.setRackunitheight(rs.getString("rackunitheight"));
+            asset.setGeolocation(rs.getString("geolocation"));
 
             // Convert from java.sql.Timestamp to java.util.Date, since it looks more pretty or something
             asset.lastModifiedDate = new Date(rs.getTimestamp("lastModifiedDate").getTime());
         new String[] { "Additional hardware", "additionalhardware" },
         new String[] { "Admin", "admin" },
         new String[] { "SNMP community", "snmpcommunity" },
-	new String[] { "Rack unit height", "rackunitheight" }
+	new String[] { "Rack unit height", "rackunitheight" },
+        new String[] { "GeoLocation coordinates", "geolocation" }
     };
 }

opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml

                 </bean>
 
                 <bean class="org.opennms.web.navigate.FileBasedNavBarEntry">
-                    <property name="name" value="Vulnerabilities"/>
-                    <property name="url" value="vulnerability/index.jsp"/>
-                    <property name="locationMatch" value="vulnerability"/>
-                    <property name="file" value="${opennms.home}/etc/vulnerabilities.enable"/>
-                </bean>
-
-                <bean class="org.opennms.web.navigate.FileBasedNavBarEntry">
                     <property name="name" value="Map"/>
                     <property name="url" value="map/index.jsp"/>
                     <property name="locationMatch" value="map"/>

opennms-webapp/src/main/webapp/WEB-INF/web.xml

       <param-value>list.htm</param-value>
     </init-param>    
   </servlet>
-  <servlet>
-    <servlet-name>filterVulnerability</servlet-name>
-    <servlet-class>org.opennms.web.vulnerability.VulnerabilityFilterServlet</servlet-class>
-  </servlet>  
   
   
   <!-- Servlet for updating the notification status -->
     <url-pattern>/alarm/query</url-pattern>
   </servlet-mapping>
 
-  <servlet-mapping>
-    <servlet-name>filterVulnerability</servlet-name>
-    <url-pattern>/vulnerability/list</url-pattern>
-  </servlet-mapping>    
-  
   <!--servlet mapping for update notification status servlet -->
   <servlet-mapping>
     <servlet-name>updateNotificationStatus</servlet-name>
     <location>/errors/statisticsreportidnotfound.jsp</location>
   </error-page>
   <error-page>
-    <exception-type>org.opennms.web.vulnerability.VulnerabilityIdNotFoundException</exception-type>
-    <location>/errors/vulnerabilityidnotfound.jsp</location>
-  </error-page>  
-  <error-page>
     <exception-type>org.opennms.netmgt.model.events.EventProxyException</exception-type>
     <location>/errors/eventproxyexception.jsp</location>
   </error-page>  

opennms-webapp/src/main/webapp/element/node.jsp

   
 
   <!-- Asset box, if info available --> 
-  <c:if test="${! empty model.asset && (! empty model.asset.description || ! empty model.asset.comments)}">
+  <c:if test="${! empty model.asset && (! empty model.asset.description || ! empty model.asset.comments || ! empty model.asset.geolocation)}">
     <h3 class="o-box">Asset Information</h3>
     <table class="o-box">
       <tr>
         <th>Comments</th>
         <td>${model.asset.comments}</td>
       </tr>
+
+      <c:if test="${! empty model.asset.geolocation}">
+        <tr>
+          <th>Geo Coordinates</th>
+          <td><a href="node-maps?nodeId=${model.id}">${model.asset.geolocation}</a></td>
+        </tr>
+      </c:if>
     </table>
   </c:if>