How to insert emoticons into google wave

by Naveen 8. December 2009 06:14
emoticon in google wave

This is .Net implementation of recently published python Google Wave robot supasmiley. This is a very simple robot that parses the text in a blip. If there is some text that matches standard character combination for emoticon display, it replaces that text with a google wave gadget to display graphical display. In this example, the robot is only looking for character combination <3. If it is found, the range of characters are removed and gadget is inserted. The gadget is a simple flash movie that display beating heart.


 void ProcessEmotions(IEvent e)
 {
  var txtView = e.Blip.Document;
  var txt = txtView.Text;
  var idx = txt.IndexOf("<3");
  if (idx == -1)
  {
    return;
  }
  txtView.Delete(new Range(idx, idx+2));
  txtView.InsertElement(idx, new Gadget("http://wave.byteblocks.com/emotions-gadget.xml"));
}

Try It

  • Add byteblocks-emotions@appspot.com into your contact list.
  • Start a new wave or you can choose an existing wave
  • Add byteblocks-emotions@appspot.com as participant in the wave.
  • Enter text and where you want to show beating heart, type <3
  • ... like the heart now....

Download Sample Project

Views: 1468

Tags:

Google Wave

Tricky - Implementing Halloween Google Wave Robot and Gadget Sample Using .Net

by Viper 3. November 2009 16:58

Download Sample Project

After doing some plain text Google wave robots implementations, it is time for some fun robot that has some graphical implementation to it. This post is about port of tricky python sample published by Google in their Google wave development resources. This robot uses Google wave gadget as well to display some images. So implementation of this robot will help you understand how Google wave gadgets get included in the wave and how you can add them from robot itself. I am not going to discuss implementation of gadget here. I will do it in my future post.

In one of my earlier posts Developing Google Wave Robots Using .Net i discussed fundamental steps in creating and deploying your Google wave robot. So I will refer you to reading that post if you have not done it already. So following those steps i created my new robot named byteblocks-tricky.

How to use and try it

  • Add byteblocks-tricky@appsot.com as participant in your contacts
  • Start a new wave and add byteblocks-tricky@appspot.com as one of the participants in the wave. As soon as you add it as participant, you will notice that title of your wave has changed and a graphical widget gets added to the document.
  • Start a new message and type trick or treat. It will randomly give your trick or treat and display an image for the item.

Implementation

This robot handles WAVELET_SELF_ADDED and BLIP_SUBMITTED. In WAVELET_SELF_ADDED handler, robot inserts a gadget into the wave. In BLIP_SUBMITTED the robot looks for text trick or treat in document. If it finds it, it randomly decided if you are going to get tricked or get a treat. Then it searches Google images for appropriate image for that item and then inserts that image into the document.

Have fun with trick or treat.

Views: 1161

Tags:

Google Wave

How to debug Google Wave Robot and extensions

by Viper 3. November 2009 09:32

I have been writing posts on how to develop Google Wave robots. During the process of development of some prototype robots I ran into lot of issues, bugs and what not. Since this is a new framework and still in beta state, so you will be running into more issues than expected. Having the robot hosted on Google app engine cloud adds some challenge itself if you want to debug your robot. And I get questions everybody about debugging of these robots as well. So here is my attempt on putting together some notes and thoughts on debugging a Google wave robot.

Deployment Check

First and foremost, you need to check if your robot has been correctly or not. Here are some steps I follow when I deploy a new robot.

1.Check capabilities.xml

This is a very quick and robot test that will reveal following two things very quickly. In your browser type the URL http://{robotname}.appspot.com/_wave/capabilities.xml. If everything is deployed correctly and working as designed then you should verify following outputs.

  • You do no get 404 status code. If you get 404 (Page not found) then you have deployment issues going on. To resolve this issue, check following things:

    • Your URL is correct.

    • Your robot name is correct.

    • Check in your App Engine dashboard to see if this application has been deployed.

    • Check your code if you are handling requests for this request.

  • You should get a valid capabilities.xml document in response. And this response should contain all the capabilities or events your robot is handling. Here are some common issues that you may run into:

    • You get a blank xml document. Check if you have configured your entry point to robot correctly. One of the common problems I have seen with python implementation is that correct entry point is not provided in app.yaml file. Other problem I run into is that your entry point robot implementation is not correct and is some blank implementation. I have seen this happen when you use Google app engine sdk to create new application.

