skip to main content
TGO > Programmers documentation > Styling > Introducing cascading style sheets > How to represent a business object
 
How to represent a business object
Describes how business objects are represented by business class properties and attribute properties:
*Business class properties
*Describes the types of business class and the inheritance and override mechanisms.
*Attribute properties
*Describes the use of attribute properties in the table component.
Business class properties
The representation of each instance of a given business object class is based on the declarations defined in the business object class selector. See The CSS specification for more information on CSS syntax and selectors.
JViews TGO has two categories of business object classes:
*Predefined
Predefined classes are provided by JViews TGO and oriented towards telecommunications. These classes include a predefined set of attributes and a corresponding default representation.
*User-defined
User-defined classes are defined by you according to your business model. These classes have no predefined set of attributes and the default graphic representation is basic. You will probably want to define your own graphic settings.
JViews TGO style sheets provide a built-in inheritance mechanism based on the business class hierarchy. This inheritance mechanism allows objects of a given business class to inherit settings from their parent business class. The advantage of the inheritance mechanism is that you can have a unified look-and-feel for all subclasses of a given class. If you define a graphic setting in a base class selector, this setting will be applied to all subclasses. For example, to apply a setting to all the predefined business classes, you must define the setting in the selector object ilog.tgo.model.IltObject. The overriding mechanism allows you to define exceptions in subclasses.
In the following example, the label is defined as invisible for all IltObject instances, except for instances of IltNetworkElement.
How to override an inherited setting
 
object."ilog.tgo.model.IltObject" {
    labelVisible: false;
}
object."ilog.tgo.model.IltNetworkElement" {
    labelVisible: true;
}
JViews TGO provides default property values for all predefined business object classes. These default property values ensure that all graphic components have an attractive display, which underpins the JViews TGO look-and-feel. This look-and-feel follows the Telecommunications Management Network (TMN) standard. The look-and-feel can be modified by overriding default property values. See the appropriate sections in this documentation for a complete list of all properties that can be used to customize the JViews TGO look-and-feel for predefined business objects.
When you work with user-defined business classes, their default graphic representation is basic. Therefore, you must define your own look by defining your own default values for these properties. The default property values for user-defined business classes are set to give a very simple look-and-feel in all graphic components. You can customize properties for user-defined business classes using the business class hierarchy.
How to customize properties for user-defined business classes
 
object.MyBusinessClass {
    label: @myNameAttribute;
}
If you want to customize the representation of all business classes, regardless of whether they are predefined or user-defined business classes, use the selector based on the object type.
How to customize the representation of all business classes
 
object {
    foreground: gray;
}
Attribute properties
Attribute properties are mainly used in the table component. For example, each cell in a table represents one attribute of a business object. Each attribute has its own associated set of properties that represent the graphic settings used by the table cell renderer to render the attribute value.
Attribute declarations are set using a CSS selector that is based on type object and a CSS class formed from the business class name and the attribute name.
How to customize attributes
 
object."ilog.tgo.model.IltObject/name" {
    label: @name;
}
JViews TGO provides default property values for all predefined business attributes. The use of these property values provides an esthetic display in a table, which corresponds to the JViews TGO look-and-feel.
Each attribute of the user-defined classes has an associated set of properties with default values. Attribute properties are also organized in a hierarchy. If an attribute is inherited from a parent class, its attribute property will inherit from the attribute property defined in the parent class. For example, the attribute property of IltNetworkElement inherits from the attribute property of IltObject.
How to use the inheritance mechanism for attributes
 
object."ilog.tgo.model.IltObject/name" {
    labelFont: "arial-plain-10";
}
object."ilog.tgo.model.IltNetworkElement/name" {
    labelFont: "arial-plain-12";
}

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