Getting Started With Google Wave Developlement
Upcoming SlideShare
Loading in...5

Getting Started With Google Wave Developlement



Introduction to Google Wave Gadget and and Robot APIs. Presentation given May 26, 2010 at the National Extension Technology Conference in Auburn, Alabama. War Eagle!

Introduction to Google Wave Gadget and and Robot APIs. Presentation given May 26, 2010 at the National Extension Technology Conference in Auburn, Alabama. War Eagle!



Total Views
Views on SlideShare
Embed Views



1 Embed 8 8



Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Getting Started With Google Wave Developlement Getting Started With Google Wave Developlement Presentation Transcript

  • Getting Started With Google Wave Development James E. Robinson, III NC State University NETC 2010
  • Google Wave v/s Google wave Wave - the Wave protocol wave - The Google wave web app
  • Wave Anatomy
  • Wavelet Anatomy
  • Wavelet Anatomy (cont.) Blips Participants Tags Data Documents metadata creator creation_time last_modified_time robot title
  • Blip Anatomy
  • Blip Anatomy (cont.) Document Annotations Children Parent (if not already) metadata creator contributors last_modified version
  • Gadgets: n, dynamic web content that can be placed on any page on the web. Gadgets can be games, mini applications, news feeds, maps or any content. See also: JavaScript on steroids.
  • <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello, World"> <Require feature="wave" /> </ModulePrefs> <Content type="html"> Hello, World! </Content> </Module>
  • Wave Gadget API setStateCallback getState setPrivateStateCallback getPrivateState submitDelta setParticipantCallback
  • Gadget API Example <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Counter/State Example" height="120"> <Require feature="wave" /> </ModulePrefs>
  • <Content type="html"> <![CDATA[ <div id="content_div" style="height: 50px;"></div> <input type=button value="Click Me!" id="butCount" onClick="buttonClicked()" > <input type=button value="Reset" id=" butReset" onClick="resetCounter()">
  • <script type="text/javascript"> var div = $('content_div'); function init() { if (wave && wave.isInWaveContainer()) { wave.setStateCallback(stateUpdated); } } gadgets.util.registerOnLoadHandler(init);
  • function buttonClicked() { var val = wave.getState().get('count', '0'); wave.getState().submitDelta( {'count': val + 1}); } function stateUpdated() { if (!wave.getState().get('count')) { div.innerHTML = "The count is 0." } else { div.innerHTML = "The count is " + wave.getState().get('count'); } }
  • // Reset value of "count" to 0 function resetCounter(){ wave.getState().submitDelta({'count': '0'}); } </script> ]]> </Content> </Module>
  • Gadget Hosting?
  • What To Do? if __name__ == '__main__': myRobot = robot.Robot('robot name', image_url='') myRobot.register_handler( events.WaveletSelfAdded, OnSelfAdded) myRobot.Run()
  • Add us a Gadget... def OnSelfAdded(event, wavelet): blip = event.blip gadget = element.Gadget(GADGET_URL) blip.append(gadget)
  • Wave Happenings wavelet_blip_created wavelet_blip_removed wavelet_participants_change wavelet_self_added wavelet_self_removed wavelet_title_changed wavelet_timestamp_changed wavelet_version_changed
  • Blip Happenings blip_contributors_changed blip_deleted blip_submitted - only fires once blip_timestamp_changed blip_version_changed document_changed - various intervals form_button_clicked
  • downloads.html
  • Register your new application...
  • Complex mapping structure AppName: jerobins-test Application URL: Wave Address:
  • Now What? def OnBlipSubmitted(event, wavelet): blip = event.blip gadget = blip.first(element.Gadget, url=GADGET_URL) if gadget: count = gadget.get('count', '0') gadget.update_element({'count', '0'}) blip.append("nCount before blip" + " changed: " + count)
  • Danger, Will Robinson! Your robot or gadget may not be the only gadget or robot on the wave.
  • Annotations
  • Robot Annotations def OnWaveletSelfAdded(event, wavelet): blip = event.blip blip.Annotation("my-robot/tag") def OnButtonClicked(event, wavelet): blip = event.blip annots = blip.annotations if annots.include("my-robot/tag"): """ do MY robot stuff """
  • Active Robot API Performing scheduled tasks (e.g. cron jobs) at specified intervals Creating new waves within Google Wave in response to actions within Google Wave itself Responding to outside events or services by updating waves or creating new ones
  • Keep on Wavin' ...