Hi Dave.
We are evaluating Tableau at the moment but I'm quite impressed at the online content. I've managed to answer pretty much all my queries. Getting the SDK up and running was relatively painless (especially as I'm not overly Java friendly).
I downloaded the Tableau API from
https://onlinehelp.tableau.com/current/ ... h%3D_____3
This page contains the links for the downloads. I downloaded "Tableau SDK for C/C++/Java (64-bit)" as I'm running 5.1.1 64bit Ebase.
I copied the 4 jar files from the 'Java' folder of the SDK download to 'C:\ebaseXi_5.1.0\UfsClient\IntegratedServer\ebasetest\WEB-INF\lib'
I added the Tableau Desktop bin folder ie 'C:\Program Files\Tableau\Tableau 9.3\bin\' into the path of my PC.
I compared the contents of 'bin' folder in the SDK download to the 'bin' folder of my Tableau Desktop and found most files existed; although they were subtly different ** todo check if the newer files should have been copied across.
I copied 3 dlls from the 'bin' folder of the SDK download to the Desktop 'bin' folder (TableauCommon.dll; TableauExtract.dll; TableauServer.dll)
A restart of Ebase then allowed me to use the Tableau SDK.
A simple script to create a TDE file (Tableau Data Extract). Rough and ready to prove the point
Code: Select all
importPackage(com.ebasetech.xi.api);
importPackage(com.ebasetech.xi.services);
importPackage(com.tableausoftware.common);
importPackage(com.tableausoftware.extract);
//https://onlinehelp.tableau.com/current/api/sdk/en-us/SDK/C++/html/index.html
var a = "START<br>";
try
{
a = a + "pre initialize";
ExtractAPI.initialize();
a = a + "<br>initialized";
var file = "c:/saj.tde";
var fn = services.file.existsFile(file);
if (fn == true)
{
services.file.deleteFile(file);
}
var TDEextract = com.tableausoftware.extract.Extract(file);
var tableDef = new TableDefinition();
a = a + "<br>defined tabledef";
tableDef.addColumn("rowID",Type.CHAR_STRING);
tableDef.addColumn("value",Type.DOUBLE);
a = a + "<br>defined tablecolumns";
var tbl = TDEextract.addTable('Extract',tableDef);
a = a + "<br>table added";
var newrow = com.tableausoftware.extract.Row(tableDef);
for (i=0;i<100;i++)
{
newrow.setCharString(0,'saj'+i);
newrow.setDouble(1,i);
tbl.insert(newrow);
a = a + ".";
}
TDEextract.close();
}
catch (e)
{
log(e);
a = a + "<br><br>## error --- " + e;
}
finally
{
ExtractAPI.cleanup();
event.getOwner().addErrorMessage(a);
}
A simple script to publish a data source (ie the TDE) to Tableau Server. Rough and ready to prove the point
Code: Select all
importPackage(com.ebasetech.xi.api);
importPackage(com.ebasetech.xi.services);
importPackage(com.tableausoftware.common);
importPackage(com.tableausoftware.server);
var a = '';
try
{
ServerAPI.initialize();
a = a + 'initialized<br>';
var sc = ServerConnection();
a = a + 'connected<br>';
sc.connect('[http://Tableauserver]','[user]','[password]','');
a = a + 'connected<br>';
sc.publishExtract('[c:/fileName.tde]','[user]','[DataSourceName]',true);
a = a + 'published<br>';
sc.disconnect();
a = a + 'disconnected<br>';
sc.close();
}
catch(e)
{
a = a + 'Error - ' + e + '<br>';
}
finally
{
ServerAPI.cleanup();
a = a + 'published<br>';
event.getOwner().addErrorMessage(a);
}
Thanks