EspressChart consists of several components: Chart Designer, Chart Viewer, EspressManager, and Chart API. Chart Designer is used to create charts in a GUI environment. Chart Viewer is a JNLP (More about Applets in JNLP: Section 2.6 - Run Applets in WebStart with JNLP file) that is used to view a chart (saved in .cht, .pac or.tpl format). Chart API is used to create charts programmatically. Scheduler is used to schedule exports for charts. Finally, EspressManager serves as a user administrator and handles data and data buffering.
Note that qblicense.jar
must be included in the CLASSPATH or in the HTML page as an archive (along with any other additional jars) in order to run any code.
While the Chart Designer must be used in conjunction with EspressManager, an option is provided for Chart Viewer and Chart API to work without connecting to EspressManager.
Connecting to EspressManager requires you to specify the information about how to connect to EspressManager. If EspressManager is running as an application, you can use API methods to specify the IP address/machine name where EspressManager is located and the port number EspressManager is listening on.
You use the following two API methods to set the connection information:
static void setServerAddress(java.lang.String address); static void setServerPortNumber(int port);
For example, the following lines of code:
Qbchart.setServerAddress("someMachine"); Qbchart.setServerPortNumber(somePortNumber);
will connect to EspressManager running on someMachine
and listening on somePortNumber
.
Please note that if EspressManager connection information is not specified, the code will attempt to connect to EspressManager on the local machine and listening to the default port number (22071).
If EspressManager is running as a servlet, you can use the following methods:
public static void useServlet(boolean b); public static void setServletRunner(String comm_url); public static void setServletContext(String context);
For example, the following lines of code:
Qbchart.useServlet(true); Qbchart.setServletRunner("http://someMachine:somePortNumber"); Qbchart.setServletContext("EspressChart/servlet");
will connect to EspressManager running at http://someMachine:somePortNumber/EspressChart/servlet
.
Please note that these methods exist in the QbChart
and QbchartDesigner
.
For Chart Viewer a JNLP (More about Applets in JNLP: Section 2.6 - Run Applets in WebStart with JNLP file), you can set the connection information to the EspressManager by passing in the following parameters:
server_address (server address), server_port_number (port number)
The above parameters are set if EspressManager is running as an application. If EspressManager is running as a servlet, the following parameters are used:
comm_protocol (servlet), comm_url (machine name/IP address and port number), servlet_context (servlet context)
Described, in sections below, are the various deployment scenarios that you may encounter and the consequences of each scenario.