RE: Web Intents based APIs

From: Greg Billock [mailto:gbillock@google.com] 
Sent: Tuesday, June 05, 2012 1:39 AM
To: Nilsson, Claes1
Cc: James Hawkins; public-web-intents@w3.org
Subject: Re: Web Intents based APIs

 

 

The MIME types are really nice in that they're conceptually very simple and
lightweight -- that makes them great for interchange, because they have a
minimum of structure. When APIs are fine with that, there's no reason not to
use them. For many, though, the type probably wants to have more structure
to it, which MIME types simply don't provide. For instance, the Gallery API
type may want to provide an object which allows you to read through it to
open different images asynchronously. MIME types won't support that kind of
interaction. They're definitely simpler, but sometimes that's a limitation
and not a feature.

 

[Jungkee] yes, Greg. That's exactly my suggestion for the Gallery API. In
fact, one more thing is I suggest we leave the description of the actual
definition of the dictionary to the related spec. (in this case,
"mediaObject" in the Gallery API.) In that way, Web Intents spec does not
have to describe every detail of the dictionary definition and only
describes the types it supports.

BTW, this is what I tried in the demo:

 

var mediaObject = {};

mediaObject.title = "Splendid photo";

mediaObject.description = "Photo taken by Jungkee";

mediaObject.url = "http://gallery.foo/photo.png";

mediaObject.content = b; // blob of the photo

mediaObject.filename = "/webhost/picture/photo.png";

mediaObject.author = "Jungkee Song";

mediaObject.date = "2012-06-05T17:32Z";

mediaObject.location = l; // position data

mediaObject.copyright = "CC";

mediaObject.tags = ["people", "sky", "plain"];

 

var mediaObjectArray = new Array();

 

for (var i = 0; i < [length of media items]; i++) {

    ...

    mediaObjectArray[i] = m; // mediaObject object

}

 

intent.data.postResult(mediaObjectArray);

 

 

 

 

 

 

 

Received on Tuesday, 5 June 2012 08:39:02 UTC