W3C home > Mailing lists > Public > public-device-apis@w3.org > January 2010

RE: [contacts] PutForwards for complex contact attributes

From: <richard.tibbett@orange-ftgroup.com>
Date: Tue, 19 Jan 2010 13:21:16 +0100
Message-ID: <4493_1263903677_4B55A3BD_4493_213181_1_355A518BC0575547B2A3D6773AAF8EEF83624F@ftrdmel1>
To: <public-device-apis@w3.org>
Hi,

I'm of the current belief having studied the subject somewhat that
WebIDL PutForwards [1] is not implementable within the Javascript
language. I hope to be stood corrected ;-)

I'm also still at a loss as to if/how to correctly define PutForwards on
an array object in WebIDL. Any input would be excellent as it avoids
requiring set and get methods in a JS API to mimic the 'putforwards
effect'.

If anyone is able to propose a way to implement the existing WebIDL
PutForwards mechanism [1] in a JS environment then that would be great
(and would be kudos for genius!). Otherwise we should drop this
PutForwards proposal albeit that would come at the loss of some
intuitive and useful helper behaviour and may require some helper
functions to be defined.

Cheers,

Richard

[1] http://dev.w3.org/2006/webapi/WebIDL/#PutForwards

> -----Original Message-----
> From: public-device-apis-request@w3.org 
> [mailto:public-device-apis-request@w3.org] On Behalf Of 
> richard.tibbett@orange-ftgroup.com
> Sent: 21 December 2009 17:11
> To: public-device-apis@w3.org
> Subject: [contacts] PutForwards for complex contact attributes
> 
> Hi,
> 
> Looking in to the WebIDL documentation I see some value in 
> using PutForwards [1] for Contacts API [2] 'complex' attributes.
> 
> The intention is to increase the simplicity for developers to 
> work with ContactField-based attributes (e.g. currently these 
> are phones, emails, impps attributes in the Contact interface):
> 
> The intention is for...
> 
> contact.phones.push({value:'+440000000001'}); // add a new 
> value, relying on the existing mechanism
> 
> ...to become equivalent to:
> 
> contact.phones.push('+440000000001'); // ...add a new value, 
> relying on a PutForwards helper mechanism to set the 
> resulting 'value' attribute to '+440000000001'.
> 
> 
> My question is a.) whether this is of interest for this API, 
> and b.) how it can be correctly defined in WebIDL based on 
> the nature of the attribute (an Array). 
> 
> Currently I have the following markup in mind:
> 
> interface ContactField {
>     attribute DOMString[]? types;
>     attribute DOMString    value;
> };
> interface ContactProperties {
>     ...
>     [PutForwards=value] readonly attribute ContactField[] phones;
>     ...
> };
> 
> Is this specified correctly???
> 
> This could require clarification via the WebIDL mailing list 
> but worthwhile getting feedback from DAP participants on the 
> proposed helper mechanism first...
> 
> Best Regards,
> 
> Richard
> 
> [1] http://dev.w3.org/2006/webapi/WebIDL/#PutForwards
> 
> [2] http://dev.w3.org/2009/dap/contacts/
> 
> 

*********************************
This message and any attachments (the "message") are confidential and intended solely for the addressees. 
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration. 
France Telecom Group shall not be liable for the message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
********************************
Received on Tuesday, 19 January 2010 12:21:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:41 UTC