sendPortletEvent examples
Using the Agile Service Manager custom tool functionality, you can send Agile Service Manager DASH portlet events to other DASH portlets, provided these subscribe to the types of events being sent. You use the sendPortletEvent helper function to define these portlet events. You can only send events to other DASH portlets if you are running Agile Service Manager within DASH, rather than in a direct-launch browser window.
Example 1: Topology Viewer and DASH Web Widget on same page
This event opens an internal personnel directory in the web widget for the clicked-on 'person' resource.
var address = 'http://adminsys:8080/staff?name=' + asmProperties.name;
var eventPayload = {
'name': 'http://ibm.com/TIP#DisplayURL',
'URL': address
};
asmFunctions.sendPortletEvent(eventPayload);
Example 2: Topology Viewer and Event Viewer on same page
This event updates the Netcool/OMNIbus Web GUI Event Viewer to display events where 'Node' matches the clicked resource name. It displays the Agile Service Manager Topology Viewer and Netcool/OMNIbus Event Viewer on the same page.
var whereClause = 'Node = \'' + asmProperties.name + '\'';
var eventPayload = {
name: "http://ibm.com/tip#NodeClickedOn",
payload: {
product: {
OMNIbusWebGUI: {
displaycontext: {
"filterName": "HostEvents",
"filterType": "user_transient",
"registerFilter": "true",
"sql": whereClause,
"forceOverwrite": "true",
"viewName": "Default",
"viewType": "global",
"dataSource": "OMNIBUS"
}
}
}
}
};
asmFunctions.sendPortletEvent(eventPayload);
Example 3: Event Viewer on it own page
This event updates the Netcool/OMNIbus Web GUI Event Viewer to display events where 'Node' matches the clicked resource name. It displays the Netcool/OMNIbus Event Viewer on its own page.
var whereClause = 'Severity > 2 and Node = \'' + asmProperties.name + '\'';
var eventPayload = {
name: "http://ibm.com/isclite#launchPage",
NavigationNode: "item.desktop.navigationElement.EventViewer",
switchPage: true,
payload: {
product: {
OMNIbusWebGUI: {
displaycontext: {
"filterName": "HostEvents",
"filterType": "user_transient",
"registerFilter": "true",
"sql": whereClause,
"forceOverwrite": "true",
"viewName": "Default",
"viewType": "global",
"dataSource": "OMNIBUS"
}
}
}
}
};
asmFunctions.sendPortletEvent(eventPayload);