Skip to main content

Configuring a Tomcat Server

Install

The steps below describe how to install the Reveal SDK into an existing Tomcat application.

1 - Update the pom.xml file.

First, add the Reveal Maven repository.

pom.xml
<repositories>
<repository>
<id>reveal.public</id>
<url>https://maven.revealbi.io/repository/public</url>
</repository>
</repositories>

Next, add the Reveal SDK as a dependency.

pom.xml
<dependency>
<groupId>com.infragistics.reveal.sdk</groupId>
<artifactId>reveal-sdk</artifactId>
<version>1.3.0</version>
</dependency>

2 - Add a JAX-RS Dependency

Add a dependency to a Jakarta RESTful Web Services (JAX-RS) implementation. You can choose between multiple options like Jersey, RESTeasy, Apache CXF, etc. Please follow the steps described by the provider of your preference.

As an example, here the dependencies you need to add for Jersey:

<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.32</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
<version>2.32</version>
</dependency>

3 - Create a ServletContextListener class and initialize the Reveal SDK by calling the RevealEngineInitializer.initialize method.

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import com.infragistics.reveal.engine.init.RevealEngineInitializer;

@WebListener
public class RevealServletContextListener implements ServletContextListener {

@Override
public void contextDestroyed(ServletContextEvent ctx) {

}

@Override
public void contextInitialized(ServletContextEvent ctx) {

//initialize Reveal
RevealEngineInitializer.initialize();
}
}

Export

In order to export dashboards to an Image (either programmatically or through user interaction) the Reveal SDK uses Playwright. For exporting dashboards to Excel, PDF or PowerPoint the Reveal SDK uses an internal application called ExportTool.

By default, the first time an end-user tries to export a dashboard to an image, PDF or PowerPoint, both Playwright and ExportTool trigger the required downloads automatically. However, for some platforms there are some dependencies that need to be installed in advance, and also your server environment might restrict external downloads and you might need to setup these tools manually.

Playwright Configuration

Playwright will try to download the required binaries, but if manual configuration is required you can check Playwright documentation.

macOS Dependencies

The only required library for macOS is libgdiplus. Installation Instructions

Linux Dependencies

There are dependencies to multiple native libraries in Linux. The exact list of dependencies you need to install depends on the distribution used, the version, and list of packages previously installed.

Below there's a list of libraries needed for a basic Ubuntu 18.0.4 distribution:

sudo apt-get update

sudo apt-get install -y libgdiplus\
libatk1.0-0\
libatk-bridge2.0-0\
libxkbcommon0\
libxcomposite1\
libxdamage1\
libxfixes3\
libxrandr2\
libgbm1\
libgtk-3-0\
libpango-1.0-0\
libcairo2\
libgdk-pixbuf2.0-0\
libatspi2.0-0

sudo apt-get install -y --no-install-recommends xvfb
note

If needed, you can get more information about missing libraries from errors included in the log file.

If using Ubuntu, you must install the Chromium dependencies using Maven.

mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install-deps chromium"

For other environments, the following dependencies may be required:

sudo apt-get install -y --allow-unauthenticated libc6-dev
sudo apt-get install -y --allow-unauthenticated libx11-dev

ExportTool Manual Setup

The instructions below are required only in the following scenarios:

  • You're having issues with the automatic download mechanism
  • You want to have everything pre-installed in advance.

Step 1 -Download the required binaries for your platform: Windows, Linux, or macOS.

Step 2 - Unzip the file to a directory in your server, where your Web Application is running (your user should be able to access that directory).

Step 3 - After extracting the zip file, you can get the ExportTool at this location: <dir>/<version>/<arch>/ExportTool, for example:

<dir>/1.0.0/linux-x64/ExportTool.

Step 4 - While initializing Reveal, set the directory where you extracted the zip file. Should be similar to the following code snippet:

String exportToolDir = "<dir>";
RevealEngineInitializer.initialize(new InitializeParameterBuilder().
setExportToolContainerPath(exportToolDir).
build());

Alternatively, you can specify the directory through the system property reveal.exportToolContainerPath, as shown below:

java -Dreveal.exportToolContainerPath=<dir> -jar target/upmedia-backend-spring.war