2. Check profile

If you have provided custom profile or for that matter even if there is some default profile associated with your robot, you can check it. Type this url in your browser, http://{robotname}.appspot.com/_wave/robot/profile. You should get a json response object back that could look something as shown below.


{
  "profileUrl": "http://www.byteblocks.com",
  "imageUrl": "http://wave.byteblocks.com/byteblocksavatar.gif",
  "name": "StockBlocks",
  "javaClass": "com.google.wave.api.ParticipantProfile"
}

If you are handling requests for this URL in your robot and not returning 404 status code, then you should get a response even if its blank document. If you get 404 status code, that would mean that your robot is not configured and implemented correctly.

App Engine Dashboard As Debug Tool

Before I discuss any further, i think this will be good spot to talk about Google App Engine dashboard. This is the place where you will see all your deployed applications, their status etc. If you are seeing errors or problems in your robot, this dashboard is your best friend to get a quick answer to lot of common issues.

  • When you log into your Google app engine application dashboard, you will see Logs link in left pane. Click on it and it will bring a view like below. You can filter your log messages from the filter drop down as shown in the image.


    Another place in dashboard from where you can get details about various requests in your robot is from the summary view. In the CPU load section you can see all the requests that are being sent your robot. You can click on individual URL in that view to get details log about that URL. You can see a sample view of the summary and details log about profile URL in images below.


    A lot of time you will be able to diagnose your problems from this log itself. Following is an example of one of the issues I ran into. I implemented a custom profile for my robot for it to display my avatar and site URL in the profile. But it was not working for me. So I looked at the logs in app engine dash. You can see from the log message below that my robot is throwing 404 error code to the wave client.


    
    11-02 04:31AM 52.458 /_wave/robot/profile 404 82ms 6cpu_ms 0kb gzip(gfe)
    64.233.172.1 - - [02/Nov/2009:04:31:52 -0800] "GET /_wave/robot/profile HTTP/1.1" 404 124
         - "gzip(gfe)" "byteblocks-stocks.appspot.com"
    I 11-02 04:31AM 52.462
    path: <http://wave.byteblocks.com/Stocky.ashx?/_wave/robot/profile>
    I 11-02 04:31AM 52.537
    remote response: 404
    
    

    Just by looking at this message I was able to quickly diagnose the problem. I never implemented a handler for /_wave/robobt/profile. You can read about the details on this in my earlier post Specifying Google wave robot profile data

Implementation problems

This is where some robust error and event logging mechanism will help you greatly. There are couple of tricks I have come up with for my robot implementation. Some of these may or may not apply to your implementation depending on your deployment.

  • Always use structured exception handling around error prone implementation. For that matter since wave api is still in beta state, whole implementation is subject to throw error if underlying data format changes. In your exception handling routines, append detailed stack trace or error messages in the wave itself. But make sure that you this dump configurable so you can turn it on or off from wave itself. In my previous post Google Wave Robot Development Sample I showed how complete .Net stack trace is dumped as new blip in the wave when exceptions occur.
  • Use some instrumentation and logging framework like log4net etc. in your implementation. Log all the errors and warnings in log database(file, or database or event log etc.).
  • Some time unhandled exceptions will occur that may bypass all your safety net. Look in the event logs of your server to see what went wrong.

Get latest code

Yes that is true, the wave api is still in beta state. So always keep your api code updated with latest changes from google code site. I have run into this issue a few times. Just getting latest updates and recompile and redeployment may solve some of the issues that you may be seeing.

More tricks

These are some of the basic diagnostics and debugging steps you can perform to track issues in your robot. There is always some new trick that everybody has. I will keep adding more information to this post as I do some more experiments with this api.

