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

WICDA

From: Robin Berjon <robin@berjon.com>
Date: Fri, 25 Jun 2010 10:55:35 +0200
Message-Id: <2058E1F4-CA18-48CC-AB63-5E3559287E47@berjon.com>
To: public-device-apis@w3.org
Hi,

during the last call, we discussed the fact that policy may need a way of enhancing Web IDLs produced outside of this WG in order to give some operations URIs. This is a problem that I've had to think about in the Web IDL REST binding context because it will likely also require some hinting and I don't want to have to modify the Web IDL.

For this purpose I quickly designed "Web IDL Component Designators and Actions" (WICDA, pronounced "wickeder") which you can read at http://dev.w3.org/2009/dap/wicda/. There's also an implementation of it in WebIDL.js that you can grab from GitHub: http://github.com/darobin/webidl.js. If you look inside "scratch" you can see wicda.js which is a simple script that takes wicdactions.json and applies it to wicda.idl.

Very briefly, WICDA provides two things. One is a way of pointing at components in a Web IDL schema. So for instance if you have the following Web IDL:

  module Cryptids {
      interface Dahut {
         void graze (float volume, DOMString whichPlant);
      };
  };

You could point to the "graze" operation using the following component designator:

  /module:Cryptids/interface:Dahut/operation:graze(float,DOMString)

The second thing that it provides are action sheets, that are essentially sequential lists of actions that can use component designators to modify Web IDL items. Right now the only action that we need is one to add extended attributes, so that's all that's supported. Say you wanted to add [Coolness=high] to the Dahut interface, and [Circular] to the graze operation, you would do the following:

{
  "name": "Cryptid Plus",
  "description: "Cryptids, only much cooler",
  "actions": [
    { "action": "addExtAttr",
      "path": "/module:Cryptids/interface:Dahut",
      "value": "[Coolness=high]" },
    { "action": "addExtAttr",
      "path": "/module:Cryptids/interface:Dahut/operation:graze(float,DOMString)",
      "value": "[Circular]" }
  ]
}

Applied to the IDL above, this would produce:

  module Cryptids {
      [Coolness=high]
      interface Dahut {
         [Circular]
         void graze (float volume, DOMString whichPlant);
      };
  };

This is experimental, I'm not sure it's a good idea, not sure that it's useful, not sure that we want it, and if we do that we want it on Rec-track, but it was a quick hack to put together so I thought I'd give it a shot. Thoughts?

-- 
Robin Berjon - http://berjon.com/
Received on Friday, 25 June 2010 08:56:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:10 GMT