In the xhtml you could have the following then to complete my previous email
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xhtml:head> <xhtml:title>My Page</xhtml:title> <xforms:model id="mymodel"> <xforms:instance id="request-instance"> <requestInfo> <paramt1 /> </requestInfo> </xforms:instance> <xforms:submission ref="instance('request-instance')" id="default-submission" method="post" action="/myapp/post"/> </xforms:model> <xhtml:p> <xhtml:div style="display:inline"> <!-- TODO: corriger le choix de la station avec un select <xforms:input model="formulaire" ref="param1" id="MyParameter1Id" /> </xhtml:div> </xhtml:p> ... does that make sense? in this example the request-intance is submitted and then later taken in the xpl as /requestInfo/param1 E. -----Message d'origine----- De : Suganda [mailto:[hidden email]] Envoyé : jeudi, 20. septembre 2007 12:48 À : [hidden email] Objet : Re: [ops-users] RE : how to input parameter from xhtml to xpl inweb-service[Urgentt] Hi Eric thanks for fast response ok i understand your reply but i still confuse about this line <!-- Build of the object to pass to the web service --> <param1><xsl:value-of select="/requestInfo/param1" /></param1> what is the requestInfo example that you mean ? can you elaborate mode detail about this line ? perhaps some simple example is the requestInfo related to the view.xhtml ? thanks in advance ganda:) Leray Eric wrote: > > Hi suganda, > > The way you could go about this could be the following: > > Use your main xpl instance (the one with all the input parameters) as an > input to a xslt processor. This will allow for the creation of the dynamic > request. > > Here is an example > <!-- Prepared the configuration of the web service and construct the > object parameter --> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#instance" /> > <p:input name="config"> > <delegation:execute service="yourservice" > operation="anOperation" xsl:version="2.0"> > <!-- Build of the object to pass to the web service --> > <param1><xsl:value-of select="/requestInfo/param1" /></param1> > </delegation:execute> > </p:input> > <p:output name="data" id="request" /> > </p:processor> > > then you ca use the result of this processor to make the call > > <!-- Call to the web service with the predefined configuration --> > <p:processor name="oxf:delegation"> > <p:input name="interface"> > <config> > <service id=" yourservice" type="webservice" > endpoint="http://localhost:8080/WebServices/services/yourservice"> > <operation name=" anOperation " nsuri="http://servicenamespace/" > /> > </service> > </config> > </p:input> > <p:input name="call" href="#request" /> > <p:output name="response_ws" id="service-response" /> > </p:processor> > > I hope this will help > > E. > > -----Message d'origine----- > De : Suganda [mailto:[hidden email]] > Envoyé : jeudi, 20. septembre 2007 12:25 > À : [hidden email] > Objet : [ops-users] how to input parameter from xhtml to xpl in > web-service[Urgentt] > > > hi all > i already capable to print the result of my web-service > > however i still use static text in the input parameter of my service > > can anyone explain how do i pass parameter from my xhtml to my xpl > > below is the xhtml file > > <?xml version="1.0" encoding="utf-8"?> > > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:xi="http://www.w3.org/2001/XInclude"> > > <xhtml:head> > <xhtml:title>XForms Web-Service-Ganda</xhtml:title> > <xforms:model> > <xforms:instance id="result-instance"> > <xi:include href="input:data"/> > </xforms:instance> > <xforms:instance id="start-instance"> > <start/> > </xforms:instance> > <xforms:submission id="receive" > action="/xforms-web-service-ganda/starts" ref="instance('start-instance')" > method="post"> > </xforms:submission> > </xforms:model> > </xhtml:head> > > <xhtml:body> > <xforms:group> > <xhtml:p> > <xforms:output ref="instance('result-instance')"> > <xforms:label>The result is: </xforms:label> > </xforms:output> > </xhtml:p> > <xhtml:p> > <xforms:group> > <xforms:input ref="instance('start-instance')"> > <xforms:label>Start : </xforms:label> > </xforms:input> > <xforms:trigger> > <xforms:label>Submit</xforms:label> > </xforms:trigger> > <xforms:send ev:event="DOMActivate" > submission="receive"/> > </xforms:group> > </xhtml:p> > </xforms:group> > <xhtml:p style="margin-top: 3em"> > <xhtml:a href="/xforms-web-service-ganda/">Back</xhtml:a> to > web-service-ganda > </xhtml:p> > </xhtml:body> > > </html> > > > and this is the page flow > > <config xmlns="http://www.orbeon.com/oxf/controller" > xmlns:xu="http://www.xmldb.org/xupdate"> > > <page path-info="/xforms-web-service-ganda/" view="enter-starts.xhtml"> > <action when="/form/action = 'submit'" > action="enter-starts-action.xsl"> > <result when="/valid = 'true'" page="web-service-ganda"/> > </action> > </page> > > <page id="web-service-ganda" > path-info="/xforms-web-service-ganda/starts" model="view-web-service.xpl" > view="view.xhtml"> > <action when="true()" action="atom.xpl"> > <result when="/success = 'true'" page="finishing"/> > <result when="/success = 'false'" page="errors"/> > </action> > </page> > > <page path-info="/xforms-web-service-ganda/get" model="get.xpl"/> > > <page id="finishing" path-info="/xforms-web-service-ganda/finish" > model="get.xpl" view="finishing.xhtml"> > <action when="/anything-else = 'yes'"> > <result page="web-service-ganda"/> > </action> > <action when="/anything-else = 'no'"> > <result page="see-you-again"/> > </action> > </page> > > <page id="errors" path-info="/xforms-web-service-ganda/errors" > view="errors.xhtml"> > <action when="/action = 'ok'"> > <result page="web-service-ganda"/> > </action> > </page> > > <page id="see-you-again" > path-info="/xforms-web-service-ganda/see-you-again" > view="see-you-again-view.xml"/> > > <epilogue url="oxf:/config/epilogue.xpl"/> > > </config> > > > > then this is the xpl that is used to call web service that i confuse how > to > pass parameter > > <?xml version="1.0" encoding="utf-8"?> > <!-- > Copyright (C) 2007 Orbeon, Inc. > > This program is free software; you can redistribute it and/or modify > it > under the terms of the > GNU Lesser General Public License as published by the Free Software > Foundation; either version > 2.1 of the License, or (at your option) any later version. > > This program is distributed in the hope that it will be useful, but > WITHOUT ANY WARRANTY; > without even the implied warranty of MERCHANTABILITY or FITNESS FOR A > PARTICULAR PURPOSE. > See the GNU Lesser General Public License for more details. > > The full text of the license is available at > http://www.gnu.org/copyleft/lesser.html > --> > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:f="http://orbeon.org/oxf/xml/formatting" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:b4p="http://www.example.org/message" > xmlns:delegation="http://orbeon.org/oxf/xml/delegation" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > > <p:param name="instance" type="input"/> > <p:param name="data" type="output"/> > <p:param name="data2" type="output"/> > > <p:processor name="oxf:delegation"> > <p:input name="data" href="#instance"/> > <p:input name="interface"> > <config> > <service id="single-branch" type="webservice" style="document" > endpoint="http://localhost:8080/ode/processes/SimpleChoiceBranching/SimpleChoiceBranching/SimpleChoiceBranching/Client?wsdl"> > <operation name="receive" > nsuri="http://example.com/SimpleChoiceBranching/SimpleChoiceBranching" > soap-action="http://example.com/SimpleChoiceBranching/SimpleChoiceBranching/ForClient/receive"/> > </service> > </config> > </p:input> > > <p:input name="call"> > <delegation:execute service="single-branch" operation="receive" > xsl:version="2.0" xmlns:delegation="http://orbeon.org/oxf/xml/delegation"> > <b4p:start>Hello</b4p:start> > </delegation:execute> > </p:input> > > <p:output name="data" id="receiveResponse"/> > > </p:processor> > > <p:processor name="oxf:exception-catcher"> > <p:input name="data" href="#receiveResponse"/> > <p:output name="data" id="revoke-ws-output"/> > </p:processor> > > <p:choose href="#revoke-ws-output"> > > <p:when test="/exceptions"> > > <!--delete this area also works properly--> > <p:processor name="oxf:pipeline"> > <p:input name="config" href="view-web-service.xpl"/> > <p:input name="data" href="#revoke-ws-output"/> > <p:input name="delegation" href="#receiveResponse"/> > <p:input name="header"> > http://localhost:8080/ode/processes/completeTask > </p:input> > <p:output name="data" id="revokedTask"/> > </p:processor> > <!--end of comment--> > > <p:processor name="oxf:scope-generator"> > <p:input name="config"> > <config> > <key>webservice2</key> > <scope>session</scope> > <session-scope>application</session-scope> > </config> > </p:input> > <p:input name="data2"><receiveResponse>false</receiveResponse></p:input> > <p:output name="data2" ref="data2" id="data4"/> > </p:processor> > > <p:processor name="oxf:scope-serializer"> > <p:input name="config"> > <config> > <key>webservice2</key> > <scope>session</scope> > <session-scope>application</session-scope> > </config> > </p:input> > <p:input name="data" href="#data4"/> > </p:processor> > > <p:processor name="oxf:identity"> > <p:input name="data"><success>false</success></p:input> > <p:output name="data" ref="data"/> > </p:processor> > > </p:when> > > <p:otherwise> > > <!-- delete this area also works properly--> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#instance"/> > <p:input name="config"> > <task xsl:version="2.0"> > <receiveResponse> > <xsl:value-of select="/*:output/@start"/> > </receiveResponse> > <reloadTaskList/> > </task> > </p:input> > <p:output name="data" id="revokedTask"/> > </p:processor> > <!--end of comment--> > > <p:processor name="oxf:scope-generator"> > <p:input name="config"> > <config> > <key>webservice2</key> > <scope>session</scope> > <session-scope>application</session-scope> > </config> > </p:input> > <p:input name="data2" href="#receiveResponse"/> > <p:output name="data2" ref="data2" id="data3"/> > </p:processor> > > <p:processor name="oxf:scope-serializer"> > <p:input name="config"> > <config> > <key>webservice2</key> > <scope>session</scope> > <session-scope>application</session-scope> > </config> > </p:input> > <p:input name="data" href="#data3"/> > </p:processor> > > <p:processor name="oxf:identity"> > <p:input name="data"><success>true</success></p:input> > <p:output name="data" ref="data"/> > </p:processor> > > </p:otherwise> > > </p:choose> > > </p:config> > > =========== > > see this line <b4p:start>Hello</b4p:start>? > Hello is static text, > i want to bring that input from my view.xhtml > but i dont have any idea about it > helppppp > > thanks > ganda:) > > -- > View this message in context: > http://www.nabble.com/how-to-input-parameter-from-xhtml-to-xpl-in-web-service-Urgentt--tf4486685.html#a12794532 > Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com. > > > > > > -- > 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 > > View this message in context: http://www.nabble.com/how-to-input-parameter-from-xhtml-to-xpl-in-web-service-Urgentt--tf4486685.html#a12794773 Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com. -- 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 |
hi eric,
thanks for the reply i already works properly now now i already successfuly calling webs-service with dynamic input and receive response in the same xhtml page however i still have 1 more problem how do i want to show the response in another pages ? i already tried this page-flow ============= <config xmlns="http://www.orbeon.com/oxf/controller" xmlns:xu="http://www.xmldb.org/xupdate"> <page path-info="/xforms-web-service-ganda/" view="enter-starts.xhtml"> <action when="/form/action = 'submit'" action="enter-starts-action.xsl"> <result when="/valid = 'true'" page="web-service-ganda"/> </action> </page> <page id="web-service-ganda" path-info="/xforms-web-service-ganda/starts" model="view-web-service.xpl" view="view.xhtml"> <action when="/start != ''" action="atom.xpl"> <result page="finishing"/> </action> </page> <page id="finishing" path-info="/xforms-web-service-ganda/finish" model="get.xpl" view="finishing.xhtml"> <action when="/anything-else = 'yes'"> <result page="web-service-ganda"/> </action> <action when="/anything-else = 'no'"> <result page="see-you-again"/> </action> </page> <page id="errors" path-info="/xforms-web-service-ganda/errors" view="errors.xhtml"> <action when="/action = 'ok'"> <result page="web-service-ganda"/> </action> </page> <page id="see-you-again" path-info="/xforms-web-service-ganda/see-you-again" view="see-you-again-view.xml"/> <epilogue url="oxf:/config/epilogue.xpl"/> </config> =============== can i pass parameter (the response of web-service) from atom.xpl into another model ( get.xpl ) so when i already get the response , i want to pass that response to get.xpl after that i will set that parameter in get.xpl, that parameter later will be used in finishing.xhtml i can pass parameter from get.xpl into finishing.xhtml what i confused is how to pass parameter between model to model ? can you give me simple code how to passing that parameter ? <page id="web-service-ganda" path-info="/xforms-web-service-ganda/starts" model="view-web-service.xpl" view="view.xhtml"> <action when="/start != ''" action="atom.xpl"> <result page="finishing"/> </action> </page> <page id="finishing" path-info="/xforms-web-service-ganda/finish" model="get.xpl" view="finishing.xhtml"> <action when="/anything-else = 'yes'"> <result page="web-service-ganda"/> </action> <action when="/anything-else = 'no'"> <result page="see-you-again"/> </action> </page>
|
Administrator
|
On 9/21/07, Suganda <[hidden email]> wrote:
> how do i want to show the response in another pages ? i already tried this > page-flow Instead of posting the instance to the same page and using the PFC to transfer the flow to another page, I recommend you do the submission directly from XForms to that other page. This will make the PFC much simpler. If you need to do some verification before going to the other page, you can have the code that does the verification exposed as a service, and call that code again with a submission. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- 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 |
Free forum by Nabble | Edit this page |