skip to main content
Programmers documentation > Styling > Customizing object states > Customizing the SAN state system
 
Customizing the SAN state system
Describes the SAN secondary states and how to create and customize them.
*Creating new SAN secondary states
*Describes how to create a new SAN secondary state.
*Customizing SAN Secondary States
*Describes how to configure each representation of SAN secondary states.
Creating new SAN secondary states
The SAN (Storage Area Network) State Dictionary provides secondary state values that can be used to complement OSI, Bellcore, SNMP, or SONET standards. The secondary states included in this dictionary can be used to model and represent any state with a numeric value. For information on the dictionary and its graphical representation,
Refer to SAN states: the SAN state dictionary in the Business Objects and Data Sources documentation.
You can create your own SAN secondary state, and configure how new and existing secondary states are graphically represented in your objects.
How to create new SAN states (using the API)
SAN secondary states are created using IltSAN.NewSecState, as follows:
 
IltSAN.SecState state =
   IltSAN.NewSecState("SAN.SecState.CPUUtilization","Measures the CPU use
rate");
NewSecState takes two arguments. The first one is a name that identifies the new SAN state in the application. The name must comply with the rule SAN.SecState.<value>. For example, when a new state is created with name SAN.SecState.CPUUtilization, it is referred to in XML files in the following way:
 
<SAN state="CPUUtilization">78</SAN>
The second argument is a description. This description is used as a tooltip to display more information about the SAN state represented in a business object. To activate the tooltip support for secondary states, see Customizing tooltips.
NewSecState returns an instance of IltSAN.SecState, that you can use in exactly the same way as the predefined SAN secondary states.
Once a new SAN secondary state has been created, you need to configure its graphic representation. See Customizing SAN Secondary States for more information.
How to create new SAN states (using CSS)
You can also create new SAN secondary states by using global CSS settings:
 
Settings {
   san: true;
}
SAN {
   states[0]: @+san0;
}
Subobject#san0 {
  class: 'ilog.tgo.model.IltSAN.SecState';
  name: "SAN.SecState.CPUUtilization";
}
Customizing SAN Secondary States
SAN states explains how to customize the object representation according to the SAN state information. You can also customize the decoration that is displayed when a given SAN secondary state is set in the object.
In the SAN state dictionary, the secondary states are numeric and by default they are represented by a gauge. There are also two other possible representations for these states. The IltDecorationType class defines the possible graphical representations. The possible values of this class are:
*Gauge
*Chart
*Counter
How to customize a SAN secondary state decoration (using the API)
SAN secondary states can be displayed as charts, gauges or counters. By default, the gauge decoration is used. If you want to indicate that you are going to use another type of representation, without changing the default configuration for each representation, modify the secondary state information as follows:
 
IltSettings.SetValue("SAN.SecState.IO.Type", IltDecorationType.Chart);
The property to be set is built in the following way: “<STATE NAME>.Type”. For example, SAN.SecState.Available.Type or SAN.SecState.CPUUtilization.Type.
How to customize a SAN secondary state decoration (using CSS)
You can also customize a SAN secondary state decoration by using global CSS settings. For more information, see Using global settings.
You must specify the full state name, for example " SAN.SecState.CPUUtilization ", when matching the " name " attribute. The CSS property to be customized is type.
 
setting."ilog.tgo.model.IltState"[name="SAN.SecState.CPUUtilization"] {
   type: Counter;
}
How to modify the gauge graphical representation of a SAN secondary state (using the API)
When a SAN secondary state is graphically represented by a gauge decoration, the configuration of this decoration has to be previously defined. All SAN secondary states have a predefined gauge representation. Refer to SAN states: the SAN state dictionary in the Business Objects and Data Sources documentation for information on how each secondary state is graphically represented.
Suppose you have a secondary state that is configured with a gauge decoration as follows:
 
IltSettings.SetValue("SAN.SecState.CPUUtilization.Type",
IltDecorationType.Gauge);
You can modify this decoration in the following way:
 
IltColorModifier modifier1 = new IltColorModifier.Shade(0.5f);
IltColorModifier modifier2 = new
    IltColorModifier.MultiColor(IltColorModifier.MultiColor.USE_LAST_VALUE);
IltColorModifier modifier = modifier1.compose(modifier2);
 
IltGaugeMapping mapping = (IltGaugeMapping)
    IltSettings.GetValue("SAN.SecState.CPUUtilization.Gauge");
mapping.setColorModifier(modifier);
You can also create a new gauge mapping, and set the new value in the following way:
 
IltGaugeMapping mapping = new IltGaugeMapping(minImg, maxImg);
IltSettings.SetValue("SAN.SecState.CPUUtilization.Gauge", mapping);
How to modify the gauge graphical representation of a SAN secondary state (using CSS)
You can also customize the gauge graphic representation by using global CSS settings. You must specify the full state name, for example " SAN.SecState.CPUUtilization ", when matching the " name " attribute. The CSS property to be customized is gauge.
When defining a new gauge mapping class, the following CSS properties are used: minImage, maxImage, direction, colorModifier. They match corresponding set methods of the IltGaugeMapping class (and its super class). Refer to ilog.tgo.graphic.IltGaugeMapping for information on how to customize the gauge decorations.
In the example below, the color modifier class named MyColorModifier has been created and included in the search path.
 
