problem with attribute action in the action element

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

problem with attribute action in the action element

julien.bittard
Hello,

I use the version 2.8 of OPS with tomcat 5.0.28.

In my "page-flow.xml" I use the attribute action in the element action like that:

<page id="ancien_combattant_page1" path-info="/ancien-combattant" xforms="xforms-model.xml" model="model_page1.xpl" view="view_page1.xsl">
       
<action when="/form/action = 'EtapeSuivante'"  action="test_postal_ville.xpl">
  <result when="/sucess = 'true'" page="ancien_combattant_page2">
    <xu:update select="/form">
      <xu:copy-of select="document('input:instance')/form/*"/>
    </xu:update>
  </result>
  <result when="/sucess = 'false'">
    <xu:update select="/form">
          <xu:copy-of select="document('input:instance')/form/*"/>
    </xu:update>
  </result>
</action>

</page>

<page id="ancien_combattant_page2" path-info="/ancien-combattant2" xforms="xforms-model.xml" model="model_page2.xpl" view="view_page2.xsl"/>
   

And in my page view "view_page1.xsl" i have this:

<xforms:submit xxforms:appearance="image">
 <xxforms:img src="/oxf-theme/images/bouton/actif/etape_s.gif" />
 <xforms:setvalue ref="/form/action">EtapeSuivante</xforms:setvalue>
</xforms:submit>


So I click on my image and i suppose that my file "test_postal_ville.xpl" is executed. But not, it execute the first model file "model_page1.xpl" !
I don't understand what happend.
I know this because in "test_postal_ville.xpl" i call a webservice and it isn't call.

Can you help me ?

thank you.

Sorry for the bad english.



--
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: problem with attribute action in the action element

Erik Bruchez
Administrator
Julien,

This should work.

What do you have in test_postal_ville.xpl? Do you have a "data" output
which you are referring to?

-Erik

[hidden email] wrote:
 > Hello,
 >
 > I use the version 2.8 of OPS with tomcat 5.0.28.
 >
 > In my "page-flow.xml" I use the attribute action in the element
action like that:
 >
 > <page id="ancien_combattant_page1" path-info="/ancien-combattant"
xforms="xforms-model.xml" model="model_page1.xpl" view="view_page1.xsl">
 >
 > <action when="/form/action = 'EtapeSuivante'"
action="test_postal_ville.xpl">
 >   <result when="/sucess = 'true'" page="ancien_combattant_page2">
 >     <xu:update select="/form">
 >       <xu:copy-of select="document('input:instance')/form/*"/>
 >     </xu:update>
 >   </result>
 >   <result when="/sucess = 'false'">
 >     <xu:update select="/form">
 >           <xu:copy-of select="document('input:instance')/form/*"/>
 >     </xu:update>
 >   </result>
 > </action>
 >
 > </page>
 >
 > <page id="ancien_combattant_page2" path-info="/ancien-combattant2"
xforms="xforms-model.xml" model="model_page2.xpl" view="view_page2.xsl"/>
 >
 >
 > And in my page view "view_page1.xsl" i have this:
 >
 > <xforms:submit xxforms:appearance="image">
 >  <xxforms:img src="/oxf-theme/images/bouton/actif/etape_s.gif" />
 >  <xforms:setvalue ref="/form/action">EtapeSuivante</xforms:setvalue>
 > </xforms:submit>
 >
 >
 > So I click on my image and i suppose that my file
"test_postal_ville.xpl" is executed. But not, it execute the first model
file "model_page1.xpl" !
 > I don't understand what happend.
 > I know this because in "test_postal_ville.xpl" i call a webservice
and it isn't call.
 >
 > Can you help me ?
 >
 > thank you.




--
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: Re: problem with attribute action in the action element

julien.bittard
> What do you have in test_postal_ville.xpl? Do you have a "data" output
> which you are referring to?

> -Erik

OK I think I have find my error.
I have this on the start of test_postal_ville.xpl :

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

But on the end i refer to this:

<p:choose href="aggregate('root', #testOrgan)">
  <p:when test="/root/FluxWebService/msCodeRet = '1'">
            <p:processor name="oxf:identity">
                <p:input name="data"><success>true</success></p:input>
                <p:output name="data" ref="data"/>
            </p:processor>
        </p:when>
  <p:otherwise>
            <p:processor name="oxf:identity">
                <p:input name="data"><success>false</success></p:input>
                <p:output name="data" ref="data"/>
            </p:processor>
        </p:otherwise>
    </p:choose>
   
</p:config>


I'm so idiot !!! I must replace the name of parameter output "instance" to "data", no ?

Thank you for your help.



--
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: problem with attribute action in the action element

Erik Bruchez
Administrator
Julien,

It's not stupidity: this kind of errors is often not easy to catch.

BTW we have recently added some better checks in the PFC to detect
incorrect outputs, at least for the page model.

-Erik

[hidden email] wrote:

