|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.nms.util.NmsUiAPI
NmsUiAPI is one of the core APIs in Web NMS Java Client Framework, which
is used in Tree and Custom View related customizations from the client
side. Apart from the above mentioned purpose, this class also provides
API methods for customizing some of the UI aspects of the client.
The various areas where NmsUiAPI can be put to use, is discussed below.
|
|
||||||||||||
|
The basic and important component in the Web NMS client is the Tree that appears in the left hand side of the main window. NmsUiAPI API provides static methods which can be used to customize this Tree dynamically from the client side. Various customization that are possible with this class includes, Adding, Modifying, Inserting and Removing tree nodes dynamically. com.adventnet.nms.fe.common.NmsTreeAPI is a RMI based API
that can be used to perform these customizations from the server side. The various methods present in this API that can be used for tree customizations are briefed below:
|
|
|
||||||||||
|
        A "Custom View" is defined as a view in which, a subset of data (from an entire set of data) can be viewed separately based on some criteria. As the name implies, the user can create as any number of Custom Views as required.         Apart from the flexibility to create Custom Views from the client (through GUIs), Web NMS provides two different APIs (one from the server side and the other from the client side) for creating Custom Views. This class being the client side API for achieving all the Custom View related customizations, NmsTreeAPI forms the server side equivalent. API Usage : The various custom view related customizations with their respective API methods is listed in the table below.
