Issues debugging sql processor usage

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issues debugging sql processor usage

alex sharaz-3
Hi All,

I'm currently building a cascading dropdown list app based around 3  
dropdown lists  where the  options available for selection in the last  
2 lists are dependent upon the selection made "further up the tree"

I've got 99% of it working in a fashion, but the only  thing stopping  
me finishing it off is setting up a parameter to be used in a sql  
processor when building the "next" select1 itemset.

If I could figure out how to enable the right form of debugging I'd  
probably be o.k.

So the first thing I do in the app  is pump prime an instance used to  
build the top level dropdown list.

<xforms:group ref="instance('info-instance')">
                    <xforms:select1 ref="top_level_location/name"  
appearance="compact">
                                  <xforms:item>
                                          <xforms:label>Select a  
general area....</xforms:label>
                                          <xforms:value>0</xforms:value>
                                  </xforms:item>
                                  <xforms:itemset  
nodeset="instance('netdev-instance')/top_level_locations/
top_level_location">
                                             <xforms:label  
value="name" />
                                              <xforms:value  
ref="name" />
                                  </xforms:itemset>
                                                <xforms:action  
ev:event="xforms-value-changed">
                                                    <xforms:send  
submission="info-instance-2-submission"/>
                                                 </xforms:action>
                     </xforms:select1>
........
When I select an item from this list it updates the instance below  
( example shown) and invokes a submission action

  <xforms:instance id="info-instance">
                                 <query_details>
                                    <top_level_location>
                                         <name>University</name>
                                    </top_level_location>
                                    <sub_location_1>
                                         <name/>
                                    </sub_location_1>
                                    <sub_location_2>
                                         <name/>
                                    </sub_location_2>
                                    <ras_clients/>
                                 </query_details>
                         </xforms:instance>

 From <xforms:model>

<xforms:submission id="info-instance-2-submission" ref="instance('info-
instance')"
                                 replace="instance" instance="info-
instance-2" method="post"
                                 action="/location-info/get-sub-
location">
                                 <xforms:message ev:event="xforms-
submit-error" level="modal">
                                         An error occurred while  
selecting 2nd level locations</xforms:message>
                         </xforms:submission>

Here I'm submitting the "info-instance"  instance to an sql processor.  
The replace and instance attributes put data generated by the sql  
processor into an instance called info-instance-2. ( this bit works
just fine if i use a "static" sql statement and not one that uses  
parameters )

 From page-flow.xml

<page path-info="/location-info/get-sub-location" view="service-get-
sub-location.xpl"/>

The service-get-sub-location.xpl has the following defined as part of  
my test harness

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:oxf="http://www.orbeon.com/oxf/processors"
         xmlns:xi="http://www.w3.org/2001/XInclude">

     <p:param type="input" name="instance"/>
     <p:param type="output" name="data"/>

     <p:processor name="oxf:sql">
         <p:input name="data"  href="#instance"/>
         <p:input name="config">
             <sql:config>
                 <query_details>
                     <sql:connection>
                         <sql:datasource>readonlyradsupport</
sql:datasource>
                         <sql:execute>
                             <sql:query>
                                 select distinct location_sub_type  
from locations where location_type='University' order by  
location_sub_type asc
                             </sql:query>
                             <sql:result-set>
                                 <sql:row-iterator>
...... etc
                       </sql:execute>
                     </sql:connection>
                 </query_details>
             </sql:config>
         </p:input>
         <p:output name="data" ref="data"  debug="ccsas: sub location"/>
     </p:processor>


With the select statement shown above, everything works just fine and  
I can build a subsequent dropdown list from the data generated.

However, if I replace the select statement with

select distinct location_sub_type from locations where  
location_type='<sql:param type="xs:string" select="/query_details/
top_level_location/name"/>' order by location_sub_type asc

which should be defined as 'University" ( see info-instance definition  
above), I get an error saying that I haven't supplied a parameter for  
the prepare-sql  statement.

