Integrator Scripting API
In Jedox Integrator, scripting languages could be used in the following components:
- Groovy functions and jobs
- JavaScript functions and jobs
- Variable definition (Groovy only)
Besides the functionality of the scripting language, Jedox Integrator provides several classes with additional functionality related to Jedox Integrator processing. The Java API Documentation for the ETL components is available online or as a download.
Examples for the use of script functions and jobs can be found in the sample Jedox Integrator projects sampleGroovyOlap.xml, sampleGroovyFunction.xml, sampleGroovyJob.xml, and ETLTasks.xml which are located in <Installpath/JedoxSuite/tomcat/webapps/etlserver/data/samples>).
In the sample GroovyJob you can find the Groovy job SendMail with the following script:
mailer = API.getMailer();
mailer.setServer();
/* for 2 recipients */
mailer.addRecipient("changeme@gmail.com");
mailer.addRecipient("changeme2@gmail.com");
mailer.setSubject("ETL Test Mail");
mailer.setMessage("Hello! here are the files.");
/* with 2 attachements */
mailer.addAttachment("FileToOlap.csv");
mailer.addAttachment("BikerOrderlines.csv");
mailer.send();
The following additional methods are also available:
Class LOG |
|
Void | debug (Object message) Adds a debug message to the log of the Jedox Integrator execution |
Void | error (Object message) Adds an error message to the log of the Jedox Integrator execution |
Void | info (Object message) Adds an info message to the log of the Jedox Integrator execution |
Void | warn (Object message) Adds a warning message to the log of the Jedox Integrator execution |
Class OLAP The connection refers to the name of the Jedox connection in the Jedox Integrator project. To get a complete API on cubes, dimensions, and elements, use method getDatabase(). With an object of type IDatabase, all methods of the OLAP Java Client Library (palojlib) are available. Package com.jedox.palojlib.interfaces.IDatabase is automatically imported. The Integrator sample project sampleGroovyOLAP.xml uses the APIs ICube.loadcell and ICube.loadcells. Cube.loadcell writes a single cell to an OLAP cube and has the advantage that this writing will be audited, if Audit is enabled for the given cube. Cube.loadcells can write several cells to an OLAP cube, but this writing will not be audited. Both APIs can be used on numeric and string cells and are described in Java API for OLAP (In-Memory DB) . |
To limit the authorizations of a script on the OS-level side (e.g. access to files and directories), change the OS user for the JedoxSuiteTomcatService, as described in the article Accessing Network Files.
Updated June 5, 2023