Views: 2011

Tags:

Google Wave

How to specify profile information for google wave robot

by Viper 2. November 2009 11:49

In my earlier post, How to publish google wave robot capabilities, I talked about capabilities.xml file that each robot publishes to declare what event(s) it can handle. And one of the nodes in the XML file was profile. The original specification was that robots could provide their profile information in that node. It looks like that this specification was changed. Now this profile node is ignored in capabilities.xml. Wave client sends a separate request to /wave/robot/profile url to your robot. And it expects a JSON response for that request. That JSON response has the following format and structure.

{
  "profileUrl": "http://www.byteblocks.com",
  "imageUrl": "http://wave.byteblocks.com/byteblocksavatar.gif",
  "name": "StockBlocks",
  "javaClass": "com.google.wave.api.ParticipantProfile"
}

Specifying google wave robot profile information

In your .Net implementation of the robot, it is very easy to provide the profile information. You can add ParticipantProfile attribute to your ASHX handler class. And you are all set to go. You can see from the following code snippet how easy it is do so.


[WebService(Namespace = "http://byteblocks.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ParticipantProfile(Name = "StockBlocks", 
   ImageUrl = "https://wave.google.com/a/wavesandbox.com/static/images/profiles/rusty.png", 
   ProfileUrl = "http://www.byteblocks.com")]
public class Stocky : EventDrivenRobotBase
{.....}

The API will take care of sending the appropriate response to wave client.

Update version

If you want to update existing profile of your robot, then you will need to change version of it as well. The client caches the profiles of robots. Unless it sees that there is a newer version available, it will keep using older profile.

Views: 1625

Tags: ,

Google Wave | Google Wave

Developing Google Wave Robot To Monitor Latest Stock Price

by Viper 28. October 2009 05:20

Download Sample Robot Project

In my last post Goole Wave Robot Sample, I walked through basic building blocks of development of a Google Wave robot using .Net. I think its time now that we see how this cool framework can be put to some useful lifting for us. In this post I will discuss conversion of Google provided java sample Stocky. This robot parses stock ticker provided in your wave or blip and then it contacts another third party app engine application to get latest stock price corresponding to that ticker. Following image shows how the output of Stocky will look like. This is from .Net port of the sample. I called my sample byteblocks-stocks. So in case you want to give it a spin, add byteblocks-stocks@appspot.com to your contacts.

stocky google wave robot

Events handled by byteblocks-stocks

I discussed some important events and life cycle of wave in my post Life cycle and events in Google Wave Robots. This prototype robot handles two events only (for now). As you develop more and more Google wave robots, you will realize that 80% of the tasks can be accomplished by handling the events I discussed in my earlier posts. Following is the list of events handled by byteblocks-stocks.

  • self_added - As i explained in my earlier post that this event is fired when a robot gets added to a wave. Our stocks robot takes this opportunity to tell the participants how to use its features. For now it announces Get stock price by prefixing your stock symbol with $. You can use this event to do any initialization that needs to be done in the robot as well.
  • blip_submitted - This event is fired when participant has submitted a blip. In layman's terms when participant has clicked on Done button in a blip. The robot parses the contents of the blip document to extract all ticker symbols. Then it contacts a third party service to get latest stock price for that ticker and then modifies the content of the blip with stock price for that ticker.

Sample Project

This is mostly port of java sample to .Net. For now I have repalced java PersistenceManager with ASP.Net cache to save previous tickers mentioned in blips. Other than this changes, the code is very straight forward. You can download the project and play with it to figure out insides of Google wave robot development.

How it works

Here are steps you will follow to see how this robot works

  • Add byteblocks-stocks@appspot.com into your google wave contact list.
  • As soon as you add this robot as participant, it will add a blip with instructions on how to use it.
  • Create a new blip in your wave and type name of any stock ticker. For example to check price of Google stock, you will enter $goog. Depending on how fast event responds and wave synchronizes the information, you will see that blip's content has been replaced with something like goog (550.34).
  • If you want to track price of multiple tickers in same blip, simple enter multiple ticker symbols prefixed with "$". For example $goog$msft$boa

