PDA

View Full Version : querycomponent cdf 3.2



j_nep
09-01-2009, 07:25 AM
Hi

I was testing QueryComponent from CDF 3.2 and I had to replace in QueryComponent code from CoreComponents
object.result = json.values;
by object.result = json;
to make it works, because result was shown as undefined.

pmalves
09-01-2009, 07:44 AM
Hum.. no.

Seems to me that you're using an old version of jtable.xaction, did you upgrade correctly?

j_nep
09-01-2009, 08:37 AM
I think I have the correct one. I just download cdf 3.2 and compare with jtable.xaction from my solution with cdf 3.2..

It's this one:


<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
<title>Jtable</title>
<version>1</version>
<logging-level>ERROR</logging-level>
<documentation>
<author/>
<description>Empty blank action sequence document</description>
<help/>
<result-type/>
<icon/>
</documentation>

<inputs>
<QUERY type="string">
<sources>
<request>query</request>
</sources>
<default-value/>
</QUERY>
<CATALOG type="string">
<sources>
<request>catalog</request>
</sources>
<default-value/>
</CATALOG>
<JNDI type="string">
<sources>
<request>jndi</request>
</sources>
<default-value/>
</JNDI>
<CUBE type="string">
<sources>
<request>cube</request>
</sources>
<default-value/>
</CUBE>
<ROLE type="string">
<sources>
<session>role</session>
</sources>
<default-value/>
</ROLE>
<QUERY_TYPE type="string">
<sources>
<request>queryType</request>
</sources>
<default-value>mdx</default-value>
</QUERY_TYPE>
</inputs>

<outputs>
<results type="string">
<destinations>
<response>content</response>
</destinations>
</results>

</outputs>

<actions>

<actions>
<condition><![CDATA[QUERY_TYPE == "mdx"]]></condition>
<action-definition>
<component-name>MDXLookupRule</component-name>
<action-type>Query MDX</action-type>
<action-inputs>
<CATALOG type="string"/>
<JNDI type="string"/>
<QUERY type="string"/>
<CUBE type="string"/>
<ROLE type="string"/>
</action-inputs>
<action-resources/>
<action-outputs>
<query-results type="result-set" mapping="query_result"/>
</action-outputs>
<component-definition>
<location><![CDATA[mondrian]]></location>
<query>{QUERY}</query>
<jndi>{JNDI}</jndi>
<cube>{CUBE}</cube>
<role>{ROLE}</role>
<catalog>{CATALOG}</catalog>
</component-definition>
</action-definition>
</actions>

<actions>
<condition><![CDATA[QUERY_TYPE == "sql"]]></condition>
<action-definition>
<component-name>SQLLookupRule</component-name>
<action-type>Relational</action-type>
<action-inputs>
<QUERY type ="string"/>
<JNDI type="string"/>
</action-inputs>
<action-outputs>
<query-results type="result-set" mapping="query_result"/>
</action-outputs>
<component-definition>
<jndi>{JNDI}</jndi>
<live><![CDATA[false]]></live>
<query>{QUERY}</query>
</component-definition>
</action-definition>
</actions>

<action-definition>
<component-name>JavascriptRule</component-name>
<action-type>JavaScript</action-type>
<action-inputs>
<query_result type="result-set"/>
<QUERY_TYPE type="string"/>
</action-inputs>
<action-outputs>
<results type="string"/>
</action-outputs>
<component-definition>
<script><![CDATA[// MDX to Relation result set, needed for the

var values = new Packages.org.json.JSONArray();

if (query_result != null)
{

var rsmd = query_result.getMetaData() ;
var colHeaders = rsmd.getColumnHeaders() ;
var rowHeaders = rsmd.getRowHeaders() ;
var colCount = rsmd.getColumnCount() ;
var rowCount = query_result.getRowCount() ;

if(rowCount> 0)
{
for (i=0; i<rowCount; i++)
{
var value = new Packages.org.json.JSONArray();
if(QUERY_TYPE == "mdx")
value.put(rowHeaders[i][0]);

for(j=0; j< colCount; j++)
{
var v = query_result.getValueAt(i,j)+"";
value.put(v.replace(/Infinity/g,'0'));
}

values.put(value);
}

}
}

var results = new java.lang.String(values.toString().getBytes("utf8"));
results;
]]></script>
</component-definition>
</action-definition>



</actions>
</action-sequence>To can open it with DesignStuio I had to open it with "text Editor" (in design Studio), delete  from the begin, and then open with "Action Secuence Editor", because and node error was displayed.

pmalves
09-01-2009, 08:51 AM
No, that's not the correct one

j_nep
09-01-2009, 08:54 AM
Hi Pedro.
I've replaced the jtable.xaction by jtable.xaction.sql (because I have to work also with sql queries)...and also with the other files (.sql).
Now I've seen that with the other jtable.xaction json.values works correctly.
May be you have to delete this file (jtable.xaction.sql) to avoid confusion?¿ :)

pmalves
09-01-2009, 10:07 AM
That's weird. Both of the files that I have here (jtable.xaction and jtable.xaction.sql) have that behavior

naveen.arumugam
10-12-2009, 07:56 PM
Hi

I am new to PDS. When I tried to open jtable.xaction I got the following error. I am using RC2. Any reason? Am I missing something?

The following XML nodes were not specified. You should fix the XML before continuing

Thanks
Naveen

pmalves
10-12-2009, 08:16 PM
The xaction used by cdf engine are not good for your eyes. You shouldn't have to open them.


Not unless you know what you're doing... really

naveen.arumugam
10-12-2009, 08:48 PM
Pedro

Thanks for the reply. Actually, I am going thru 'pentaho solutions' by roland bouman and Jos Van... in which it's mentioned to have a look on xaction.
Anyways, I was able to open other xaction files, so , as I was using RC2, I checked with...

will not open... :-)

pmalves
10-13-2009, 06:13 AM
Choose a simpler one, not the dark magic we do there :)

karthik
11-06-2009, 11:45 AM
So where can I find the new one?..... Please help BOSS...

jorge_perez_a
02-19-2010, 12:22 PM
Q tal amigos de la comunidad----
Necesito me ayuden con el tema de DASHBOARD
Logre crear una dashboar....PERO EL problema radica en que no lo puedo ver desde otra maquina que no sea el servido....
QUE ESTOY HACIENDO MAL:::
AYUDENME...
GRACIAS -:confused: