Skip Headers
Oracle® Communications Network Integrity Developer's Guide
Release 7.1

E23701-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

15 Model Extension Using Specifications

This chapter provides information about using specifications to create model extensions in Oracle Communications Network Integrity.

Overview

Network Integrity cartridges persist their results to POMS in an Oracle Communications Information Model representation. The Information Model defines a base set of entities and the relationships between them. The Information Model is extendable through Specifications. Specifications add attributes to the base Information Model entities. It is expected that most cartridges must extend the Information Model entities and therefore must make use of Specifications.

Like UI Parameters, Specifications are defined using the Design Studio data dictionary. UI Parameters are actually a special type of specification. A Specification used for model extension is associated with a single Information Model entity type. Multiple Specification types can be defined for each Information Model entity type. Within the Data Dictionary, a Specification is a special type of data dictionary structure. The elements that comprise the structure are also known as characteristics.

Specifications can be shared between cartridges. Network Integrity ensures that when multiple cartridges are deployed together, their shared Specifications are compatible.

When cartridge code persist information to POMS it creates Information Model entities and usually a specific type of Specification is attached to each Information Model entity to hold additional attributes. Within the Network Integrity UI, an Information Model entity and its specification are represented as a single object.

All action types must define which specification types they use. This is done through the Action's Model tab. The Model tab defines the list of Model Collections that the Action uses. The Model Collections define the Specifications and implicitly through the Specifications, the base Information Model entity types that the Actions use. Design Studio for Network Integrity generates special classes, called specification helpers, to help simplify the usage of the Specifications by the cartridge developer.

As Specifications attributes are displayed in the Network Integrity UI, the user can define UI Hints for the Specifications. These UI Hints work much like the UI Hints for UI Parameters except that Specification attributes are always read-only in the Network Integrity UI. For Specifications, the following UI attributes can be associated with the following data dictionary item types:

  • Structures can be decorated with the following attributes:

    • Label: this attribute specifies the label that displays in the UI

    • Tool Tip: this attribute specifies a short message that displays when the pointer hovers over the field

  • Child elements can be decorated with the following attributes:

    • Label: this attribute specifies the label that displays in the UI

    • Tool Tip: this attribute specifies is a short message that displays when the pointer hovers over the field

    • All of the other attributes have no effect.

  • UI attributes for top level elements are not used.

Working with Specifications

Working with Specification involves four areas of Design Studio for Network Integrity:

  • The data dictionary defines Specifications. The data dictionary defines:

    • The data dictionary structures that are used as Specifications

    • The elements of the data dictionary structure

    • The enumeration types of the elements within the Specification's structure

  • The Model Collections editor chooses the Specifications that are part of a Model Collection.

  • The Action editor Model tab is used for choosing the Model Collections that the Action uses. This indirectly defines which Specifications is used.

  • The cartridge editor's UI Hints tab is where UI attributes are defined for the data dictionary structures and child elements of the Specification.

The high level steps for using Specifications in Actions are:

  1. Use the data dictionary to define a Specification.

  2. Refer to the Specifications from a Model Collection.

  3. From the Action's Model tab choose the Model Collections that the Action uses.

  4. Navigate to the cartridge UI Hints tab to add UI attributes to the Specification data dictionary structures and elements.

Data Dictionary Editor

Use of the data dictionary editor is described in Design Studio documentation, Working with the Data Dictionary section. A Specification is a special type of data dictionary structure. To define a Specification:

  1. Create a top level structure for the Specification.

  2. On the Details tab specify the Display Name.

  3. On the Entity Type tab specify:

    • Dynamic

    • Choose the base entity type of the Specification. The chooser contains an entry for each base entity type that can be extended. It also contains an entry UI Parameter Specification which is a special entry for UI Parameters. This has nothing to do with extending the Information Model; it should not be chosen.

  4. Add child elements to the specification. For the child element specify:

    • Display Name.

    • Type: The Child elements must be of type string or an enumeration type of base type string.

  5. Save the data dictionary.

As Specifications can be shared between Actions, it is not always necessary to define a new Specification.

Model Collections

To make use of Specifications in your cartridges specify which Specifications the Cartridge and Actions use. Do this with Model Collections and the Action Model tab.

Create Model Collection

To create a Model Collection:

  1. In the Cartridge View, from the popup menu, select New then Integrity then Model Collection. A Model Collection Wizard dialog displays.

  2. In the Collection Wizard dialog specify:

    • Project: the project in which the Model Collection is created.

    • Name: the name of the Model Collection.

    • Folder: to group different Model Collections into different folders, enter the name of a new folder, or choose an existing folder by using the Browse button. The folders can be found inside the Model Collections folder of the project tree in the Cartridge view.

  3. Click Finish to create the new Model Collection. The Model Collection opens in a Model Collection editor.

Adding a Specification to a Model Collection

To add a Specification to a Model Collection:

  1. Select Add in the Model Collections editor. A Data Item Selection dialog displays.

  2. Use the Specification Type, Dictionary, Type and Search fields to filter the Specifications displayed in the dialog.

  3. Select the desired Specifications and click the OK. The Data Item Selection dialog closes.

  4. Save the Model Collection.

Removing a Specification from a Model Collection

