Set Up the Oracle Analytics Extension Development Environment on Windows

This topic describes the tasks you need to perform to set up and use your Oracle Analytics extension development environment.

Install Oracle Analytics Desktop on Windows

Oracle Analytics Desktop provides the scripts needed to create your development environment and extension skeletons, and a local test environment.

Install or upgrade to the latest version of Oracle Analytics Desktop.
  1. Go to Oracle Analytics Desktop Installation Download, click Download and log into your Oracle Cloud account.
  2. In the Oracle Software Delivery Cloud page, click Platforms and select Microsoft Windows x64.
  3. Review and accept the license agreement. Click the Oracle Analytics Desktop ZIP file to download it.
  4. Go to the download location on your computer, double-click the ZIP file, and double-click Oracle_Analytics_Desktop_<version>_Win.exe and perform the installation.
  5. Navigate to C:\Program Files\Oracle Analytics Desktop to confirm the installation.

Install Java JDK on Windows

Use a Java JDK version that is compatible with your Windows and processor. All examples in this chapter were developed with Java JDK 8u201.

  1. Open Command Prompt and enter this command to check if you have Java JDK installed:
    java -version
  2. If one or more Java JDK is installed, confirm one is compatible with your macOS and processor.
  3. If you need to install Java JDK, go to Java SE 8 Archive Downloads.
  4. Locate and download the JDK install file compatible with your Windows and processor.
  5. After the installation completes, open Command Prompt and enter this command to check that the Java JDK version you picked installed successfully:
    java -version

Set User Variables and Create a Development Directory on Windows

Create or modify the user variables required by the Oracle Analytics Desktop scripts. Then create the development directory to contain your development environment,

In this procedure, you create or update these required user variables:
  • PLUGIN_DEV_DIR - The location of your development directory, for example C:\PLUGIN_DEV_DIR.
  • DVDESKTOP_SDK_HOME - The location of your Oracle Analytics Desktop installation, for example C:\Program Files\Oracle Analytics Desktop\dvdesktop.
  • JAVA_HOME - The location of your JDK 1.8 installation, for example C:\Program Files\Java\jdk-1.8.
  • Path - The location of your Oracle Analytics Desktop bin directory, for example C:\Program Files\Oracle Analytics Desktop\tools\bin. This variable already exists in Windows. When you update it, make sure that you don't delete or modify any of the variable's existing paths.
  1. Open File Explorer, right-click This PC, and then click Properties. Click Advanced System Settings, and in the Advanced tab click Environment Variables.
  2. In Environment Variables, click New under User variables for <computer name>. In the New User Variable dialog, go to Variable name and enter the name of the variable, and then browse for or enter the directory location. See the list at the top of this task for variable name and value requirements. Click OK.
  3. In Environment Variables, under User variables for <computer name> click the Path variable, and then click Edit. Browse for or enter the location of your Oracle Analytics Desktop bin directory. Click OK.
  4. In the Environment Variables dialog, click OK.
  5. To create the development directory, open the Command Prompt and run this command:
    cd C:\
    mkdir $PLUGIN_DEV_DIR

Create the Extension Development Environment on Windows

After you configure user variables, you run the bicreateenv script to create the development environment that contains the resources you need to create extensions.

For information about the options available for running the script, see the script's command-line help, for example:
cd $PLUGIN_DEV_DIR
bicreateenv -help
  1. Open Command Prompt, and run the bicreateenv script to create the environment, for example:
    cd $PLUGIN_DEV_DIR
    bicreateenv
  2. In File Explorer, navigate to the directory that you created and confirm that its contents look like this:

  3. Optional: If you’re working behind a web proxy, open gradle.properties and add system properties that point to your proxy.
    Use the following example to set your gradle.properties:
    systemProp.https.proxyHost=www-proxy.somecompany.com
    systemProp.https.proxyPort=80
    systemProp.https.nonProxyHosts=*.somecompany.com|*.companyaltname.com

Create a Skeleton Extension on Windows

Use the bicreateplugin script to create an Oracle Analytics extension skeleton.

The bicreateplugin script uses the following syntax:
bicreateplugin viz -subType <subtypename> -id <com.company.yourVizName>

Where:

subType is the type of visualization extension you want to create. Valid values are basic, dataviz, and embeddableDataviz. Don't include subType when you create a workbook extension.

id is the name of the extension. The name you specify must be in this format: <com.company.yourVizName>.

For information about the extensions you can create when you run the bicreateplugin script, see Types of Oracle Analytics Extensions. The examples used in this topic show you how to create the dataviz and workbook skeleton extensions.
Running the script creates a folder in your PLUGIN_DEV_DIRECTORY environment. This folder contains the files that you use to develop the extension. The <extension_name>.js render method is the entry point where you can start writing code.
  1. In Command Prompt, run the bicreateplugin script in your development directory.
    cd $PLUGIN_DEV_DIR
    bicreateplugin viz -subType <subtypename> -id <com.company.yourVizName>
    This example shows how to create a dataviz skeleton extension:
    bicreateplugin viz -subType dataviz -id com.companyabc.helloviz 
    This example shows how to create a workbook skeleton extension:
    bicreateplugin workbook -id com.companyabc.helloworkbook
  2. In File Explorer, navigate to your development environment and extension directory, for example C:\PLUGIN_DEV_DIR\src\customviz, and confirm that a new folder was created and that its name matches the extension name you specified.
    This example shows a dataviz extension's directory:

    This example shows a workbook extension's directory:

Test Your Visualization and Workbook Extensions on Windows

Use Command Prompt to run Oracle Analytics Desktop in SDK mode to test your Oracle Analytics visualization and workbook extensions. Running Oracle Analytics Desktop in SDK mode opens Oracle Analytics Desktop in a browser.

For information about creating workbooks and adding visualizations to workbooks, see the Oracle Analytics product documentation section in Oracle Analytics Extension Development Resources.
You must build and package a workbook extension before you can upload it to Oracle Analytics Desktop to test it. See Build and Package an Extension.
  1. In Command Prompt, change to PLUG_IN_DEV_DIR and run this command to invoke Oracle Analytics Desktop in a browser:
    cd $PLUGIN_DEV_DIR
    ./gradlew run
  2. If after you run the command Oracle Analytics Desktop opens and then closes, you can use the Windows task bar to manually open Oracle Analytics Desktop in a browser.
    1. Go to the Windows task bar and click Show hidden icons. Locate and right-click the Oracle Analytics Desktop icon.
    2. Select Copy URL to Clipboard.

    3. In a browser, paste the copied URL and press Enter.
  3. To test a visualization extension:
    1. In Oracle Analytics Desktop, open or create a workbook.
    2. In the workbook's Data Panel, click Visualizations and scroll to the bottom of the Visualizations list to locate the Custom Visualizations section containing the custom visualizations you created.

  4. To test a workbook extension:
    1. In Oracle Analytics Desktop, click Navigator, and then click Console. Go to the Extensions and Enrichments section and click Extensions.
    2. Click Upload Extensions and browse for and select the workbook extension ZIP file. Click Open.
    3. In Oracle Analytics Desktop, open or create a workbook.
    4. In the Toolbar click Custom Workbook Extension to view a list of the workbook extensions and you uploaded to your instance.