2.3. Starting EspressManager

Before ChartDesigner can be started, EspressManager must be running. In most cases, EspressManager should be started on the web server, but it is possible to use EspressChart on a stand-alone machine by running both EspressManager and ChartDesigner locally. The assigned IP number will be 127.0.0.1. This will create a log file <EspressChartInstallDir>/EspressManager.log, which can be used to monitor resource usage as well as diagnose problems. It is not necessary to install or start EspressManager on each ChartDesigner user machine.

To start EspressManager, run EspressManager.bat or EspressManager.sh file in the EspressChart root directory (this file is generated automatically during installation). For Windows installations, you can use program shortcuts that were added to Start menu or desktop, depending on the options that were specified during installation. EspressManager will then start automatically with default properties.

You can there also Add/delete/modify users.

"Manage Users" button can be used to add and remove user name and encrypted password in the config.txt file.

You can also configure EspressManager with your own settings using several arguments that have been provided. The argument starts with dash - followed by a command. No space is needed in each argument, but at least one space is required to separate different arguments.

You can enter these arguments in the command line when starting EspressManager and you can also edit the espressmanager.bat/espressmanager.sh file to add arguments.

-help

When you type -help, the EspressManager provides information on available arguments and their meaning. -h or -? can also be used to get the same online help information.

-log

When you type -log argument, a log file is created and all the client/server network information will be stored. An administrator can open the log file to evaluate each user's request. The log is saved as EspressManager.log.

-monitor:ON/OFF

When you specify -monitor argument, the EspressManager monitor appears as a graphic user interface that can be used to view the status as well as modify the EspressManager settings.

Click to view larger image

EspressManager Monitor

-runInBackground:ON/OFF

This argument allows you to specify whether to run EspressManager as a background process or not. Running as a background process eliminates user input for shutdown and allows EspressManager to be run from a script. In order to make this argument work properly, it should be used in conjunction with the -monitor:OFF argument. When running EspressManager this way, the only way to shut it down is to end the process.

-recordLimit:nn

This argument allows you to set a maximum limit for the number of records EspressManager will retrieve from a database when executing a query. Once the maximum is reached, EspressManager will stop running the query. This feature prevents users from retrieving more records than can be stored in memory, and prevents crashes due to out of memory errors.

-queryTimeout:sss

This argument allows you to specify a timeout interval in seconds for chart queries. Once the query execution time passes the timeout argument, EspressChart will abort the query. This feature prevents users from accidentally creating run-away queries.

-DBBuffer:nnn

If a database is being used as data source for a chart, you can choose to buffer both the database connection and the data used for the chart using this argument. The number of connections and queries that will be stored depends on the number specified in the DBBuffer argument from 1 to 999.

-DBCleanAll:ddhhmm

Data in the data source may be updated periodically. Therefore, when the data buffer options is used (i.e. DBBuffer has a non-zero value), you may want to refresh the buffer to get the latest data. The -DBCleanAll argument can be used to indicate a time period after which data is cleared from the buffer and fetched from the data source. The value of ddhhmm means dd days, hh hours and mm minutes. EspressManager also supports omitted format, meaning that it will translate the value with the assumption that the omitted digits are the higher digits. For example:

  • -DBCleanAll:101010 means clean the buffer every 10 days, 10 hours, and 10 minutes.

  • -DBCleanAll:1010 means clean the buffer every 10 hours and 10 minutes.

  • -DBCleanAll:10 means clean the buffer every 10 minutes.

This argument is invalid if the -DBCleanAll argument is set to 0 (i.e. always clean memory).

The refresh interval is printed when EspressManager is started.

-RequireLogin

This argument is used to apply security to ChartDesigner when it is launched via the API. Normally, when ChartDesigner is called via the API, there is no user authentication. This allows users to apply their own authentication to the programs, but it can also allow unauthorized users access to the server. To prevent this, users can turn on this argument (values are true/false) to force authentication for ChartDesigner when it is called from the API. With this argument turned on, every time a QbChartDesigner object is displayed, a correct username and password (defined in the config.txt file) must also be supplied via API method calls. For more information about calling ChartDesigner from the API, please see Section 10.5.6 - Calling Chart Designer from Chart API.

-QbDesignerPassword

This argument allows you to set password when the -RequireLogin argument is turned on. Instead of using a login from the config.txt file, you can set a specific password that must be supplied to the server via a method call when displaying a QbChartDesigner object. For more information about calling ChartDesigner from the API, please see Section 10.5.6 - Calling Chart Designer from Chart API.