To remove a Specification from a Model Collection:

  1. Select the Specification and click Remove.

  2. Save the Model Collection.

Action Model Tab

From the Action's Model tab define which Model Collections the Action should use.

Adding a Model Collection to a Model

To add a Model Collection to the model, use the following procedure:

  1. Select Add. A Select the Model Collection to Add dialog displays.

  2. In the dialog, you can filter the Model Collections that are displayed by entering the first few characters of the Model Collections name.

  3. Select the desired Model Collection and select the OK. The Model Collection are added to the Action's model.

  4. Save the Action.

Removing a Model Collection from an Model

To remove a Model Collection from the model, use the following procedure:

  1. Select the Model Collection, and click Remove.

  2. Save the Action.

Cartridge Editor UI Hints Tab

UI Hints are defined for Specifications from the Cartridge editor's UI Hints tab. The user assigns UI attributes to the data dictionary structures and child elements using the fields at the right of the tab.

For Specifications, UI Hints apply to all Network Integrity UI screens where the Specifications are displayed. For Specifications, only the Label and Tool Tip UI attributes can be associated with the data dictionary items.

The procedures for defining UI Hints for Specifications are the same as for UI Parameters. See "Working with UI Parameter Examples" for further details.

Specification Usage Examples

This section describes some common operations involving Specifications.

Create and Use Specification Example

The steps to create and use a Specification are:

  1. Create the new Specification using the procedure described in "Data Dictionary Editor".

  2. Refer to the new Specification from a Model Collection.

    1. If you must create a Model Collection, then use the procedure described in "Create Model Collection".

    2. Use the procedure described in "Adding a Specification to a Model Collection" to refer to the Specification.

  3. If necessary, refer to the Model Collection from the Action's Model tab. Use the procedure described in "Adding a Model Collection to a Model".

  4. Change UI hints for the Specification from the Cartridge UI Hints tab. See "Cartridge Editor UI Hints Tab" for details.

Use an Existing Specification Example

The steps to use an existing Specification are:

  1. Refer to the Specification from a Model Collection. See "Adding a Specification to a Model Collection".

  2. If necessary, refer to the Model Collection from the Action's Model tab. Use the procedure described in "Adding a Model Collection to a Model".

  3. Change UI hints for the Specification from the Cartridge UI Hints tab. See "Cartridge Editor UI Hints Tab" for details.

Modify Specification Usage Example

The steps to modify a Specification are:

  1. Modify the Specification's data dictionary structure. Use of the data dictionary editor is described in the Design Studio documentation, Working with the Data Dictionary section.

  2. If desired, modify the UI Hints for the Specification. See "UI Hints Tab" for details.

Defining Enumerated Values for Specifications Example

To define Specifications which have enumerated values, the following steps are required:

  1. In the data dictionary, create a top level element of type string.

  2. In the Enumerations tab for the top level element, define the set of enumerations. Set both the code and the description. The code becomes an enumerated value for the Specification. The description becomes the label displayed in the Network Integrity UI.

  3. On the element which supports the enumeration, change the type to be the type of the top level element just defined.

Stop Using a Specification Usage Example

To stop using a Specification, use the following steps:

  1. Remove the Specification from the Model Collection. See "Removing a Specification from a Model Collection" for the procedure.

  2. If the Model Collection contains no other specifications you may to delete it. First remove it from any model's that are referring to it. Then delete it.

  3. If the Specification is not being used elsewhere in the cartridge, you should remove any UI hints for the specification from the Cartridge UI Hints tab. Use the following procedure:

    1. From the Cartridge UI Hints tab, select the Specification and the select the Remove all UI Hints for the Selected Elements.

    2. Save the Cartridge.

    3. Select Clean UI Hints.

    4. If the Specification is not being used, it is a best practice to remove it from the Data Dictionary.

Specification Helpers

Specification Helper classes are generated by the Design Studio for Network Integrity when Specifications are referred to by Model Collections. The Specification Helpers are generated to the following package:

  • Cartridge Default Package.Model Collection Name.Model Collection Name

The names of the Specification Helpers are based on the names of the Specifications in the Model Collection. For example if the name of the Specification is deviceGeneric, then the name of the Specification Helper is DeviceGeneric.

The Specification Helpers have a getter and setter method for each element in the specification. The Specification Helper also has a constructor which takes a POMS entity interface object. A code sample which illustrates the use of a Specification Helper is shown below. In the code sample, the DeviceGeneric class is the Specification Helper.

// create a Logical Device entity which uses
// the Device Generic specification.
//
LogicalDevice logicalDevice = PersistenceHelper.makeEntity(LogicalDevice.class);
DeviceGeneric logicalDeviceExt = new DeviceGeneric(logicalDevice);
 
// Set static attribute values to LogicalDevice.
logicalDevice.setId(makeLDevID(scanResponse));
logicalDevice.setName(rfc1213Mib.getSysName());
logicalDevice.setDescription(rfc1213Mib.getSysDescr());
 
// Set dynamic attributes/characteristics.
//
logicalDeviceExt.setMgmtIPAddress(scanResponse.getManagementIP());
logicalDeviceExt.setSysObjectId(rfc1213Mib.getSysObjectID());