2012������01·���

2012������01·���17������

Web Intents������ persistent connection������¼������½���¹������������������

���򏩡��䏢����\��\���\���\������¼��������������¡� Web Intents ������ persistent connection (·��Џ��³�����䏪�³����������¼������½���¹�����������ď��������������򏪳�������������������������¾���²��Ï��·���������¹��¡�

�����������䏢����Web Intents ������������������������������\��\���\���\������¼��������¡�������Web Intents������¾��؏����ӏ�������������²��ď��·��������¡�W3C������\µ\���\���������\���\���\���\��������������̏�����������������������������¾��؏����ӏ����������������������� ������������������½��Џ����������������������ď������������¹���̏�¡�����叢���������̏��������������������������·���������Ï��Ï���orz
120117-0

Web Intents ������»�������������µ­½��ҏ��µ������������������������������������¡����������������������я������������������¹���̏�¡�W3C ������ Mailing List�������������³������������������������µ��������������ҏ������������𡯏����ď���������������µ­½��ҏ��µ�����������������쏢������¡��������«���������«»²¹������������������������������¹��¡��½������������³��돪���ӏ��¹�������������� Section 4 & 5 �������������������¹���̏�¡��򏩡��䏢����\��\���\���\������¼��������������¡��½�������������«����������5.3 Persistent connctions (·��Џ��³�����䏪�³����������������������������¼���������¾������²�����ď�����������»�ߏ��������������¹��¡�

Web Intents ������ RPC \���\���\���

Web Intents��������¡�RPC (Remote Procedure Call) \���\���\������������������������������������������¹��¡��³���³��������¡�Web Intents�����ҏ�����������½Ð���¹�����Ï����� Client, ������������½Ð���µ�����������������Ï����� Server ���������¹��������������¡�Client ���«���������������µ������������Ð���·��¡�Server����²��ď��«���·������������½�������������¹��ԏ�������¡��½������·���²��������ҏ����ӏ��¹�����������������Ï������̡돫������������������������������������������¹��¡򏪡�돢�¹²��я�����\��\���\���\������¼������¾���²��Ï��·�����ď��»½���URL��������¡��½�����¡돫��������������¹��¡�

���³������ RPC \���\���\���������·�����������������¡�돫�������·���²��������ҏ����ӏ��¹��������¡��½�������돪�¹��� Server ���«������ Client ������\������¼\��ď����ҏ��������¹���³���������̏�¡�½Ð���������������������������������³��������¡�����𡯏��Ð��¡�Server ����\���\���\���\���\µ���¼\���\¹���������������·��������¡�Client���«����������\���\���\���\���������\���\���\»���¼\��������ҏ���������������ď�������¡ߏ����������������Ï����µ��������ҏ��·��������������¡�Server�����Ï��������������������������������µ���������������������������¾������\������¼\�����¼���«������������\���\���\���\���\���\���\»���¼\���������¼��؏��ޏ��������³������������½Ð���������������»�����я����돫����������������ޏ����������ӏ�ď�����¼��؏��ޏ��������³����������½Ð���������������¹���̏�¡��������������돪؏�����������������������������¹������������������¡�RPC\���\���\������������·���Ð��������������������������¡�²��ď��«���·������������ Persistent connection ������¹��ԏ�����¼������폢�������̏����Ώ��·���������������������������¹��¡�
120117-1

Persistent connections on Web Intents

���³������ Persistent connection ������¼������½���¹������¼������������̏�¡�Web Intents API������Editor's Draft 5.3 Persistent connections ������µ­½��ҏ��µ���������������������������¹��¡��½������������������¡񏪲���³��я����졭�������ޏ�����½Ð�������������������½��돩Ώ�����³«���µ������������������������\��\���\���\������¼\·\���\���\���\���\���\���\������������������ޏ�����»����»������������¡�iframe�����ҏ����Џ����������ď����򏪳���������������������������¡��³���³������������¼���������¾������²���������¹��¡�

���³���������ԏ���̏�������������������������¡񏪢���������Draft�������������돪�²¼���������������Ï�����½��ҏ����㏢�������������������������������¹��¡�

One is returning URIs which can be loaded by clients in an iframe and then messaged using other web platform features.

�����돪�²¼��¡�돪؏����؏���
�����돫����������������򏪳���������¡񏪴��ӏ��µ������������URI���«������ client �����Ï����� iframe ������³«���­��¡�(Web Intents�돪�³�돢������Web������µ����½������»�����������������¡�\���\���\»���¼\���\���\�돢���ҏ��¹�������������������������¹����
��������������������¡񏪢��������̏�����\���\���\���\����������������������������Ð��¡�\���\���\���\��������������䏪�³���¹�����������ď�����������URL¾��Ï����я����� Web Intents ������¼������������·��¡��½������������ iframe ������³«��������¡��½���·��������¡�client ������ iframe(server) �����������¡���ӏ�������¡�HTML5 Web Messaging�����������������ҏ����Џ��������������Ð��¡�Persistent Connection����¼������½���������­�����������������������Ï��������ޏ��������¹��¡�
120117-2

������𡯏��Ð��¡�Client��������¡�돪�²¼������\³���¼\��������� Web Intents �����ҏ���������돢�·���������¹��¡�(action��������¡񏪳��������¡����������²¼������URL������shema-URL���������·�����������Џ��������������·�����ď���

var intent = new Intent(
  "http://webintents.cloudfoundry.com/chat",
  "text/url-list",
  "");
window.navigator.startActivity(intent, function(data) {
  // ������½���
});
Web Intents·Ð���³����������������돢�µ������������ server ��������¡�\���\���\���\��\���\������������Ð���·��¡�돪�²¼������\³���¼\���������¼«\���\���\���\��я�����������\���\���\���\���µ����½������\��\���\»\¹���¹������URL�����ҏ����ӏ��·���������¹��¡�
if(window.intent && window.intent.postResult) {
  window.intent.postResult(location.origin+"/chat");
}
Client��������¡�¾���µ­������URL������¼��؏���¼�����������������¡��½������������ iframe ������³«���­��¡�HTML5 Web Messaging(postMessage)�����ҏ����Џ�����\���\���\»���¼\���\���\�돢����¹��ԏ����Ï��³��������������¡�\���\���\���\���������µ����½�����ҏ����̏����Џ��¹���������³����������½Ð�����������������������Ï��������������������������¹��¡����Џ��������쏢������������¡�돪�²¼���������������Ï�����\³���¼\������������������������������¹����������������¾������²�����ď�¡�startActivity()���������������ѡ돫⏢ď�ԏ�����\³���¼\���\Ð\���\������������·�����������ď�𡯏�����������¡�
var ifr_ = document.createElement('iframe');
ifr_.id = "chatifr";
ifr_.src = data;
ifr_.style.display = "none";
document.body.appendChild(ifr_);

$("#chatifr").load(function(){
  var subwin_ = ifr_.contentWindow;
  subwin_.postMessage("init", "*");

  $("#chat .after form").submit(function(){
    var box_ = $("#chat .after input[name='chatmesg']");
    subwin_.postMessage(box_.val(), "*");
    box_.val("");

    return false;
    });

  window.addEventListener("message", function(e){
    $("#chat .after output")
      .append([e.data.username," => ",e.data.body,"
"].join("")); }); });
�����ӏ��³���������̏�������¡�iframe������³«���«�����������������Ï�����URL��������������������������������¡�HTML5 Web Messaging������\³���¼\���\��\���\�돢�̏���̏���ߏ��������¹���̏�¡��³���³������������³����돢Ï��·���������¹��¡�

Web Intents������\���\���\���\���¾��Ï����я����ҡ�¹���������·�����������Џ����������������������������Ï��³������

��������������������¡�Web Intents�����ҏ�¡���\³\���\���\·\���\��я����䏪�³�����Џ�����\���\���\���\���¾��Ï����я����ҏ����ҡ�¹���¹�����������ď����������������Џ��������������Ð�������������㏢����¹�����𡯏��������Ð�������������³���������������������������������¹��¡��³������������������������������������������¡�Working Draft �������������돪�²¼���������������Ï�����½��ҏ����㏢�������������������������������¹��¡�

In these cases, Web Intents is acting as a way for the user to attach a particular client page to a persistently-available service.

(�돪�²¼��¡񏪣���돪؏�����)
���³������������������\�ޏ��¼\¹��������������¡�Web Intents��������¡񏩡���������������\��⏢�¼\��������������� persistent \µ���¼\���\¹������\��\���\»\¹���¹��������������������̏���ߏ�����¾��Ï����я�����¼������������¹�����������ď��������������򏪳����������·�����������Џ��������������������������������������¹��¡�
���³���������������Ï�����¹�����𡯏��������������ď�������������¡�½��������Ï����� Web \��\��\�������ӏ����·�������²������½���������������������������¹��¡�Web Intents ��������¡�\������¼\�����¼����¼«���³������ Web \��\��\���\�ޏ��¼\·\���\��я����ҏ����쏪���ҏ��¹�����������ď�����������»��������������Ώ��������¹������������¡��½������¾��Ï����я��������������������������������� Web Intents ���������������������叢��������������������̏���ߏ����������������������������������Ï��³���������������������������������¹��¡�

������𡯏��Ð��¡�\���\Ð\���\¹�����·�������������������������𡯏��Ð��¡��³���������������Ï�����¹�����𡯏��������ҏ����Џ��������������³��������������¡�Device(client)¾���������\���\���\���\³\���\���\���\���������\½���¼\¹���������·��������¡�\���\���\���\�돢����\���\���\���(server)���������½������������\¹\���\������¼\���\���\�돪���叢ď��¹���������³����������²������½���������������������������¹��¡�Web Intents·Ð���³��������¡�\������¼\��ď����ҏ����·������¹�����������ď�����������\���\���\���\���¾��Ï����я����ҏ��������������������������·��¡��½������\���\���\���\��������ҏ����Џ�������������¡�HTML5 ������³���¼��� API �����ҏ����Џ�����������¼������������·������ Blob \������¼\��ď����� Web Socket ������»���������������\���\���\��я�����\¹\���\������¼\���\���\�돪���叢ď��¹���������Ð�������������������������¹��¡�

¾������������������������·�����ď�¡�\���\���\���\�����������������\µ\���\��\��������ҏ�¡�http://webintents.cloudfoundry.com/�����������²�����������쏢�­���������·�����ď�¡�돫������㏢¡�http://webintents_chat.cloudfoundry.com/������\��\���\»\¹���·�����ď�������¡�"connect to 3rd party chat"\���\���\��я�����\���\���\���\������¹��������������¡�Web Intents ���̏���������돢�·���������¹��¡�picker window���«������"chat"�����ҏ����쏢���ӏ�������¡�Inline ������ login ²������������̏��½¼�����µ���������������¹������������¡��¾����돢���ҏ����Џ��������� "start" \���\���\��я�����\���\���\���\������·���������������������µ��������¡��¹��������������¡񏢱µ������²���������������\���\���\���\������������Џ���\���\���\���\¹���̏��½¼�����µ��������¡�\���\���\���\��������ҏ����̏�����½Ð�����������������������Ï��������������������������¹��¡�
120117-3

���³���³������2��������½������¼���������������̏����������������¹��¡�돫������������䏢������¡�http://webintents.cloudfoundry.com/ ��������������¡�\���\���\���\���������µ����½��������ߏ�������¡�WebSocket������\³���¼\���\��\���\�돢�������������������¹��ԏ��������������������������������������������¹��¡��³������\��⏢�¼\�����������������¡�������������������\���\���\���\���\���\���\»���¼\�������������½Ð�������������ޏ�����¼��؏���»������������������쏢������¡�\���\���\���\���\µ���¼\Ð���¼������������\���\���\»���¼\���������������������������������������¡񏪡�������� http://webintents_chat.cloudfoundry.com/chat ���������������»���������������������¹��¡��³������URL��������¡񏪲���²���»��������� iframe ������\��쏢�¼\��\��я��µ�����������������쏢������¡�µ¼»�������쏢����\Ð\���\���\��\���\���\���\���\������¼\«���¼���������·����������돢�«���·���������������������¹��¡��³���������������Ï��������¹���������³��������������¡�¼«���³������·�����������¡�\���\���\���\���µ����½������³���¼«������ Web\µ\���\���������¼���������¹��Џ��������³����������½Ð���������������¹��¡�

�����������á돫������������䏢������¡�\���\���\���\���\µ���¼\���\¹������¼«���³�����������쏪���ҏ��������­���������������������¹��¡���²��я���������������������¡�\µ\���\��\���������\���\���\���\���\µ���¼\���\¹���������ޏ��������¹���̏�¡��������· Intent ���������·������ facebook������\���\���\���\�����������¡�Google Talk���̏��Ð�����ď��µ�����������������������Ï�������������������������¡��½������\��⏢�¼\��������������������������������������ď�������������������¡�¼«���³������¹\�����Ώ�����\���\���\���\���\µ���¼\���\¹�����ҏ����쏪���ҏ��·�����������̏����Џ��¹���������³����������½Ð�����������������������Ï��������������������������¹��¡��³��������������������¡�\���\���\���\���������»��������Ï����ď�������������������¡�\���\���\���\���������\µ\���\����������돪䏩��돢�·���������ޏ��������Ð���������ޏ��������»�����я��������·�����ď��̏�¡��³���������������Ï�����¹�����𡯏������������폢������������¡�����������\µ\���\������«������������������Google Talk�����������������ҏ����̏����Џ��������­��¡��«��������¡��½�����������������ҏ����쏪���� ½Ð�����������������������Ï������������������������������¹��¡�

����²���¾���²��Ï��·������\µ\���\��\���\µ\���\�����������¡�github������������³«���·�����������������������¹��¡�client������ https://github.com/KensakuKOMATSU/webintents_test��¡�server ������https://github.com/KensakuKOMATSU/webintents_chat_test���������¹��¡�


��ď��µ���\���\���\��\���\���\­\���\�돢����
kotesaki at 04:07����Permalink����Comments(17)����TrackBack(0)����clip!����html5 | WebIntents

2012������01·���14������

Cloud Foundry������Mac����������돢�«���·�����������Ώ�����

���򏩡��䏢����\��\���\���\������¼��������¡�µ�ߏ��¹������Cloud Foundry\���\��ď��������¹��¡�

What's the idea of this entry?

\��쏢�¼\��\���PaaS������ Cloud Foundry ��������¡񏪣���¾������³������\��⏢�¼\�������github/vcap)������½��Џ��«������������������������ "Automated Setup" ������»���������������\���\���\¹\������¼\������·���������¹��¡�������¡��³������Setup\¹\���\���\��\������������¹���̏�¡�Ubuntu 10.04.2 server 64bit ����������돢�«���¹���³�����������ҏ���돪���я�������돫��������������������������������¹��¡��³���������ď�������¡�Cloud Foundry��������돢돫�����³����«�����������ď�������¡�ġ����¹��������������Ï��������¹���������������­��������¡�������������������\���\������¼\���������\µ���¼\Ð���¼������ssh���\��������������¡�¡�¡��������«²��ď��«�������������������������¹��¡�������������������¡�����¼������µ������Mac����������돢�«���·�����ď������������������������½���������叢���Ï���²��ď��«������³��⏢�������·��¡������������������Ï��³��������������¡�Mac������Cloud Foundry������\���\���\���\��\���\���\���\¹\������¼\������·���������·�����ď�����������¡��½������������\���\������������¹��¡�

Does it work on Mac?

���µ��������¡񏪢���������Setup\¹\���\���\��\�������²��ď����ҏ������������������������������������«�����ҡ��������ޏ�����½��Џ�������������¡񏪤������­�����������я���������������̏��«���������������¹��¡�돫���������������¡�Cloud Foundry \«���¼\���\�������¾���������github������������³«���µ������������������������ Cloud Foundry ������³���¼���\³\���\����¼\���\���\�������������\���\���\¹\������¼\�����¡����������á돫���������������¡��½�����������������·������·����������돢����\���\���\���\���\��\��������nginx��������������¡�mysql��������������¡�rabbitMQ��������������¡�ruby������������node����������������������\���\���\¹\������¼\������������¹��¡�����������¾��䏢�·��������������¡�publickey ������������¾���²���µ­»���������»²¾������·���������������������µ��������¡�

��������¡�Ubuntu���·���Ð������������������������������������������������������¡��³������»��Џ����� apt-get ������������������»��������������������������������ď�������¡�����������������¡��½���������¾�����������ҏ�����������������\���\���\¹\������¼\������¹���������Ð��¡񏪴���������Mac����������������돢�������������쏢�쏢����������������\���\������������¹��¡�

���³���³��������¡�Cloud Foundry�����������·���\���\���\���\���\��\��������������������ҏ����Џ�������������������������¡񏩡�돢돫��·���������������������ޏ��������������µ��������¡�돪�����������������̏���ߏ�����������������������¡��½�����������叢���������ď����������������������»�����я�¡�����𡯏��Ð��¡�rabbitMQ������»������������������������������������������Ð��¡��½������������\���\���\¹\������¼\������¹����������̏���ߏ����������������������������������������ġ�����������¡�����������������¡�¼�������돢����\���\���\¹\������¼\������¹��������������������������������������¡��½���������؏�����������¹������������������·��������𡯏��Ð��¡��½�����������叢���������������Џ����������������������������»�����я�¡���¼�������돢���������Џ��������������³��������������¡�Cloud Foundry��������돢�­�����ҏ�����²��ҏ��������­���������¹���·��¡�Automatic Setup������»��������Ï�������¡����������Ï��·������������\���\���\���\���\���\���\���\¹����������������������»����������������·���������������������¹������������...����

��돪�����������������̏���ߏ�����������������

�돪�²¼��������¡�Cloud Foundry�����ҏ���돢�«���¹�������������ď�������������¡�돪�����������������̏���ߏ��������������������ҏ���µ��я��·���������¹��¡����������������Ώ�������¡�\Ð���¼\���\���\��я�������������������¡��³������\Ð���¼\���\���\��я�����������������Mac����������돢���������ď��������쏢�쏢���������������Ï������������������¹��¡�

  • rvm
  • ruby-1.8.7 (���³��������������¡����ҏ��������������������·�����ď���������̏���ߏ��������������«������)
  • ruby-1.9.2
  • Rails 3.0.5
  • sqlite3 (3.7.9) (Cloud Foundry Controller������development\������¼\�������������돢�«���¹¾���¹���)
  • redis (2.4.4) (sudo port install redis; sudo port loas redis)
���������������돢������������¡򏪤��ď���̏�¡����������������Ώ�������¡�ruby������rvm�����������Џ��������������������������µ�����������������������Ï�����������¡񏪩��ӏ��³rubygem����������̏���ߏ��������¹��¡򏪮�돢�������ď�������¡�

����������������¡񏪳�����������������������������������¡�Must������

  • node (0.6.6)
�����������Џ����������������������������¹��¡�

��돫¢����\���\��\���\���\���\���������돫�����

Cloud Foundry��������������¡�돫¢����\���\��\���\���\���\������������·��������¡�

  • /var/vcap
  • /var/vcap.local
���̏���̏���ߏ�����������������¡�
$ mkdir /var/vcap
$ chown komasshu.staff /var/vcap
$ mkdir /var/vcap.local
$ chown komasshu.staff /var/vcap.local
�����ҏ����������������������쏢�­���������¹��¡����������������Ώ�������¡�Cloud Foundry¼«������������¡�root��������񏢱��������������ԏ���ߏ��������¹������������¡�chown������\������¼\�����¼���¾������\��\������¼\�ߏ��¾��������¡�³���¼«������\���\��\���\��ѡ������­�����������������������·������²¼���µ��������¡�

Cloud Foundry������\���\���\¹\������¼\���

Cloud Foundry·���������\���\���\���\������¼��������������¡�돪�²¼���̏���̏���ߏ��������¹��¡�

vcap
cloud foundry������\³\��\³\���\����¼\���\���\���
vcap-service
cloud foundry��������¡�³���¼���\���\���\���\���\��\�����ҏ���돢�«���¹�����ď�����������\³\���\����¼\���\���\���
nats
cloud foundry������»���������������������������lightweight pub-sub messaging
vmc
cloud foundry������»��������Ï����ď�����������\³\���\½���¼\���\���\���\���\��\���\���
������돪؏�����\���\��\���\���\���\��������ҏ�돫�������������¡��½���������¾������������ git clone���·���������¹��¡�
$ cd ~
$ mkdir cloudfoundry
$ cd cloudfoundry
$ git clone https://github.com/cloudfoundry/vcap.git
$ git clone https://github.com/cloudfoundry/vcap-services.git
$ git clone https://github.com/derekcollison/nats
�����������ď�¡�vmc��������������������������������¡�gem�����������Џ��������������¹��¡�
$ gem install vmc
�����������쏢¡�Mac������½���\���\���\¹\������¼\���������ruby������������vmc����¾���¼�������������돢�­���������»�����я�¡򏪳��������� rvm ������ruby-1.9.2�����������⏢������������𡯏���������돢�«���·���������������������¹��¡�

github����½��쏢���������������ď�������¡�\»\���\���\��\���\�ߏ��������¹��¡����������쏢¡�돪�²¼������¼���½��������������� bundler ���̏���̏���ߏ��������¹������������¡�

$ gem install bundler
�����������Џ����������������쏢�������������������������µ��������¡�
�����������돢¡�vcap���«��������¡�vcap-services������»��������Ï����ď�������������¡�symboli link�����ҏ�����������·���������¹��¡�
$ cd vcap
$ rmdir services
$ ln -s ../vcap-services services
���½���·��������¡�vcap������³���\���\���\������¼\������������Ð���·��¡�bundle install������¹��ԏ����Ï��³��������������¡񏪱�̏���ߏ�����gem������¼������������·���������¹(cloud foundry���������� Rails \��\��\������������������������������������������¹������������¡�rake db:migrate���̏���̏���ߏ��������¹������¡�
$ cd ~/cloudfoundry/vcap
$ cd router
$ bundle install

$ cd ../cloud_controller
$ bundle install
$ rake db:migrate

$ cd ../dea
$ bundle install

$ cd ../health_manager
$ bundle install

$ cd ../stager
$ bundle install

$ cd ../services/redis
$ bundle install

$ cd ~/cloudfoundry/nats
$ bundle install
�����������쏢¡���²��я�����redis����������service���������·���������Ð�����ď��¹������¾���¹��������ҏ������������·���������������������¹��¡�

³���¼��������Ώ�����\���\���\���\�������������¹¹

¼���������¡�Cloud Foundry������³���¼��������Ώ�����\���\���\���\��������ҏ�����¹¹���·���������¹��¡�

cloud_controller/config/cloud_controller.yml
����²��я�����·�����������������¡�nginx������»��������������������������������������ď�������¡�router���������¾������\��\���\»\¹���·���������¹��¡��³���������ď�������¡�router������\���\���\���\���\���\����¼\���2222������»������������·���������¹��¡�
-external_uri: api.vcap.me
+external_uri: api.vcap.me:2222
�����������¼���\��\«\���\���\��������ҏ�����¹¹���·���������¹��¡�
-admins: [[email protected], [email protected]]
+admins: [[email protected]]
����������¡񏢱���½��ҏ�����vmc\³\���\���\��������������������¼���\��\«\���\���\��������ҏ�돫�����·�����ď�������¡�돪�²¼���������Ώ�����������¹¹������¹��ԏ����������ď����叢���Ï��̏��������������������·�����������Ï�¡�\���\���\���\���\�����������������¡񡭏��������¼��ԏ���񏢱������̏�����������������������\��\«\���\���\������̏�돫�����²������½���������������������������������������¹������������¡��³������������\���\��؏��������·���������¹��¡�
-allow_registration: true
+allow_registration: false
dea/config/dea.yml
\���\���\���\���\�����������������¡�node.js������\Ð���¼\���\���\��я���0.4.12���������������������������������������¹������������¡��³�����������ҏ�����¹¹���·���������¹��¡�
node:
     executable: node
-    version: 0.4.12
+    version: 0.6.6
bin/vcap
����²��я�����·�����������������¡�service���������·������redis���·���«����돢�«���·���������»�����я�����������¡��½����������¹¹������¹��ԏ��������������¹��¡�
def self.services
-    %w(redis mysql mongodb neo4j)
+    %w(redis)
end
���¾��������������¡�vmc�������������½¼�������ҏ�����¹¹���¹�����������ď�������������¡�ġ����¹�����Џ�𡯏����ď����叢���Ï��̏��������������������³�����������������������«������������������������µ������������·���������¹���̏�¡���������������𡯏����돩��돢�«���¹���������ޏ�������������¡��³���������돢����������������OK���������¹��¡�

run!!

�����������������������ď��������³��������������¡�½������������������돢�������������·�����ď�����������¡�����������������돢�«���¹���������ޏ��������¹��¡�

$ cd ~/cloudfoundry/nats
$ bin/nats-server
������nats�����ҏ���돢�«���·��¡�
$ cd ~/cloudfoundry/vcap
$ bin/vcap start
��������¡�cloud foundry�����ҏ���돢�«���·���������¹��¡��³�����������������������������ď�����µ�������� :)

¼�����돪���������돢�«���·�����������Ώ�����

����²��я�����·��������������� nginx �����ҏ���돢�«���·�����������������������������ď�������¡�vmc ������ target ������

http://api.vcap.me:2222
���������������������������¹��¡�����������������¡�/etc/hosts��������¡�api.vcap.me ������127.0.0.1������������¹¹���·�����ď�������¡��³������\��ď��¼\²\���\���������\��\«\���\���\��������ҏ��Ð�����ď��·���������¹��¡�
$ vmc target api.vcap.me:2222
$ vmc add-user --email [email protected] <- �����������\������¼\��
$ vmc add-user --email [email protected]  <- �돫�������\������¼\��
����������������¡��³������돫�����·������\������¼\�����¼������ vmc login ������¹��ԏ�������¡�\��\��\���\�ޏ��¼\·\���\��я�����deploy����½Ð�����������������������Ï��������������������������¹��¡�\��\��\���\�ޏ��¼\·\���\���deploy�����򏪳���������������������������������¡�https://github.com/cloudfoundry/vcap������»²¹�����������¡�¹¹��������¡�¾��䏢�·������¾��Ï����я�����@u1���µ�����я�����\���\���\�돢��\���\¹\¹\������������¹��¡�

\������¼\«\���Mac������\���\���\¹\������¼\������µ��������������������������������¡�ġ����¹������³����������³��⏢�������������������������¹��¡�����𡯏��Ð��¡�Cloud Foundry������\³\���\���\������¼\������¼��������¡�Rails����������돢����������������������������������¡񏢱½��돩Ώ����¡����������¾��Ï����я�������¡�sqlite3������\������¼\���\��������ҏ��«���������Ð�돫������䏪�����³��¡�

$ cd cloudfoundry/vcap/cloud_controller/db
$ sqlite3 cloudcontroller.sqlite3

sqlite> select * from apps;
4|4|hello|sinatra|ruby18|128|1|STARTED|STAGED|f781071b01a446deac76cf5dfcb7626700d018aa|ccGixGg0FNk=|---
:debug: !!null
|f|2012-01-13 04:36:53.932974|2012-01-13 04:36:58.544203|bc5dd7d1409a13c7a73c4d11781be19f61904ca8|256|2048|2|1
7|4|hello2|sinatra|ruby18|128|1|STARTED|STAGED|4bcaa6f4a83edcc22d5f4b51ffd54e2917798f4e|ccGixGg0FNk=|---
:debug: !!null
|f|2012-01-13 04:53:22.330493|2012-01-13 04:53:25.575726|bc3f25c248866b944a80c89607a66dc6d0ee360b|256|2048|2|1
8|4|chat|node|node|64|1|STARTED|STAGED|e1cf880a9ccec05203f4f2883b2bffdfbb4148dc|ccGixGg0FNk=|---
:debug: !!null
|f|2012-01-13 05:14:23.285442|2012-01-13 11:19:40.286418|7c136c0f666bc8ce8c89e5da78bb74c994c1fe0c|256|2048|4|1
9|4|chat2|node|node|64|1|STARTED|STAGED|a7f04c2fe2845abf0f2c0f647cee52093f4bfc43|ccGixGg0FNk=|---
:debug: !!null
|f|2012-01-13 05:38:44.459637|2012-01-13 05:40:33.890639|b7434917bc408e8ef8914ec15bb3f5427f75196c|256|2048|4|1

sqlite> select * from routes;
2|4|hello.vcap.me:2222|t|2012-01-13 04:36:54.084230|2012-01-13 04:36:54.084230
5|7|hello2.vcap.me:2222|t|2012-01-13 04:53:22.346050|2012-01-13 04:53:22.346050
6|8|chat.vcap.me:2222|t|2012-01-13 05:14:23.442924|2012-01-13 05:14:23.442924
7|9|chat2.vcap.me:2222|t|2012-01-13 05:38:45.575668|2012-01-13 05:38:45.575668
�����������ď�¡񏩡�돢돫�����������\��\��\��������� /var/vcap.local/dea/apps �����������只���ӏ��µ���������������������������������«��¡�ġ����¹³���������¹���������³����������½Ð���������������¹��¡�

����������¡�\��\��\���\�ޏ��¼\·\���\���deploy���·�����ď�������¡� /etc/hosts ������FQDN ������\���\¹\������¾���Ð�����ď����ҏ����쏪���돢����������������!!������𡯏��Ð��¡��³�����я���������������

127.0.0.1  localhost api.vcap.me hello.vcap.me chat.vcap.me hello2.vcap.me

���¾������\µ���¼\���\¹����mongodb���������������������ҏ���돢�«���·�����ď�����¾���¹�����������¡�redis�����ҏ���돢�«���¹���������³������������»²¹�����������¡�\���\���\���\���\������·�����������Ώ��������������������µ��������¡�


��ď��µ���\���\���\��\���\���\­\���\�돢����
kotesaki at 11:21����Permalink����Comments(7)����TrackBack(0)����clip!����Cloud Foundry 

2012������01·���09������

\���\���\���\���\Ð\���\¹�����·���������¼������½���¹������ Web Intents ����\���\���\���\���\Ð\���\¹�����·��������ԏ���

�����²��я�����\��\���\���\������¼�������돫⏢�­���³���­��¡���²��я����� Web Intents ��������������¹������\���\¹\������������¹��¡���²��я�������¡����ӏ��������¼��¡�Web Intents ���� Web ������������\���\���\���\���\Ð\���\¹�����·���\µ���¼\���\¹������¼������½���¹�������������������ď�������¡�½�������ߏ����� API �������������������������«���폢¡����������������������������������������·���������¹��¡����������쏢¡�Web Intents �����¡���Ï����䏢����»���������������������������������������������¡������²��я�����\��\���\���\������¼������»²¾���²¼���µ��������¡�

Device APIs ������돪����·����돢����

Web Intents ������\���\���\���\���\Ð\���\¹�����������¡����·��������������Џ���������돢������¡�Device APIs ������돪����·����돢���Џ�������������������������ġ������������ď�����������»�ߏ��������������¹��¡�

\¹\������¼\���\���\���\��я����������������� Device ������\���\���\���\��\���µ����½������ Web ���«�����������̏����Џ��¹������ API ��������������������������¡� W3C ��������������¡�¼��������� Device APIs Working Group ������»���������²½���̏�ď�����������������������������������������¹��¡�����𡯏��Ð��¡�½»½���������¾��Ï����я�����¼������������¹������ "Contacts API" ��������¡�\«\���\���������µ�������돢�·��¡�»��ޏ�����·������¼�����ď��²��������䏢����¼������������¹������ "HTML Media Capture API" ������������������»���������²½���������������ҏ�ď��������������������������������������¡��³������Working Group���������¹��¡�

���³���³��������¡��³������ Device APIs Working Group ��������������¡��³������������������ Device ������µ����½������\��\���\»\¹���¹�����������ď�������������¡��½���������¾�����������������Џ�����API»���������²½�����ҏ�ď�����������������­���������·�����ď�¡��³��������������¡�Device�������������¹������µ����½����½»½��������ď�����\«\���\�������������������������ď�ԏ��������ޏ�¡�API������»���������½��Џ��̏���̏���ߏ��������³�����������ҡ돪؏�����·���������¹��¡�·���²������������·��������¡�API��ď�ԏ�������������²½�����ҏ�����������������������������������·���²������������������������������·�����ď�¡����Џ��������쏢������������¡� Device APIs Working Group������\��⏢�¼\���������³���������������­������ API �돫�����������ҏ��«���������Ð�돫������䏪�����³���������¹��¡�
120109-0

���µ��������������¡��³����������ď����������¡�돪�²¼������¼�����¹�����я���������������������������µ������³���·���������¹��¡�

  1. ���·���·������Deviceµ����½����½Ð�����������ď����я�������¡�»���������²½��돫ӏ��������̏���̏���ߏ�������������������¡�Web���«���������½������µ����½�����ҏ����̏�����½Ð�����������������������Ï�������������������������������¡�»��С���ӏ��̏���̏���ߏ��������������������������·�����������Ï�¡�
  2. Device ������ Cloud ���̏���ޏ�����������µ����½�����ҏ����Ѣ�����·����������������������������������������������������돢¡�³«������¼��ԏ������돪叢����������\���\���\���\���\�����¼\¹������API�����ҏ����Џ��������������ޏ��������Ð������������������������
�돫������������䏢����������������������������������������������¡�¼«������������������»�ߏ��������������¹������������¡��³���³�����������������я����������䏢�������������������������������������·���������¹��¡�

������𡯏��Ð��¡�Contacts API��������¡�\���\Ð\���\¹����·��������я���������������������������������������½»½��������ď��«������\������¼\��ď�����¼������������¹���������³�����������ҏ����䏪���쏢����»���������²½��������������¹��ԏ��������������������������������¹��¡��·���«���·��¡�½»½��������ď����� Google Contacts ���������������Ï�������¡���Cloud¾���������������������������������­���������¹��¡��½���·��������¡�Cloud������������������·������������������¾���¹��������� Web-API �����ҏ����Џ��������������Ð RESTful ������������������������ HTTP ������½»½���������¾��Ï����я�����¼������������������­���������¹��¡�������������������������¡񏩡�ޏ�����½»½��������ď�������������¡���\������¼\«\���\���\Ð\���\¹���������Ð���·������\��\���\»\¹���¹������¾���¹�����������¡񏪢��������Џ����� Javascript API �����ҏ����Џ�������¡�Cloud ¾���������\������¼\��ď�����\��\���\»\¹���¹������¾���¹�����������¡�RESTful \���\���\���\���\�����¼\¹�����ҏ����Џ�������������¡ߏ����������������Ï��³���������������������������������¹��¡��½���·��������¡��򡭏�叢����¹­������»��������Ï��³����������½Ð��������¡��«������½��������Ï��­�����������㏢��������������������������������������\���\���\���\���\�����¼\¹���«�����������������Ï��³��������������¡�Web developer �����������������Ð�돫������䏪�����³���������¹��¡�¾�����������������������������������������¡�Cloud �����쏢����\��\��\������¼\���������¹\�����Ώ��������¹��¡�

����ޏ������������³��������������¡�\«\���\������«������¼�����ď�ď�����¼������������¹������ Media Capture API ���������Ð���·��������������������𡯏��������¹��¡��³������ API ��������¡�\������¼\«\���\���\Ð\���\¹������\«\���\������������Ð���·��������¡�Contacts API ����ޏ�������¡񏪢��������Џ�����API�����ҏ����Џ�����\��\���\»\¹���¹�������������������������¹���̏�¡��³��������������������������������������������¡�Cloud ¾��������� Web \«\���\��������������������Ð��¡�RESTful ������\��\���\»\¹���������­��¡񏪢��������Џ����� API �����������ԏ���ߏ��������¹��¡�

���³���������������Ï�������¡�Device APIs Working Group�������³������������������������\��\��\������¼\�����������¡�\������¼\«\���\���\Ð\���\¹������Cloud�������������돪叢����������\���\���\���\���\�����¼\¹�����ҏ����Ѣ�����¹������»��ӏ����ӏ�����¾·�����������ď������������¹��¡�(Contacts API������Media Cature API ��������¡��½�����������叢����¹­������¼��������؏��µ���������������������������»�����я�����������¡񏢱½¾��؏��������µ�����叢�������������������������������������������������������������»�����я��̏��Ï��Ï��Ï���
120109-1

TPAC2011 f2f minutes

��돫ҏ�����11·�������\��\���\���\«������\·\���\³\���\Ð\������¼����\µ\���\���\���\���\�������������³«��돪����µ������������ W3C ������ "TPAC2011" ��������¡��³�������������������������Ð���·��¡�Web Intents������»���������������²���·������·���������������³�����Ï��������¹������µ�������������¹��ԏ��������������������·�����ď�¡��½����������»��ҏ����� Device APIs WG ������ f2f (face to face) \��Ώ��¼\���\��\���\�돢���� minutes(µ���»��ӏ�����) ���«������³�������ӏ��«���������³����������½Ð���������������¹��¡�

������𡯏��Ð "Contacts API" ��������������¹������\���\��\¹\«\���\·\���\��я���»������������������������¹���돢������¡��³�����я����������������ӏ��������­���̏����������������¹��¡�

Do we care (at all) about contacts? In the "cloud" era, there will be many online services that do this and anyone can write a web app that connects to them already. Just curious.
����Contacts API ��������������������������¡�\��\���·���������­���������������ޏ������������������«����"cloud"��������������¡����ď��������µ�����я�����\���\���\���\���\���\µ���¼\���\¹���̏���������¡񏪪������������������½�����������ҡ�·������Web\��\��\���������½��Џ��������³���������̡���叢����½Ð������������������������������������¡򏪮���¼������²����������������������
���½���·��������¡������������̏�����µ������������̏�ď�������я�������������¡�돪�²¼���������������Ï��������������������̏����������������·�����ď�¡�
wondering why the API approach when Web Intents is being considered now
����Web Intents������������������»�������������������������������������¡��������¼������API\��\��\������¼\��������ҏ������������·�������������������������«���폢��
���½���������������Ð���·��¡�돪�²¼���������������Ï�����²��я����⏢�̏��������µ���������������������������¹��¡�
as currently specified it is mostly about what does a contact look like, so most of the API would not change even with Web Intents
������������µ�����������������¡�Contact�������«�����ď����䏢������������¹������µ������������̏��������������������«��������¡�Web Intents��������������������������������������µ������������·����������������������API���������叢���������я����������������Џ����������������������������я��������������������������«����������
���½���·��������¡�돪�²¼���������������Ï�����ACTION\���\¹\������̏�돫��������������������·�����ď�¡�
Contacts find() may be replaced with Intents
����Contacts API ������find()��������¡�Web Intents�����������ӏ��­��¹��𡯏���������������������
��������������������¡�Contacts API��������������������������������¡�Web Intents������\���\��\������¼\¹���¹��������������������»��������������������ď����������������Ï��³���������������¹��¡�

���µ��������¡��³���³������²��ď��������� Contacts API ���������������Ï����� Device APIs ����������������������²���·������¹������������������¡�Web Intents���̡����·������¹�������������������·�����������Ï��폢�½��������������������������������������¡�Contacts API����������������¹��ԏ����������������ď�¡�TAG(W3C������µ»½���»��Ï������돪С��²���)������������µ������������«������³�������ӏ��«���������³����������½Ð���������������¹��¡�

my prejudice will be there are certain tangible benefits of URIs and accessing via ReST. if you have a Camera on a machine and you can access it remotely When you name things with URIs that support http, you can access it transparently
����»����������Ð���«�����돪؏��«���폢����������¡�REST������\��\���\»\¹���������­������URIs�����������������������ҏ�����\���\���\���\��\���\������̏������������������������Ï��³��������¡�\���\Ð\���\¹¾���������\«\���\���������HTTP������\��\���\»\¹���������­������URIs�����ҏ����؏��ޏ�¡�\���\������¼\������«������������\��\���\»\¹���������­�����������������Ï��������¹���������Ð��¡���\������¼\«\���������\���\������¼\�������������������²��������쏢����\��\���\»\¹���¹���������³����½Ð�����������������������Ï���������������������
���¾�������������������������«�����������Ώ��������·�����������Ï�¡�
I remember 30 years ago that Printer vendors looked puzzled when asked about Web Servers on them and today I can talk to an average printer over HTTP
����30����������돢¡�\��\���\���\��ď��¼\���\���\������¼������Web\µ���¼\Ð���¼������\��\���\���\��ď��¼��������돪䏢�»���������³��������������������������������ď�ҏ����������ď�돪�¡�돢����������·�����������������ď�¡��·���«���·��¡�������������½��������쏢����\��\���\���\��ď��¼����������Web\µ���¼\Ð���¼������\��\���\���\��ď��¼��������������돪䏢�·�����������������������ď���������HTTP������\��\���\»\¹���¹���������³����������½Ð����������������
��������������������¡񏢱������¹������\���\Ð\���\¹������Web\µ���¼\Ð���¼�����ҏ�������돪䏢�¹���������̏�¡�\«\���\���������HTTP������RESTful������\��\���\»\¹���������­�����������������Ï�������������������¡��½���·��������¡�\������¼\«\���\���\Ð\���\¹������Web\«\���\������������������Ï�����\���\���\���\���\���\Ð\���\¹������������²��������쏢��������ޏ�����¼���½�����������·�����Ï��³���������̏��������­�����������������Ï����������������������������������Ï����؏��������¹��¡򏩡��������ԏ�����Web\µ���¼\Ð���¼���«�����������������������Ð��¡�\���\Ð\���\¹������\���\���\���\��\���µ����½������¼«���³��������·�����Ï��³���������̏��������­���������¹��¡�½¾��������������¡񏪢��������Џ���������½���API�����ҏ�돫ӏ��������¹����������̏���ߏ��������������������������������������¹������������¡�돪����·������\���\Ð\���\¹µ����½�����ҏ����̏����Џ��¹���������³���������������������ޏ�����½Ð���������������������ޏ��������¹��¡�
(�����������������Ώ�������¡�½¾������¼������������ҡ��돪���������¼­�����������������������������Ï����؏����������������������������»�����я�¡���������������������¡񏪩�̏�돫������½���������API������¹�����𡯏����������Ï����������������á������������������¹��¡�����𡯏��Ð��¡�Battery API��������¡�\Ð\���\���\������¼\·\���\���API��������������������������������¡�½¾�����������������������������Џ�����Javascript API���������������³�����Ï����������������á������������������������������������������������¹��¡���
120109-2

���½���·��������¡�\������¼\«\���������\���\���\���\�����������¡����Ï�����Web\��\��\������������·������\��\���\»\¹½Ð�����������������������Ï��������������������Ð��¡�\������¼\�����¼������������돪؏�����Web\µ\���\������«������\«\���\���������»�����������ď�����»��Џ�������¡��½�����������������ҏ����쏪���ҏ��·��¡�\��\���\»\¹���������­���������ޏ��������Ð���������������������»�����я�¡��½������µ����½�����ҏ����Ѣ�����·������������������������API���̏�¡��������µ������Web Intents�������������������¹��¡�Device������µ����½������������\��\���\»\¹¼«������������������¡�Web Intent������»��������Ï���̏���ߏ����������������������������������»�����я���(\������¼\«\���������Web\µ\���\���������\��\���\»\¹���¹���������Ð���������������������ޏ��������¹����������������¡��½�����������ҏ��­�����⏢����»��������Ï����ď�������������������¡�Web Intents������������²���·���������API���������������������������¹��¡�
120109-3

�����ď��������·��¡�Web Intents API ������ Registration �������½¾��؏�����»�����������������¡������²��я�����\��\���\���\������¼������¾���²��Ï��·�����ď����������Ï�������¡�\������¼\�����¼����Intent���������·������������\µ���¼\���\¹�����ҏ����Ѣ�����·������������������������\µ\���\���������\��\���\»\¹���¹���������³���������������¹��¡�\������¼\�����¼���̏�¡�\������¼\«\���������\«\���\���\µ\���\���������»��ӏ���돢����\��\���\»\¹���¹�����������������������Ï��³������������������������¹�����𡯏��������������������»�����я�¡�½¾��������������¡�\������¼\«\���������Web\µ���¼\���\¹������²��ď��������«������¼���½������������Ð�����ď��������­���������³���������̏�����²���·������������¹��¡��½������������������������������������������¡�돪�²¼���������������Ï���������������������������������¹��ԏ��������������������������������¹��¡�

we expect device-local resources to use Web Intents to register themselves as potential providers?
����\���\Ð\���\¹\������¼\«\�����������Web\µ���¼\Ð���¼����\���\½���¼\¹������ Web Intents ������»��������Ï����ď�������������¡��½������¼«��ď��������\��\���\Ð\���\������¼���������·���������Ð�����ď��������­������������»�ߏ��������������������������폢��
Yes
�������������­����������
���³��������������¡񏢱½¾��؏�����Registration������»������������̏�¡��������������������������я���������������³�̏���������������¡��½�������돪�³�돢����Registration�����򏪳�������¹�����𡯏���������������������������𡯏��Ð��¡�¹���¾���½Ð²���»��Џ�����\���\���\������¼����\���\���\���\��������\��\���\»\���\������¹�������������������������������³����������½Ð���������������¹��¡�
���½���·������²���µ���������·������������������·��������¡�Device API WG��������¡�WebApps WG(Web Intent�����ҏ��µ���¹�������������·�����������������ď�����������¡�����Ï���ޏ�����µ������������¹������\���\¹\���\���\��폢�¼\¹�����ҏ�돫��������³����������·������������·���������·�����ď�¡�

Web Intents �����ҏ����Џ�����������\���\���\���\���\Ð\���\¹�����·���

���µ��������¡��³���������������Ï����� �����������������\���\Ð\���\¹��������¡�Web\µ���¼\Ð���¼�����ҏ�������돪䏢�¹������ �����������������Ï����������叢�������폢������������¡�Web Intents ��������¡��µ���������������½������²������½���­������³������²���������³����������½Ð���������������¹��¡��½���������̏�¡�\���\���\���\���\Ð\���\¹�����·������������¹��¡�

���³��������������������¡�\«\���\��������ҏ������������·��������¡�\������¼\«\���������\«\���\���������Web\«\���\��������ҡ돫⏢�­¹���������������½Ð���·���������·�����ď��̏�¡��³�����Ï�������������������������������������¡�Web Intents ���«�����������̏�����½Ð������������\«\���\�����������¡�ď��������²��я�������������������\���\���\«\���������������·��������я������������������������������������³���������������������������������¹�������½���������̏�¡�Web\µ���¼\Ð���¼�����ҏ����Џ����я��������·��������𡯏��Ð������¡�\������¼\«\���\���\Ð\���\¹������\«\���\���������²��ҏ����䏪���㏢�̏����ԏ����Џ����������������Ð��¡�Web Intents ������»�����������������¡�\���\���\«\��������ҏ����̏����Џ��¹���������³����������½Ð���������������¹���·��¡�\«\���\��������ҏ����Џ����я�����������������������PC���«��������¡�\¹\������¼\���\���\���\��я�����\«\���\��������ҏ����̏����Џ��¹�����������������������������ď��³������������½Ð�����������������������Ï��������������������������¹��¡�
120109-4

��������������¡���\���\���\���\���\Ð\���\¹�����·�����¡ߏ����������������Ï����������؏����ҏ�¡��ӏ�������\���\Ð\���\¹�����������������Џ����ď��·������������������������µ����½�����ҏ�¡񏪤¾������\���\Ð\���\¹�����ҏ����̏����Џ��¹���������³��������������¡�Web\µ���¼\���\¹������²������̏����������̏�����½Ð�����������������������Ï��������������������³��������¡ߏ�����¹�����𡯏��������������������¹��¡��½���������¾������������\���\Ð\���\¹������������·���¹�����������¡��ӏ��½������»��Џ��¹������\µ���¼\���\¹�������ޏ�Џ�����������\������¼\�����¼���̏����·������¹������\���\Ð\���\¹������¼«���³�����������쏢�������³���������̏��������­��������¡ߏ��³��������¡��½����������½Ð�������������������������̏�¡�\��쏢�¼\��\��я�����»�������������������Ï�����������Web��������������������������������¹�����𡯏��������������������¹��¡�

���³���������������Ï�����\���\���\���\���\Ð\���\¹�����·��������� "Device Orchestration" �����������������я��������������·���������¹��¡򏢱���������������³��⡭������̏�¡��½���������¾������������³���������𡭏�����������\��쏢�¼\��\¹\���\��������ԏ�����·��¡���������آ���������ҏ����؏����������������������Ï�������¡��½���������¾������������\���\Ð\���\¹���̏�¡񏪣��Ѣ�����¹������\µ���¼\���\¹��𡭏����������������ԏ�����µ��������¡�\������¼\�����¼��������������������������돪�������²������̏�����\µ���¼\���\¹�����ҏ����Ѣ�����¹�����������������������Ï�������������������������������¡񏪳������������³���������������؏�����������������������������²��ҏ��·���������������������¹��¡�

Web Intent��������¡��³���������������Ï����� Device Orchestration ������¹��ԏ����Ï��������­��������¡�·������«���»������������ API ���������������������������·�����������Ï�¡򏪿��̏�����½Ð������������\���\Ð\���\¹�������������«��������¡��ӏ��½������»���\������¼\�����¼��������������������������¡ߏ�돪���������돪�����̏�����\���\Ð\���\¹�����ҏ����쏪���ҏ��·��¡��½�����������������ҏ����Џ�������������¡�돫�������������\µ���¼\���\¹�����ҏ����̏����Џ��¹���������³����������²������½���������������������������¹��¡�

\¹\������¼\���\���\���\��я��������«�����������������ġޏ�������䏢���ҏ�¡�\���\���\���\�돢����\���\���\��я������돪䏩��돢�·��������¡�²������²�����Ώ����я��������������«���������³������������²������½���������������������������¹���·��¡�\���\½\³\���\²���¼\���������\³\���\���\������¼\������¼���������·��������¡�¼������µ������\¹\������¼\���\���\���\��я����ҏ����̏����Џ��¹���������³������������²������½���������������������«���������·���������������»�����я�¡�Apple TV������ AirPlay ���������������Ï�����\µ���¼\���\¹���̏�¡񏪱���½��������쏢������������������������µ��¡����������½Ð�����������������������Ï��������������������������·�����������Ï�¡򏩡���������������\���\Ð\���\¹�����������¡���ӏ��������·���«���½¾��؏����������̏����Џ��������­���������«�����������ď�������¡񏩡���������������돫�����¹��Џ����Ώ��̏��½¾��؏���̏���ߏ�������¡��³���������������Ï�����\µ���¼\���\¹���̏�¡�������������������\���\Ð\���\¹������»���������������µ���·��⏢���������̏�����½Ð�����������������������Ï���������������������������䏪���ԏ��µ���������������¹��¡�

Service Discovery

���µ��������¡��³������������������������½��ҏ����㏢����\·\���\���\��쏢������������¡�돫����������­�������������������������������̏����������������¹��¡��ӏ�ď��������²��я�����������\���\���\«\���������\���\���\��я����������·������������­���������Ï��Ï��Ï�¡ߏ�����������������������\·\���\���\��쏢����¼������½���¹�����������ď�������������������¡��½������������������Web\µ���¼\���\¹�����ҏ�¡�\���\���\���\��������Web Intents���������Ð�����ď��¹����������̏���ߏ��̏����������������¹��¡����������������叢������¡�\������¼\«\���\���\Ð\���\¹������µ����½�����������������Ð��¡�½Ð²���»��Џ�����\��\���\»\���\������¹���������³������������²������½���������·�����������Ï��̏�¡��½������»��Џ��¹��¡�¾��آ�·�����������������������������Џ�������������ď��������²��я�����������\���\Ð\���\¹�����ҏ�¡�»��ӏ���돢�������Ð�����ď��·�����������쏢�������³������������������������������¹�����𡯏�������������돢������Џ��������¹��¡�

���½���������ď�������������������¡�DLNA���������������Ï��������ӏ��½������»��Џ�������ď��������²��я�������������������\���\Ð\���\¹�����ҏ�¡�¼«����돢�������������«���·��¡�\µ���¼\���\¹���Ð�����ď��¹������»��������������Ώ�¡����̏���̏���ߏ��������¹��¡��½���������������Ï���������Device������¼«����돢�������������«���¹��������¡�Service Discovery API��������¡��³������������������Web and TV Interest Group��������¡񏢱����������̏�ď����������������������¡�Device APIs WG ������»��������������ѡ돩�³�������돢����¹��ԏ��������������������������·�����ď�¡��½���·���������³����������������������¡�Web Intents Task Force�������돫⏢�­·��Џ��̏�������¡�µ������������̏��³���ޏ��������������������������������¹��¡�
120109-5

Service Discovery������»��������������Ώ��̏�¡�Web Intents ������»�������������������������������������������������Ï��������������������«��������¡񏢱�����ď�������쏢���������������㏪�������«������������»�ߏ��������������������������¹���̏���¾�����������¡�service discovery������¹��ԏ����Ï�����������¡����������� Too, much ���«��������������¡�¡�¡򏪡��²��я�����\��\���\���\������¼������¾���²��Ï��·�����ď�¡񏪪»½���URL������\������¼\¹\�ޏ��¼\¹��������������������������¡�Service Discovery �����������ԏ���ߏ��������·�����������Ï��·������¡񏪱�̏���ߏ�����API�����������������³����������������ӡ돫������������������������»�����я�¡�¾���¼���������Web Intents ������ Service Discovery ������»��������������Ώ��������̏����·������������­�����������������Ï��������������������Ð������������������������»�ߏ��������������������������¹��¡�

������������������

����²��я�������¡񏪡��²��я������돫⏢�­���³���­��¡�Web Intents������������������������¼���������¾������²���������·�����ď�¡���²���¾���²��Ï��·�����ď�����������¡��ӏ��������¼��¡�Web Intents����\���\Ð\���\¹�����·���������½�������ߏ������������������������«���폢¡ߏ����������������Ï�������¡�Web\«\���\������������������Ï��������³������������¹�����𡯏�������������¡�\������¼\«\���\���\Ð\���\¹������\���\���\���\��������������ҏ�����������������¹�����𡯏�������������������������¡񏪡��������������\���\Ð\���\¹������Web\µ���¼\Ð���¼���̏�������돪䏢�µ����������Ï����������쏢������·��𡯏����������������Ï��������·�����������Ï����������������Ï���������������������������������������������³��������¡��½�����Ï��¹��������������¡�Web\µ���¼\���\¹���������·��������¡񏪡��������������\���\Ð\���\¹���̏�����¾���²½���µ�����������������ď�������¡�Web Intents ������»��������Ï��³��������������¡����·���²������½���������������������³������������½��ҏ����㏢�������·�����ď�¡�

�����������ď�¡�\���\���\���\���\Ð\���\¹�����·���\µ���¼\���\¹���̏�¡�������������ď�����������¹�����������ď�������������������¡�Service Discovery����µ��¡�������������«��������½�������ߏ��������������������³��������������¡��½��������������������¹���������½��돩Ώ���������½���²½����돢���Џ�������������������������������ġ����������������·�����ď�¡�

��������ď�������쏢��������³Ð���������·��������¡��³��������������������������\���\���\���\���\Ð\���\¹�����·�����¡ߏ�����������������\·\���\���\��쏢������������¡��ӡ돫�������������\���\���\���������\���\·\��я���»��Џ�������¡�\��叢�¼\���\²���¼\���\���\��\������������«���������Ð������������������¡ߏ��̏��ӏ��½�������¾������\��\������\���\·\��я�����\³\���\���\������¼\������¹��������¡ߏ����������������Ï�������������̏��·���������������������·�����ď��̏�¡�Web Intents ���������������ӏ����������������\���\Ð\���\¹���̏���ޏ����㏢������¡��½���������������̏��­µ������쏢����·���¹������¹��������¡ߏ����������������Ï��·�돪�µ��������ҡ������������������������������¹��¡��½�����я��������������³���������� Web �������������������������������������������¹��������������¡�

Web Intents ���̏�����������������»�����𡯏����������������Ï�������������������������������������¡����·���Ð������������»��С���ӏ��̏���̏���ߏ��������¹���̏���²��ď��·��������¡�W3C������\µ\���\���������\���\���\���\��������������̏�����������������������������¾��؏����ӏ���������������������¡��³���������«������������Web�����ҏ�����������¾�����������¡����䏢�̏��\���»���������»�����я�¡�

��돪���������������¡�Web ������������\���\���\���\���\Ð\���\¹�����·�������M2M (Machine to Machine)��¡ߏ�����¼�����������·������������������������½��Џ���������\���\��\��ӏ�ď��²½ ��돪�½���·���������HTML5��¡ߏ��̏�����³��Ï����ҏ����Џ�𡯏��������� ������¾���²��Ï��·��������¡񏪳��䏩���䏢����\��\���\���\������¼�����������㏢���������ď�����������»�ߏ��������������¹��¡��³������������������½��Џ����ҏ�������������¡�Web Intents ��������������������������������ġ����������������������������»�����я��̏�¡�Web ������������\���\���\���\���\Ð\���\¹�����·�����������¡��򏢱���������Web������ď�����������������Ð���·��������¡񏩡��䏪���䏢����ď�������������㏢�­�����򏢱��Џ�������������������������¡񏪤��������Џ���̏��«���������������¹���������������������������������������������������������¹��¡��³��������̏�����������½���������������������������¡񏪢�������ѡ돫����������µ���������������³�����������ҏ����쏪���Ï��������·���������¹��¡�


\���\��\��ӏ�ď��²½ ��돪�½���·���������HTML5��¡ߏ��̏�����³��Ï����ҏ����Џ�𡯏����� (���«�����䏢�·½���)


��ď��µ���\���\���\��\���\���\­\���\�돢����
kotesaki at 10:59����Permalink����Comments(12)����TrackBack(0)����clip!����html5 | WebIntents

2012������01·���07������

\���\���\���\���\Ð\���\¹�����·���������¼������½���¹������ WebIntents ��������Ï����䏢����»��������������򏪴��ԏ���

���·���������������ޏ��������·�����������쏢���������������������Ï�𡭏������������������¹��¡򏪳��䏪����������µ¹���·�����������졭������������·���������¹��¡�

���µ��������¡��򏪮�����돪�½���������POST��������¡񏪳������̏���돫������Ӣ�½���������»�������������������������API������ "Web Intents" ������������������������¼���������¾������²���������¹��¡�
���³������¡�"Web Intents"��������¡�Android������ "Intent" ������������¾�������������������»��������»��������������Ώ�������¡�돪叢����������Web\��\��\���\�ޏ��¼\·\���\��я�����¼«���³�����������·������¹���������³������������²������½���������¹������API���������¹��¡�Web\µ\���\������������ԏ��­µ����½���������Ð���·��¡񏪤¾������Web\��\��\���������µ����½�����ҏ����̏����Џ��¹���������³����������²������½�����������������������ď�������¡�\¹\��ԏ��¼\���\���¼������Web\��\��\���������³«������������¼������½���·���������������������������¹��¡򏪿��̏����Џ��¹������\������¼\�����¼��������������������������������¡�¼�����·������������Web\��\��\��������ҏ����̏����Џ��������­������\���\���\���\������̏��­���������������¹��¡�

���³������API������¹¹��������½������¼���������������³��������������¡�

Deviceµ����½���������̏�����
\���\Ð\���\¹�������������������­������µ����½����\«\���\�����������¡�½»½��������ď���������������������\���\���\���\�����«�����������̏����Џ��¹��������¡�
Web of things
\¹\������¼\���\���\���\��я�����\���\���\��я�����������������\���\���\���\���\Ð\���\¹�����·���\µ���¼\���\¹������Web������¼������½���¹��������¡���������������������������������·��ҏ��̏�����Web
�����������������������ď�¡��򏢱��� Web ���̏�ď��²½�����ҏ�ď�����²�����������������������������������������䏢�µ���������������������������³������������������\µ���¼\���\¹������¼������½���¹�������������������ď�������¡�½�������ߏ������돪������ӏ��������ޏ�����¼�����¹������¹�����𡯏��������������������«���������������¹��¡�
Android Intent������������������»��������API���̏�¡�����Deviceµ����½������\���\���\���\���\Ð\���\¹�����·���\µ���¼\���\¹¼������½����������̏�ď�䏢������������������¡���������������������������������¡�\���\���\���\���\���\��я��������������������������«���������·���������������»������(��������������돪�½���������\���\��я��������­���������»�����я��������·������)��¡��³������������������������������������������¡�¼���²��я�����\��\���\���\������¼������¾���²��Ï��¹���������³���������������·��������¡��򏩡��䏢����\��\���\���\������¼������������ "Web Intents" ����������Ï����䏪���쏢����¹�����𡯏������������½������»���������������������������������������¾���²��Ï��·���������¹��¡�

What's Web Intents?

Web Intents��������¡񏪢���������������½��ҏ����㏢���ď����������Ï����� Android Intent ���������������Ï�������¡�Web\��\��\���\�ޏ��¼\·\���\��я����������Ï��·�����ҏ����·������¹������API���������¹��¡�Web\µ\���\������«������ Web Intents ������API �����ҏ�����������½Ð���¹��������¡�picker\���\��\���\���\��Ï��̏��폢����¾������̏�������¡񏪩Ð�����ď�돪Џ����Ώ�����Web\��\��\���\�ޏ��¼\·\���\��я���\���\¹\������½¼�����µ���������������¹��¡�\������¼\�����¼��������¡��½�������������«������������돪؏�����Web\��\��\��������ҏ����쏪���ҏ��·��¡��½������\µ���¼\���\¹�����ҏ����̏����Џ��¹���������³���������̏��������­���������¹��¡�

������𡯏��Ð��¡񏢱½¾��؏�����Web\��⏢�¼\��������� mailto: ������»������������¹��������������¡�OS���������Ð�����ď��µ������������������������\������¼\������¼����¼«�����µ�������돢�·���������¹���̏�¡��³�����������ҏ���GMail������»��������������ď�������������¡ߏ�����»�ߏ����������ď��³���������̏���������ď�������������ď������������������������������������«������»�ߏ��������������¹��¡��³���������������Ï�����\�ޏ��¼\¹������ Web Intents ������»��������Ï�������¡�\������¼\�����¼������¼«����̏�����»��������������ď�����Web Mail Service�����ҏ����쏪���ҏ��������­�����������������Ï����������������������������������������ġ������������������¹��¡�����𡯏��Ð��¡�GMail���̏��폢����¾������̏�������¡񏪡����ď�����\��\���\���\¹����������������¼«����돩���Џ������µ������������¾��؏����ӏ�������¡�\������¼\����������·µ�̏�돫�����²������������̏��½¼�����µ�����������������������������������Ģ����¹�����¡�돪叢����������Web\µ\���\�������ӏ�������¡�\������¼\��ď�����¼��؏��ޏ��������·��¡����·������¹���������³����������²������½���������������������������ޏ��������¹��¡�

���³��������������������������������¡񏪴��ď�ԏ�����Web\��\��\���\�ޏ��¼\·\���\��я����ҏ����·������µ���»���������³������������²������½���������·�����ď�¡�����𡯏��Ð��¡�\��\���\��\���\���\µ���¼\���\¹���������������Ï�������¡񏪤¾������Web\µ\���\���������\³\���\���\���\��������� iframe ������������������¹��Џ����Ώ�¡�HTML5 Messaging ( PostMessage() ) ������»��������Ï��³��������������¡�돪叢���������� Web\��\��\�������ӏ�����\������¼\��ď����·���������¹��ԏ����Ï��³������������²������½���������¹��¡�
���·���«���·���������̏�������¡����·������¹������Web\��\��\�����������¡�\µ\���\���������³«������¼��ԏ���»������������¹������·��������ӏ����������������������������쏢������¡񏪿��̏�����¼��ԏ����������·������¹������Web\��\��\��������ҡ���Ï����䏪���쏢���������������쏪���ҏ��¹���������³������������½Ð���������������»�����я��������·�����ď�¡򏪢��������̏�����\������¼\�������������������������𡯏��Ð��¡�\µ\���\���������³«������¼��ԏ��� GMail �����ҏ����쏪���ҏ��¹��������������¡�\������¼\�����¼������ Yahoo!\������¼\��� ������»��������������ď�������������������¡��½�����������ҏ��¾�����䏪���̏����Џ��¹���������³������������½Ð�������������������������������¹��¡�
���³���������������Ï�����¾��آ�·������²���·������¹�������������������̏�¡�Web Intents ���������¹��¡��¹��������������������¡����·������¹������ Web\��\��\������������쏪���ҏ��������³«������¼��ԏ��«�����������̏�����¼��ԏ��������������·��¡��½������»��Џ��¹������\������¼\�����¼������я��¹\������¾��آ�·�������ޏ�Џ�������������¡�¼«���³������Web\��\��\��������ҏ����쏪���ҏ��¹���������³����������²������½���������������������������¹��¡��½���·��������¡��³������������������̏�¡�Web \��\��\���������������������\���\Ð\���\¹µ����½���������̏����Џ�������¡�\���\���\���\���\Ð\���\¹�����·���������\·\���\���\��쏢���ҏ�¡񏢱½¼��������쏢�����������������������·���������¹�������³���������؏�����������¾��䏢돪㏢������¡�¼���²��я��������������·���������¹������¡�
wi-0

How to use Web Intents API

���½��������������������¡����Џ��������쏢����»����������������������������������������������������·���������¹��¡����������쏢¡�돪�²¼������������������������¡�¼¹������»��Џ�����������»�������������������Ï�����������������������������¡��򏢱���������¹¹������������������²������½���­���̏����������³�����������ҏ��¾µ�������������������µ��������¡�

Registration

Web Intents��������������¡����������돪���·������¹������Web\��\��\���������\���\���\���\�����������Ð�����ď��¹����������̏���ߏ��̏����������������¹��¡�Android Intent�����������������Ð��¡�\��\��\���������\���\���\¹\������¼\������¹���������������­���������Ð�����ď��µ���������������������ޏ��������¹���̏�¡�Web\��\��\������������������½�����Ï����������Ï��������ޏ��������������������­���������»�����я�¡��³���������ď�������¡񏪩Ð�����ď��·�����ď�����Web\µ\���\���������<head>��������������¡�<intent>\���\�돢����½��Џ��������³��������������¡�\���\���\���\����������¡��½������\µ\���\��������ҏ��Ð�����ď��·���������¹��¡����Џ��������쏢������������¡�돪�²¼���������������Ï�����¼���½������������¹��¡�

  1. Web Intent���������·�����������̏����Џ��·�����������Ώ��·������ Web \µ\���\��������� <intent> ������µ­½��ҏ��¹��������¡�
  2. �����̏�����¼��ԏ��̏�¡�¾���µ­������Web\µ\���\���������\��\���\»\¹���¹������
  3. \���\���\���\����������¡�<intent>������������¾��Ï����я����ҏ��«��������¡�\���\���\���\�����������½������\µ\���\��������� Web Intent ���������·���������Ð�����ď��¹��������¡�
���³���³��������¡�<intent>��������¡�돪�²¼���������������Ï�����µ­½��ҏ��·���������¹��¡�
<intent
  action="http://webintents.org/share"
  type="image/*"
  title="image share"
  href="share.html"
  disposition="window"
/>
action (required)
Web\��\��\������̏���²��ď�����µ����½��������돢돫��������ҏ����Ѣ�����¹���������«��¡ߏ�����¼�����¹��¡򏪮���돪؏���������»��⏪�я�����»���������²������½��¡�¾�����������������\¹\­���¼\���URL�����������������������������쏢������¡�����Ï��­µ����½�����ҏ����Ѣ�����¹���������³�����������ҏ��½���·��������������������¡����������쏢¡�http://webintents.org/share��������������¡��³������\¹\­���¼\���URL�����ҏ����Џ�����������¾���¹���������»�������������µ­½��ҏ��µ��������������������������¡�
type (optional)
Web\��\��\������̏���²��ď����ҡ�·��𡯏��������«��¡ߏ�����¼�����¹��¡򏪮���돪؏���������»��⏪�я�����»���������²������½��¡�¾����������������������� MIME type ������¼�����·�����������쏢������¡���������������������\���\��폢�¼\���\���\���������²��������������ҡ�·��𡯏��������³�����������ҡ돪؏�����·��������������������¡�
title (optional)
���³������Web\��\��\���������\���\���\���\�����¡�Web Intents������\���\���\«���¼��������¡��³������\���\���\���\������̏��½¼�����µ��������������¡�
href (optional)
Intent���Ð�����ď��¹������Web\��\��\���������URL��¡�¾���������Intent\���\�돢�̏�¡�http://example.com/ ������µ­½��ҏ��µ������������������������¾���¹�����¡�http://example.com/share.html ����Intent������\µ\���\������������·���������Ð�����ď��µ������������
disposition (default="window")
Web\��\��\������̏�¡��������������������Ï��������½¼�����µ���������������«������¼�����¹��¡�window������inline������»���������²������½�����������������������������쏢������¡�window������¾���¹�����������¡�돪叢����������Window���������½¼�����µ��������������¡�inline������¾���¹�����������¡�\���\���\«���¼���������������½¼�����µ��������������¡�
�돪�¾�����������������������¡�½���������������type������action���������Ð���¹������Intent������\���\���\���\�����������Ð�����ď��¹���������³����������½Ð���������������¹��¡�

Invocation

¼���������¡�������Web\��\��\������«��������¡�Web Intents �����ҏ����̏����Џ��¹������¼���½������������¹��¡򏪤¾������Web\��\��\���������½������������ҏ��������»�����ď����� type ������ action ������»������������·��������¡�Web Intents�����ҏ�����������½Ð���·��¡�\���\���\«���¼�����ҏ��½¼�����·���������¹��¡�

�����������돢¡�돪�²¼�����������������������Ï����� Intent \���\���\���\��\���\���������\���\���\¹\���\���\¹�����ҏ�����������·���������¹��¡�

var intent = new Intent(
  "http://webintents.org/share",
  ����image/png����,
  'http://hoge.com/image.png');
���³��������������¡�²��������䏢���Ң���Ï��­���¹������¾���¹��������ҏ������������·���������������������¹��¡�\³\���\¹\���\���\���\��ď����¡돫⏢ď�ԏ�������¡��½���������¾�������돪�²¼���������������Ï��������������������������¹��¡�
������1�돫⏢ď�ԏ�¡� action (required)
Intent���������Ð���·�������돪����������¹������ action ������»������������¹��������¡򏪮���돪؏���������»��⏪�я�����»���������²������½��¡�¾�������������������������¡�\¹\­���¼\���URL��������������������¡�share(����Ï��­)������»������������·������������������
������2�돫⏢ď�ԏ�¡� type (required)
Intent������½������������ҡ돪����������¹������\������¼\��ď����� type ������»������������¹��������¡򏪮���돪؏���������»��⏪�я�����»���������²������½��¡�¾�������������������������¡�MIME type(image/png)�����ҏ����Џ�������¡�png·���¼�돢����²��������䏢���ҏ����Џ��������������³������������¼�����·������������������
������3�돫⏢ď�ԏ�¡� data (required)
Intent���������������¹\������¼\��ď�����»������������¹��������¡򏪮���돪؏�����Object������»���������²������½����structured clone\��\���\��\���\���\������̏���̏����Џ��µ������������������¡����ď��������·��¡�돫⏢�­���������¹\������¼\��ď�����·���¼�돢������¡�action ������ type ������\���\��𡭏��������������������­������\���\��폢�¼\���\���\������������������¹����̏���ߏ��̏���������¡�¾�������������������������¡��½������»�������������\¹\­���¼\���URL������ http://webintents.org/share ������µ�̏��������µ�����������������������������ď�������¡��½������»����������������������������¡�²��������䏢����URL������»������������·��������������������¡����� canvas�����������������ҏ����Џ�������¡�data-url�����ҏ�����������·��������¡�돫⏢�­���������¹���³������������²������½)
���½���·��������¡�돪�²¼���������������Ï����� startActivity \���\½\���\��������ҏ����������ӏ��³��������������¡�Web Intents ������\���\���\«���¼���̏��½¼�����µ��������¡�\³\���\¹\���\���\���\��ď�����»������������·������ type ������ action ������\���\���\������¹������ Intent ������\���\¹\�������\���\���\«���¼���������½¼�����µ���������������¹��¡�
window.navigator.startActivity(intent, onSuccess, onError);
intent (required)
������������·������ Intent \���\���\���\��\���\���������\���\���\¹\���\���\¹������»���������
onSuccess (optional)
Intent���«������\������¼\��ď��̏����ӏ��������������­������»���(Intent�����Ï�����postResult()�����ҏ����������я�����»���)������ callback �������ď�ԏ�¡��³�����¡������ď�ԏ����������돫��돫⏢ď�ԏ����� Intent ���«������������\������¼\��ď���³������¼���µ��������������¡�
onError (optional)
Intent��������¡�½�����������¼��돪���ԏ��·�����ď��������­����Intent�����Ï�����postFailure()�����ҏ����������я�����»���)������ callback �������ď�ԏ�¡��³�����¡������ď�ԏ����������돫��돫⏢ď�ԏ����� Intent ���«������������\������¼\��ď���³������¼���µ��������������¡�
¾���µ­¼���½�����������¡񏪱½¼�����µ������������\���\���\«���¼���«������\������¼\�����¼����Web\��\��\��������ҏ����쏪���ҏ��¹��������������¡�Intent�����Ï�����½����������̡돫⏢�­·��Џ��̏��������������¹

Intent������������������½Ð���µ�����������ď�돪�����\������¼\��ď�����½��������򏪴��򏪳���

\���\���\«���¼·Ð���³��������¡�Web\��\��\������̏��������Ð��������������������¡�

window.intent
��������¡�³���¼���\������¼\��ď���³������¼���µ���������������������������¹��¡�����𡯏��Ð
window.intent.data
��������¡񏢱���������½Ð���·�����Ï��«������»������������µ������������\������¼\��ď���³������¼���µ���������������������������¹������������¡��½���������������Ð���¹������½�������������¹��ԏ����������ď�������¡�
window.intent.postResult(some_data);
���������·��������¡�½��������򏢱���������\������¼\��ď�����»������������·������ intent.postResult() �����ҏ����������ӏ��³��������������¡�\������¼\��ď��̏�����������½Ð���·�����Ï��������������������������¹(startActivity()���������������ѡ돫⏢ď�ԏ�����»������������·�����ġ������ď�ԏ��̏��������Ð���������������¹������¡��³������»��Џ�����\������¼\��ď�����·���¼�돢������¡�action ������ type ������\���\������µ�̏��������µ������������»���������������½¾���������������¹����¾�����������������������http://webintents.org/share��������¡��³������»�������������µ­��돪䏢�µ���������������������������¹������¡�
�����������쏢¡�½�������������¼��돪���ԏ��·������¾���¹�����������¡�intent.postFailure()�����ҏ����������я��������������������µ��������¡򏢱���������½Ð���·�����Ï�����½����������̏�������������¡�startActivity()����������»��돫⏢ď�ԏ�����»������������·�����ġ������ď�ԏ��̏��������Ð���������������¹��¡�

\��\���\���\������¼\·\���\���\���\���\���\���\���

���½��돩Ώ�¡�Web Intents������\µ\����¼\������¹������\���\���\���\�������������������������»�����я��̏�¡��³������������\��\���\���\������¼\·\���\��я��¹������\���\���\���\���\������̏�����³«���µ���������������������������¹��¡�Intent�����ҏ�����������½Ð���¹�����Ï�¡񏢱���������½Ð���µ�����������������Ï��Ð������������¡�돪�²¼������Javascript�����ҏ�����������¹��Џ��������³��������������¡�Web Intents ������»����¹���³����������½Ð���������������¹��¡�

<script src="http://webintents.org/webintents.min.js"></script>

\µ\���\��\���\µ\���\���

http://webintents.cloudfoundry.com/��������¡�Web Intents������\µ\���\��\���\µ\���\��������ҏ�돫����������������Ώ��������·�����ď�¡�
wi-1
���³������\��⏢�¼\��������� head \���\�돩������������������¡�

<intent
  action="http://webintents.org/shorten"
  type="text/uri-list"
  href="shorten"
  title="Link Shortener(test)" />
<intent
  action="http://webintents.org/share"
  type="image/*"
  href="imageshare"
  title="Image Share(test)" />
��������¡񏩡��я����������� intent \���\�돢��µ­��돪䏢�µ�����������������쏢������¡�http://webintents.cloudfoundry.com/shorten������ URL �������»½���²½\µ���¼\���\¹(shorten)�����ҏ�¡�http://webintents.cloudfoundry.com/share��������¡�²��������䏢���¢���Ï��­\µ���¼\���\¹������Web Intents���������·���������Ð�����ď��·���������������������¹��¡�(������µ­��¡�\��\���\���\������¼\·\���\���\���\���\���\���\�����������������¡񏢱½¾��� http://webintents.org ������ Origin ������ localStorage ���������Ð�����ď��·���������������������¹��¡�)

���³���³��������¡�����𡯏��Ð "shorten" ������½��Џ��«������������\���\���\��я�����\���\���\���\������¹��������������¡�돪�²¼������\³���¼\�������¼���¹��ԏ��µ���������������¹��¡�

$("#urlshortner button").click(function(){
  var url = $("#urlshortner input").val();

  var intent = new Intent(
    "http://webintents.org/shorten",
    "text/uri-list",
    url);
  window.navigator.startActivity(intent, function(data) {
    $("#urlshortner .out").text(data);
  });
});
���³���³��������������¡�action = http://webintents.org/shorten, type = text/uri-list ��������¡�\���\���\¹\���\���\¹(intent)�����ҏ�����������·��¡�startActivity()��������¡�Web Intents�����ҏ�����������½Ð���·���������������������¹��¡��³���³��������¡��³������ type ������ action ���������Ð���·��������¡񏪢���������¼�����·�����ď����������Ï����� "http://webintents.cloudfoundry.com/shorten" ���̏��Ð�����ď��µ���������������������������¹������������¡�\���\���\«���¼���������������³������URL���̏��½¼�����µ���������������¹��¡��³������\���\���\���������\���\���\���\������¹��������������¡�½����������̏��³������\µ\���\����������돫⏢�­·��Џ��̏��������������¹��¡�
wi-2

http://webintents.cloudfoundry.com/shorten ��������������¡�돪�½���������

var url = window.intent && window.intent.data || null;
��������¡�Web Intents ���������������µ������������\������¼\��ď�����¼������������·��¡�
var shorten = url.length > 8 ? url.slice(0,8) : url;
��������¡񏪩������µ������������URL�����ҏ�돪�½���������8������»��⏢�������»½������·���������¹�������µ�����������������\���\���\���\­���������¹���̏�¡�����������\µ\���\��\��������������������Ï��³��������������𡭏�����¼������������������µ������ (^^;) ������¡�
wi-3

���³���³��������¡�"back to caller"������\���\���\��я�����\���\���\���\������¹��������������¡�돪�²¼������\³���¼\�����������������������¡�\������¼\��ď��̏�����������½Ð���·�����Ï��������������µ���������������¹��¡�

window.intent.postResult(shorten);

setTimeout( window.close, 500);
postResult()��������¡񏪪»½���������������URL\������¼\��ď����ҏ�����������½Ð���·�����Ï��������������·��¡�window.close() �����ҏ����������ӏ��³��������������¡��³������\µ\���\��������ҏ��������������������������������¹��¡�
�����������쏢¡�Web Intents ������\��\���\���\������¼\·\���\���\���\���\���\���\�����������������¡�\������¼\��ď�����¼��؏��ޏ��������·������postMessage()�����ҏ����Џ������������������������������������¹���̏�¡񏪤����돪�������window.close�����ҏ����������я��������·�����������Ï�������¡�postMessage������½����������̡��돪�»���·�����������������Ï�����������window���̏��������������������·��������������¡�\������¼\��ď����ҏ��������»�����������������ď�������¡�500msec�����ԏ����������ď�������¡�close���¹������½�������������¹��ԏ��������������������������¹��¡�

���³���������������Ï�����postResult()��������¡�\������¼\��ď��̏����ӏ��µ��������������������¡񏢱���������½Ð���·�����Ï����������� startActivity���������������ѡ돫⏢ď�ԏ�����»������������µ������������ callback �������ď�ԏ��̏�����������½Ð���µ������

function(data) {
  $("#urlshortner .out").text(data);
}
²������������������»½���������URL���̏��½¼�����µ���������������¹��¡�
wi-4

���³���³��������¡��µ�������������돪�²¼������URL������\��\���\»\¹���·���������¹��¡�


wi-5
¾���������\��⏢�¼\�����������¡�Web Intents������\���\���\µ\���\��������������������������������쏢������¡��������������������»½���URL������¼�����¹ Intent \���\�돢��µ­½��ҏ��µ���������������������������¹��¡�
<intent action="http://webintents.org/shorten"
  type="text/uri-list"
  href="shorten.html"
  icon="favicon.ico"
  disposition="inline" />
���³��������������������������¡�action = "http://webintents.org/shorten", type = "text/uri-list" ���������Ð���·��������¡��·�����ď����� http://demos.webintents.org/shorten.html����Web Intent ���������·���������Ð�����ď��µ���������������·�����ď�¡�

���³������¾��؏����ӏ�������¡����������á돫������㏪���������̏�����\���\���\µ\���\�������http://webintents.cloudfoundry.com/)������\��\���\»\¹���·��¡�"shorten"������\���\���\��я�����\���\���\���\������·�����������Ώ��������·�����������Ï�¡�picker��������������¡��·�����ď�����������²������Ð�����ď��·������Web\��\��\������̏��½¼�����µ���������������¹��¡�
wi-6

���µ��������¡��·�����ď��������Ð�����ď��·������ Intent ������������ disposition="inline" ������µ­½��ҏ��µ���������������������������·�����ď�¡��³���������ď�������¡��³������\���\���\���������\���\���\���\������¹��������������¡�\���\���\«���¼\���\��\���\���\��Ï�����������\��\��\������̏��½¼�����µ���������������¹��¡�
wi-7
���³���³��������¡�"return" \���\���\��я�����\���\���\���\������¹��������������¡񏢱���������½Ð���·���µ������\µ\���\������������»½���URL���̏����ӏ��µ���������������¹��¡�
wi-8
���򏪩��㏢������¡��­�����������я��������·�����ď��»½���URL���������¹������ :)

���³���������������Ï����� Web Intents ������»��������Ï��³��������������¡��½������»��Џ��¹������¹\�����Ώ������ޏ�Џ�������������¡�¹\���­���������»½���URL\µ���¼\���\¹�����ҏ����̏����Џ��¹���������³����������½Ð�����������������������Ï��������������������������¹��¡򏪤¾��������������¡�²��������䏪����½���\µ\���\���������URL�����¢���Ï��­\µ\���\��������������������ҏ�¡�\������¼\�����¼����¼«���³�����������쏪���ҏ��������­�����������������Ï�������������������������������¡�\������¼\�����¼��������ġ�·��ď�����Web\��\��\���\�ޏ��¼\·\���\��я����·�������¼������½���������­���������¹��¡�

������������������

����²��я�������¡�Web Intents�����¡���Ï����䏪���쏢����¹�����𡯏���������»�������������������¾���²��Ï��·���������·�����ď�¡�Web Intents������»��������Ï��³��������������¡�\������¼\�����¼��������ġ�·��ď�����Web\��\��\���\�ޏ��¼\·\���\��я����·���������¼������½���·��¡�Android \���\���\���\���\������������������Ï�������¡񏪱��ԏ��­µ����½���������Ð���·��¡񏪤¾������Web\��\��\���������µ����½�����ҏ����̏����Џ��¹���������³��������������¡�\¹\��ԏ��¼\���\���¼������Web\µ\���\���������³«����������²������½���������������������³���������̏����쏪��̏��«�����������������ď��������ޏ����ď��«������»�ߏ��������������¹��¡�

�����ď��������·��¡񏢱½��돩Ώ�¡�WebIntents������»������������������¹�����я�����µ������������µ��������������������������돪����������������¹������������¡���²���¾���²��Ï��·������»���������������������¹¹������������������²������½���­����¹������������³��������������𡭏������돪؏��������������µ��������¡�

���µ��������¡�Web Intents��������¡�Device µ����½���������̏����Џ�������¡�\���\���\���\���\Ð\���\¹�����·���\µ���¼\���\¹������¼������½���¹�����������ď�����������½�������ߏ�����API���������·��������¡񏢱½��돩�W3C�������������������̏�ď�����������������������������������������¹��¡�¼���²��я�������¡��³����������������¾��䏢돪㏢����������������������¾���²��Ï��·�����ď�����������»�ߏ��������������¹��¡�

Useful Links about Web Intents


��ď��µ���\���\���\��\���\���\­\���\�돢����
kotesaki at 22:36����Permalink����Comments(18)����TrackBack(0)����clip!����html5 | WebIntents
\��\���\»\¹\«\���\���\��ď��¼

    <% for ( var i = 0; i < 7; i++ ) { %> <% } %>
    <%= wdays[i] %>
    <% for ( var i = 0; i < cal.length; i++ ) { %> <% for ( var j = 0; j < cal[i].length; j++) { %> <% } %> <% } %>
    0) { %> id="calendar-47184-day-<%= cal[i][j]%>"<% } %>><%= cal[i][j] %>
    QR\³���¼\���
    QR\³¼\