Re: JSON/mediatypes/src/replace

Hi John,

You probably won't believe it, but I was making exactly the same points yesterday. Also in a lot of cases your instance that is used to create the request isn't the instance that receives the data. So you are forced to specify the serialization method in those cases.

Kind regards,

Nick Van den Bleeken
R&D Manager

Phone: +32 3 821 01 70
Office fax: +32 3 821 01 71
nick.van.den.bleeken@inventivegroup.com<mailto:nick.van.den.bleeken@inventivegroup.com>
www.inventivedesigners.com


[cid:image001.png@01CBF2F8.1DA19110][cid:image002.png@01CBF2F8.1DA19110][cid:image003.png@01CBF2F8.1DA19110]

On 02 Dec 2011, at 18:35, John Boyer wrote:

Hi Steven,

It might be better to go with this alternative of saying that the output is XML unless otherwise stated.

One issue that arises with the automatic serialization is what to do if an instance is read as XML (or JSON) and then a replacement submission replaces *part* of the instance with JSON (or XML).  There's no general rule about the submission replacement format affecting the subsequent serialization of the instance.

Some specialized version of that rule doesn't seem to help much either, i.e. it makes more friendly a thing which was not all that unfriendly anyway.  The application author will know whether the service being contacted expects to receive json or xml, so it does not appear to be a problem that the author would request json serialization in the mediatype.

Cheers,
John M. Boyer, Ph.D.
Distinguished Engineer, IBM Forms and Smarter Web Applications
IBM Canada Software Lab, Victoria
E-Mail: boyerj@ca.ibm.com<mailto:boyerj@ca.ibm.com>

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw





From:        "Steven Pemberton" <Steven.Pemberton@cwi.nl<mailto:Steven.Pemberton@cwi.nl>>
To:        public-forms@w3.org<mailto:public-forms@w3.org>
Date:        02/12/2011 08:29 AM
Subject:        Re: JSON/mediatypes/src/replace
________________________________



Of course, the other option is always to serialize as XML unless otherwise
told.

Steven

On Fri, 02 Dec 2011 16:08:36 +0100, Steven Pemberton
<Steven.Pemberton@cwi.nl<mailto:Steven.Pemberton@cwi.nl>> wrote:

> Take this XForm (fragment), which loads an instance, changes a value,
> and writes it out again:
>
> <model>
>                  <instance src="http://example.com/data"/>
>                  <submission id="put" resource="http://example.com/data" method="put"/>
>                  <action ev:event="xforms-ready">
>                                   <setvalue ref="date" value="now()"/>
>                                   <send submission="put"/>
>                  </action>
> </model>
>
> I believe we agreed (just checking) that this will work whether the data
> coming in is XML or JSON. In other words, the submission uses the same
> mediatype to serialise as the instance was populated with.
>
> I think the same should be true in this case, where instead of using
> src=, the instance is populated with a submission replace="instance."
> Again, just checking.
>
> <model>
>                  <instance id="i"/>
>                  <submission id="get" resource="http://example.com/data" method="get"
> replace="instance" instance="i"/>
>                  <submission id="put" resource="http://example.com/data" method="put"/>
>                  <action ev:event="xforms-ready">
>                                   <send submission="get"/>
>                                   <setvalue ref="date" value="now()"/>
>                                   <send submission="put"/>
>                  </action>
> </model>
>
> Steven



--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.


________________________________

Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer

Received on Friday, 2 December 2011 20:03:49 UTC