If you have any questions, feel free to drop me a line.

Views: 2563

Tags:

Google Wave

Google Wave Robot Development Sample

by Viper 28. October 2009 05:20

Download Sample Robot Project

In this post I will discuss development of a Google Wave robot using .Net API. This sample is a port of java sample Debuggy provided by google. I have leveraged that sample to build a simple robot that performs following things:

  • Provides debugging messages to understand life cycle of a wave
  • Dumps details about the whole wave

Some of the key concepts demonstrated in this sample are:

  • How to handle various events in a wave?
  • How to extract contents of a wave/blip?
  • How to add new blip to a wave?
  • How to modify content of an existing blip?
  • How to format content of blip?

Steps to develop a google wave robot

In my previous post, I talked about how to go about developing a wave robot using .Net. I will list those points quickly here.

  • Create a google app engine account. If you already have one then you do not need one. Create an application for your robot in app engine dashboard.
  • Modify proxy.py file to point to URL where you will be hosting your .Net ASHX handler to listen on wave events
  • Upload this python application to app engine
  • Create an ASP.Net Web Application project and add an ASHX handler that will provide implementation for all the robot events that you want to handle.

I will pick OnBlipSubmitted implementation from the sample project and discuss it line by line. And following image shows how this robot is interacting in wave client.

google wave robot

protected override void OnBlipSubmitted(IEvent e)
{
 base.OnBlipSubmitted(e);
 IBlip blip = e.Wavelet.AppendBlip();
 TextView textView = blip.Document;
 textView.Append(string.Format("WaBo - Blip submitted [{0}][{1}]", 
  e.Blip.BlipId, e.Blip.Document.Text));
 if (e.Blip.Document.Text.IndexOf("_dumpit_") != -1)
 {
  try
  {
   var cacheKey = string.Format("DumpTrack_{0}", e.Wavelet.WaveId);
   if (HttpContext.Current.Cache[cacheKey] == null)
   {
     e.Wavelet.AppendBlip().Document.Append("Dumping Wave - " + e.Blip.Document.Text);
     ViewUtil.DumpWave(e);
   }
  }
  catch (Exception ex)
  {
   ViewUtil.DumpException(e, ex);
  }
 }
}

All the steps in this method are very intuitive and self explanatory.

  • Each event handler is provided with parsed request data in IEvent parameter. Different properties and methods provide you with access each component of a wave.
  • Method calls base class implementation of the event handler, just in case there is some. Currently base class implementation is empty.
  • To add a new blip, you will call AppendBlip method on Wavelet. If you do not want to add a new blip and want to act on existing blip itself then you can access the blip via e.Blip property.
  • Each blip has an associated document which is view to content of that blip. To access that document of blip, you will access Document property of the blip.
  • To access content of the blip that triggered the event, you can look at Text property of Document object. For example in my sample, I want to check if the content contains the word _dumpit_. I access it via e.Blip.Document.Tex and then look for presence of that text string in there.
  • To add content to your blip, you can utilize following methods on Document object.
    • Append
    • AppendElement
    • AppendInlineBlip
    • AppendMarkup
    • AppendStyledText

    All these methods are very self explanatory. Simplest of all these methods is Append. If you want to insert some simple text you can use this method. For more formatted and styled text you can utilize other methods. Following example shows implementation from method where I am displaying wave creator's name in red color and other participant names are displayed in blue.

    
    foreach (var participant in e.Wavelet.Participants)
    {
     var color = (string.Compare(participant, creator, true) == 0) ? "red" : "blue";
     var txt = string.Format("<span style=\"color:{0};font-weight:bold;\">{1}</span>", 
      color, participant);
     textView.AppendMarkup(txt);
     textView.Append(ViewUtil.CreateNewLine());
    }
    
    

Following image shows how this debug helper robot helps in dumping exception details when somethings goes wrong in robot event handlers.

wave debug

