SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Programming with and for
Google Wave
Douwe Osinga
May 28th, 2009
Wave Developer Preview
Introducing WaveSandbox.com
Getting access to the sandbox and how to use it



 Developer accounts initially on wavesandbox.com
 Explore the docs on the Google Code site
 Check out the new Google Wave blog site
 You will get an email inviting you to sign up
 Complete the form to pick your desired user name
 Accounts will be created starting next week!
Wave Building
Anatomy of a wave
Waves, wavelets, participants, and blips


                                           A wave can be
                                           considered the root
                                           Waves contain
                                           wavelets
                                           Wavelets contain blips
                                           Permissions are
                                           applied at the wavelet
                                           level
Embedding
Embedding architecture
How scripts communicate with the Wave Server
Embed API
How scripts communicate with the Wave Server




              LoadWave
              SetUIConfig
              AddReply
              Follow
Example Code for Embedding
  Embedding a wave without customization


<div id='waveframe' style='height:500px;width:100%'/>
<script type='text/javascript'
  src='http://wave-api.appspot.com/public/embed.js'> </script>
<script>
 var wavePanel = new WavePanel(
     'http://wave.google.com/a/wavesandbox.com/');
 wavePanel.loadWave('wavesandbox.com!w+PfYnNrZk%1');
 wavePanel.init(document.getElementById('waveframe'));
</script>
Customizing the UI
  Example of using the setUIConfig method and addParticipant


<div id='waveframe' style='height:500px;width:100%'/>
<button type="button"
     onclick="wavePanel.addParticipant()">
  Add comment</button>
<script type='text/javascript'
  src='http://wave-api.appspot.com/public/embed.js'> </script>
<script>
 var wavePanel = new WavePanel(
     'http://wave.google.com/a/wavesandbox.com/');
 wavePanel.setUIConfig('red', 'black', 'courier new', '18px');
 wavePanel.loadWave('wavesandbox.com!w+PfYnNrZk%1');
 wavePanel.init(document.getElementById('waveframe'));
</script>
Embedding Within a Google Gadget
   Used to embed a wave on iGoogle and other gadget containers
<ModulePrefs title="Google Wave" height="600" ../>
<UserPref name="waveID" display_name="Wave ID" required="true" default_value="
wavesandbox.com!w+t7KgqNmw%1" />
<UserPref name="font" display_name="Font" required="false" default_value="" />
...
<Content type="html" view="home,canvas,default,profile">
<![CDATA[
<div id='waveframe' style='height:650px; width:100%;'></div>
<script type='text/javascript'
    src='http://wave-api.appspot.com/public/embed.js'></script>
<script type="text/javascript">
  var wavePanel = new WavePanel("http://wave.google.com/a/wavesandbox.com/");
  wavePanel.loadWave("__UP_waveID__");
  wavePanel.setUIConfig(
    '__UP_bgcolor__', '__UP_color__', '__UP_font__', '__UP_fontsize__');
  wavePanel.init(document.getElementById('waveframe'));
</script>
]]>
</Content>
</Module>
Wave Embed Gadget Settings
Users don't have to copy any code



                                    Users can change
                                    settings without knowing
                                    JavaScript or HTML
                                    Allows waves to be on
                                    gadget containers that
                                    don't allow raw scripts
Future Plans for Embedding
An overview of potential future enhancements



                                          Anonymous Access
                                          Search Panel
                                          Provide Participants
                                          Communication Hub
Extensions: Gadgets and Robots
Intro to Gadgets and Robots
The difference between a robot and a gadget

                                              Robot
Robot: participant, runs in the cloud
Gadget: wave element, runs on the
client

Robot: interacts with the wave
Gadget: interacts with the user, saves         Gadget
state in the wave

Robot: observes and modifies the
wave
Gadget: has limited view of the wave,
modifies only its own state
Gadgets Deep Dive
Gadget Architecture
Multiple clients talking to the Wave Server using Wave XML
Wave Gadget API
Interacting with wave participants and state
Hello World Gadget
  Bare bones Gadget


<Module>
 <ModulePrefs title="Basemap" height="400" ../>
  <Require feature="rpc"/>
 </ModulePrefs>
 <Content type="html">
  <![CDATA[
    <script type="text/javascript"
     src="http://wave-api.appspot.com/public/wave.js">
    </script>
    <div id="map_canvas">Hello Wave</div>
  ]]>
 </Content>
