Setup and Configuration

    Prerequisites (Maven)

    Analytics Java SDK is distributed as a set of Maven modules. To work with the SDK libraries, you need to add a reference to Analytics's Maven Repository and also a dependency in your Maven pom.xml file.

    Add the following repository:

    <repositories>
      <repository>
        <id>reveal.public</id>
        <url>http://revealpackages.eastus.cloudapp.azure.com/repository/public</url>
      </repository> 
    </repositories>
    

    And the following dependency:

    <dependency>
      <groupId>com.infragistics.reveal.sdk</groupId>
      <artifactId>reveal-sdk</artifactId>
      <version>version_number</version>
    </dependency>
    

    Replace version_number with a number similar to 0.9.6.

    If you are not familiar with Maven, please refer to the following link.

    For Oracle Databases you need to add an extra repository and dependency

    Setup and Configuration (Generic Server)

    To integrate Analytics with any existing application, you need to follow these generic steps:

    1. Add a dependency to the existing app implementation.
    2. Add a dependency to Analytics SDK.
    3. Initialize Analytics.
    4. Enable server-side export

    If you are interested in configuring Tomcat or Spring, follow the links below:

    Step 1 - Adding a dependency to the app implementation

    Add a dependency to the existing application implementation, following the steps needed for the server of your preference.

    Step 2 - Adding a dependency to Analytics SDK

    Add a dependency to reveal-sdk and specify your SDK version.

    <dependency>
        <groupId>com.infragistics.reveal.sdk</groupId>
        <artifactId>reveal-sdk</artifactId>
        <version>version_number</version>
    </dependency>
    

    Replace version_number with a number similar to 1.0.1821.

    Step 3 - Initializing Analytics

    To initialize Analytics, you use AnalyticsEngineInitializer.initialize.

    It is possible to invoke the method without initial parameters:

    AnalyticsEngineInitializer.initialize();
    

    But most of the times, you will be using parameters as shown in the example below:

    AnalyticsEngineInitializer.initialize(
        new InitializeParameterBuilder()
            .setAuthProvider(new AnalyticsAuthenticationProvider())
            .setUserContextProvider(new AnalyticsUserContextProvider())
            .setDashboardProvider(new AnalyticsDashboardProvider())
            .setDataSourceProvider(new UpMediaDataSourceProvider())
            .setDataProvider(new UpMediaInMemoryDataProvider())
            .setMaxConcurrentImageRenderThreads(2)
            .setLicense("SERIAL_KEY_TO_BE_USED")
            .build());
    

    Those parameters, are the providers used to customize Analytics, you’ll need to create your own providers when integrating Analytics into your application.

    The available parameters passed to AnalyticsEngineInitializer.initialize are:

    • setAuthProvider. Here you should include a custom class that resolves authentication, implementing IRVAuthenticationProvider.
    • setUserContextProvider. Custom class that provides information about the user, implementing IRVUserContextProvider.
    • setDashboardProvider. Custom class that replaces or modifies a dashboard, implementing IRVDashboardProvider.
    • setDataSourceProvider. Custom class that replaces or modifies a data source, implementing IRVDataSourceProvider.
    • setDataProvider. Custom class that returns in-memory data for dashboards, implementing IRVDataProvider.
    • setLicense. Here you can configure the SDK license, by including the Serial Key.

    For further details about how implement your own Dashboard providers, please check our UpMedia samples in GitHub.

    Step 4 - Enabling server-side export

    The Java SDK uses some native components for exporting dashboards to different formats: Image, PDF, PPT and Excel.

    If you are interested in exporting server-side to one or more of those formats, please refer to Server-side Export Configuration

    Setup and Configuration (Client)

    To set up the Analytics Web Client SDK you need to:

    1. Check Dependencies.

    2. Reference the Web Client SDK.

    3. Instantiate the Web Client SDK.

    1. Checking Dependencies

    The Analytics Web Client SDK has the following 3rd party references:

    2. Referencing the Web Client SDK

    Enabling $.ig.AnalyticsView component in a web page requires several scripts to be included. These scripts will be provided as part of Analytics Web Client SDK.

    <script src="~/Analytics/infragistics.reveal.js"></script>
    

    JavaScript files can be found in "<InstallationDirectory>\SDK\Web\JS\Client".

    3. Instantiating the Web Client SDK

    Analytics’s Dashboard presentation is handled natively through the Web Client SDK.

    To get started follow these steps:

    1. Define a <div /> element with “id” and invoke the $.ig.AnalyticsView constructor.

      Note

      Hosting Client-Side and Server-Side Parts Separately If you want to host client-side and server-side parts on different servers, please read here before you continue to next step.

    2. Call $.ig.RVDashboard.loadDashboard providing the dashboardId and success and error handlers.

    3. In the success handler instantiate the $.ig.AnalyticsView component by passing a selector for the DOM element where the dashboard should be rendered into. Finally you should use the retrieved dashboard and set it to the dashboard property of the $.ig.AnalyticsView

    Sample Code

    <!DOCTYPE html>
    <html>
      <head>
        ⋮
        <script type="text/javascript">
          var dashboardId = "dashboardId";
    
          $.ig.RVDashboard.loadDashboard(
            dashboardId,
            function (dashboard) {
              var revealView = new $.ig.AnalyticsView("#revealView");
              revealView.dashboard = dashboard;
            },
            function (error) {
              //Process any error that might occur here
            }
          );
        </script>
      </head>
      <body>
        <div id="revealView" style="height:500px;" />
      </body>
    </html>
    

    Working with Oracle Database

    As said above, Analytics Java SDK is distributed as a set of Maven modules. To work with the SDK libraries, you need to add two references and dependencies in your Maven pom.xml file.

    Add the following repositories:

    <repositories>
      <repository>
        <id>reveal.public</id>
        <url>http://revealpackages.eastus.cloudapp.azure.com/repository/public</url>
      </repository> 
      <repository>
        <id>jeecg</id>
        <url>http://maven.jeecg.org/nexus/content/repositories/jeecg/</url> 
      </repository>
    </repositories>
    

    And the following dependencies:

    <dependencies>
      <dependency>
        <groupId>com.infragistics.reveal.sdk</groupId>
        <artifactId>reveal-sdk</artifactId>
        <version>version_number</version>
      </dependency>
      <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
        <version>10.2.0.5.0</version>
      </dependency>
    </dependencies>