MDX / JAVA Integration
JAVA classes are made available from icCube MDX expressions.
By default JAVA support is turned off. It can be activated via the _ javaMdxConfiguration _ section in the file icCube.xml. Once activated, the allowedPackage, allowedClass and allowedMethod defines the JAVA packages and classes that can be accessed via MDX.
Note that when exposing icCube to a wide/public audience we strongly advise either to keep JAVA support turned off and instead setup a thin wrapper library that is exposing explicitly JAVA methods as MDX functions (contact us for more information) or check carefully the allowed packages and classes.
The notation J!Package.Class.Method( ...) allows for accessing any JAVA static method or field from an MDX statement. Note that the conversion of the parameters (as well as the result) is handled automatically by the MDX engine. The following calculated member is computing the square root of PI using JAVA classes:
WITH MEMBER [Measures].[val] AS J!Math.sqrt( J!Math.PI )
As seen in the previous example, the fully qualified class name is not required. However, in case of ambiguities (i.e., the class is available in more than one package) then a part or the whole package can be specified:
J!java.Math.PI or J!java.lang.Math.PI
No specific configuration is required to access JAVA classes. All the classes accessible by the icCube server are potentially available. However if you need JAVA classes from JAR that are not available with icCube, simply add them to the icCube-install/lib directory and update accordingly the icCube.bat or icCube.sh files if you're using them (the icCube.exe file is going to use all the JARs available in the lib directory).
In order to be able to use the class names without having to specify the whole package names a repository of all the available classes is possibly built. This repository can be configured within the file $install/bin/icCube.xml using classRepositoryActive and classRepositoryPath).