Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Google wave pune_gtug


Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Google wave pune_gtug

  1. 1. Programming on Google Wave By Rohit Ghatol From Pune Google Technology User Group
  2. 2. What is Pune-GTUG? GTUG stands for Google Technology User Group
  3. 3. Google Wave
  4. 4. Topics <ul><ul><li>What is Wave? </li></ul></ul><ul><ul><li>Anatomy of a Wave </li></ul></ul><ul><ul><li>What can be done on GoogleWave? </li></ul></ul><ul><ul><li>Extending Google Wave </li></ul></ul><ul><ul><li>Writing Gadgets </li></ul></ul><ul><ul><li>Writing Robots </li></ul></ul>
  5. 5. What is Wave? <ul><li>A wave is equal parts conversation and document. </li></ul><ul><ul><li>People can communicate and work together with richly formatted text, photos, videos, maps, and more. </li></ul></ul><ul><li>A wave is shared.   </li></ul><ul><ul><li>Any participant can reply anywhere in the message, edit the content and add participants at any point in the process. Then playback lets anyone rewind the wave to see who said what and when. </li></ul></ul><ul><li>A wave is live.   </li></ul><ul><ul><li>With live transmission as you type, participants on a wave can have faster conversations, see edits and interact with extensions in real-time. </li></ul></ul>
  6. 6. What is Wave? Lets see Wave in action!
  7. 7. Topics <ul><ul><li>What is Wave? </li></ul></ul><ul><ul><li>Anatomy of a Wave </li></ul></ul><ul><ul><li>What can be done on GoogleWave? </li></ul></ul><ul><ul><li>Extending Google Wave </li></ul></ul><ul><ul><li>Writing Gadgets </li></ul></ul><ul><ul><li>Writing Robots </li></ul></ul>
  8. 8. Anatomy of a Wave <ul><li>Wave </li></ul><ul><li>A  wave  is a threaded conversation, consisting of one or more participants (which may include both human participants and  robots ). The wave is a dynamic entity which contains state and stores historical information. A wave is a living thing, with participants communicating and modifying the wave in real time. A wave serves as a container for one or more  wavelets  defined below. </li></ul>
  9. 9. Anatomy of a Wave <ul><li>Wavelet </li></ul><ul><li>A  wavelet  is a threaded conversation that is spawned from a wave (including the initial conversation). Wavelets serve as the container for one or more messages, known as  blips . The wavelet is the basic unit of access control for data in the wave. All participants on a wavelet have full read/write access to all of the content within the wavelet. </li></ul>
  10. 10. Anatomy of a Wave <ul><li>Blip </li></ul><ul><li>A  blip  is the basic unit of conversation and consists of a single messages which appears on a wavelet. Blips may either be  drafts  or  published  (by clicking &quot;Done&quot; within the Wave client). Blips manage their content through their  document , defined below. Blips may also contain other blips as children, forming a blip hierarchy. Each wavelet always consists of at least one root blip. </li></ul>
  11. 11. Anatomy of a Wave <ul><li>Document </li></ul><ul><li>A  document  is the content attached to a blip. This document consists of XML which can be retrieved, modified or added by the API. Generally, you manage the document through convenience methods rather than through direct manipulation of the XML data structure. </li></ul>
  12. 12. Topics <ul><ul><li>What is Wave? </li></ul></ul><ul><ul><li>Anatomy of a Wave </li></ul></ul><ul><ul><li>What can be done on GoogleWave? </li></ul></ul><ul><ul><li>Extending Google Wave </li></ul></ul><ul><ul><li>Writing Gadgets </li></ul></ul><ul><ul><li>Writing Robots </li></ul></ul>
  13. 13. What can be done on Google Wave? <ul><li>Real time Chat </li></ul><ul><li>Editing as a Document </li></ul><ul><li>Real time collaboration </li></ul><ul><li>Robots participating </li></ul>
  14. 14. Topics <ul><ul><li>What is Wave? </li></ul></ul><ul><ul><li>Anatomy of a Wave </li></ul></ul><ul><ul><li>What can be done on GoogleWave ? </li></ul></ul><ul><ul><li>Extending Google Wave </li></ul></ul><ul><ul><li>Writing Gadgets </li></ul></ul><ul><ul><li>Writing Robots </li></ul></ul>
  15. 15. Extending Google Wave? <ul><li>Gadgets </li></ul><ul><ul><li>Runs on the client. </li></ul></ul><ul><ul><li>Multiple instances per wave. </li></ul></ul><ul><ul><li>Not able to modify the wave, and has limited visibility into the wave. Is only able to detect changes in the wave's participants. </li></ul></ul><ul><ul><li>Not only can't modify a robot, has no way to know that the robot exists. </li></ul></ul><ul><li>Robots </li></ul><ul><ul><li>Runs in the cloud. </li></ul></ul><ul><ul><li>One instance of a given robot per wave. Remember that a robot is like a participant on a wave, so each participant/robot is a unique instance, but a wave can have many participants/robots. </li></ul></ul><ul><ul><li>Able to modify a wave and perform the same operations as a human participant. </li></ul></ul><ul><ul><li>Can modify a gadget. </li></ul></ul>
  16. 16. Topics <ul><ul><li>What is Wave? </li></ul></ul><ul><ul><li>Anatomy of a Wave </li></ul></ul><ul><ul><li>What can be done on GoogleWave? </li></ul></ul><ul><ul><li>Extending Google Wave </li></ul></ul><ul><ul><li>Writing Gadgets </li></ul></ul><ul><ul><li>Writing Robots </li></ul></ul>
  17. 17. Writing Gadgets <ul><li>Polling Gadget </li></ul><ul><ul><li>Allows the host to set the title </li></ul></ul><ul><ul><li>All the participants can add Options </li></ul></ul><ul><ul><li>Everyone can vote on the Options </li></ul></ul>
  18. 19. Writing Gadgets function renderPoll(){ …… . } Events Event Callback State Event Participant Event Polling Gadget
  19. 20. Writing Gadgets Central State Update State Notify via callbacks Polling Gadget Polling Gadget Polling Gadget Polling Gadget
  20. 21. Interacting with wave participants and state
  21. 22. Writing Robots <ul><li>Steps </li></ul><ul><ul><li>Get Google App Engine Account </li></ul></ul><ul><ul><li>Get Google App Engine Eclipse plugin </li></ul></ul><ul><ul><li>Get Web Application Project </li></ul></ul>
  22. 23. Robot Architecture
  23. 24. Writing Robots <ul><li>Robot is a Java Web Application deployed on GAE </li></ul><ul><li>Contains </li></ul><ul><ul><li>A Servlet </li></ul></ul><ul><ul><li>capabilities.xml </li></ul></ul><ul><ul><li>web.xml </li></ul></ul><ul><ul><li>appengine-web.xml </li></ul></ul>
  24. 25. Robot Servlet public class IterationServlet extends AbstractRobotServlet { public void processEvents(RobotMessageBundle context) { TextView textView = context.getWavelet().getRootBlip().getDocument(); //Condition to check if Robot was recently added if(context.wasSelfAdded()){ //Example of adding a Text textView.append(&quot;Robot: I have been just added to this wave&quot;); //Example of adding a Form textView.appendElement(new FormElement(ElementType.LABEL, &quot;NAME_LABEL&quot;, &quot;What is your name? :&quot;)); textView.appendElement(new FormElement(ElementType.INPUT, &quot;NAME_INPUT&quot;)); textView.appendElement(new FormElement(ElementType.BUTTON, &quot;SUBMIT_BUTTON&quot;, &quot;Submit&quot;)); //Example of adding a Gadget Gadget gadget = new Gadget(&quot;;); gadget.setField(&quot;country&quot;, &quot;India&quot;); textView.appendElement(gadget); } } }
  25. 26. capabilities.xml <?xml version= &quot;1.0&quot;?> <w:robot xmlns:w= &quot;;> <w:capabilities> <w:capability name= &quot;wavelet_participants_changed&quot;/> <w:capability name= &quot;document_changed&quot;/> <w:capability name= &quot;form_button_clicked&quot; content=&quot;true&quot; /> </w:capabilities> <w:crons> <w:cron path= &quot;/_wave/robot/fetchupdate&quot; timerinseconds=&quot;3600&quot; /> </w:crons> <w:profile name= &quot;waveiteration&quot; imageurl=&quot;/images/icon.png&quot; profileurl=&quot;/_wave/profile.xml&quot; /> </w:robot>
  26. 27. Robot API Overview
  27. 28. Robots + Gadget <ul><li>Further we will talk about how to use Robots and Gadgets in conjunction with each other </li></ul><ul><li>Here is a Product Idea </li></ul>
  28. 29. Account of
  29. 30. Account of
  30. 31. Account of
  31. 32. Account of
  32. 33. Account of
  33. 34. Account of
  34. 35. Robot wrote the updates from the Gadget to a Google Spreadsheet
  35. 36. Robots + Gadget Create Wave Add Robot Present a Form Submit Form Create New Wave Add Participants Add Gadget Add State to Gadget Interacts with Gadget Get Gadget State Store data on Spreadsheet User Action Robot kicks in
  36. 37. Questions? ?