Login  Register

Re: Re: How to wrap a text/plain response to xforms:submission so it becomes XML

Posted by Mahender Didwania on Dec 18, 2010; 10:57pm
URL: https://discuss.orbeon.com/How-to-wrap-a-text-plain-response-to-xforms-submission-so-it-becomes-XML-tp3093245p3094078.html

Further to the email below, I have found that xforms submissions processor actually does not throw an error if response is set to none.

However, in my XPL pipeline, I carry out xforms submissions a few times and I want to present the user (by way of output or textarea element on the original xform which called the XPL) with the actual result sent by XML DB as soon as as a submission finishes...

so, one xforms submission deletes a collection...user is notified, 2nd xforms submission creates a collection...user notification is updated with the response received, 3rd and 4th xforms submissions retrieve a doc from a URL (say CMS) and add that doc to the collection respectively...user notification is again updated with the results...

It all works, except the user-notification update/'actual' XML DB response capture via XPL output (for text/plain responses; and whether or not the submission succeeded).

Thanks,
Mahender.


----- Original Message -----
From: "Mahender Didwania" <[hidden email]>
To: [hidden email]
Sent: Saturday, December 18, 2010 10:40:02 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [ops-users] Re: How to wrap a text/plain response to xforms:submission so it becomes XML

Hi,

>Also, do I
understand right that in some cases, XML is returned, and in others,
text that is not XML?

Yes.

>You could try something like this:

<xforms:action ev:event="xforms-submit-error">
  <xforms:insert context="/" origin="xxforms:element('text')"/>
  <xforms:setvalue ref="/*" value="event('response-body')"/>
</xforms:action

--

That doesn't seem to work, especially because it does not modify the response, only the default-instance...please correct me if that is not the case.  Could not find xxforms:element in the docs...(where) is it documented (for more information on it)?

I want to capture the responses as returned by XML DB, but am stuck due to two things:
a) text/plain responses lead to xforms-submit-error and I have not yet been able to find a way to encapsulate that plain-text response in XML (could not find a processor that takes a plain text input and outputs XML (found the reverse though))
b) response is not preserved by xforms processor in case of an error, it is replaced with the document submitted

I actually want to give status report to the user incrementally which means that the XPL output (once I am able to find a workaround for a) and b) above) should flush out to browser incrementally - how to achieve that?

Thanks,
Mahender.


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