Page Flow and Sql Processor

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

Page Flow and Sql Processor

Massimiliano Di Dato
My problem is the follow:
I have a sql processor on sql.xpl file. This processor simply connect to a mysql database and perform a select query.
The page flow is the follow:
 
<page id="home" path-info="/anagrafica/home" view="operazioni-view.xhtml">
 <action when="/employer/action = 'search'">
  <result page="sql" transform="oxf:xslt">
  <query xsl:version="2.0" xmlns:xsl="<A href="mhtml:{CA45797E-A9DB-4943-98F7-AD51D9017C91}mid://00000058/!x-usc:http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform">
  <name>
    <xsl:value-of select="doc('input:action')/employer/name"/>
  </name>
  <surname>
    <xsl:value-of select="doc('input:action')/employer/surname"/>
  </surname>
  <phone>
    <xsl:value-of select="doc('input:action')/employer/phone"/>
  </phone>
  <address>
    <xsl:value-of select="doc('input:action')/employer/address"/>
  </address>
  </query>
  </result>
  </action>
</page>
 
As you can see i try to submit an xml structure (<query>) to "sql".
As result, in sql processor, the element <sql:param> can't find the value of relative element. As consequence my query always return null value.
I try to replace sql processor with a processor that write the XML submission on a file to see the result. The xml file is correct and contains the aspected value.
If i perform the XML submission from view page of HOME (operazioni-view.xhtml) with e POST method i can perform the query with success.
However i want to pass through page-flow to respect the MVC model.
How can i do?


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Page Flow and Sql Processor

fl.schmitt(ops-users)
Massimiliano Di Dato schrieb:

> As you can see i try to submit an xml structure (<query>) to "sql".
> As result, in sql processor, the element <sql:param> can't find the
> value of relative element. As consequence my query always return null value.
> I try to replace sql processor with a processor that write the XML
> submission on a file to see the result. The xml file is correct and
> contains the aspected value.

So the problem may not be the Page Flow but the XPL. How do you access
the submission in the XPL containing the sql processor? Have you tried
to attach a debug attribute to the p:param element to see how the XPL
input looks like? Debugging the input of the XPL and that of the SQL
processor could be a first step to find the point where the "chain" is
broken.

florian



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Page Flow and Sql Processor

Massimiliano Di Dato
This is the XPL code:
call proc(<sql:param type="xs:string" select="/employ/name"/>,<sql:param
type="xs:string" select="/employ/surname"/>,
                   <sql:param type="xs:string"
select="/employ/phone"/>,<sql:param type="xs:string"
select="/employ/address"/>)

With the SAME code, if i send XML submission by a HTTP POST SUBMISSION from
another page , it works.
However how can i insert a debug attribute to debugging XPL?

----- Original Message -----
From: "Florian Schmitt" <[hidden email]>
To: <[hidden email]>
Sent: Monday, June 18, 2007 11:19 PM
Subject: Re: [ops-users] Page Flow and Sql Processor


> Massimiliano Di Dato schrieb:
>
>> As you can see i try to submit an xml structure (<query>) to "sql".
>> As result, in sql processor, the element <sql:param> can't find the
>> value of relative element. As consequence my query always return null
>> value.
>> I try to replace sql processor with a processor that write the XML
>> submission on a file to see the result. The xml file is correct and
>> contains the aspected value.
>
> So the problem may not be the Page Flow but the XPL. How do you access
> the submission in the XPL containing the sql processor? Have you tried
> to attach a debug attribute to the p:param element to see how the XPL
> input looks like? Debugging the input of the XPL and that of the SQL
> processor could be a first step to find the point where the "chain" is
> broken.
>
> florian
>
>

--------------------------------------------------------------------------------


>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Page Flow and Sql Processor

fl.schmitt(ops-users)
Hi Massimiliano,

  > With the SAME code, if i send XML submission by a HTTP POST SUBMISSION
> from another page , it works.
> However how can i insert a debug attribute to debugging XPL?

You can add an attribute named "debug" to p:param, p:input and p:output,
for example:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:oxf="http://www.orbeon.com/oxf/processors">

     <p:param name="instance" type="input" debug="xpl-sql-in"/>
     <p:param name="doc-list" type="output" debug="xpl-sql-out"/>

<p:processor name="oxf:sql">
     <p:input name="datasource" href="datasource.xml"/>
     <p:input name="data" href="#instance" debug="sql-data-in" />
     <p:input name="config" debug="sql-query">
         <sql:config>
             <employees>
                 <sql:connection>
                     <sql:execute>
                         <sql:call>
                             <!-- ... -->
                         </sql:call>
                 </sql:connection>
             </employees>
         </sql:config>
     </p:input>
     <p:output name="output" ref="doc-list" debug="sql-data-out" />
</p:processor>

</p:config>


HTH
florian




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Page Flow and Sql Processor

Massimiliano Di Dato
Sorry but i had follow your suggest,but it's not clear in which way i can
take advantage from debug tag. I insert the code that you suggested me but
the result is the same. No results....


----- Original Message -----
From: "Florian Schmitt" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, June 19, 2007 12:46 PM
Subject: Re: [ops-users] Page Flow and Sql Processor


> Hi Massimiliano,
>
>  > With the SAME code, if i send XML submission by a HTTP POST SUBMISSION
>> from another page , it works.
>> However how can i insert a debug attribute to debugging XPL?
>
> You can add an attribute named "debug" to p:param, p:input and p:output,
> for example:
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>     <p:param name="instance" type="input" debug="xpl-sql-in"/>
>     <p:param name="doc-list" type="output" debug="xpl-sql-out"/>
>
> <p:processor name="oxf:sql">
>     <p:input name="datasource" href="datasource.xml"/>
>     <p:input name="data" href="#instance" debug="sql-data-in" />
>     <p:input name="config" debug="sql-query">
>         <sql:config>
>             <employees>
>                 <sql:connection>
>                     <sql:execute>
>                         <sql:call>
>                             <!-- ... -->
>                         </sql:call>
>                 </sql:connection>
>             </employees>
>         </sql:config>
>     </p:input>
>     <p:output name="output" ref="doc-list" debug="sql-data-out" />
> </p:processor>
>
> </p:config>
>
>
> HTH
> florian
>
>
>

--------------------------------------------------------------------------------


>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Page Flow and Sql Processor

fl.schmitt(ops-users)
Hi Massimiliano,

> Sorry but i had follow your suggest,but it's not clear in which way i
> can take advantage from debug tag. I insert the code that you suggested
> me but the result is the same. No results....

the debugging can only help to track down the problem - you will have to
check the log file for the debug output. IMHO the easiest way is to use
Eclipse with the Orbeon Studio Plugin, but depending on the Log4J config
you could use also other logging tools (console, file and so on).

florian





--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws