xforms:submission : Build the value for action attribute dynamically

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

xforms:submission : Build the value for action attribute dynamically

a.grin
Hello,

I'm completely new to OPS and XForms.
I'm searching the way to build dynamically the value of the "action" attribute in the xforms:submission element. The goal is to add some parameters to the URL where XML is to be submitted:
<xforms:submission id="send_to_lw" method="post" action="http://127.0.0.1:8080/LW/xml?uuid=234234234234234234"/>
The value of the uuid is known only in the run-time (comes with the input:instance).
Building the complete <xforms:submission> element with XSLT doesn't help - <xforms:submit submission="send_to_lw"> cannot find referenced submission element.

Thanks for any help.
Andrey.



--
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: xforms:submission : Build the value for action attribute dynamically

Erik Bruchez
Administrator
Andrey,

I think the answer is simple: there is no way to dynamically build the
value of xforms:submission/@action.

If you use the "get" method, then you can pass parameters to the
URL. But you can't do a POST in this case. With xforms:load, you can
dynamically build an entire URL, but you can't do a POST either, or
retrieve any result except for displaying a new page.

-Erik

[hidden email] wrote:
 > Hello,
 >
 > I'm completely new to OPS and XForms.

 > I'm searching the way to build dynamically the value of the "action"
 > attribute in the xforms:submission element. The goal is to add some
 > parameters to the URL where XML is to be submitted:
 > <xforms:submission id="send_to_lw" method="post"
action="http://127.0.0.1:8080/LW/xml?uuid=234234234234234234"/>
 > The value of the uuid is known only in the run-time (comes with the
 > input:instance).
 > Building the complete <xforms:submission> element with XSLT doesn't
 > help - <xforms:submit submission="send_to_lw"> cannot find
 > referenced submission element.
 >
 > Thanks for any help.
 > Andrey.




--
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: xforms:submission : Build the value for action attribute dynamically

a.grin
Erik,
 
Thank you for the answer. I try to explain my scenario.  Maybe I just went completely wrong way.
There is my main application that stores part of the data as XML documents. Lets assume that each XML document is associated with some GUID. Application runs under Tomcat and I created a servlet to communicate with OPS. This servlet in doGet method expects to recieve some GUID as request parameter and writes the corresponding XML document in the response. doPost method expects to get the GUID as a parameter of the request and the changed XML document in the request.
1. I created OPS view for editing of the XML document.
1. My view defined in OPS is opened in the browser. GUID that identifies XML document is passed as a parameter in the request.
2. My OPS view requests the document from the servlet in the main application (request is built dynamically in the xforms:instance definition - that works fine)
3. After user changes the document and clicks "Submit" i want to send the XML back to the servlet and pass the same GUID as a parameter.
Of course I can include GUID in the XMl document itself but for several reasons I'd like to avoid it. Besides even the URL of the servlet should come from the configuration, so in any case I need some kind of dynamic building of the URL for submitting edited data.
 
Andrey.

 
On 3/1/06, Erik Bruchez <[hidden email] > wrote:
Andrey,

I think the answer is simple: there is no way to dynamically build the
value of xforms:submission/@action .

If you use the "get" method, then you can pass parameters to the
URL. But you can't do a POST in this case. With xforms:load, you can
dynamically build an entire URL, but you can't do a POST either, or
retrieve any result except for displaying a new page.

-Erik

[hidden email] wrote:
> Hello,
>
> I'm completely new to OPS and XForms.

> I'm searching the way to build dynamically the value of the "action"
> attribute in the xforms:submission element. The goal is to add some
> parameters to the URL where XML is to be submitted:
> <xforms:submission id="send_to_lw" method="post"
action="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://127.0.0.1:8080/LW/xml?uuid=234234234234234234" target="_blank"> http://127.0.0.1:8080/LW/xml?uuid=234234234234234234"/>
> The value of the uuid is known only in the run-time (comes with the
> input:instance).
> Building the complete <xforms:submission> element with XSLT doesn't
> help - <xforms:submit submission="send_to_lw"> cannot find
> referenced submission element.
>
> Thanks for any help.
> Andrey.





--
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: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.objectweb.org/wws" target="_blank">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: xforms:submission : Build the value for action attribute dynamically

Adrian Baker-2
In reply to this post by Erik Bruchez
I've been a little frustrated by this (arbitrary?) limitation in the
past also.

If your parameters are coming from your instance, instead of trying to
add parameters to the URL, you can include them in the XML you're
submitting and then extract them from the body of the POST server side.

Alternatively you can use an XSLT or some other method to pre-process
the form and set the action URL that way.

Adrian

Erik Bruchez wrote:

> Andrey,
>
> I think the answer is simple: there is no way to dynamically build the
> value of xforms:submission/@action.
>
> If you use the "get" method, then you can pass parameters to the
> URL. But you can't do a POST in this case. With xforms:load, you can
> dynamically build an entire URL, but you can't do a POST either, or
> retrieve any result except for displaying a new page.
>
> -Erik
>
> [hidden email] wrote:
> > Hello,
> >
> > I'm completely new to OPS and XForms.
>
> > I'm searching the way to build dynamically the value of the "action"
> > attribute in the xforms:submission element. The goal is to add some
> > parameters to the URL where XML is to be submitted:
> > <xforms:submission id="send_to_lw" method="post"
> action="http://127.0.0.1:8080/LW/xml?uuid=234234234234234234"/>
> > The value of the uuid is known only in the run-time (comes with the
> > input:instance).
> > Building the complete <xforms:submission> element with XSLT doesn't
> > help - <xforms:submit submission="send_to_lw"> cannot find
> > referenced submission element.
> >
> > Thanks for any help.
> > Andrey.
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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