PDA

View Full Version : Dashboard- session variables



billl
06-26-2006, 02:49 PM
I have deployed the application to JBoss Portal Server 2.2 using the Pentaho ant scripts. Pentaho components work in the samples.

For my own components, I run some system actions when a user logs on to the JBoss Portal. Their login id will be loaded in to a session variable to use as a filter against reports, cubes etc.

When I use this session variable to run a JasperReport, I get the expected output. However, when I try to use it with a Custom Dashboard the session value is not picked up.


portlet.xml node:
<portlet>
<portlet-name>TestPieChart</portlet-name>
<portlet-class>org.pentaho.ui.portlet.charting.PieDatasetChartPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>%TestPieChartTitle</title>
<subtitle>Simple Sample</subtitle>
</portlet-info>
<portlet-preferences>
<preference>
<name>chart</name>
<value>test/portal/test.pieChart.xml</value>
</preference>
<preference>
<name>drill-url</name>
<value></value>
</preference>
<preference>
<name>outer-params</name>
<value>test_merchant_number</value>
</preference>
<preference>
<name>inner-param</name>
<value></value>
</preference>
</portlet-preferences>
</portlet>


http://forums.pentaho.org/archived_att/files/test_piechart.xaction

Post edited by: billl, at: 06/26/2006 18:50

guzaldon
06-26-2006, 05:12 PM
Uhmm I see the problem.

You were not using an action input.


<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
<name>test_piechart.xaction</name>
<title>Transactions Piechart</title>
<version>1</version>
<logging-level>debug</logging-level>
<documentation>
<author/>
<description>Transactions Piechart</description>
<help/>
</documentation>

<inputs>
<test_merchant_number type="string">
<sources>
<session>test_merchant_number</session>
</sources>
</test_merchant_number>
</inputs>

<outputs>
<rule-result>
<type>list</type>
</rule-result>
</outputs>

<resources/>

<actions>
<action-definition>
<component-name>SQLLookupRule</component-name>
<action-type>rule</action-type>
<!-- DIFFERENT -->
<action-inputs>
<test_merchant_number type="string">
</action-inputs>
<action-outputs>
<rule-result type="list"/>
</action-outputs>
<component-definition>
<jndi>RMDDW</jndi>
<query> <![CDATA[
EXEC rmdsp_get_transactions_dashboard '{test_merchant_number}'
]]> </query>
</component-definition>
</action-definition>

</actions>
</action-sequence>

Try that out.
Not only do you have to take your input into the xaction but also pass it to your action components how less will it know to you use it.

Hope that helps,

Nic