Frage

I am developing spotfire data source and using this, my datasource is going to get data from multiple URL's. For each URL I have to create a table in spotfire. Could you please show me some code to achieve this.

War es hilfreich?

Lösung

First, note that a single data source object can only produce a single table. That is, you cannot "hardcode" a list of URLs in your DataSource class. However, you can supply a single URL as parameter and require your user of the Spotfire Professional Client to enter the URL when he creates the data table (e.g., by clicking File -> Add Data Table) and have him/her do that multiple times.

The important step in implementing this is to make Spotfire aware of the information supplied as a parameter and make this information serializable (Spotfire Prof. has to store it somewhere in the DXP after all). You do this by writing a "PromptModel" class, registering together with the associated View (the form that will be displayed to the user to prompt for the URL), and then doing some wiring (registering, implementing the right constructor, etc.).

The example that you linked glances over this stuff unfortunately (you see some comments saying "Not shown..."). However if the Spotfire SDK (TIB_spotfdev*.zip), you'll find a more extensive example called "SpotfireDeveloper.CustomDataSourceExample" that takes care of all these steps.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top