Re: XForms:instance requests, the HTTP Accept header and RESTful Web Services...

Philip Fennell wrote:
> If parameters are added to the URL to 'help' the process of content
> negotiation then things are no longer RESTful because the addition of
> the parameter(s) the URL and we no longer have one URL per resource.
> I think it is a bit harsh to say that providing the ability to specify
> an Accept header for the instance request is 'syntactic sugar'. Why is
> it so much more important for the submission than it is for the intial
> request?

I didn't mean to add a parameter to the get URL in the source attribute but was 
thinking about a new attribute on the instance element which form authers could 
use to control RESTful content negotiation, e.g.:
<xf:model>
   <xf:instance src="/object/145-12345" type="text/xml"/>
   ...

With dummy instance for the work-around, I was thinking about not specifying a 
URL at all but rather leaving the instance data empty or almost empty at load 
time and only replacing the empty document with the submission that has the 
appropriate accept header specified. An (untested) example would look like this...

<xf:model>
   <xf:instance name="I1"><my:empty/></xf:instance>
   <xf:submission action="/object/145-12345"
     name="S1" instance="I1" replace="instance">
     <header><name>accept</name><value>text/xml</value></header>
   </xf:submission>
   <xf:action ev:event="xforms-ready">
     <xf:send submission="S1"/>
   </xf:action>
   ...

Calling the above mentioned type-attribute syntactic sugar is indeed a bit 
harsh, considering its usefulness in a restful application. The problem that I 
want to avoid is duplicating the submission module into the instance element... 
what if you want to use WSSE headers when loading an initial instance... add 
another attribute... and so forth. Hence I'd argue for using the submission 
workaround (at least for now), starting with a potentially empty instance, 
whenever fine grained control on how an instance is retrieved is needed.




-- 
Sun Microsystems                Lars Oppermann <lars.oppermann@sun.com>
Nagelsweg 55                    Software Engineer
20097 Hamburg, Germany          Phone: +49 40 23646 959
http://www.sun.com/             Fax:   +49 40 23646 550
-----------------------------------------------------------------------
Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee 1,
D-85551 Kirchheim-Heimstetten, Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering

Received on Friday, 19 October 2007 15:01:27 UTC