What I'd really like is to be able to see what is being supplied via  
<p:input name="data"  href="#instance"/> just to check that
a) The instance I specified in the <xforms:submission is getting into  
the sql processor
b). If I've specified the select= argument correctly.

When enabling debugging I seem to alternate between not enough to  
reams and reams of logging

Any help appreciated
Rgds
Alex


==========
Time for another Macmillan Cancer Support event. This time its the 12  
day Escape to Africa challenge

View route at http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&msa=0&msid=203779866436035016780.00049e867720273b73c39&z=8

Please sponsor me at http://www.justgiving.com/Alex-Sharaz





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Issues debugging sql processor usage

bsteuhl
do not wrap your param in a string - take out the single quotes.  Then try and let us know.  Should work.  If not give us update and I will look at code some more but single quotes is definitely not correct.
 

Brian Steuhl
Website: http://BTMSoftwareSolutions.com

Follow BTM on Twitter

Business Email: [hidden email]
Cell: 908-421-0742

Home Office: 732-961-3187

Google Voice: 732-800-1286 (1BTM)
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com




From: alex sharaz <[hidden email]>
To: [hidden email]
Sent: Wed, July 6, 2011 8:44:27 AM
Subject: [ops-users] Issues debugging sql processor usage

Hi All,

I'm currently building a cascading dropdown list app based around 3 dropdown lists  where the  options available for selection in the last 2 lists are dependent upon the selection made "further up the tree"

I've got 99% of it working in a fashion, but the only  thing stopping me finishing it off is setting up a parameter to be used in a sql processor when building the "next" select1 itemset.

If I could figure out how to enable the right form of debugging I'd probably be o.k.

So the first thing I do in the app  is pump prime an instance used to build the top level dropdown list.

<xforms:group ref="instance('info-instance')">
                  <xforms:select1 ref="top_level_location/name" appearance="compact">
                                <xforms:item>
                                        <xforms:label>Select a general area....</xforms:label>
                                        <xforms:value>0</xforms:value>
                                </xforms:item>
                                <xforms:itemset nodeset="instance('netdev-instance')/top_level_locations/top_level_location">
                                            <xforms:label value="name" />
                                            <xforms:value ref="name" />
                                </xforms:itemset>
                                              <xforms:action ev:event="xforms-value-changed">
                                                  <xforms:send submission="info-instance-2-submission"/>
                                                </xforms:action>
                    </xforms:select1>
........
When I select an item from this list it updates the instance below ( example shown) and invokes a submission action

<xforms:instance id="info-instance">
                                <query_details>
                                  <top_level_location>
                                        <name>University</name>
                                  </top_level_location>
                                  <sub_location_1>
                                        <name/>
                                  </sub_location_1>
                                  <sub_location_2>
                                        <name/>
                                  </sub_location_2>
                                  <ras_clients/>
                                </query_details>
                        </xforms:instance>

From <xforms:model>

<xforms:submission id="info-instance-2-submission" ref="instance('info-instance')"
                                replace="instance" instance="info-instance-2" method="post"
                                action="/location-info/get-sub-location">
                                <xforms:message ev:event="xforms-submit-error" level="modal">
                                        An error occurred while selecting 2nd level locations</xforms:message>
                        </xforms:submission>

Here I'm submitting the "info-instance"  instance to an sql processor. The replace and instance attributes put data generated by the sql processor into an instance called info-instance-2. ( this bit works
just fine if i use a "static" sql statement and not one that uses parameters )

From page-flow.xml

<page path-info="/location-info/get-sub-location" view="service-get-sub-location.xpl"/>

