Documentation
Search results

Bold BI Dashboards embedding in Java Servlet using Embedded SDK

A GitHub link has been provided to get the sample application, which demonstrates the rendering of the dashboard available on your Bold BI server. This is followed by steps to create a new embedding application in Java Servlet on your own.

NOTE: The best way to get started would be to read the Getting Started section of the documentation. The Getting Started guide provides you with enough information that you need to know before working on the sample.

Prerequisites

How to run the sample

  1. Please get the Java Servlet project from this link.

  2. Please ensure that you have enabled embed authentication on the embed settings settings page. If it is not currently enabled, please refer to the provided image or detailed instructions to enable it.

    Embed Settings

  3. To download the embedConfig.json file, please follow this link for reference. Additionally, you can refer to the image below for visual guidance.

    EmbedSettings image EmbedConfig Properties

  4. Please copy the downloaded embedConfig.json file and paste it into the designated location within the application. Make sure that you have placed it correctly in the application, as shown in the image.

    EmbedConfig image

    ServerUrl Dashboard Server BI URL (ex: http://localhost:5000/bi, https://demo.boldbi.com/bi)
    SiteIdentifier For the Bold BI Enterprise edition, it should be like site/site1. For Bold BI Cloud, it should be an empty string.
    UserEmail UserEmail of the Admin in your Bold BI, which would be used to get the dashboard list.
    EmbedSecret Get your EmbedSecret key from the Embed tab by enabling the Enable embed authentication in the Administration page
    Environment Your Bold BI application environment. (If it is a cloud analytics server, use `BoldBI.Environment.Cloud`; if it is your server, use `BoldBI.Environment.Enterprise`)
    DashboardId Item ID of the dashboard to be embedded in your application.
    ExpirationTime Token expiration time. (In the EmbedConfig.json file, the default token expiration time is 10000 seconds)
  5. Import the Java Servlet project in Eclipse.

  6. Run the project by Right‑clicking it then Run As → Run on Server.

How this sample works

  1. The embedSample method will be invoked based on the configured embedConfig values in the index.jsp file. render dashboard

  2. Before rendering, call the BoldBI.do, which redirects to the token generation action in the BoldBI.java. This action generates the access token using the provided embedDetails. Get Embed Details

  3. Once the token is generated, it will be returned to the index.jsp file and the dashboard will start to render it.