setting."ilog.tgo.model.IltState"[name="SAN.SecState.CPUUtilization"] {
  gauge: @+gaugeSan;
}
Subobject#gaugeSan {
  class: 'ilog.tgo.graphic.IltGaugeMapping';
  minImage: '@|image("icon1.png")';
  maxImage:'@|image("icon2.png")';
  direction: Bottom;
  colorModifier: @+myColorModifier;
}
Subobject#myColorModifier {
  class: "MyColorModifier";
}
How to modify the chart graphical representation of a SAN secondary state (using the API)
When a SAN secondary state is graphically represented by a chart decoration, the configuration of this decoration has to be previously defined. All SAN secondary states have a predefined chart representation. Refer to SAN states: the SAN state dictionary in the Business Objects and Data Sources documentation for information on how each secondary state is graphically represented.
Suppose you have a secondary state that is configured with a chart decoration as follows:
 
IltSettings.SetValue("SAN.SecState.CPUUtilization.Type",
IltDecorationType.Chart);
You can modify this decoration in the following way:
 
IltColorModifier modifier1 = new IltColorModifier.Shade(0.5f);
IltColorModifier modifier2 =
  new IltColorModifier.MultiColor(IltColorModifier.MultiColor.USE_LAST_VALUE);
IltColorModifier modifier = modifier1.compose(modifier2);
 
IltChartMapping mapping = (IltChartMapping)
  IltSettings.GetValue("SAN.SecState.CPUUtilization.Chart");
mapping.setColorModifier(modifier);
You can also create a new chart mapping, and set the new value in the following way:
 
IltChartMapping mapping = new IltChartMapping(minImg, maxImg);
IltSettings.SetValue("SAN.SecState.CPUUtilization.Chart", mapping);
How to modify the chart graphical representation of a SAN secondary state (using CSS)
You can also customize the chart graphic representation by using global CSS settings. You must specify the full state name, for example " SAN.SecState.CPUUtilization ", when matching the " name " attribute. The CSS property to be customized is chart.
When defining a new chart mapping class, the following CSS properties are used: minImage, maxImage, xAxisDirection, yAxisDirection, colorModifier. They match corresponding set methods of the IltChartMapping class (and its super class). Refer to ilog.tgo.graphic.IltChartMapping for information on how to customize the chart decorations.
In the example below, the color modifier class named MyColorModifier has been created and included in the search path.
 
setting."ilog.tgo.model.IltState"[name="SAN.SecState.CPUUtilization"] {
  chart: @+chartSan;
}
Subobject#chartSan {
  class: 'ilog.tgo.graphic.IltChartMapping';
  minImage: '@|image("icon1.png")';
  maxImage:'@|image("icon2.png")';
  xAxisDirection: Right;
  yAxisDirection: Bottom;
  colorModifier: @+myColorModifier;
}
Subobject#myColorModifier {
  class: "MyColorModifier";
}
How to modify the counter graphical representation of a SAN secondary state (using the API)
When a SAN secondary state is graphically represented by a counter decoration, the configuration of this decoration has to be previously defined. All SAN secondary states have a predefined counter representation. Refer to SAN states: the SAN state dictionary in the Business Objects and Data Sources documentation for information on how each secondary state is graphically represented.
Suppose you have a secondary state that is configured with a counter decoration as follows:
 
IltSettings.SetValue("SAN.SecState.CPUUtilization.Type",
IltDecorationType.Counter);
You can modify this decoration in the following way:
 
IltCounterMapping cm = new IltCounterMapping(new DecimalFormat("#Mbs"),
                                             IltrFont.CounterText,
                                             true, Color.black,
                                             Color.white, Color.black,
                                             3, 1, IlvDirection.Right, false);
IltSettings.SetValue("SAN.SecState.CPUUtilization.Counter", cm);
How to modify the counter graphical representation of a SAN secondary state (using CSS)
You can also customize the counter graphic representation by using global CSS settings. You must specify the full state name, for example " SAN.SecState.CPUUtilization ", when matching the " name " attribute. The CSS property to be customized is counter.
When defining a new counter mapping class, the following CSS properties are used: format, font, antialiasing, foregroundColor, backgroundColor, borderColor, xPadding, yPadding. They match corresponding set methods of the IltCounterMapping class (and its super class). Refer to ilog.tgo.graphic.IltCounterMapping for information on how to customize the counter decorations.
 
setting."ilog.tgo.model.IltState"[name="SAN.SecState.CPUUtilization"] {
  counter: @+counterSan;
}
Subobject#counterSan {
  class: 'ilog.tgo.graphic.IltCounterMapping';
  format: @+myNumberFormat;
  font: "Helvetica-Bold-12";
  antialiasing: false;
  foregroundColor: red;
  backgroundColor: blue;
  borderColor: red;
  xPadding: 100;
  yPadding: 100;
}
Subobject#myNumberFormat{
  class: 'MyNumberFormat';
}

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.