The service-get-sub-location.xpl has the following defined as part of my test harness

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:sql="http://orbeon.org/oxf/xml/sql"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        xmlns:xi="http://www.w3.org/2001/XInclude">

    <p:param type="input" name="instance"/>
    <p:param type="output" name="data"/>

    <p:processor name="oxf:sql">
        <p:input name="data"  href="#instance"/>
        <p:input name="config">
            <sql:config>
                <query_details>
                    <sql:connection>
                        <sql:datasource>readonlyradsupport</sql:datasource>
                        <sql:execute>
                            <sql:query>
                                select distinct location_sub_type from locations where location_type='University' order by location_sub_type asc
                            </sql:query>
                            <sql:result-set>
                                <sql:row-iterator>
...... etc
                      </sql:execute>
                    </sql:connection>
                </query_details>
            </sql:config>
        </p:input>
        <p:output name="data" ref="data"  debug="ccsas: sub location"/>
    </p:processor>


With the select statement shown above, everything works just fine and I can build a subsequent dropdown list from the data generated.

However, if I replace the select statement with

select distinct location_sub_type from locations where location_type='<sql:param type="xs:string" select="/query_details/top_level_location/name"/>' order by location_sub_type asc

which should be defined as 'University" ( see info-instance definition above), I get an error saying that I haven't supplied a parameter for the prepare-sql  statement.

What I'd really like is to be able to see what is being supplied via  <p:input name="data"  href="#instance"/> just to check that
a) The instance I specified in the <xforms:submission is getting into the sql processor
b). If I've specified the select= argument correctly.

When enabling debugging I seem to alternate between not enough to reams and reams of logging

Any help appreciated
Rgds
Alex


==========
Time for another Macmillan Cancer Support event. This time its the 12 day Escape to Africa challenge

View route at http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&msa=0&msid=203779866436035016780.00049e867720273b73c39&z=8

Please sponsor me at http://www.justgiving.com/Alex-Sharaz





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Issues debugging sql processor usage

alex sharaz-3
Many many thanks Brian,
worked a treat
Rgds
Alex

On 6 Jul 2011, at 13:51, Brian Steuhl wrote:

> do not wrap your param in a string - take out the single quotes.  
> Then try and let us know.  Should work.  If not give us update and I  
> will look at code some more but single quotes is definitely not  
> correct.
>
> Brian Steuhl
> Website: http://BTMSoftwareSolutions.com
>
> Follow BTM on Twitter
> Business Email: [hidden email]
> Cell: 908-421-0742
>
> Home Office: 732-961-3187
>
> Google Voice: 732-800-1286 (1BTM)
> RSS Feed To My Blog:
>
>
>
>
>
> From: alex sharaz <[hidden email]>
> To: [hidden email]
> Sent: Wed, July 6, 2011 8:44:27 AM
> Subject: [ops-users] Issues debugging sql processor usage
>
> Hi All,
>
> I'm currently building a cascading dropdown list app based around 3  
> dropdown lists  where the  options available for selection in the  
> last 2 lists are dependent upon the selection made "further up the  
> tree"
>
> I've got 99% of it working in a fashion, but the only  thing  
> stopping me finishing it off is setting up a parameter to be used in  
> a sql processor when building the "next" select1 itemset.
>
> If I could figure out how to enable the right form of debugging I'd  
> probably be o.k.
>
> So the first thing I do in the app  is pump prime an instance used  
> to build the top level dropdown list.
>
> <xforms:group ref="instance('info-instance')">
>                   <xforms:select1 ref="top_level_location/name"  
> appearance="compact">
>                                 <xforms:item>
>                                         <xforms:label>Select a  
> general area....</xforms:label>
>                                         <xforms:value>0</xforms:value>
>                                 </xforms:item>
>                                 <xforms:itemset  
> nodeset="instance('netdev-instance')/top_level_locations/
> top_level_location">
>                                             <xforms:label  
> value="name" />
>                                             <xforms:value  
> ref="name" />
>                                 </xforms:itemset>
>                                               <xforms:action  
> ev:event="xforms-value-changed">
>                                                   <xforms:send  
> submission="info-instance-2-submission"/>
>                                                 </xforms:action>
>                     </xforms:select1>
> ........
> When I select an item from this list it updates the instance below  
> ( example shown) and invokes a submission action
>
> <xforms:instance id="info-instance">
>                                 <query_details>
>                                   <top_level_location>
>                                         <name>University</name>
>                                   </top_level_location>
>                                   <sub_location_1>
>                                         <name/>
>                                   </sub_location_1>
>                                   <sub_location_2>
>                                         <name/>
>                                   </sub_location_2>
>                                   <ras_clients/>
>                                 </query_details>
>                         </xforms:instance>
>
> From <xforms:model>
>
> <xforms:submission id="info-instance-2-submission"  
> ref="instance('info-instance')"
>                                 replace="instance" instance="info-
> instance-2" method="post"
>                                 action="/location-info/get-sub-
> location">
>                                 <xforms:message ev:event="xforms-
> submit-error" level="modal">
>                                         An error occurred while  
> selecting 2nd level locations</xforms:message>
>                         </xforms:submission>
>
> Here I'm submitting the "info-instance"  instance to an sql  
> processor. The replace and instance attributes put data generated by  
> the sql processor into an instance called info-instance-2. ( this  
> bit works
> just fine if i use a "static" sql statement and not one that uses  
> parameters )
>
> From page-flow.xml
>
> <page path-info="/location-info/get-sub-location" view="service-get-
> sub-location.xpl"/>
>
> The service-get-sub-location.xpl has the following defined as part  
> of my test harness
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>         xmlns:sql="http://orbeon.org/oxf/xml/sql"
>         xmlns:xs="http://www.w3.org/2001/XMLSchema"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         xmlns:oxf="http://www.orbeon.com/oxf/processors"
>         xmlns:xi="http://www.w3.org/2001/XInclude">
>
>     <p:param type="input" name="instance"/>
>     <p:param type="output" name="data"/>
>
>     <p:processor name="oxf:sql">
>         <p:input name="data"  href="#instance"/>
>         <p:input name="config">
>             <sql:config>
>                 <query_details>
>                     <sql:connection>
>                         <sql:datasource>readonlyradsupport</
> sql:datasource>
>                         <sql:execute>
>                             <sql:query>
>                                 select distinct location_sub_type  
> from locations where location_type='University' order by  
> location_sub_type asc
>                             </sql:query>
>                             <sql:result-set>
>                                 <sql:row-iterator>
> ...... etc
>                       </sql:execute>
>                     </sql:connection>
>                 </query_details>
>             </sql:config>
>         </p:input>
>         <p:output name="data" ref="data"  debug="ccsas: sub  
> location"/>
>     </p:processor>
>
>
> With the select statement shown above, everything works just fine  
> and I can build a subsequent dropdown list from the data generated.
>
> However, if I replace the select statement with
>
> select distinct location_sub_type from locations where  
> location_type='<sql:param type="xs:string" select="/query_details/
> top_level_location/name"/>' order by location_sub_type asc
>
> which should be defined as 'University" ( see info-instance  
> definition above), I get an error saying that I haven't supplied a  
> parameter for the prepare-sql  statement.
>
> What I'd really like is to be able to see what is being supplied  
> via  <p:input name="data"  href="#instance"/> just to check that
> a) The instance I specified in the <xforms:submission is getting  
> into the sql processor
> b). If I've specified the select= argument correctly.
>
> When enabling debugging I seem to alternate between not enough to  
> reams and reams of logging
>
> Any help appreciated
> Rgds
> Alex
>
>
> ==========
> Time for another Macmillan Cancer Support event. This time its the  
> 12 day Escape to Africa challenge
>
> View route at http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&msa=0&msid=203779866436035016780.00049e867720273b73c39&z=8
>
> Please sponsor me at http://www.justgiving.com/Alex-Sharaz
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
==========
Time for another Macmillan Cancer Support event. This time its the 12  
day Escape to Africa challenge

View route at http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&msa=0&msid=203779866436035016780.00049e867720273b73c39&z=8

Please sponsor me at http://www.justgiving.com/Alex-Sharaz





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws