ARTICLES
Dynamic GraphML Tooltips
One user in the community is using the GraphML Topology and asked me in chat if it were possible to add tooltips to a vertex from within a groovy script.
Short answer: Yes
Long answer
By default, setting the tooltip is supposed to work only by setting it directly in the graphml file itself.
The official documentation for this says, that the name of the attribute is tooltipText.
So if you are looking for static tooltips, that is the way to go.
By default dynamic tooltips are not supported, but we could leverage the GraphMLVertexStatusProvider capabilities.
Simply enable it and add the following line to the file $OPENNMS_HOME/etc/graphml-vertex-status/default.groovy:
import org.opennms.features.topology.plugins.topo.graphml.GraphMLVertexStatus
assert alarmSummary != null
vertex.setTooltipText("test"); // :)
return new GraphMLVertexStatus() \
.severity(alarmSummary.maxSeverity)
.alarmCount(alarmSummary.alarmCount)That is pretty much it.
For more properties, simply have a look at the classes
GraphMLVertex
and AbstractVertex.
Any public method can be used in the groovy script.