Customising the Pentaho User Console – Part 4.
Posted under BI Server, Open Source, Pentaho, Tutorials, User Console
This post is part 4 of the series “Customising the Pentaho User Console (PUC)” Version 3.5.x. Here is a list of what I have covered in other parts:
- Login page and dialog
- Messages
- Main toolbar, menu bar and logo panel
- Launch page (covered in this post)
In this post I will show you how to customise the launch page.
The Launch Page
The launch page is the default page that is displayed when you log into the PUC, below is a screenshot of the launch page:
launch.jsp
The contents of the launch page are generated by the launch.jsp file which is located under the tomcat/webapps/pentaho/mantle/launch/ directory, the images which are used for the launch page are located under the tomcat/webapps/pentaho/mantle/launch/images directory.
The contents of the launch.jsp are:
<%@ taglib prefix='c' uri='java.sun.com/jstl/core'%><%@ page language="java" import="java.io.InputStream, java.util.Locale, java.util.PropertyResourceBundle, java.util.ResourceBundle, java.util.regex.Pattern, java.util.regex.Matcher, org.pentaho.platform.util.messages.LocaleHelper, org.pentaho.platform.api.engine.IPentahoSession, org.pentaho.platform.api.engine.IPluginManager, org.pentaho.platform.api.repository.ISolutionRepository, org.pentaho.platform.engine.core.system.PentahoSystem, org.pentaho.platform.engine.core.system.StandaloneSession, org.pentaho.platform.util.logging.Logger, org.pentaho.platform.web.jsp.messages.Messages, org.pentaho.platform.web.http.PentahoHttpSessionHelper, org.apache.commons.lang.StringEscapeUtils"%> <% /* * Copyright 2006 Pentaho Corporation. All rights reserved. * This software was developed by Pentaho Corporation and is provided under the terms * of the Mozilla Public License, Version 1.1, or any later version. You may not use * this file except in compliance with the license. If you need a copy of the license, * please go to www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho * BI Platform. The Initial Developer is Pentaho Corporation. * * Software distributed under the Mozilla Public License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to * the license for the specific language governing your rights and limitations. * * @created Jul 23, 2005 * @author James Dixon * */ %> <%@page import="org.pentaho.ui.xul.XulOverlay"%> <%@page import="org.pentaho.platform.api.engine.IPluginManager"%><html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title><%=Messages.getString("UI.PUC.LAUNCH.TITLE")%></title> <style type="text/css"> <!-- body { color: #000000; background-color: #FFFFFF; margin: 0px; } p { margin: 0px; padding: 0px; } A:link,A:visited,A:hover { color: #7e932f; text-decoration: underline; } A:hover { color: #ca6333; text-decoration: underline; } .launchPanel { background-color: white; background-image: url(images/quicklaunch_bg.png); background-repeat: no-repeat; background-position: center; height: 100%; } .ql_container { width: 620px; margin-bottom: 50px; } .ql_icon_bar_left { width: 41px; height: 147px; vertical-align: top; padding-top: 25px; } .ql_icon_bar_middle { background-image: url(images/ql_icon_bar_middle.png); background-repeat: repeat-x; width: 100%; height: 199px; } .ql_icon_bar_right { width: 41px; height: 147px; vertical-align: top; padding-top: 25px; } .ql_spacer { width: 20px; } .ql_btn { width: 167px; } .ql_btn_left { width: 41px; height: 56px; } .ql_btn_middle { background-image: url(images/ql_btn_middle.png); background-repeat: repeat-x; width: 100%; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 1.25em; line-height: 20px; font-weight: 300; text-align: center; vertical-align: top; white-space: nowrap; padding-top: 5px; } .ql_btn_right { width: 41px; height: 56px; } .ql_btn_left_hover { width: 41px; height: 56px; } .ql_btn_middle_hover { background-image: url(images/ql_btn_middle_hover.png); background-repeat: repeat-x; width: 100%; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 1.25em; line-height: 20px; font-weight: 300; text-align: center; vertical-align: top; white-space: nowrap; padding-top: 5px; } .ql_btn_right_hover { width: 41px; height: 56px; } .ql_new_report { width: 120px; height: 130px; padding-bottom: 13px; cursor: pointer; } .ql_new_analysis { width: 120px; height: 130px; padding-bottom: 13px; cursor: pointer; } .ql_manage { width: 120px; height: 130px; padding-bottom: 13px; cursor: pointer; } .ql_logo { width: 290px; height: 91px; padding-bottom: 30px; } .button { cursor: pointer; width: 167px; padding: 0px; spacing: 0px; height: 56px; } .btn_left { background-image: url("images/ql_btn_left.png"); background-repeat: no-repeat; height: 56px; width: 22px; } .btn_right { background-image: url("images/ql_btn_right.png"); background-repeat: no-repeat; height: 56px; width: 22px; } .btn_center { background-image: url(images/ql_btn_middle.png); background-repeat: repeat-x; width: 100%; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 1.25em; line-height: 20px; font-weight: 300; text-align: center; vertical-align: top; white-space: nowrap; padding-top: 5px; } .btn_left_hover { background-image: url("images/ql_btn_left_hover.png"); background-repeat: no-repeat; height: 56px; width: 22px; } .btn_right_hover { background-image: url("images/ql_btn_right_hover.png"); background-repeat: no-repeat; height: 56px; width: 22px; } .btn_center_hover { background-image: url(images/ql_btn_middle_hover.png); background-repeat: repeat-x; width: 100%; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 1.25em; line-height: 20px; font-weight: 300; text-align: center; vertical-align: top; white-space: nowrap; padding-top: 5px; } --> </style> <script type="text/javascript"> Button = function(label, container){ var btn = document.createElement("input"); btn.setAttribute("type","button"); table = document.createElement("table"); document.getElementById(container).innerHTML=""; document.getElementById(container).appendChild(table); table.setAttribute("cellpadding","0"); table.setAttribute("cellspacing","0"); table.setAttribute("border","0"); table.className="button"; table.setAttribute("height","56"); table.setAttribute("width","167"); table.cellSpacing = "0px"; table.cellPadding = "0px"; var tbody = document.createElement("tbody"); var tr = document.createElement("tr"); var left_td = document.createElement("td"); left_td.className="btn_left"; left_td.innerHTML = "<img src="/img/spacer.gif"> ; tr.appendChild(left_td); var center_td = document.createElement("td"); center_td.setAttribute("width","100%"); center_td.className="btn_center"; center_td.onselectstart=function(){return false;} center_td.style.MozUserSelect='none'; center_td.innerHTML = label; tr.appendChild(center_td); var right_td = document.createElement("td"); right_td.innerHTML = "<img src="/img/spacer.gif"> ; right_td.className="btn_right"; tr.appendChild(right_td); tbody.appendChild(tr); table.appendChild(tbody); table.onmouseover=function(){ window.selectedButton = this; left_td.className="btn_left_hover"; right_td.className="btn_right_hover"; center_td.className="btn_center_hover"; }; this.reset = function(){ left_td.className="btn_left"; right_td.className="btn_right"; center_td.className="btn_center"; } table.onmouseout = this.reset; this.onClick=function(onClick){ if(window.parent && window.parent.mantle_initialized){ table.onclick = function(){eval("window.parent." + onClick)}; } }; } window.onresize = function(){ if(window.selectedButton){ window.selectedButton.onmouseout(); } // IE_6_FIX: When resized by PUC, IE will display rendering issues. This is accounted for by the code below. if(window.isIE6){ // IE6 has a rate limit on the number of resize events that it will fire. This means we cannot rely on the // resize event alone to determine when the reisize is complete. The timer ensures that the layout is // recomputed after PUC is done resizing the br. setTimeout(function(){ window.tableWrapperDiv.style.top = "1px"; window.tableWrapperDiv.style.top = "0px"; }, 350); } } function loader(){ // IE_6_FIX: We're using a CSS filter to enable transparany in IE 6. This has the side-effect of trapping mouse events in the // filtered area. The standard workaround is to wrap that area in two divs, one absolutely positioned inside a relative one. var navAgent = window.navigator.userAgent; window.isIE6 = false; var reg = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navAgent) if (reg != null) { var version = parseFloat( RegExp.$1 ); window.isIE6 = version >= 6.0 && version < |