Skip to main content

Adding an Amazon S3 Data Source

breaking changes

Currently, the Reveal SDK is in the process of decoupling the data sources from the Reveal SDK core package. In order to ensure the project's continued functionality, you might be required to install additional packages into your project. Please see the Supported Data Sources topic for more information.

Step 1 - Add an event handler for the RevealView.onDataSourcesRequested event.

var revealView = new $.ig.RevealView("#revealView");
revealView.onDataSourcesRequested = (callback) => {
//add code here
callback(new $.ig.RevealDataSources([], [], false));
};

Step 2 - In the RevealView.onDataSourcesRequested event handler, create a new instance of the RVS3DataSource object. Set the Title, Subtitle, and Region properties. After you have created the RVS3DataSource object, add it to the data sources collection.

revealView.onDataSourcesRequested = (callback) => {
var s3 = new $.ig.RVS3DataSource();
s3.title = "My S3 Server";
s3.subtitle = "Amazon S3";
s3.region = "region";

callback(new $.ig.RevealDataSources([s3], [], false));
};

When the application runs, create a new Visualization and you will see the newly created Amazon S3 data source listed in the "Select a Data Source" dialog.

note

The RVS3DataSource loads folders and files based on the authentication provider registered with the Reveal SDK. Amazon S3 authenticates using a RVAmazonWebServicesCredentials. See the Authentication topic for more information.

Get the Code

The source code to this sample can be found on GitHub