| Business Objects and Data Sources > Network Elements > Loading a Network Element Defined in XML |
Loading a Network Element Defined in XML |
INDEX
PREVIOUS
NEXT
|
This section shows how to load a network element from an XML file in a data source. For detailed information about data sources, see section Data Sources.
All you have to do is create a data source using the data source default implementation defined by IltDefaultDataSource and pass the XML file to the parse method of the data source, as shown below:
dataSource = new IltDefaultDataSource();
dataSource.parse("NetworkElementXMLFile.xml");
Below is an example of a network element defined in XML format. For details about the XML elements used in this example, see Table 3.1, Elements in an XML Data File.
In this example, the object state associated with the first network element (NE1) has a default value. The second object (NE2) explicitly defines the primary states of its associated OSI state. For details about states, see section States.
<cplData>
<addObject id="NE1">
<class>ilog.tgo.model.IltNetworkElement</class>
<attribute name="name">NE1</attribute>
<attribute name="type">NE</attribute>
<attribute name="function">Transport</attribute>
<attribute name="family">OC96</attribute>
<attribute name="position" javaClass="ilog.cpl.graphic.IlpPoint">
<x>10.0</x>
<y>50.9</y>
</attribute>
<attribute name="objectState"
JavaClass="ilog.tgo.model.IltOSIObjectState"/>
</addObject>
<addObject id="NE2">
<class>ilog.tgo.model.IltNetworkElement</class>
<attribute name="name">NE2</attribute>
<attribute name="type">Terminal</attribute>
<attribute name="position" javaClass="ilog.cpl.graphic.IlpPoint">
<x>60.0</x>
<y>50.9</y>
</attribute>
<attribute name="objectState"
javaClass="ilog.tgo.model.IltOSIObjectState">
<state>
<administrative>Unlocked</administrative>
<operational>Enabled</operational>
<usage>Active</usage>
</state>
</attribute>
</addObject>
</cplData>
Figure 4.1 shows the two network elements displayed in a network component:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |