I need to develop a Pentaho Dashboard with CDE, but my production environment doesn't have CDE installed and can't be installed. When developing a Dashboard with CDE we can see that 3 main pieces (files) are generated and can't be publish / executed in a CDF/CDA only Pentaho Server:
- *.wcdf: Description file containing the Name, Description and some other information.
- *.cdfde: Definition file containing all the elements, layout and styles of the dashboard.
- *.cda: Definition file of the CDA sources.
- Development Laptop with Pentaho 4.0.0 GA and latest CTools installed using the CTools Installer.
- Production Environment with Pentaho 4.0.0 GA and the latest relases of CDF and CDA.
After some tests I realized that it was not going to be as simple as I thought, and the main reason is that the charts used in CDE are CCC, but CCC is only available within CDE and not in CDF. Searching for a solution I found Pedro Alves' post about integrating CDE in CDF.
The Solution Phase 1
- Create a new Solution (Top level folder) in Pentaho User Console MyCompany, then create a new folder in the solution Dashboards and an aditional folder under that as files to have a directory structure like this:
<?xml version="1.0" encoding="UTF-8"?>
Notice that when executing the newly created dashboard, some problems are encountered:
- The Image and styles are not applied.
- If using a CCC Chart in the Dashboard, an error will pop Object type ccc***** can't be mapped to a valid class.
- Open the template.html and styles.css (or how you named it) in a text editor.
- Look for the tag that includes your stylesheet (In my case <link rel="stylesheet" type="text/css" href="res/MyCompany/Dashboards/files/styles.css?v=1314758846169" />), this tag is invalid because the resource is not valid within CDF scope, change it to something like this:
<link rel="stylesheet" type="text/css" href="GetCDFResource?resource=/MyCompany/Dashboards/files/styles.css" />
- Both in the stylesheet file (styles.css) and in the html file (template.html) replace any link wih the correct value using the GetCDFResource? entry type.
- url('sw_logo.jpg') will be changed to url('GetCDFResource?resource=/MyCompany/Dashboards/files/sw_logo.jpg')
- Follow the instructions in Pedro Alves' post about integrating CDE in CDF but instead of copying the files into any "random" location, create the following folder pentaho-solutions/pentaho-cdf/js/CCC and place there the files.
- Add the following lines at the top of the template.html file to include CCC into your dashboard:
- Refresh the Solution Repository and execute the modified Dashboard.
Please be aware that buy following this procedure, there is a change of deleting and changing some Pentaho system files/folders and can damage the installation so please create a backup and apply and test first in a Dev Environment.