I hope this sample will provide you enough information and details to get started with Google Wave robot development using .Net. I will post some more samples to demonstrate more advanced features of this framework.

Views: 6362

Tags:

Google Wave

Life cycle and events in Google Wave Robots

by Viper 28. October 2009 03:47

In my previous two posts I discussed some basics of getting started with development of Google Wave robots using .Net and then talked about publishing of capabilities.

Let's now see what all events get fired by google wave client and how do you handle them in your robot. First let's see what all events (or capabilities) are available. Here is some information from Google wave api site itself.

Robot Events

The following events which a robot may subscribe to are particularly important:

  • wavelet_blip_created fires when a new wave blip has been created.
  • wavelet_participants_changed fires whenever a participant (including another robot) is added or removed from the wave.
  • wavelet_title_changed fires whenever the wavelet title changes.
  • blip_contributors_changed fires whenever the editors of a blip change.
  • blip_deleted fires whenever a blip is deleted from the wavelet.
  • blip_submitted fires whenever a blip is submitted. Note that this event only fires once the user clicks Done or moves to another blip.
  • document_changed fires whenever content is added to a blip, at various intervals.

I will discuss these events in little bit more details and try to tell you when they get fired

self-added

This event is fired as soon as you add the robot as one of the participant in your wave. It is not manadatory that a robot has to be added when a wave is started. As I mentioned few times, a robot is like a real participant in wave that can be added or removed at any given time. So this event is fired when robot gets added to wave. To handle this event, you will need to override OnWaveletSelfAdded method in your ASHX handler.

wavelet_participants_changed

As soon as robot gets added to a wave, framework sends this event to robot with list of participants who are already part of the wave. Your robot will be included as one of the participants in that list.

wavelet_blip_create

This event is fired when a new blip is created in the wave. An example of creating a new blip could be when you reply to another message. Moment you hit reply link or button, this event is fired. This will be good place to any state initialization in your robot for all new blips that are created. For example if you want to cache ID of the blip for later tracking or things like that, you can do that in this event handler.

document_changed

This event is fired when there is any change in the document. This includes character by character change notification being sent to the robot or participants. You will notice that as you are typing in your wave, your robot is getting these notifications continuously. Since this event is fired very often, it is going to create a lot of network traffic for your robot as well as web server handling the requests. There are couple of things you may want to keep in mind when subscribing to this event:

  • If you are not going to take any action on the document or content while it is being acted on, do not subscribe to this event. This will affect performance of your client application as well web application.
  • Keep the actions as atomic as possible for this event. Especially if your robot is adding new blips or modiying content of the existing blip(s), then long operations in this event handler may give some unwanted UI behavior to your participants.

blip_submitted

This event is fired when a blip is submitted. What this means is that when you hit Done button for your blip, it is no longer in draft mode and it gets submitted. This is one of the most used events because at this point the content of the blip is final (till somebody edits it again). If you are taking action based on final content of the blip, this will be the place where you will do it.

blip_deleted

As name suggests, this is fired when a blip is deleted from wave. If you are keeping some state for a blip in your robot, this will be a good place to perform any clean up or any final actions that need to be taken on that blip.

Other events

There are lot more events that your subscribe to. But the ones that discussed are very basic building blocks of a simple robots. I will discuss other events in my later posts. In next post I will walk through development of a simple debugging robot.

Views: 903

Tags:

Google Wave

How to publish google wave robot capabilities

by Viper 27. October 2009 13:58

In last post Developing Google Wave Extension Using .Net, I gave a quick overview of how to get started with wave robot development. In this post I will try to discuss how communicaton between your robot and wave client works.

What events get notified to client?

Communication between wave client and robot is based on event subscription model. What this means is that a robot has to specify what all events it wants to listen on. There are a lot of events that you can subscribe to. For this post's discussion I will limit it to some basic and important events. So first question you have is how do a robot subscribes for the events? In wave framework this happens by pubslishing of capabilities by robot. When your robot gets added to a wave, the client looks for Capabilities.xml file at your app engine's location. My sample robot is named wavebog. So I see a post request coming to the server for url http://wavebog.appspot.com/_wave/capabilities.xml. Here is example of Capabilities.xml from google wave api.

