|
Users can write their own Device Management applications as Java Applets or build Java Applets using Bean Builder and bring it up from Web NMS Client through map menus or list (Network Database) menus. The Applet is independent of the main Web NMS Client and do not share any common object with the Web NMS Client. The properties with which an Applet come up are specified as arguments in the menu file. The Applet get these properties by invoking the applet.getparameter( ) method with the appropriate argument.
There are two ways in which Java Applet can be created.
One of the purposes of bundling the IDE, namely Bean Builder with Web NMS is to facilitate developing Applet and integrating it with Web NMS. This tool can be run through the BeanBuilder.bat/sh file located in <Web NMS Home>/bin/developertools directory. Once you have created your Applet (using the Bean Builder tool) you must get it integrated with Web NMS by following the steps given below :
Compile your Applet class
You can create a NAR (similar to that of JAR) of the created Applet and integrate it with Web NMS using the Deployment Wizard tool.
Writing an Applet by extending JApplet
You can create your own Applet by extending JApplet. A created Applet must be integrated with Web NMS for invoking it's function. This can be done by either of the two ways as given below:
Place your Applet class into <Web NMS Home>/classes/NmsClientClasses.jar and update the jar.
Create one's own jar and place it in <Web NMS Home>/classes directory.
If you adopt the point no.2, then the following steps are to be executed :
Make entry of your
created jar name in the ARCHIVE tag of the
clientparameters.conffile
as shown below :
ARCHIVE ="../classes/NmsClientClasses.jar,../classes/test.jar,../classes/<your jar name>
To invoke the change
in the standalone Application Client, set the classpath of your created
jar in the startApplicationClient.bat/shfile
located in <Web NMS home>/bin
directory as shown below:
set classpath=%NMS_HOME%\classes\NmsClientClasses.jar;%NMS_HOME%\classes\<your jar name>
Once the Applet is integrated with Web NMS it can be invoked either through the map menus or through the list menus as per the requirement. All the object specific menus present in <Web NMS Home>/mapdata/menus directory are known as map menus and that present in <Web NMS Home>/listmenus directory are known as list menus (specific for Network Database).
The menu action types namely "open" and "opennw" can be used for invoking Applet in Web NMS client. An example entry of an Applet in one of the map menu configuration file is as follows :
<MENU-ITEM name = "Managed Object Properties"
action_type="open"
action_value="<your own Applet class">
</MENU-ITEM>
Once an entry is given in the menu configuration file, the file can be saved and the client can be started. The specified Applet can be invoked on clicking the respective menu/menu-item in the same window (as defined by the menu action type"open" ).
Difference between Invoking Applet and NMS Frame from Client
Some of the basic differences between an Applet and an NMS frame are as listed here :
| S.No. | Applet |
NMS Frame |
|---|---|---|
|
1. |
An Applet is external to the client because it is invoked on a separate browser in the client, which has no control on the invoked Applet. |
NMS frame is internal to the client and the is having complete control over the NMS frame |
|
2. |
The Applet is invoked via the "openurl" and "opennw" actions which are specified in the menu configuration files. |
The frame (which has to be an instance of NmsFrame) is invoked through the "openframe" action |
|
3. |
Parameters are specified as key=value pairs in the menu file. The values are given as place holders e.g. HOST=${displayname}. Here displayname is a key for a property of the selected object .These values are substituted with those of the selected object when the menu item is clicked to invoke the Applet.
Note : This parameter substitution is always possible for object specific menus but for the panel specific menus this can be done only when the selected panel contains objects i.e. for map panels or network database panels (even in this case you have to have the object whose properties you want to pass to your Applet as selected ). |
Parameters are specified as key=value pairs in the menu file.The values are given as place holders e.g. HOST=${displayname}. Here displayname is a key for a property of the selected object .These values are substituted with those of the selected object when the menu item is clicked to invoke the Frame. Note : This parameter substitution is always possible for object specific menus but for the panel specific menus this can be done only when the selected panel contains objects i.e. for map panels or network database panels (even in this case you have to have the object whose properties you want to pass to your Frame as selected ). |
|
4. |
You need to invoke the NetMonitorPluginServlet (which is provided by the NMS as a default option to invoke Applets) from the web server and pass the properties (mentioned in S.No:3) to it. The servlet code handles these properties and passes them as parameters to the applet. This has one advantage i.e., since the servlet is on the server side it can be used to do some manipulations directly on the server and pass the result to the Applet. |
In case of an NmsFrame an instance of NmsMainApplet is passed to it through the init(JApplet) method when the frame is invoked. The NmsMainApplet contains all the properties specified in the menu file with their values substituted with respect to the selected managed object. |
|