In this recipe, we will show you how to publish the Mondrian 4 schema on the Pentaho BI server, making the schema available to the Analysis Report for data exploration.
Make sure you have the Mondrian 4 schema that was created in the previous recipes defined well. MongoDB must be started with the databases created in the previous chapter.
Proceed with the following steps:
<Pentaho-installation-path>/server/biserver-ee/pentaho-solutions/system/
and open the olap4j.properties
file with your favorite text editor./home/latino/git/pentaho-mongodb-cookbook/source code/chapter4/
. My MongoDB database has the username as root
, and the password is password
. If your database doesn't require authentication, you can remove it from the connectString
. Otherwise, if your database requires authentication, you can use the http://localhost:8080/pentaho/api/password/encrypt
endpoint to generate the encrypted password:cookbook.name=mongoDBPentahoCookbook cookbook.className=org.pentaho.platform.plugin.services.connections.PentahoSystemDriver cookbook.connectString=jdbc:mondrian4:Host=localhost;dbname=SteelWheels;DataServicesProvider=com.pentaho.analysis.mongo.MongoDataServicesProvider;Catalog=/home/latino/git/pentaho-mongodb-cookbook/source code/chapter4/MongoDBPentahoCookbook.mondrian.xml;username=root;password=ENC:cGFzc3dvcmQ=
As you notice, publishing a Mondrian 4 schema is much more manual than the Mondrian 3.x versions; you need to edit the olap4j.properties
file. The olap4j.properties
file consists of the Manage Data Sources of the BI server for Mondrian 4. In this file, we define the connections and the schema filesystem location. The connections are defined by a unique connection name with the following properties, with dot (.
) splitting:
name
: This property needs to match with the Mondrian schema name:<Schema name='Mondrian4MongoDBPentahoCookbook' quoteSql='false' missingLink='ignore' metamodelVersion='4.00'></Schema>
className
: This is the driver class name.connectString
: This is the olap4j connection string that contains the following properties:Host
: This is the MongoDB instance. In this example, it is the same machine, that's why we use localhost
.dbname
: This is the MongoDB database name. In this example, it is SteelWheels.DataServicesProvider
: This is the MongoDB native connection data service provider.Catalog
: This is the location of the MongoDB database in the filesystem. If you have the Mondrian schema in the Pentaho repository (based on JCR), you should start the JCR path with ":", for example, :/public
.username
: This is the username of MongoDB for the database. If the database doesn't need authentication, you can remove this property and the password property.password
: This is the MongoDB database password encrypted using the following password encryption endpoint: http://localhost:8080/pentaho/api/password/encrypt
.After we have the olap4j.properties
file changed correctly, we restart the server to apply those changes. In the Pentaho BI server, you can test the Mondrian schema by selecting Create New and then Analysis Report.