Publishing a Mondrian 4 schema

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.

Getting ready

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.

How to do it…

Proceed with the following steps:

  1. In your filesystem, go to <Pentaho-installation-path>/server/biserver-ee/pentaho-solutions/system/ and open the olap4j.properties file with your favorite text editor.
  2. Add the following lines. However, you need change the file path for the Mondrian schema; in my case, it is /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=
  3. Save the file and restart the Pentaho BI server. If you open the Analysis Report, you should see the new data source.

How it works…

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset