Customizing SONET protection states

The SONET state system defines a set of protections that can be associated with link objects. You can create new SONET protections, as well as configure how new and existing protections are graphically represented in your objects.

How to create a new SONET protection state (using the API)

Create a new protection state using the method NewProtection. This method takes two arguments: a name and a description.
IltSONET.Protection protection = IltSONET.NewProtection("InTest", 
   "Indicates that the communication channel is currently under test");
The name is used to identify the state in the application. When a new protection state is created with the name InTest, it is referred to in XML in the following way:
<protection>InTest</protection>
The description is used to provide information about the semantics of the state. It can be used as a tooltip to display more information about the protection state represented in a business object. To activate the tooltip support for secondary states, see Customizing tooltips.

How to create a new SONET protection state (using CSS)

You can create new protection states using global CSS settings.
Settings {
   sonet: true;
}
SONET {
   protections[0]: @+prot0;
}
Subobject#prot0 {
  class: 'ilog.tgo.model.IltSONET.Protection';
  name: "InTest";
}

How to customize SONET protection states (using the API)

Each SONET protection state is associated with an icon that can be customized using SetValue. This method requires two arguments, the first argument being the property key name. SONET Protection state property names are formed by: “SONET.Protection.<YOUR STATE NAME>.Icon”
IlpImageRepository imageRep = 
IltSystem.GetDefaultContext().getImageRepository();
Image problemImage = imageRep.getImage("problem.png");
IltSettings.SetValue("SONET.Protection.Problem.Icon", problemImage);
or
IltSettings.SetValue("SONET.Protection.Exercisor.Icon", img);

How to customize SONET protection states (using CSS)

You can customize SONET protection states using global CSS settings. For more information, see Using global settings. You must specify the full state name, for example " SONET.Protection.Problem ", when matching the " name " attribute. The CSS property to be customized is icon .
setting."ilog.tgo.model.IltState"[name="SONET.Protection.Problem"] {
   icon: '@|image("problem.png")';
}