>>What do you have in test_postal_ville.xpl? Do you have a "data" output
>>which you are referring to?
>
>
>>-Erik
>
>
> OK I think I have find my error.
> I have this on the start of test_postal_ville.xpl :
>
> <p:param type="input" name="instance"/>
> <p:param type="output" name="instance"/>
>
> But on the end i refer to this:
>
> <p:choose href="aggregate('root', #testOrgan)">
>   <p:when test="/root/FluxWebService/msCodeRet = '1'">
>             <p:processor name="oxf:identity">
>                 <p:input name="data"><success>true</success></p:input>
>                 <p:output name="data" ref="data"/>
>             </p:processor>
>         </p:when>
>   <p:otherwise>
>             <p:processor name="oxf:identity">
>                 <p:input name="data"><success>false</success></p:input>
>                 <p:output name="data" ref="data"/>
>             </p:processor>
>         </p:otherwise>
>     </p:choose>
>    
> </p:config>
>
>
> I'm so idiot !!! I must replace the name of parameter output "instance" to "data", no ?
>
> Thank you for your help.
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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: Re: problem with attribute action in the action element

julien.bittard
Hello,

Ok my file test_postal_ville.xpl is executed. But now i want to modify, in this file, the xform instance because i want to copy the error message of my webservice.

So i add this:

<p:processor name="oxf:xupdate">
  <p:input name="data" href="#instance" debug="instance test_postal debut"/>
  <p:input name="charge" href="#charge"/>
       
  <p:input name="config">
     <xu:modifications>
               
     <xu:variable name="infoCharge" select="doc('input:charge')/FluxWebService" as="element()"/>
               
     <xu:choose>
      <xu:when test="$infoCharge/msCodeRet = '-1'">
         <xu:update select="/form/erreurWSTiers">
            <xu:value-of select="$infoCharge/erreur/message"/>
         </xu:update>
         <xu:update select="/form/show-error">
               true
         </xu:update>
         <xu:append select="/form/erreurWSTiers">
            <xu:attribute name="myns:invalid">.</xu:attribute>
         </xu:append>
      </xu:when>
    </xu:choose>
   </xu:modifications>
  </p:input>
       
  <p:output name="data" ref="instance" debug="instance test_postal"/>
</p:processor>

I have declared the output parameter:

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

But I think that the instance is not modify because the debug point "instance test_postal" is not present in the log. And when i post my xforms-model.xml, it's not modify.

My page-flow.xml :

<action when="/form/action = 'EtapeSuivante'"  action="test_postal_ville.xpl">
 <result when="/success = 'chargeSuivi'" page="ancien_combattant_page2">
   <xu:update select="/form">
     <xu:copy-of select="document('input:instance')/form/*"/>
   </xu:update>
  </result>
</action>

Have you undestand my problem ?

thank you.



--
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: problem with attribute action in the action element

Erik Bruchez
Administrator
Things look pretty ok in your code below. Is the file with the
oxf:xupdate processor, your page model? Maybe it would be easier if
you could send all the files to reproduce the issue.

-Erik

[hidden email] wrote:
 > Hello,
 >
 > Ok my file test_postal_ville.xpl is executed. But now i want to
 > modify, in this file, the xform instance because i want to copy the
 > error message of my webservice.
 >
 > So i add this:
 >
 > <p:processor name="oxf:xupdate">
 >   <p:input name="data" href="#instance" debug="instance test_postal
debut"/>
 >   <p:input name="charge" href="#charge"/>
 >
 >   <p:input name="config">
 >      <xu:modifications>
 >
 >      <xu:variable name="infoCharge"
select="doc('input:charge')/FluxWebService" as="element()"/>
 >
 >      <xu:choose>
 >       <xu:when test="$infoCharge/msCodeRet = '-1'">
 >          <xu:update select="/form/erreurWSTiers">
 >             <xu:value-of select="$infoCharge/erreur/message"/>
 >          </xu:update>
 >          <xu:update select="/form/show-error">
 >                true
 >          </xu:update>
 >          <xu:append select="/form/erreurWSTiers">
 >             <xu:attribute name="myns:invalid">.</xu:attribute>
 >          </xu:append>
 >       </xu:when>
 >     </xu:choose>
 >    </xu:modifications>
 >   </p:input>
 >
 >   <p:output name="data" ref="instance" debug="instance test_postal"/>
 > </p:processor>
 >
 > I have declared the output parameter:
 >
 > <p:param type="input" name="instance"/>
 > <p:param type="output" name="data"/>
 > <p:param type="output" name="instance"/>
 >
 > But I think that the instance is not modify because the debug point
 > "instance test_postal" is not present in the log. And when i post my
 > xforms-model.xml, it's not modify.
 >
 > My page-flow.xml :
 >
 > <action when="/form/action = 'EtapeSuivante'"
action="test_postal_ville.xpl">
 >  <result when="/success = 'chargeSuivi'" page="ancien_combattant_page2">
 >    <xu:update select="/form">
 >      <xu:copy-of select="document('input:instance')/form/*"/>
 >    </xu:update>
 >   </result>
 > </action>
 >
 > Have you undestand my problem ?
 >
 > thank you.




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