Search code examples
jsppentahosaiku

Modify pentaho home page button


I'm beginning to work with pentaho. On the PUC i'd like to change the "new report" and "new analysis" buttons and replace them with (respectively) "saiku reporting" and "saiku analytics"

For saiku analytics I found out how to do it I went in

\biserver-ce-4.8.0-stable\biserver-ce\tomcat\webapps\pentaho\mantle\launch\launch.jsp

And replace:

onClick="launch('launch_new_analysis', window.top.openAnalysis)"

with:

onClick="launch('saikuButton',function() {warning('Error opening Saiku
Ananlysis.')})"

It works fine but I can't find out how to do the same with saiku reporting

Thks a lot for your help


Solution

  • I found out the solution

    first I need to modify

    \biserver-ce\pentaho-solutions\system\saiku-adhoc\plugin.xml
    

    And add this

    <overlay id="launch" resourcebundle="../content/saiku-adhoc/web/saiku-adhoc.properties">
                <button id="saikuAHButton" image="../content/saiku-adhoc/web/images/src/adhoc_32.png"
                            command="openURL('Saiku Reporting','Saiku Reporting','content/saiku-adhoc/web/index.html?biplugin=true')"
                            label="saiku ad hoc label button" />
            </overlay>
    

    Just before the </overlays> Then I have to go to

    \biserver-ce\tomcat\webapps\pentaho\mantle\launch\launch.jsp

    And modify the "onclick new WAQR ..." to:

    <td align="center" class="smallButton"><button class="pentaho-button" id="button0" onclick="launch('saikuAHButton', function() {warning('error opening saiku ad-hoc reporting .')})">New saiku Ad-hoc report</button></td>
    

    I can do the same for the image just on the top of the button (because the image is also clickable):

    <td align="center" width="226" valign="bottom" class="largeGraphicButton"><img src="images/clr.gif" width="226" height="10"><br><a href="#" onClick="launch('saikuAHButton', function() {warning('error opening saiku ad-hoc reporting .')})"><img src="images/new_report.png" border="0"></a></td>
            <td valign="bottom" width="3" class="largeGraphicSpacer"><img src="images/clr.gif" width="3" height="11"></td>
            <td align="center" width="226" valign="bottom" class="largeGraphicButton"><img src="images/clr.gif" width="226" height="10"><br><a href="#" onClick="launch('saikuButton',function() {warning('Error opening Saiku Ananlysis.')})"><img src="images/new_analysis.png" border="0"></a></td>
    

    Now when I click on it I have direct access to saiku reporting and analysis, I just have to remove the shortcut for WAQR and analyzer on the menu (which will be easy) and I'm good