Adding a custom field view to the Information tab under General Information view in Spectrum OneClick

Document ID : KB000020624
Last Modified Date : 14/02/2018
Show Technical Document Details


This solution explains how to add the "HasStaleInterfaces" attribute to the general information subview under Information tab.


This is a step by step procedure on how to add an attribute named "HasStaleInterfaces" to the general information subview under component details:

  1. Identify the xml file responsible for displaying the Information view of a model class.

  2. In this document we will customize the general information view of firewall model class.

  3. On the OneClick webserver -> Navigate to $SPECROOT/tomat/webapps/spectrum/web-inf/topo/config/topo-app-config.xml and look for the below code
    <contents-registry>	<icon-reg-id>firewall-icon-config</icon-reg-id>	<tooltip-config>device-tooltip-config</tooltip-config>	<information-config>view-devicedetails-config</information-config>	<model-class>27</model-class> <!-- FIREWALL -->	</contents-registry>

  4. The above code builds up the information view for firewall devices.

  5. Now look for view-devicedetails-config xml under $SPECROOT/tomat/webapps/spectrum/web-inf/topo/config directory and check the idref in the view tag
    <view id="view-devicedetails-config" idref="view-devicedetailsbase-config"> -------> Note this xml

  6. Now search for view-devicedetailsbase-config and the below code in this xml is responsible for displaying the fields under general information sub view under component detail panel of the firewall class.
    <!-- General Information -->	<field-subview idref="device-geninfo-subview-config" expanded="true">	<title></title>	</field-subview>

  7. Now navigate to $SPECROOT/custom/topo/config directory

  8. Create a xml file with the name "device-geninfo-subview-config" and add the code below to the xml file
    <?xml version="1.0" encoding="utf-8"?>	<field-subview idref="device-geninfo-subview-config"> --> Adding new field to General Information subview<field-column>	<column>	<name>HasStaleInterfaces</name> --------> Adding this field to the General Information Tab<content>	<attribute>0x12be7</attribute> ---------> Attribute id of HasStaleInterfaces</content>	</column>	</field-column>	</field-subview>

  9. Save the file

  10. Close and restart any open OneClick clients.

  11. Login to OneClick and search for any firewall model in the database

  12. Go to the component detail panel -> Information -> General information tab and observe that "HasStaleInterfaces" field is add towards the right

    Figure 1

This way we can add any field like device criticality , Red/Yellow/Orange threshold attributes to general information sub-view.