How to modify the label data displayed for model icons in Spectrum OneClick?

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

Summary:

How to modify the label data displayed for model icons in Spectrum OneClick?

Instructions:

Each device type file has an XML file that that defines what data will be displayed in the icon label within OneClick. In this example, we will add the network address to the label. This will be in addition to the model name and device type which are there by default.

The XML files that contain this data are, by default, located in the $SPECROOT/tomcat/webapps/spectrum/WEB-INF/topo/config directory. The file names are oneclick-<devicetype>-iconbase-config.xml. Some actual examples are: oneclick-device-iconbase-config, oneclick-snmp-iconbase-config, oneclick-router-iconbase-config, oneclick-printer-iconbase-config, etc...

We will need to create files with these same names, for each icon which we wish to modify, in the $SPECROOT/custom/topo/config directory.

Below is an example of the XML within these new custom files. For our example the only data that needs to be changed in each file is the second line. The icon-config idref must match the file name, so in the example below the file name of this particular file is: oneclick-device-iconbase-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<icon-config idref="oneclick-device-iconbase-config">
<static-color idref="oneclick-default-iconbase-color-config"/>
<components>
 <!-- ================================================================= 
  - Definition of the model label.
  - =================================================================
 -->
<label-component idref="default-iconlabel-config" index="1">
 <x>0</x>
 <y>74</y>
 <column-list>
  <field-column>
   <column idref="column-modelname-config"/>
   <column idref="column-networkaddress-config"/>
   <column idref="column-devicetype-config"/>
 </field-column>
 </column-list>
</label-component>
</components>
</icon-config>  

In addition, the x and y coordinates may need to be tweaked if the icon overlaps the text. Review the default file for appropriate x/y coordinates for the particular device icon.

Once all files have been created and modified you will need to restart tomcat and re-launch the OneClick console. The changes should now be in effect.

If there are any icons that do not display this new information, then you will need to find the appropriate file name for that device type and simply copy one of the custom XMLs and rename and edit the name in the file.