-MaxRecordInMemory:nnn

This argument allows you to set the maximum number of records that should be allowed in memory. Unlike the record limit which stops the query, this feature will begin paging the data to temporary files in the system when the threshold is reached. The viewing/exporting of the chart will continue, but the data will be read from the paging files. This feature prevents the system from running out of memory when running charts.

-MaxCharForRecordFile:nnn

This argument allows you to set the maximum characters allowed per field in the paging file that is generated when record file storage is invoked. Any characters in a record in the data that are longer than this argument will be truncated in the finished chart.

-FileRecordBufferSize:nnn

This argument allows you to set the number of records that should be paged at a time when the record file storage is invoked. The size of the buffer affects performance, so the larger the buffer size, the faster the chart is generated.

-singleTableForDistinctParamValue

When you use -singleTableForDistinctParamValue argument, the parameter dialog for parameterized charts will be drawn differently. When you map a parameters to a database column, the distinct list will be drawn by running select distinct on the mapped field only. The default behavior (without this argument) will use the joins and conditions in the original query to constrain the distinct parameter list. For more information about parameterized queries, please see Section 4.2.2.2 - Parameterized Queries.

If you're running on Mac OS X and you selected to create aliases when installing, you will need to modify the espressmanager.app package to change the EspressManager settings. To do this, right-click (Ctrl+Click) on espressmanager.app and select Show Package Contents from the pop-up menu. Next, navigate to the Contents folder where you will see a file called Info.plist. Opening this file in a text editor adds the arguments to the lax.command.line.args under Java properties.

2.3.1. Starting EspressManager as a Servlet

In addition to running as an application process, EspressManager can be run as a servlet within an application server/servlet runner. In this environment, EspressManager uses http to communicate with the client instead of sockets. The advantage to this configuration is that EspressManager can share the same port as the application server which makes it easier to deploy from behind firewalls. In addition, users can perform remote administration when running EspressManager this way.

To deploy EspressManager as a servlet, complete the following steps. As an example, Tomcat is located at C:\Tomcat and EspressReport installed to C:\EC70

As an example, Tomcat is located at C:\Tomcat and EspressChart installed to C:\EC70

2.3.1.1. Tomcat settings

To link Tomcat installation with our product installation, access the file "C:/Tomcat/conf/server.xml", and add your code defining one or more product installations between the "Valve" and "Host" sections.

<context path="/ER70" docBase="/home/user/Quadbase/TomcatER/ER"><Manager pathname=""/></context>

2.3.1.2. Startup settings

For Windows operating systems

Access the folder "C:/Tomcat/bin," copy the file "startup.bat" and paste it in your chosen installation of EC. Then, open the file and edit code to direct the Tomcat startup file to the Tomcat installation folder.

set "CATALINA_HOME=C:\Tomcat"

For Linux operating systems

Create a startup.sh file in <EC install directory> and make it executable.

Type the following two lines into the newly created <EC install directory>/startup.sh file

EXECUTABLE="<path to tomcat>/bin/catalina.sh"exec "$EXECUTABLE" start "$@"

For example:

EXECUTABLE="/home/user/tomcat/bin/catalina.sh" exec "$EXECUTABLE" start "$@"

[Note]Note

The rest of this guide is the same for Windows and Linux.

2.3.1.3. File launch settings

To make changes in the launching files, first, select the "EspressChart.jsp" find the end of the file and find the commented lines, and remove the comments.

<!-- Use these params if running EspressManager as servlet <param name="comm_protocol" value="servlet"/> <param name="comm_url" value="<%=codebase%>"/> <param name="servlet_context" value="servlet"/> -->

These are the parameters for connecting to EspressManager servlet, "servlet_context" may need edit, for example, in Tomcat/conf/servlet.xml, you configure your application as "/EC70", the value will be "EC70/servlet".

In the next step, you will need to edit "designer.bat" or "designer.sh" and append the following parameter at the end of the file: "-servlet:http://your-server-ip:your-port/EC70/servlet". Please note that this parameter must be placed at the end of the file, as placing it anywhere else will result in the designer being treated as a Java parameter and not run as intended.

When running EspressManager as a servlet, all components that connect to EspressManager need to be modified to take this into account. This includes Chart Designer, Chart Viewer, and any application/servlet/JSP using the chart API. For more information about EspressChart deployment, please see Chapter 12 - Deployment.