</Module>
Adding a Map
  Paste in a standard Google Map API example


...
 <script type="text/javascript">
    var map;
    function main() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(35, 135), 2);
    }
    gadgets.util.registerOnLoadHandler(main);
 </script>
 <div id="map_canvas" style="width: 100%; height: 100%"></div>
 ]]>
 </Content>
</Module>
Making the Map Shared
   Using getState , setStateCallback , addListener , and more

 ...
function stateChanged() {
  var state = wave.getState();
  map.setCenter(
     new GLatLng(state.get('lat', 35),
                  state.get('lng', 135)), 2);
  }

function main() {
 if (wave && wave.isInWaveContainer()) {
   wave.setStateCallback(stateChanged);
 }
 ...
 GEvent.addListener(map, "dragend", function() {
   wave.getState().submitDelta({
       lat: map.getCenter().lat(),
       lng: map.getCenter().lng()
   });
 });
Adding Avatars
Using getState , setStateCallback , addListener , and more

var participants = wave.getParticipants();
for (var i = 0; i < participants.length; ++i) {
 var p = participants[i];
  var ploc = state.get(p.getId(), i * 2 + '|' + i * 2).split('|');
 var lat = parseFloat(ploc[0]);
 var lng = parseFloat(ploc[1]);
 var Icon = new GIcon();
 Icon.image = p.getThumbnailUrl();
 var marker = new GMarker(new GLatLng(lat, lng), {draggable:true, icon:Icon});
 map.addOverlay(marker);
 if (p.getId() == wave.getViewer().getId()) {
   marker.pid = p.getId();
   GEvent.addListener(marker, "dragend", function() {
     var d = {}
     d[this.pid] = this.getLatLng().lat() + '|' + this.getLatLng().lng();
     wave.getState().submitDelta(d);
   });
 }
Other Examples of Gadgets
Games, polls, puzzles, and more
Robots Deep Dive
Robot Architecture
   How robots interact with clients and the Wave Server




* All robots run on App Engine today but that will be opened up
Wave Robot API
Overview of the model, events, and operations



                          Wavelets: BlipCreate, ParticipantChanged,
                          TitleChanged
                          Blips: ContributorsChanged, Deleted, Submited,
                          DocumentChanged
                          Form: ButtonClicked




   TextView
   GadgetView
   FormView              Wavelet: AppendBlip, AddParticipant, Create,
                         RemoveSelf, SetDataDoc, SetTitle, CreateBlip
                         Blip: CreateChild, Delete
                         Annotation: Delete, Set
                         Document: Append, AppendStyled, Insert, Delete,
                         Replace, Elements, InlineBlip
Simple Robot
  Example of Smiley, the emoticon robot


"""Yasr: Yet another smiley robot"""
from api import events
from api import robot

def OnBlipSubmitted(properties, context):
 blip = context.GetBlipById(properties['blipId'])
 contents = blip.GetDocument().GetText()
 contents = contents.replace(':-(', unichr(0x2639)).replace(':-)', unichr(0x263A))
 blip.GetDocument().SetText(contents)

if __name__ == '__main__':
  yasr = robot.Robot('Yasr')
  yasr.RegisterHandler(
     events.BLIP_SUBMITTED, OnBlipSubmitted)
  yasr.Run()
Completey
  Using the Google Search API and a wave robot


 if '???' in contents:
   q = '"%s"' % contents.replace('???', '*').replace('"', ' ')
   start = 0
   res = {}
   for i in range(6):
     url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&start=%d&q=%s'
% (start, urllib.quote(q))
     js = urlfetch.fetch(url=url).content
     for fragment in simplejson.loads(js)['responseData']['results']:
       for m in re.findall('<b>([^<]*)', fragment['content']):
        m = m.lower()
        if m == '...':
          continue
        res[m] = res.get(m, 0) + 1
     start += 5
   if res:
     res = res.items()
     res.sort(lambda a,b: -cmp(a[1], b[1]))
     blip.GetDocument().SetText(res[0][0])
More Example Robots
Some sample robots written to demo the API

 Polly
    handles the flow of polling
    demonstrates forms within a wave
    uses waves as the data store
 Bloggy
    publishes waves to a blog
 Buggy
    connects wave to Issue tracker
 Searchy
    does the heavy lifting for, uh, search
 Tweety
    syncs between waves and Twitter
Extensions Distribution
Extensions API
Extending the Google Wave client




     New Wave                      Insert Gadget
     Toolbar                       Add Participant
                                   Create New Wave
     Keyboard short cut
     File menu                     Apply Annotation
Integrating Extensions
Extensions allow easy access to robots and gadgets




     Robot



         Gadget
Example Extension Installer
  New Menu button for participant showing map gadget


<extension location="Toolbar">
 <info id="where-are-you-gadget"
     text="Where Are You?"
     description="Insert the Where Are You? gadget."
     imageUrl="http://wave-api-dmo.appspot.
com/public/simplemap/whereicon.png"/>
   <insertGadget
     url="http://wave-api-dmo.appspot.
com/public/simplemap/participantmap.xml"/>
</extension>
Extension Installer Screen Shot
Installer shows install state for current user
Thank You!
Thanks for listening and be sure to check out the code site




for more info:
http://code.google.com/apis/wave/
Programming For Google Wave

Más contenido relacionado

La actualidad más candente

SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsScott Gardner
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerLeonardo Pirro
 
EmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsEmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsLauren Elizabeth Tan
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법Jeado Ko
 
Android application model
Android application modelAndroid application model
Android application modelmagicshui
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScriptMark Casias
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Elyse Kolker Gordon
 
Aggregation and Awareness or How to Reduce the Amount of your FrontEnd Code ...
Aggregation and Awareness or How to Reduce the Amount of  your FrontEnd Code ...Aggregation and Awareness or How to Reduce the Amount of  your FrontEnd Code ...
Aggregation and Awareness or How to Reduce the Amount of your FrontEnd Code ...ISS Art, LLC
 
Event handling using jQuery
Event handling using jQueryEvent handling using jQuery
Event handling using jQueryIban Martinez
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QATed Drake
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todaygerbille
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightMichael Pustovit
 
Migration to jQuery 3.5.x
Migration to jQuery 3.5.xMigration to jQuery 3.5.x
Migration to jQuery 3.5.xStanislavIdolov
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineTai Lun Tseng
 

La actualidad más candente (20)

SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 
Android 3
Android 3Android 3
Android 3
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation Controller
 
EmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsEmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious Apps
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 
Android application model
Android application modelAndroid application model
Android application model
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017
 
Aggregation and Awareness or How to Reduce the Amount of your FrontEnd Code ...
Aggregation and Awareness or How to Reduce the Amount of  your FrontEnd Code ...Aggregation and Awareness or How to Reduce the Amount of  your FrontEnd Code ...
Aggregation and Awareness or How to Reduce the Amount of your FrontEnd Code ...
 
Event handling using jQuery
Event handling using jQueryEvent handling using jQuery
Event handling using jQuery
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 light
 
Migration to jQuery 3.5.x
Migration to jQuery 3.5.xMigration to jQuery 3.5.x
Migration to jQuery 3.5.x
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and Combine
 

Similar a Programming For Google Wave

Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and BeyondMarakana Inc.
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Getting Started With Google Wave Developlement
Getting Started With Google Wave DeveloplementGetting Started With Google Wave Developlement
Getting Started With Google Wave Developlementjerobins
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
JavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilderJavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilderAndres Almiray
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
Direct Web Remoting : DWR
Direct Web Remoting : DWRDirect Web Remoting : DWR
Direct Web Remoting : DWRhussulinux
 
CodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderCodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderAndres Almiray
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersJiaxuan Lin
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Matt Raible
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...DataLeader.io
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfKaty Slemon
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsLoiane Groner
 

Similar a Programming For Google Wave (20)

Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and Beyond
 
Google Wave
Google WaveGoogle Wave
Google Wave
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Getting Started With Google Wave Developlement
Getting Started With Google Wave DeveloplementGetting Started With Google Wave Developlement
Getting Started With Google Wave Developlement
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
JavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilderJavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilder
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
Direct Web Remoting : DWR
Direct Web Remoting : DWRDirect Web Remoting : DWR
Direct Web Remoting : DWR
 
Wave Workshop
Wave WorkshopWave Workshop
Wave Workshop
 
CodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderCodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilder
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdf
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 

Último

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Programming For Google Wave

  • 1.
  • 2. Programming with and for Google Wave Douwe Osinga May 28th, 2009
  • 4. Introducing WaveSandbox.com Getting access to the sandbox and how to use it Developer accounts initially on wavesandbox.com Explore the docs on the Google Code site Check out the new Google Wave blog site You will get an email inviting you to sign up Complete the form to pick your desired user name Accounts will be created starting next week!
  • 6. Anatomy of a wave Waves, wavelets, participants, and blips A wave can be considered the root Waves contain wavelets Wavelets contain blips Permissions are applied at the wavelet level
  • 8. Embedding architecture How scripts communicate with the Wave Server
  • 9. Embed API How scripts communicate with the Wave Server LoadWave SetUIConfig AddReply Follow
  • 10. Example Code for Embedding Embedding a wave without customization <div id='waveframe' style='height:500px;width:100%'/> <script type='text/javascript' src='http://wave-api.appspot.com/public/embed.js'> </script> <script> var wavePanel = new WavePanel( 'http://wave.google.com/a/wavesandbox.com/'); wavePanel.loadWave('wavesandbox.com!w+PfYnNrZk%1'); wavePanel.init(document.getElementById('waveframe')); </script>
  • 11. Customizing the UI Example of using the setUIConfig method and addParticipant <div id='waveframe' style='height:500px;width:100%'/> <button type="button" onclick="wavePanel.addParticipant()"> Add comment</button> <script type='text/javascript' src='http://wave-api.appspot.com/public/embed.js'> </script> <script> var wavePanel = new WavePanel( 'http://wave.google.com/a/wavesandbox.com/'); wavePanel.setUIConfig('red', 'black', 'courier new', '18px'); wavePanel.loadWave('wavesandbox.com!w+PfYnNrZk%1'); wavePanel.init(document.getElementById('waveframe')); </script>
  • 12. Embedding Within a Google Gadget Used to embed a wave on iGoogle and other gadget containers <ModulePrefs title="Google Wave" height="600" ../> <UserPref name="waveID" display_name="Wave ID" required="true" default_value=" wavesandbox.com!w+t7KgqNmw%1" /> <UserPref name="font" display_name="Font" required="false" default_value="" /> ... <Content type="html" view="home,canvas,default,profile"> <![CDATA[ <div id='waveframe' style='height:650px; width:100%;'></div> <script type='text/javascript' src='http://wave-api.appspot.com/public/embed.js'></script> <script type="text/javascript"> var wavePanel = new WavePanel("http://wave.google.com/a/wavesandbox.com/"); wavePanel.loadWave("__UP_waveID__"); wavePanel.setUIConfig( '__UP_bgcolor__', '__UP_color__', '__UP_font__', '__UP_fontsize__'); wavePanel.init(document.getElementById('waveframe')); </script> ]]> </Content> </Module>
  • 13. Wave Embed Gadget Settings Users don't have to copy any code Users can change settings without knowing JavaScript or HTML Allows waves to be on gadget containers that don't allow raw scripts
  • 14. Future Plans for Embedding An overview of potential future enhancements Anonymous Access Search Panel Provide Participants Communication Hub
  • 16. Intro to Gadgets and Robots The difference between a robot and a gadget Robot Robot: participant, runs in the cloud Gadget: wave element, runs on the client Robot: interacts with the wave Gadget: interacts with the user, saves Gadget state in the wave Robot: observes and modifies the wave Gadget: has limited view of the wave, modifies only its own state
  • 18. Gadget Architecture Multiple clients talking to the Wave Server using Wave XML
  • 19. Wave Gadget API Interacting with wave participants and state
  • 20. Hello World Gadget Bare bones Gadget <Module> <ModulePrefs title="Basemap" height="400" ../> <Require feature="rpc"/> </ModulePrefs> <Content type="html"> <![CDATA[ <script type="text/javascript" src="http://wave-api.appspot.com/public/wave.js"> </script> <div id="map_canvas">Hello Wave</div> ]]> </Content> </Module>
  • 21. Adding a Map Paste in a standard Google Map API example ... <script type="text/javascript"> var map; function main() { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(35, 135), 2); } gadgets.util.registerOnLoadHandler(main); </script> <div id="map_canvas" style="width: 100%; height: 100%"></div> ]]> </Content> </Module>
  • 22. Making the Map Shared Using getState , setStateCallback , addListener , and more ... function stateChanged() { var state = wave.getState(); map.setCenter( new GLatLng(state.get('lat', 35), state.get('lng', 135)), 2); } function main() { if (wave && wave.isInWaveContainer()) { wave.setStateCallback(stateChanged); } ... GEvent.addListener(map, "dragend", function() { wave.getState().submitDelta({ lat: map.getCenter().lat(), lng: map.getCenter().lng() }); });
  • 23. Adding Avatars Using getState , setStateCallback , addListener , and more var participants = wave.getParticipants(); for (var i = 0; i < participants.length; ++i) { var p = participants[i]; var ploc = state.get(p.getId(), i * 2 + '|' + i * 2).split('|'); var lat = parseFloat(ploc[0]); var lng = parseFloat(ploc[1]); var Icon = new GIcon(); Icon.image = p.getThumbnailUrl(); var marker = new GMarker(new GLatLng(lat, lng), {draggable:true, icon:Icon}); map.addOverlay(marker); if (p.getId() == wave.getViewer().getId()) { marker.pid = p.getId(); GEvent.addListener(marker, "dragend", function() { var d = {} d[this.pid] = this.getLatLng().lat() + '|' + this.getLatLng().lng(); wave.getState().submitDelta(d); }); }
  • 24. Other Examples of Gadgets Games, polls, puzzles, and more
  • 26. Robot Architecture How robots interact with clients and the Wave Server * All robots run on App Engine today but that will be opened up
  • 27. Wave Robot API Overview of the model, events, and operations Wavelets: BlipCreate, ParticipantChanged, TitleChanged Blips: ContributorsChanged, Deleted, Submited, DocumentChanged Form: ButtonClicked TextView GadgetView FormView Wavelet: AppendBlip, AddParticipant, Create, RemoveSelf, SetDataDoc, SetTitle, CreateBlip Blip: CreateChild, Delete Annotation: Delete, Set Document: Append, AppendStyled, Insert, Delete, Replace, Elements, InlineBlip
  • 28. Simple Robot Example of Smiley, the emoticon robot """Yasr: Yet another smiley robot""" from api import events from api import robot def OnBlipSubmitted(properties, context): blip = context.GetBlipById(properties['blipId']) contents = blip.GetDocument().GetText() contents = contents.replace(':-(', unichr(0x2639)).replace(':-)', unichr(0x263A)) blip.GetDocument().SetText(contents) if __name__ == '__main__': yasr = robot.Robot('Yasr') yasr.RegisterHandler( events.BLIP_SUBMITTED, OnBlipSubmitted) yasr.Run()
  • 29. Completey Using the Google Search API and a wave robot if '???' in contents: q = '"%s"' % contents.replace('???', '*').replace('"', ' ') start = 0 res = {} for i in range(6): url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&start=%d&q=%s' % (start, urllib.quote(q)) js = urlfetch.fetch(url=url).content for fragment in simplejson.loads(js)['responseData']['results']: for m in re.findall('<b>([^<]*)', fragment['content']): m = m.lower() if m == '...': continue res[m] = res.get(m, 0) + 1 start += 5 if res: res = res.items() res.sort(lambda a,b: -cmp(a[1], b[1])) blip.GetDocument().SetText(res[0][0])
  • 30. More Example Robots Some sample robots written to demo the API Polly handles the flow of polling demonstrates forms within a wave uses waves as the data store Bloggy publishes waves to a blog Buggy connects wave to Issue tracker Searchy does the heavy lifting for, uh, search Tweety syncs between waves and Twitter
  • 32. Extensions API Extending the Google Wave client New Wave Insert Gadget Toolbar Add Participant Create New Wave Keyboard short cut File menu Apply Annotation
  • 33. Integrating Extensions Extensions allow easy access to robots and gadgets Robot Gadget
  • 34. Example Extension Installer New Menu button for participant showing map gadget <extension location="Toolbar"> <info id="where-are-you-gadget" text="Where Are You?" description="Insert the Where Are You? gadget." imageUrl="http://wave-api-dmo.appspot. com/public/simplemap/whereicon.png"/> <insertGadget url="http://wave-api-dmo.appspot. com/public/simplemap/participantmap.xml"/> </extension>
  • 35. Extension Installer Screen Shot Installer shows install state for current user
  • 36. Thank You! Thanks for listening and be sure to check out the code site for more info: http://code.google.com/apis/wave/