<w:robot xmlns:w="http://wave.google.com/extensions/robots/1.0">
<w:version>0.1</w:version>
<w:capabilities>
 <w:capability name="BLIP_SUBMITTED"/>
 <w:capability name="DOCUMENT_CHANGED"/>
</w:capabilities>
<w:profile name="Cartoony" 
  imageurl="http://cartoonybot.appspot.com/public/avatar.png" 
  profileurl="http://cartoonybot.appspot.com"/>
</w:robot>

There are two important parts of this file. Under the capbilities node, you specify what all capabilities (or events) the robots can handle. In this example, robot has published that it can handle two events, BLIP_SUBMITTED and DOCUMENT_CHANGED. I will talk about various events little later in the post. Second important piece of the data is Version. If you add more capabilities to your robot and do not change the version number, then your robot may not get notifications for newly added capabilities. So it is important that you handle the robot versioning very carefully. There is some other information in the capabilities file which I will discuss later.

Generating Capbilities.xml file for .Net robot

When you are using .Net API for creating your google wave robot, you do not have to explicitly create this file. The core framework takes care of this for you. I am going to jump ahead a little and give quick over view of how this file gets generated.

When wave client sends request for Capbilities.xml to your robot myrobot@appspot.com, the proxy (as I mentioned in first post), forwards the requests to your ASP.Net handler. The handler parses the request to check if the request is for ?/_wave/capabilities.xml path. If it is then it generates the XML file at run time and sends the response back to client. You will find following implementation in RobotHttpHandlerBase class.

internal XDocument CreateCapabilitiesDocument()
{
 ParticipantProfile profile = Profile;
 return new XDocument(new XDeclaration ("1.0", "UTF-8", null),
    new XElement(RobotNamespace + "robot",
    new XAttribute(XNamespace.Xmlns + "w", RobotNamespace),
    new XElement(RobotNamespace + "capabilities",
     MonitoredEvents.Select(type => type.ToXElement())),
     profile == null ? null : profile.ToXElement(),
     new XElement(RobotNamespace + "version", Version)
 ));
}

At run time it determines what all events your ASHX handler has implemented and then adds those to the xml response accordingly. It also generates unique version number ID based on the names of the events you are handling. So if in future you add implementation for more events, then version number will get changed automatically.

Handling events in your robot

As described in Hello World example, your create an ASHX ASP.Net handler in your web application. And then you change its base class to EventDrivenRobotBase. If you look inside this class you will find that there are lot of virtual methods corresponding to each event that you can possibly handle in your handler. So depending on functionality of your robot, you will override those methods in your handler. For example, based on the capabilities.xml file generated above, I added following methods in my robot.

public class WoBoCop : EventDrivenRobotBase {
protected override void OnWaveletSelfAdded(IEvent e)
{
 IBlip blip = e.Wavelet.AppendBlip();
 ITextView textView = blip.Document;
 textView.Append(string.Format("WaBo - Added to wave {0}", e.Wavelet.Title));
}

protected override void OnDocumentChanged(IEvent e)
{
 base.OnDocumentChanged(e);
 IBlip blip = e.Wavelet.AppendBlip();
 ITextView textView = blip.Document;
 textView.Append(string.Format("WaBo - Blip document changed [{0}]", 
   e.Blip.Document.Text));
}
}

There is some dummy implementation in these methods and mention of some wave concepts like blip, document, wavelet, etc. I will talk about them in next post. For this discussion I just want to concentrate on how you will publish capabilities of your robot.

Test It

To make sure that your robot is working correctly and is publishing correct capabilities, type following URL in your browser.

http://{myrobot}.appspot.com/_wave_capabilities.xml

If everything is working correctly then you should see valid XML document rendered in browser. If you are using Google Chrome then only thing you may see is version number. Do not panic. This does not mean that your robot is not working. There is only one text node in the file with version number. Chrome is rendering only that part. But if you look at the source of the page, you will find your correct XML document. Yeah, this kind of threw me into a loop for few minutes.

