US and Worldwide: +1 (866) 660-7555
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: querycomponent cdf 3.2

  1. #1

    Default querycomponent cdf 3.2

    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.

  2. #2
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    Hum.. no.

    Seems to me that you're using an old version of jtable.xaction, did you upgrade correctly?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3

    Default

    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:
    Code:
    <?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.

  4. #4
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    No, that's not the correct one
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  5. #5

    Default

    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?¿

  6. #6
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    That's weird. Both of the files that I have here (jtable.xaction and jtable.xaction.sql) have that behavior
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  7. #7

    Default jtable.xaction

    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
    Attached Images Attached Images

  8. #8
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    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
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  9. #9

    Default

    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... :-)

  10. #10
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    Choose a simpler one, not the dark magic we do there
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •