Google wave robot inline reply

I've been working on my first robot for google wave recently, a vital part of what it does is to insert inline replies into a blip. I can't for the life of me figure out how to do this!

The API docs have a function InsertInlineBlip which sounded promising, however calling that doesn't appear to do anything!

EDIT:: It seems that this is a known bug. However, the question still stands what is the correct way to insert an inline blip? I'm assuming something like this:

inline = blip.GetDocument().InsertInlineBlip(positionInText)
inline.GetDocument().SetText("some text")
13.10.2009 17:14:10
hehe, retagged from newbie to beginner, what's the scientific difference? ;)
Martin 13.10.2009 17:20:47
"Newbie" can have negative connotations, I suppose.
ceejayoz 13.10.2009 17:29:29
The wave tag got removed. Eventually google wave won't just be a google product (like email is not the product of any specific company), hence I added the wave tag
Martin 15.10.2009 08:38:17
What exactly do you mean by inline reply? Append an answer to the content of the blip or create a child blip?
Martin Klinke 17.10.2009 12:45:00
An inline reply is one which is created in the middle of another blip. If you have access to wave, create a blip, then put your cursor somewhere in the middle and press ctrl-enter, to create an inline reply. You'll get something like this: martindevans.appspot.com/file/…
Martin 17.10.2009 15:07:31
3 ОТВЕТА
РЕШЕНИЕ

If you look at the sourcecode for OpBasedDocument.InsertInlineBlip() you will see the following:

 412 -  def InsertInlineBlip(self, position): 
 413      """Inserts an inline blip into this blip at a specific position. 
 414   
 415      Args: 
 416        position: Position to insert the blip at. 
 417   
 418      Returns: 
 419        The JSON data of the blip that was created. 
 420      """ 
 421      blip_data = self.__context.builder.DocumentInlineBlipInsert( 
 422          self._blip.waveId, 
 423          self._blip.waveletId, 
 424          self._blip.blipId, 
 425          position) 
 426      # TODO(davidbyttow): Add local blip element. 
 427      return self.__context.AddBlip(blip_data) 

I think the TODO comment suggests this feature is not yet active. The method should be callable and return correctly, however I suspect that the document operation is not applied to the global document.

The syntax you included in your post looks correct. As you can see above, InsertInlineBlip() returns the value of AddBlip(), which is ...dun, dun, dun... a blip.

 543 -  def AddBlip(self, blip_data): 
 544      """Adds a transient blip based on the data supplied. 
 545   
 546      Args: 
 547        blip_data: JSON data describing this blip. 
 548   
 549      Returns: 
 550        An OpBasedBlip that may have operations applied to it. 
 551      """ 
 552      blip = OpBasedBlip(blip_data, self) 
 553      self.blips[blip.GetId()] = blip 
 554      return blip 

EDIT: It is interesting to note that the method signature of the Insert method InsertInlineBlip(self, position) is significantly different from the Insert method InsertElement(self, position, element). InsertInlineBlip() doesn't take an element parameter to insert. It seems the current logic for InsertInlineBlip() is more like Blip.CreateChild(), which returns a new child blip with which to work. From this we can suspect that this API will change as the functionality is added.

4
18.10.2009 01:24:11

It could be a possible bug.

2
17.10.2009 15:43:24
Aha! I hope they release a fix soon :/
Martin 17.10.2009 17:20:41

This appears to have previously been a bug, however, an update today has hopefully fixed it: http://code.google.com/p/google-wave-resources/wiki/WaveAPIsChangeLog

1
30.10.2009 10:32:15
Aha excellent, thankyou for pointing this out to me, it is indeed fixed now
Martin 30.10.2009 17:43:41