Sunday, January 24, 2010

Redirecting to dashboard upon login in Pentaho

The Community Dashboard Framework is undoubtedly one of the most significant community contribution to the Pentaho project, and it has attracted a lot of attention and questions about how best to use it as the primary interface to the Pentaho platform.

One question that comes up often is how to redirect the user to a dashboard, instead of the Pentaho User Console.

Generally, the use will invoke the Pentaho webapp by typing the following URL:
http://localhost:8080/pentaho

This results in the invocation of the script biserver-ce/tomcat/webapps/pentaho/index.jsp.

<html>
<head>
<title>Pentaho BI Platform</title>
< META HTTP-EQUIV="refresh" CONTENT="0;URL=./Home" >
</head>
<body>
</body>
</html>

A quick glance at this file reveals that the script redirects execution to the file biserver-ce/tomcat/webapps/pentaho/jsp/Home.jsp.

To redirect Pentaho to load a specific dashboard page instead of running Home.jsp, we change the index.jsp file in the webapps directory, as in the following example:

<html>
<head>
<title>Pentaho BI Platform</title>
<META HTTP-EQUIV="refresh" CONTENT="0;URL=/pentaho/content/pentaho-cdf/RenderXCDF?solution=mydashboard&path=/company&action=homedashboard.xcdf&template=companyview">
</head>
<body>
</body>
</html>

This loads the file
pentaho-solutions/mydashboard/company/homedashboard.xcdf
with the template companyview.

The Pentaho platform by default requires authentication before serving any content. If you haven't logged in, then you will first be directed to the login screen. Upon a succesful login, you will be directed to the dashboard.