Dashboard Listener API defines the start and end events of adding and deleting library components for users to get dashboard related information at the event and to use the information in their own application.
Event types
Basic Information
For detailed usages about the Dashboard Listener API, see JReport Javadoc com.jinfonet.web.modules.dashboard package in <install_root>\help\api
. Also, there is a sample implementation file DashboardListenerDemo.java in <install_root>\help\samples\APIDashboardListener
.
Different uses should have different implementations of the Dashboard Listener API. The implementations can be managed on the server by administrators. After a new implementation is imported to the server and enabled, it will be able to take effect immediately without restarting the server.
Besides, after an implementation is uploaded to the server, you can apply it in the URL which is used for running dashboards. The URL way has higher priority than the enabled implementation on the JReport Administration page.
To import and enable an implementation on the JReport Administration page:
See also Dashboard Listener panel in the JReport Server User's Guide for additional information.
To apply an implementation via URL:
To apply the dashboard listener via URL, append the key-value pair "jrd_dsh_listener=PackageName.ClassName" in the URL which is used for running dashboards.
For example, if you want your implemented class TestListener to take effect on a new created dashboard (not the target defined on the JReport Administration page), you can define it in the URL. Such URL will not affect the Dashboard Listener Table on the JReport Administration page.
http://localhost:8888/dashboard/app/entry/run.jsp?jrs.authorization=YWRtaW46YWRtaW4%3D&jrd_dsh_listener=com.jinfonet.TestListener&jrd_resext={"active":0,"reslst":[{"name":"/USERFOLDERPATH/admin/Dashboard1.dsh","ver":"-1"}]}