|
Custom View related Terminologies :
Following are the important terminologies that are to be understood before proceeding with using the API methods for Custom View related customizations.| Network Events | Events |
| Alarms | Alerts |
| Network Database | Network Database | Performance (Configured Collections) | Stats Admin |
"Events.35212322".
| |
||||||||
| Temporary Custom Views are Custom Views which are non-persistent in nature, i.e. information related to the Custom View is not stored in the database. The Custom View remains valid only for the current session of the client and for the user who has created the Custom View. API Usage : The various custom view related customizations with their respective API methods is listed in the table below.
|
NmsTreeAPI| Method Summary | |
static java.lang.String |
addCustomView(java.lang.String moduleId,
java.lang.String parentNodeId,
java.util.Properties criteria,
java.util.Properties treeNodeProps,
boolean sync)
Adds a Custom View whose Module is passed as the argument to moduleId,
under the node whose id is parentNodeId. |
static java.lang.String |
addCustomView(java.lang.String moduleId,
java.lang.String rootCvId,
java.lang.String displayName,
java.util.Hashtable prop,
boolean sync)
Deprecated. The method is deprecated because it does not directly take the tree node properties as an argument. The new method is public static String addCustomView(String moduleId,String parentNodeId,Properties criteria,Properties treeNodeProps,boolean sync) |
static boolean |
addNodesToTree(java.util.Properties[] prop,
java.lang.String parentId)
Adds nodes to the tree under the parent parentId. |
static boolean |
addNodesToTree(java.util.Properties[] prop,
java.lang.String parentNodeId,
java.lang.String tobeselected,
boolean sync)
Adds nodes to the tree under the node parentNodeId and selects the node tobeselected. |
static boolean |
addNodesToTree(java.util.Properties[] prop,
java.lang.String parentId,
java.lang.String tobeselected,
java.lang.String panelkey)
Deprecated. Since the Properties object should contain "panelkey" as a key, the extra argument panelKey is not required. The new method is public static boolean addNodesToTree (Properties[] prop,String parentNodeId, String tobeselected,boolean sync ) |
static java.lang.String |
addTemporaryCustomView(java.lang.String nodeId,
java.lang.String moduleId,
java.util.Properties criteriaProps,
java.util.Properties treeNodeProps,
boolean addToTree,
java.lang.String parentNodeId)
Adds a temporary custom view with name displayName whose module
is moduleId ,under the parent node whose ID is parentNodeId
, by Temporary Custom View it means that this custom view is accesible only to
the client in which it is created and it wouldn't disturb the other clients
But once this temporary custom view is saved it will be converted in to an permanent
custom view and thereafter it will be accesible to all the clients. |
static boolean |
addTreeNode(java.lang.String parentNodeId,
java.lang.String tobeselected,
java.util.Properties prop,
boolean sync)
Adds a tree node under the node parentNodeId. |
static void |
detachPanel(java.lang.String panelKey)
Detaches the panel whose key is panelkey. |
static void |
detachPanelFromNodeId(java.lang.String nodeId)
Detaches the panel whose id is nodeId. |
static NmsPanel[] |
getAllPanelInstances(java.lang.String panelName)
Returns all the instances corresponding to the given panelName. |
static java.lang.String |
getCurrentCustomView()
Returns the Current Custom View ID selected in the current Module. |
static java.lang.String |
getCurrentModuleId()
Returns the Module Id of the current custom view that is selected in the Nms Tree. |
static java.lang.String |
getCurrentNodeId()
Returns the id of the currently selected node in the Tree. |
static java.awt.Cursor |
getCursor()
Returns the cursor object currently set for the main frame. |
static java.lang.String |
getCustomViewID(java.lang.String moduleId,
java.lang.String displayName)
Returns the custom view id corresponding to the displayName. |
static java.util.Hashtable |
getCustomViewProperties(java.lang.String moduleId,
java.lang.String cvID)
This method fetches the properties of a Custom View with id cvID whose module is moduleId. |
static java.lang.String |
getCustomViewRoot(java.lang.String moduleId,
java.lang.String cvID)
Returns the name of the root node which contains the given cvID
whose module is moduleId. |
static java.lang.String[] |
getCustomViews(java.lang.String moduleId)
Returns the Ids of the Custom Views present under a module, given its Module Id(moduleId). |
static javax.swing.JDesktopPane |
getDesktopPane()
Returns the reference of the main DesktopPane. |
static javax.swing.JFrame |
getDetachedFrame(java.lang.String panelKey)
Returns the JFrame reference for the given panelkey. |
static javax.swing.JFrame |
getDetachedFrameFromNodeId(java.lang.String nodeId)
Returns the JFrame reference for the given nodeId. |
static javax.swing.JInternalFrame |
getInternalFrame(java.lang.String panelKey)
Returns the InternalFrame reference for the given panelKey. |
static javax.swing.JInternalFrame |
getInternalFrameFromNodeId(java.lang.String nodeId)
Returns the InternalFrame reference for the given nodeId. |
static javax.swing.JMenuBar |
getJMenuBar()
Deprecated. This method does not give the menubar corresponding to the panelkey present. So deprecated. |
static javax.swing.JApplet |
getMainApplet()
Returns the reference to the the JApplet instance that is shown by the Web NMS client. |
static java.util.Vector |
getMenuVector(java.lang.String panelKey)
Retuns a vector of JMenu for the given panelKey. |
static java.lang.String[] |
getModuleIds()
Returns the list of ModuleIds for all the client side modules present in Web NMS. |
static NmsPanel |
getNmsPanel(java.lang.String moduleId)
Returns the NmsPanel of the associated module given the moduleId. |
static NmsPanel |
getNmsPanelInstance(java.lang.String panelKey)
Returns the NmsPanelInstance whose key is panelkey. |
static javax.swing.JTree |
getNmsTree()
Returns the reference to the tree component used in the WebNMS client. |
static long |
getTimeOut()
Returns the current time interval set for the client to timeout on synchronous requests sent to the server. |
static java.util.Properties |
getTreeNodeProperties(java.lang.String id)
Returns the properties of the node whose id is passed as the argument. |
static java.lang.String[] |
getTreeNodesCorrespondingToPanelKey(java.lang.String panelKey)
Returns all the node ids corresponding to the given panelkey. |
static XMLNode |
getXMLNode(java.lang.String nodeId)
Returns the actual reference of the XMLNode whose id is nodeId. |
static XMLNode[] |
getXMLNodes(java.lang.String displayName)
Returns the XMLNodes array corresponding to the displayName . |
static boolean |
insertTreeNode(java.lang.String parentNodeId,
java.util.Properties prop,
java.lang.String tobeselected,
int nodeIndex,
boolean sync)
Inserts a new tree node at the specified index under the given parentNodeId. |
static boolean |
isCustomViewSupported(java.lang.String moduleId)
Checks whether the given module id is a valid one and whether the module can contain Custom Views. |
static boolean |
isPanelInitialized(java.lang.String panelKey)
Returns whether the panel corresponding to the given panelKey is instantiated or not. |
static boolean |
isPanelInitializedFromNodeId(java.lang.String nodeId)
Returns whether the panel corresponding to the given nodeId is instantiated or not. |
static boolean |
modifyCustomView(java.lang.String moduleId,
java.lang.String cvID,
java.util.Hashtable prop,
boolean sync)
Deprecated. This method is deprecated because it does not directly take the TreeNodeProperties as a parameter and tobeselected is also not present. The new method is public static boolean modifyCustomView (String moduleId,String CustomViewId,Properties criteria,Properties treeNodeProps, boolean sync) |
static boolean |
modifyCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
java.util.Properties criteria,
java.util.Properties treeNodeProps,
boolean sync)
Modifies the custom view whose Id is CustomViewId and whose module is
moduleId.The new properties for the node should be given in the treeNodePropsargument. |
static boolean |
modifyTemporaryCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
java.util.Properties criteria,
java.util.Properties treeNodeProps)
Modifies the properties of a temporary custom view with id CustomViewId whose module is moduleId ,
the new criteria properties of the custom view to be updated should be given in
criteriaProps and the new tree node properties of the temporary
custom view to be updated has to be given in treeNodeProps . |
static boolean |
modifyTreeNode(java.lang.String nodeId,
java.lang.String tobeSelected,
java.util.Properties treenodeprops,
boolean overWrite)
Modifies the properties of the tree node whose id is nodeId. |
static boolean |
moveTreeNode(java.lang.String nodeId,
java.lang.String newParent,
java.lang.String tobeselected,
int nodeIndex,
boolean sync)
Moves the node with id nodeId under the specified newParnet
at the specified nodeIndex. |
static boolean |
removeCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
boolean sync)
Removes a Custom View with given id cvID whose module is moduleId. |
static void |
removeNodeFromTree(java.lang.String[] nodeIds,
java.lang.String tobeselected,
boolean sync)
Removes all the nodes present in the array nodeIds[] from the tree. |
static void |
removeNodeFromTree(java.lang.String parent,
java.lang.String id)
Deprecated. This is deprecated because this method does not take tobeselected as an argument and the method name is as if it supports for more than one node for the operation. The new method is public static void removeNodeFromTree(String [] nodeIds,String tobeselected,boolean sync) |
static boolean |
removeTemporaryCustomView(java.lang.String cvId)
Removes the temporary custom view with ID cvId . |
static boolean |
removeTreeNode(java.lang.String nodeId,
java.lang.String tobeselected,
boolean sync)
Removes the node from the tree whose id is nodeId. |
static boolean |
renameCustomView(java.lang.String CustomViewId,
java.lang.String newDisplayName,
java.lang.String tobeSelected)
Renames a custom view with newDisplayName and selects the tobeSelected node. |
static boolean |
renameCustomView(java.lang.String moduleId,
java.lang.String cvID,
java.lang.String oldDisplayName,
java.lang.String newDisplayName)
Deprecated. This method is deprecated because it takes oldDisplayName and moduleid as arguments.Since custom view ID is unique in the tree, the module Id and old display name are not necessary. The new method is public static boolean renameCustomView(String CustomViewId,String newDisplayName,String tobeSelected) |
static boolean |
saveCustomView(java.lang.String moduleId,
java.lang.String cvID,
boolean sync)
Deprecated. As of WebNMS2.3. This is because if any customview is created, then by default it will be saved in 2.3. |
static boolean |
saveTemporaryCustomView(java.lang.String customViewId)
Saves the temporary custom view with the ID custViewId by which it
means that it has been converted to a permanent custom view . |
static void |
selectNode(java.lang.String moduleId,
java.lang.String cvID)
Deprecated. This is deprecated since it takes an argument moduleId. Since custom view id is unique the argument moduleId is not necessary.The new method is public static void selectTreeNode (String nodeId,boolean showPanel) |
static void |
selectTreeNode(java.lang.String nodeId,
boolean showPanel)
Selects the node whose id is nodeId and changes the panel if
showPanel is set to true. |
static void |
setCursor(java.awt.Cursor cur)
Sets the given cursor cur to the main frame. |
static void |
setMenuVector(java.lang.String panelkey,
java.util.Vector menusVector)
Sets the menus that are present in the menusVector to the panel whose key is
panelKey. |
static void |
setSelectionRow(int row)
Selects the node whose index from the top of the tree is row. |
static void |
setTheStatusOnLabel(java.lang.String panelKey,
java.lang.String text,
java.lang.String color)
Sets the text on status bar of the given panelKey's frame. |
static void |
setTimeOut(long timeOut)
Sets the time interval for the client to time out for the requests sent to the server through synchronous mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.String[] getModuleIds()
public static java.lang.String[] getCustomViews(java.lang.String moduleId)
instanceof
NmsCustomPanel can have Custom Views.moduleId - Module Id of the module
public static java.lang.String addCustomView(java.lang.String moduleId,
java.lang.String rootCvId,
java.lang.String displayName,
java.util.Hashtable prop,
boolean sync)
On successfull addition of the Custom View the focus will be changed to the newly added Custom view in the Nms Tree.
moduleId - Module refers to the type of Custom view
that is going to be added. Eg. Network Database, Events, Alerts etc.rootCvId - The ID of the parent Custom View under which
which the new Custom View should be added. An invalid
value will result in the failure of this method call.displayName - The name of the new Custom View to be added. The
user should be aware that any white space character in displayName
will be replaced by underscore character '_'. The users
are suggested to use names without white space character
embedded in them.prop - The hashtable object which mentions the properties
of the new Custom View with property Name as the key and the
property value as the Value.
The Hashtable should contain a Properties object, that contains
the tree node properties. The hashtable should contain the criteria
for the custom view.
Eg.
Hashtable h=new Hashtable();
Properties p=new Properties();
p.put("TREE-NAME","Example");
p.put("MENU-FILE-NAME","alertsmenu.xml");
p.put("ICON-FILE","images/reddot.png");
h.put("attributeList",p);
h.put("FieldsWanted","Status=severity;Source=entity");
sync - The variable mentions whether the call should
be synchronous or asynchronous. A value of true
makes it a synchronous call and false asynchronousremoveCustomView(java.lang.String, java.lang.String, boolean),
modifyCustomView(java.lang.String, java.lang.String, java.util.Hashtable, boolean)
public static boolean renameCustomView(java.lang.String moduleId,
java.lang.String cvID,
java.lang.String oldDisplayName,
java.lang.String newDisplayName)
moduleId and whose
custom view id is cvID. By renaming we mean that display
name or the treename can be renamed. The id for a custom view remains the same.
The new name is reflected in the NMSTree.cvID - the custom view ID whose displayName is to be changedmoduleId - The type of custom view. Eg.Network Database or Events etc.,oldDisplayName - the present display name of the Custom ViewnewDisplayName - the new display name of the Custom View
public static boolean removeCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
boolean sync)
The sync parameter should be set to true if this method should make a synchronous call to the server, in which case the method will return only after the request gets processed by the server and a reply comes back. If sync is set false the method call will be asynchronous where the method will return back immediately after placing the request to the server. In asynchronous mode the return value of true will not gurantee the removal of the Custom View on the server. It just conveys the succesfull placement of request to the server.
moduleId - Module of the Custom view that was given during addition of custom view.CustomViewId - The id of the Custom View to be removedsync - The sync variable mentions whether the call should
be synchronous or asynchronous. A value of true
makes it a synchronous call and false asynchronous.addCustomView(java.lang.String, java.lang.String, java.lang.String, java.util.Hashtable, boolean),
modifyCustomView(java.lang.String, java.lang.String, java.util.Hashtable, boolean)
public static boolean saveCustomView(java.lang.String moduleId,
java.lang.String cvID,
boolean sync)
The sync parameter should be set to true if this method should make a synchronous call to the server, in which case the method will return only after the request gets processed by the server and a reply comes back. If sync is set false the method call will be asynchronous where the method will return back immediately after placing the request to the server. In asynchronous mode the return value of truewill not gurantee that the custom View has been saved on the server. It just conveys the succesfull placement of request to the server.
moduleId - Module id of the Module under which the Custom
View is present.cvID - The id of the Custom View to be savedsync - The sync variable mentions whether the call should
be synchronous or asynchronous. A value of true
makes it a synchronous call and false asynchronous.
public static boolean modifyCustomView(java.lang.String moduleId,
java.lang.String cvID,
java.util.Hashtable prop,
boolean sync)
prop object should contain the properties of the Custom View
with which it should be updated.The sync parameter should be set to true if this method should be a synchronous call to the server, in which case the method will return only after the request gets processed by the server and a reply comes back. If sync is set false the method call will be asynchronous where the method will return back immediately after placing the request to the server. In asynchronous mode the return value of true will not gurantee the addition of the custom View on the server. It just conveys the succesfull placement of request to the server.
On successfull modification of the custom view the modified Custom view will be selected in the Nms Tree
moduleId - Module id of the Module under which the Custom
View is present.cvID - The id of the Custom View to be modified.prop - The Hashtable object containing the properties of
the Custom View as key value pair with which the Custom View
will be updated. It cannot be null.
The Hashtable should contain a Properties object that contains
the tree node properties. The Hashtable should contain the criteria
for the custom view.
Eg.
Hashtable h=new Hashtable();
Properties p=new Properties();
p.put("TREE-NAME","Example");
p.put("MENU-FILE-NAME","alertsmenu.xml");
p.put("ICON-FILE","images/reddot.png");
h.put("attributeList",p);
h.put("FieldsWanted","Source=entity");
sync - The sync variable mentions whether the call should
be synchronous or asynchronous. A value of true
makes ita synchronous call and false asynchronous.addCustomView(java.lang.String, java.lang.String, java.lang.String, java.util.Hashtable, boolean),
removeCustomView(java.lang.String, java.lang.String, boolean)
public static java.util.Hashtable getCustomViewProperties(java.lang.String moduleId,
java.lang.String cvID)
moduleId - Module refers to the type of custom view. Eg.Network Database, Events etc.cvID - The id of the Custom View to be modified.modifyCustomView(java.lang.String, java.lang.String, java.util.Hashtable, boolean)public static java.lang.String getCurrentModuleId()
getCurrentCustomView()public static java.lang.String getCurrentCustomView()
getCurrentModuleId()
public static java.lang.String getCustomViewRoot(java.lang.String moduleId,
java.lang.String cvID)
cvID
whose module is moduleId.
Returns null if either the given
moduleId is not present or the given cvID
is not of the type of moduleId.moduleId - The type of custom view.cvID - The Id of the Custom View whose root is needed.addCustomView(java.lang.String, java.lang.String, java.lang.String, java.util.Hashtable, boolean)public static boolean isCustomViewSupported(java.lang.String moduleId)
NmsPanel) which are instances of
NmsCustomPanel can have Custom Views. The
method returns true if valid else false.moduleId - The module IDpublic static void setCursor(java.awt.Cursor cur)
cur - The cursor to be set for the main framegetCursor()public static java.awt.Cursor getCursor()
setCursor(java.awt.Cursor)public static javax.swing.JTree getNmsTree()
public static void selectNode(java.lang.String moduleId,
java.lang.String cvID)
moduleId - Refers to the type of custom view.cvID - Specifies the name of the CustomView to be selected. If
passed null the rootNode of the module will be selectedselectTreeNode(java.lang.String, boolean)public static void setSelectionRow(int row)
row - Specifies the row to be selected in the WebNms tree. The nodes that are present under a collapsed
node are not taken into consideration.public static javax.swing.JMenuBar getJMenuBar()
public static NmsPanel getNmsPanel(java.lang.String moduleId)
moduleId.moduleId - The moduleId of the module whose NmsPanel instance
should be returned.public static javax.swing.JApplet getMainApplet()
public static void setTimeOut(long timeOut)
timeOut - The timeout interval to be set in millisecondsgetTimeOut()public static long getTimeOut()
setTimeOut(long)
public static java.lang.String getCustomViewID(java.lang.String moduleId,
java.lang.String displayName)
moduleId - The Module Custom View.displayName - The name as displayed on the tree. It is the name
with which the user added the custom viewpublic static XMLNode[] getXMLNodes(java.lang.String displayName)
displayName .
For a given displayName corresponding XMLNode is given.
If more than one custom view has the same name then
the method returns the XMLNodes of all the custom view that has this displayName.displayName - the display Name of the Custom ViewXMLNode
public static boolean addNodesToTree(java.util.Properties[] prop,
java.lang.String parentId)
parentId.
The user can add any number of nodes under a given parent. The prop array
should contain the properties of the tree nodes that are to be added.
The parentId is the Id of the parent node under which the nodes are to be added.prop - Property array of all nodes to be added.
Each property should contain the attributes of the particular node.
keys -> newleafs : id of the node.
TREE-NAME : the actual display name of the node on the tree
ICON-FILE : icon to be displayed for the node in the tree
like wise other properties like MENU-FILE-NAME, TREE-POPUP-MENU and any of the user property also.
*If the following attributes are not present in the properties object for any node
then
"newleafs" , "TREE-NAME" ,"panelkey"
parentId - the parent Node ID under which the nodes are to be added.
public static boolean addNodesToTree(java.util.Properties[] prop,
java.lang.String parentId,
java.lang.String tobeselected,
java.lang.String panelkey)
parentId and selects the node tobeselected.
The user can add any number of nodes under a given parentparentId.prop - Property array of all nodes to be added.
Each property should contain the attributes of the particular node.
keys -> newleafs : id of the node.
TREE-NAME : the actual display name of the node on the tree
ICON-FILE : icon to be displayed for the node in the tree
like wise other properties and any of the user property also.
If the following attributes are not present in the properties object for any node
then
"newleafs" -- id of the treenode to be added
"TREE-NAME" -- Display name of the tree-node
"panelkey" -- The panelkey of the panel that is to be shown.
parentId - the parent Node ID under which the nodes are to be added.tobeselected - the node that is to be selected after adding the given node.panelkey - the key of the panel to be selected.
public static boolean addNodesToTree(java.util.Properties[] prop,
java.lang.String parentNodeId,
java.lang.String tobeselected,
boolean sync)
parentNodeId and selects the node tobeselected.
The user can add any number of nodes under a given parent.The prop array should contain the
propertis of all the nodes that are to be added. The parentNodeId is the id of the node
under which the nodes are to be added. The parameter sync is used to make calls to the server
synchronously or asynchronously.prop - Property array of all nodes to be added.
Each property should contain all the attributes of the particular node.
keys -> newleafs : id of the node.
TREE-NAME : the actual display name of the node on the tree
ICON-FILE : icon to be displayed for the node in the tree
like wise other properties and any of the user property also.
If the following attributes are not present in the properties object for any node
then
"newleafs" -- id of the treenode to be added
"TREE-NAME" -- Display name of the tree-node
"panelkey" -- The panelkey of the panel that is to be shown.
parentNodeId - the parent Node ID under which the nodes are to be added.tobeselected - the node that is to be selected after adding the given node.sync - This argument specifies whether the call to the server should be synchronous or not. The value true
specifies synchronous call else asynchronous.
public static void removeNodeFromTree(java.lang.String parent,
java.lang.String id)
id and whose parent is parent.parent - Id of the parent node of the node to be deleted.id - Id of the node to be removed.public static java.util.Properties getTreeNodeProperties(java.lang.String id)
id - The id of the nodenull if the node is not
present.
public static boolean removeTreeNode(java.lang.String nodeId,
java.lang.String tobeselected,
boolean sync)
nodeId. After removing the node,
the node that is passed as an argument to tobeselected will be selected. If the tobeselected node is not
present in the tree then the parent node of the deleted node will be selected.The parameter sync
specifies whether the call to the server should be synchronous or not.nodeId - The Id of the node to be deleted.tobeselected - The node that is to be selected after removing the node.sync - This argument specifies whether the call to the server should be synchronous or not. The value true
specifies synchronous else asynchronous.
public static java.lang.String addCustomView(java.lang.String moduleId,
java.lang.String parentNodeId,
java.util.Properties criteria,
java.util.Properties treeNodeProps,
boolean sync)
moduleId,
under the node whose id is parentNodeId. The criteria object contains the criteria for the
for the custom view like, the columns that should be present in the table, etc.
The properties of the tree node should be specified in the treeNodeProps parameter.
The sync parameter
should be set to true if the method should make synchronous call to the server. The method will return
only after the request gets processed by the server and reply comes back. If sync parameter
is set false, the method will return immediately after placing request to the server. In asynchronous
mode the return value true conveys the successful placement of request to the server and does not guarantee
addition of custom view.moduleId - Module refers to the type of custom view that is to be added.
Eg.Network Database, Events, Alerts etc.parentNodeId - The Id of the node under which the custom view is to be added.criteria - The criteria for the custom view. For example, if the custom view should contain only two
table columns then the criteria property can contain the key and value as treeNodeProps - The Property object that contains the tree node properties. If the custom view should be
displayed as "Test" then the property should contain the key
"TREE-NAME" "Test" sync - This parameter specifies whether the call to the server should be synchronous or not.
public static boolean addTreeNode(java.lang.String parentNodeId,
java.lang.String tobeselected,
java.util.Properties prop,
boolean sync)
parentNodeId. After adding the node, the
tobeselected node will be selected. The prop object should contain the properties of the node. The sync
parameter specifies whether the call to the server should be synchronous or not.parentNodeId - The id of the node under which a node is to be added.tobeselected - The id of the node that is to be selected after adding the node. If the specified node is
not present in the tree then the currently selected node in the Nms will be retained.prop - The properties of the node that is to be added. The properties object can contain the following keys.sync - This parameter specifies whether the call to the server should be synchronous or not.
public static boolean insertTreeNode(java.lang.String parentNodeId,
java.util.Properties prop,
java.lang.String tobeselected,
int nodeIndex,
boolean sync)
index under the given parentNodeId.
After inserting the node, the tobeselected node will be selected. The prop object should
contain the properties of the node. The parameter sync specifies whether the call to the server should
be synchronous or not.parentNodeId - The id of the node under which a node is to be added.tobeselected - The id of the node that is to be selected after adding the node. If the specified node is
not present in the tree then the currently selected node in the Nms will be retained.prop - The properties of the node that is to be added. The properties object can contain the following keys.nodeIndex - The index at which the node is to be inserted. The index starts from 0.sync - This parameter specifies whether the call to the server should be synchronous or not.public static java.util.Vector getMenuVector(java.lang.String panelKey)
panelKey - The key of the panel whose JMenus are required. Eg.EventBrowser, AlertApplet etc.setMenuVector(java.lang.String, java.util.Vector)
public static void setMenuVector(java.lang.String panelkey,
java.util.Vector menusVector)
menusVector to the panel whose key is
panelKey. The menusVector should be a vector containing JMenu.panelkey - The key of the panel. Eg.EventBrowser, AlertApplet etc.menusVector - The vector containing JMenus that should appear for the given panel.getMenuVector(java.lang.String)
public static boolean modifyCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
java.util.Properties criteria,
java.util.Properties treeNodeProps,
boolean sync)
CustomViewId and whose module is
moduleId.The new properties for the node should be given in the treeNodePropsargument.
The criteria object should contain the criteria for the custom view. The parameter sync specifies
whether the call to the server should be synchronous or not.moduleId - The Module under which the custom view was added.CustomViewId - The id of the custom view that is to be modified.criteria - This parameter specifies the criteria for the panel. For example, if only one column
is needed in the table, then the criteria object can contain the key and value as treeNodeProps - If tree node properties are to be modified, this object should contain the properties
of the tree node like "TREE-NAME", "TREE-POPUP-MENU","MENU-FILE-NAME","ICON-FILE" etc.sync - This parameter specifies whether the call to the server should be synchronous or not.
public static void removeNodeFromTree(java.lang.String[] nodeIds,
java.lang.String tobeselected,
boolean sync)
nodeIds[] from the tree.
The array should contain the Ids of the nodes.nodeIds - A String array that should contain the Ids of the nodes that are to be removed.tobeselected - The id of the node that is to be selected after removing the nodes. If the specified node is not
present, the currently selected node in the Nms will be retained.sync - This parameter specifies whether the call to the server should be synchronous or not.
public static boolean renameCustomView(java.lang.String CustomViewId,
java.lang.String newDisplayName,
java.lang.String tobeSelected)
newDisplayName and selects the tobeSelected node.CustomViewId - The id of the custom view which should be renamed.newDisplayName - The new name for the custom view.tobeSelected - The node that is to be selected after renaming the custom view.true if the custom view is renamed successfully else returns false
Returns false if the CustomViewId is invalid.
public static void selectTreeNode(java.lang.String nodeId,
boolean showPanel)
nodeId and changes the panel if
showPanel is set to true.nodeId - The id of the node that is to be selected.showPanel - If this parameter is true, then the specified node will be selected and its corresponding
panel will be shown. If it is false, then the node will be selected but its corresponding panel
will not be shown.
If the nodeId is invalid, then the node Adventnet will be selected.public static NmsPanel getNmsPanelInstance(java.lang.String panelKey)
panelkey. This method returns null when the corresponding
panel is not yet instantiated (when INIT_ON_STARTUP is set to false or when the panel is disposed)panelKey - The key for the panel whose instance is needed. Eg. AlertApplet, EventBrowser etc.panelKeyNmsPanelpublic static NmsPanel[] getAllPanelInstances(java.lang.String panelName)
panelName - The fully qualified class name whose instances are needed.
Eg. com.adventnet.nms.util.ImagePanelnull if the
panelName is invalid.NmsPanelpublic static XMLNode getXMLNode(java.lang.String nodeId)
nodeId.
Every node in the tree is an instance of XMLNode.nodeId - The id of the node whose XMLNode instance is needed.XMLNodepublic static javax.swing.JDesktopPane getDesktopPane()
public static javax.swing.JInternalFrame getInternalFrameFromNodeId(java.lang.String nodeId)
nodeId.nodeId - The id of the node whose internal frame reference is needed.public static javax.swing.JInternalFrame getInternalFrame(java.lang.String panelKey)
panelKey.panelKey - The key of the panel whose internal frame reference is needed. Eg.AlertApplet, EventBrowser etc.public static javax.swing.JFrame getDetachedFrameFromNodeId(java.lang.String nodeId)
nodeId - The id of the node whose JFrame instance is needed.null if the node id is invalid or the panel corresponding to the node id is not detached.public static javax.swing.JFrame getDetachedFrame(java.lang.String panelKey)
panelKey - The key of the panel whose JFrame instance is needed.null if the panelKey is invalid or the panel corresponding to the panelKey is not detached.public static void detachPanelFromNodeId(java.lang.String nodeId)
nodeId.
If the panel is not yet instantiated, the method will do nothing.nodeId - The id of the node whose panel is to be detached. If the panel is not yet instantiated,
the method will do nothing.public static void detachPanel(java.lang.String panelKey)
panelkey.
If the frame is already detached then it brings
the frame to front. If the panel is not yet instantiated, the method will do nothing.panelKey - The key of the panel that is to be detached.public static boolean isPanelInitializedFromNodeId(java.lang.String nodeId)
nodeId - The id of the nodepublic static boolean isPanelInitialized(java.lang.String panelKey)
panelKey - The key of the panel. Eg. AlertApplet, EventBrowser etc.
public static void setTheStatusOnLabel(java.lang.String panelKey,
java.lang.String text,
java.lang.String color)
panelKey - The key of the panel. Eg.AlertApplet, EventBrowser etc. If the panelKey is invalid the
method will do nothing.text - The text that should be displayed in the status bar.color - The background color of the status bar. The value is the RGB value of the color. Eg. "255-150-175"public static java.lang.String[] getTreeNodesCorrespondingToPanelKey(java.lang.String panelKey)
panelKey - The key of the panel.
public static boolean modifyTreeNode(java.lang.String nodeId,
java.lang.String tobeSelected,
java.util.Properties treenodeprops,
boolean overWrite)
nodeId. The treenodeprops argument
should contain the new properties of the tree node. The ID and parent of the node cannot be changed. If the parameter
overWrite is false the old properties will only be updated, i.e., the keys that are not
present in the newly given properties, but present in old properties will be retained. If this parameter is
true, then all the old properties of the tree node will be removed and the newly given properties will
be applied to the node.nodeId - The id of the node whose properties are to be modified.tobeSelected - The node that is to be selected after modifying the node.treenodeprops - The new properties for the node.overWrite - If true all the old properties for the node will be removed and new properties will be applied.
If this value is false, the old values will be retained for the keys that are not present in the new properties.
public static boolean moveTreeNode(java.lang.String nodeId,
java.lang.String newParent,
java.lang.String tobeselected,
int nodeIndex,
boolean sync)
nodeId under the specified newParnet
at the specified nodeIndex.
After moving the node the tobeselected node will be selected. The sync parameter specifies
whether the call to the server should be synchronous or not.nodeId - The id of the node that is to be moved.newParent - The id of the node under which the node is to be moved.tobeselected - The node that is to be selected after the node has been moved.nodeIndex - The index at which the node is to be placed. The index starts from zero.sync - This parameter specifies whether the call to the server should be synchronous or not.public static java.lang.String getCurrentNodeId()
public static java.lang.String addTemporaryCustomView(java.lang.String nodeId,
java.lang.String moduleId,
java.util.Properties criteriaProps,
java.util.Properties treeNodeProps,
boolean addToTree,
java.lang.String parentNodeId)
displayName whose module
is moduleId ,under the parent node whose ID is parentNodeId
, by Temporary Custom View it means that this custom view is accesible only to
the client in which it is created and it wouldn't disturb the other clients
But once this temporary custom view is saved it will be converted in to an permanent
custom view and thereafter it will be accesible to all the clients.
On successfull addition of the Custom View the focus will be
changed to the newly added Custom view in the Nms Tree.nodeId - ID of the Node over which the temporary custom view has to
to be created.This parameter is vaild only incase when the parameter
addToTree is set to false .You are required to pass a null
value if no node is existing in the tree for the given moduleid, so that
a new panel is opened without adding a node in the tree. But, if
null is passed for this parameter and if a node for the given moduleid
exists then, the temporary custom view gets created over that node.moduleId - Module refers to the type of Custom view
that is going to be added. Eg. Network Database, Events, Alerts etc.criteriaProps - The criteria for the custom view. For example, if the custom view
should contain only two table columns then the criteria property can contain the * key and value as treeNodeProps - The Property object that contains the tree node properties.
If the custom view should be displayed as "Test" then the property should
contain the key "TREE-NAME" "Test" addToTree - This is used to denote whether the temporary custom view
has to be added to the tree or whether it has to be created over another
existing custom view.if addToTree is true then the custom view
will be added to the tree under the node whose ID is parentNodeId .
if addToTree is false then it will
created over the customview corresponding to the nodeId .parentNodeId - The ID of the parent Custom View under which
which the new Custom View should be added. An invalid value will result in
the failure of this method call.This is not taken in to account when
addToTree is falsesaveTemporaryCustomView(java.lang.String)
public static boolean modifyTemporaryCustomView(java.lang.String moduleId,
java.lang.String CustomViewId,
java.util.Properties criteria,
java.util.Properties treeNodeProps)
CustomViewId whose module is moduleId ,
the new criteria properties of the custom view to be updated should be given in
criteriaProps and the new tree node properties of the temporary
custom view to be updated has to be given in treeNodeProps .
On successfull modification of the custom view the modified
Custom view will be selected in the Nms TreeCustomViewId - ID of the temporary custom view to be modifiedmoduleId - Module refers to the type of Custom view
that is going to be added. Eg. Network Database, Events, Alerts etc.criteria - The criteria for the custom view. For example, if the custom view
should contain only two table columns then the criteria property can contain the * key and value as treeNodeProps - The Property object that contains the tree node properties.
If the custom view should be displayed as "Test" then the property should
contain the key "TREE-NAME" "Test" public static boolean saveTemporaryCustomView(java.lang.String customViewId)
custViewId by which it
means that it has been converted to a permanent custom view .customViewId - ID of the temporary custom view to be modifiedaddTemporaryCustomView(java.lang.String, java.lang.String, java.util.Properties, java.util.Properties, boolean, java.lang.String)public static boolean removeTemporaryCustomView(java.lang.String cvId)
cvId .cvId - ID of the temporary custom view to be removed
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||