This tool is used to generate a new xml file from an idl or modify an existing xml file. It can also be used to modify the provisioning templates. Using this tool we get the xml as an output. The input to this tool can be either idl file or xml file or both.
General structure of the xml file
Each method to be invoked on the agent instance or some other instance will be described in <Attribute> ... </Attribute> tag. The attributes of the Attribute tag are
This is the agent instance or some instance on which this particular method has to be invoked. The value of the instance has to be stored in the hashtable in ManagementServer. For example the agent reference is stored in the ManagementServer Hashtable against the key "AgentRef" then the value of the invokeObj attribute will be "$OBJ$AgentRef". If you do not specify the value here then you should set the instance value through API.
operation (or) field
The value of this attribute is the name of the method or name of the field, which is to be invoked on the instance specified in invokeObj attribute. For static method invocations, no need to append "$OBJ$" in the prefix. For example if you want to invoke "get" method of Array class then the invokeObj attribute value will be "java.lang.reflect.Array".
This is used as a key to store the result of that particular method invocation in the hashtable. This value can also be used as the value for the invokeObj attribute. This is the case if any of the method has to be invoked on the resultant object of another method(Here the resultant object of the first method will be stored in the hashtable against the label attribute's value.)
The value of this attribute can either be "true" or "false" . If we want to use the resultant object of the method invocation in future, we can persist that object. To persist permanently we have to give the value of the persistPolicy attribute as "true". If it is false then the resultant object will not be persisted.
The value of this attribute can either be "true" or "false" . If some method's result will be the final result and if we want that result, then we can get it by giving the value of the returnToUser attribute as "true". The result will be returned in a hashtable. Here the key is the value of the label attribute.
Sub Elements of the Attribute Tag
The sub element of the Attribute tag are <Argument> .. </Argument>. After this level all sub element's tags are <Sub-Argument>..</Sub-Argument>.
The attributes of sub elements :
classType : This denotes the class type of the value. Eg: java.lang.String , int
value : This is the value of that class type. This is applicable if the classType is primitive or Enum(idl type).
Creating the xml file from the IDL file
If you want to generate xml file from the idl file, you have to load the idl file using the idl file load option. The methods(operations) in the idl file will be shown in the tree format. Which ever method has to be invoked on the agent side has to be selected and moved to the Right side panel(JList). The order of the method invocation has to be maintained.
The following figure shows the IDL loaded with this tool :
After completed the method selection, click Next button which will bring you the second screen which contains the JTextArea , JTextField , JComboBox etc., as follows :
This contains the generated xml file(with default values). The default value for all primitive types are empty String. For Enum(idl type) the default value is 0(the first element).
By default this will be empty. This is for entering the input values to the method. For example if you want to invoke the method "get(String str, int val)" on the agent. Then in the UI you can see two text fields with two JLabels. The label denotes the type of the input. So you can fill the values of "str" and "val" in the text field.
This is used in three places. First is to show the methods which are selected for invocation.Second is to show the invokeObj labels(By default, the combo box value will be the methods name after that particular method). Third is used to show the Enum(idl type- actually static fields) values.
This is used for selecting the persistPolicy and returnToUser attributes. If this is selected for persistPolicy then the value will be true else false.
You can parse and edit the entire xml using the components provided in the Left Panel. After all the modifications you can save it as either xml file or insert all the attribute tags into a provisioning template's configTask or NEInput Tag.
Loading the existing xml file
If you want to edit the xml file which already exists, you load that xml file using the xml file load option. Instead of default values the existing values will be stored in the JTextArea, JTextField, JComboBox etc. You can modify this xml as explained above or you can add some extra methods from the idl. Once you load the xml file , the corresponding idl files will also be loaded. To add some extra methods you have to go back to the previous screen by clicking the Back button. There you can include the method you want, change the order in the Right JList. Again come back to the second screen by clicking the Next button. Now new Attribute tag will be created for newly added method and the existing Attribute values will be retained. Then you can modify the xml and save that file.
Note: This tool can be used for editing only those XML files which are previously generated from CORBA IDLs, for example, the XML files generated by this tool for Provisioning CORBA Devices or for carrying out Data Collection for CORBA Devices.
Loading the Provisioning Template
If you want to edit the methods (the attribute tags) in the provisioning template, you have to load the provisioning template file using the load Template option (from the LoadDialog). Then you have to choose whether the attribute tags have to be loaded either from ConfigTask or NEInput. By default the ConfigTask (the attribute tag(s) within ConfigTask) gets loaded. As usual you can edit or add new attributes and then store it back in that template or store it as a new xml file.
If any of the method argument is an array, this tool by default will create an array of size 1. If you want to add some more elements in the array then you have to select that array's last element .The button "Add Item" will be enabled. On selecting the button, you will be asked to enter the number elements to be added more (if you want the array size to be 3 , by default the array size is 1, so you have to give 2 as an input). On entering the number of elements to be added the corresponding tags get appended with the default values (This array addition is applicable only for primitive types and Enums(idl type) ). For deleting the array items select the last element of the array and press the "Delete Item" button. The corresponding tag gets deleted. You cannot delete the first element in the array i.e the tag generated by default by the tool. Also only one item can be deleted at a time.
To start this tool execute the idltoxml.bat/sh file present under <Web NMS HOME>/bin/developertools directory. Before executing , edit this file to set the IDL_CLASSES variable to the directory where the idl sources have been compiled and put. This is needed in order to generate the XML since the objects are created at runtime through reflection.