In next post I will discuss, what all events you can subscribe to and what is life cycle of a wave events.

Views: 2384

Tags:

Google Wave

How to develop Google Wave Extensions and Gadgets Using .Net

by Viper 27. October 2009 08:47

Google Wave has been out of sandbox for some time now. Google started its open beta pre-view with about 100,000 accounts. There has been lot of buzz in development community about Google Wave framework and writing extensions and widget to build some really useful and cool applications. And recently a lot of interesting extensions have been published.

One of the restrictions on development of extensions at this time is that these can only be hosted in Google App Engine environment. Google only supports two languages (and its derivatives) on Google App Engine, Java and Python. Google has mentioned that in future they will support more languages on their cloud computing environment, but there is no definite time line for that. That leaves .Net development community in a fix as far as Google Wave extension development goes. But as we all know, where there is a will there is a way.

If you look at communication mechanism of Google Wave, there is a way to do extension development in .Net framework and host your robot on ASP.Net web server. Google wave client communicates to robots by sending request to a URL with all the data and then wait for response and act on it. Currently this URL has to correspond to an application hosted on Google App Engine environment. If we can find a mechanism to redirect these calls from Google App Engine application to a URL hosted as ASP.Net application and send the response back to Google Wave client, our job is done. As you may have guessed it that we are talking about writing a light weight proxy to do this job. Soon you will find out that Google has already provided that proxy.

Wave Extension API

Google has provided with Java and Python API to develop wave extensions. There is a .Net port available on Google code at following location.

Google Wave Extension API For .Net

Getting started

There is nice description available at following link about how to get started with your first Hello World application. I will not go into details about that. But I will point out some of the issues that you will run into when you are writing your first wave extension. These are some of the issues I ran into personally. If you have questions, feel free to send me message and I will try to answer them.

Google App Engine Account

This is your first and foremost step in development. You need to create a Google App Engine account. It is free. You can get started by clicking on this link.

Google App Engine

After you are done creating your account, create an application in app engine dashboard. Make sure that you pick some name that is relevant to your extension. This is the name by which your extension will be known to world. Do not worry about uploading any code or anything at this point.

App Engine SDK

On the page from where you started with app engine account, there is a link on right side to down load Google App Engine SDK. Download python SDK and install it. When you install Python based app engine SDK, it will require that you have Python framework installed on your machine. Install will provide with links and everything if you do not have it installed it already.

Uploading Proxy Application

Follow the instructions from WIKI page about modifying the files to point to your ASP.Net server. Launch Google App Engine launcher application. Choose File > Add Existing Application menu option and not File > Create New Application option. If you choose the latter option, the application will add main.py file in your application folder. That file contains a plain hello world application. And the launcher application also overrides app.yaml file and make it to point to main.py instead of proxy.py file. When you will upload the application, you will notice that when you access your robot it always displays Hello World message. So remember to delete main.py file from your folder if it is there and make sure that app.yaml is pointing to correct file for its entry point.

Creating ASP.Net handler for robot

Follow the instructions from WIKI page to create your Hello World message robot. And test it out.

Adding your robot in Wave

To test your robot use the following steps

  1. From “Manage Contacts” section, add your robot extension account to the list. Your robot account is identified like myappengineappname@appspot.com. It is that simple. That’s why I mentioned earlier that make sure that you pick appropriate name for your application. It is also important that this account exists in your contact list before you add it to your waves. Yes a robot is like a real participant in a wave.
  2. From Google Wave client, click on “New Wave” button to start a new wave.
  3. Add your robot as one of the participants in the wave.
  4. You are done. Now your robot is getting event notifications from wave client like a real participant.

It could not be simpler than this. Did I mention that only hard part in this whole process is to get Google Wave account.

This was just to get you started. In next post I will discuss some details about life of a wave and event notifications.

Views: 3145

Tags:

Google Wave

Powered by BlogEngine.NET 1.5.1.7
Theme by Naveen Kohli