About the Web Intelligence REST API Samples

The SDK samples described in the following table work with the following set of universes and documents:

  • Warehouse.unx, eFashion.unx, and eFashion.unv universes
  • [Raylight Sample Template] Change Source, [Raylight Sample Template] Empty, [Raylight Sample Template] Refresh, and [Raylight Sample Template] Schedule documents

You must deploy the LCMBIAR file included in the ZIP file in your CMS repository to be able to run the samples. The archive file is lcmbiar/RaylightSamples.lcmbiar. Once run, Web Intelligence documents are generated in the CMS repository and can be found under Documents/Folders/Web Intelligence Samples.

Class

Description

CreateAndSaveSample

Creates and saves an empty Web Intelligence document:

  • Creates a new empty document
  • Adds a data provider
  • Adds a query specification
  • Adds a report
  • Saves the document

The data provider and query specification are attached to the document and available for future use.

To display traces in the console, you can uncomment the line containing deleteDocument(newDocID).

ChartSample

Adds four charts to an existing document:

  • Refreshes the document (data provider/query specification)
  • Adds a cell used to display the title
  • Adds a column chart to the report
  • Adds a donut chart to the report
  • Adds a bar chart with its own data filter
  • Adds a surface chart with its own data filter
TableSample

Adds a table with seven columns to a document:

  • Refreshes the document with prompt values
  • Adds a cell used to display the title
  • Adds a vertical table to the report
  • Resizes the product column width as automatic
  • Adds alerters and a variable
  • Adds an empty column to the table and fills it with the variable
RefreshSample

Refreshes a document through different ways:

  • Refreshes without changes
  • Refreshes with changes: custom context & prompt
  • Cancels a refresh
ScheduleSample

Schedules a document through different ways:

  • Purges the document from its data and saves it
  • Schedules the document to the BI launch pad inbox
  • Schedules the document to an email address
  • Schedules the document to an FTP server
  • Schedules the document to a file system

Only the schedule to the BI launch pad does not require CMS server configuration.

FreeHandSQLSample

Uses the free-hand SQL data provider:

  • Creates an empty document
  • Renames the report
  • Checks if the connection is relational
  • Adds a free-hand SQL data provider using a custom query
  • Adds a cell title
  • Refreshes the data without any changes
  • Adds a chart using data from the free-hand SQL data provider
  • Adds an input control

You must know the database schema before using a custom query.

ChangeSourceSample

Changes the data source of an existing document:

  • Gets the suggested mapping to change source
  • Applies the suggested mapping without any changes

To edit the mapping and set up your own data objects, you can uncomment the line containing editMapping().

resources and util Packages

The com.sap.webi.raylight.samples.resources package contains XML descriptions used in sample requests, such as the query specification. The com.sap.webi.raylight.utils package provides classes that help to perform utility actions in the samples (for example, login, fill in CMS parameters, send a request, and so on). The com.sap.webi.raylight.param contains the parameters required for sample execution.