Class OlapAPI
java.lang.Object
com.jedox.etl.core.scriptapi.ScriptAPI
com.jedox.etl.components.scriptapi.BaseAPI
com.jedox.etl.components.scriptapi.OlapAPI
- All Implemented Interfaces:
com.jedox.etl.core.scriptapi.IPropertiesAware,com.jedox.etl.core.scriptapi.IScriptAPI
Use with binding
OLAP to work with Jedox OLAP databases.
getDatabase(String) opens a connection to the OLAP server and
returns an IDatabase object to access the database configured in a
JedoxOlap connection in an Integrator project.
Example in Groovy to add a new cube Cube with two dimensions A and B to database Sample:
db = OLAP.getDatabase("Sample"); dimA = db.addDimension("A"); dimB = db.addDimension("B"); cube = db.addCube("Cube", [dimA, dimB] as IDimension[]);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the cell value of a cube in a database referenced by a JedoxOlap connection.voidRenames a list of elements of a dimension in a database referenced by a JedoxOlap connection.voidRenames a single element of a dimension in a database referenced by a JedoxOlap connection.getConnection(String connection) Opens a connection to the OLAP server from a JedoxOlap connection.getDatabase(String connection) Opens a connection to the OLAP server from a JedoxOlap connection and returns anIDatabaseobject for the database of the JedoxOlap connection.Methods inherited from class com.jedox.etl.components.scriptapi.BaseAPI
clearProperties, getComponentName, getConfigSetting, getConfigSetting, getGlobalConnections, getLocalFilesDir, getProjectName, getProperty, setPropertyMethods inherited from class com.jedox.etl.core.scriptapi.ScriptAPI
getDefaultImports, getExtensionPoint, getParameters, setAPIDescriptor
-
Constructor Details
-
OlapAPI
public OlapAPI()
-
-
Method Details
-
getConnection
public IConnection getConnection(String connection) throws com.jedox.etl.core.component.ETLRuntimeException Opens a connection to the OLAP server from a JedoxOlap connection. Use the returnedIConnectionto manage databases on this server.This connection will be closed automatically At the end of the Integrator execution.
To access the database in a JedoxOlap connection, use
getDatabase(String)directly instead ofgetConnection(String)and thenIConnection.getDatabaseByName(String).- Parameters:
connection- name of a JedoxOlap connection in the Integrator project- Returns:
- an
IConnectionto access the open connection - Throws:
com.jedox.etl.core.component.ETLRuntimeException- if an error occurs and log level is set to"OFF", otherwise the error is logged with the configured level (ERRORby default)
-
getDatabase
public IDatabase getDatabase(String connection) throws com.jedox.etl.core.component.ETLRuntimeException Opens a connection to the OLAP server from a JedoxOlap connection and returns anIDatabaseobject for the database of the JedoxOlap connection.This connection will be closed automatically At the end of the Integrator execution.
- Parameters:
connection- name of a JedoxOlap connection in the Integrator project- Returns:
- an
IDatabaseto access the database - Throws:
com.jedox.etl.core.component.ETLRuntimeException- if an error occurs and log level is set to"OFF", otherwise the error is logged with the configured level (ERRORby default)
-
data
public Object data(String connection, String cube, String[] coordinates) throws com.jedox.etl.core.component.ETLRuntimeException Returns the cell value of a cube in a database referenced by a JedoxOlap connection.- Parameters:
connection- name of a JedoxOlap connection in the Integrator projectcube- name of the cubecoordinates- list of dimension elements to reference the cube cell- Returns:
- cube cell value
- Throws:
com.jedox.etl.core.component.ETLRuntimeException- if an error occurs and log level is set to"OFF", otherwise the error is logged with the configured level (ERRORby default)
-
erename
public void erename(String connection, String dimension, String oldName, String newName) throws com.jedox.etl.core.component.ETLRuntimeException Renames a single element of a dimension in a database referenced by a JedoxOlap connection.- Parameters:
connection- name of a JedoxOlap connection in the Integrator projectdimension- name of the dimensionoldName- name of the dimension element to renamenewName- new name of the dimension element- Throws:
com.jedox.etl.core.component.ETLRuntimeException- if an error occurs and log level is set to"OFF", otherwise the error is logged with the configured level (ERRORby default)
-
erename
public void erename(String connection, String dimension, String[] oldNames, String[] newNames) throws com.jedox.etl.core.component.ETLRuntimeException Renames a list of elements of a dimension in a database referenced by a JedoxOlap connection.- Parameters:
connection- name of a JedoxOlap connection in the Integrator projectdimension- name of the dimensionoldNames- array of element names of the dimensionnewNames- array of the new element names of the dimension- Throws:
com.jedox.etl.core.component.ETLRuntimeException- if an error occurs and log level is set to"OFF", otherwise the error is logged with the configured level (ERRORby default)
-