Google wave robot inline reply
Asked Answered
B

3

5

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")
Bielefeld answered 13/10, 2009 at 17:14 Comment(6)
hehe, retagged from newbie to beginner, what's the scientific difference? ;)Bielefeld
"Newbie" can have negative connotations, I suppose.Insensibility
number that follows beginner tag is 3051, newbie 60. that's allSociability
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 tagBielefeld
What exactly do you mean by inline reply? Append an answer to the content of the blip or create a child blip?Xe
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/…Bielefeld
H
4

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.

Heretofore answered 18/10, 2009 at 1:16 Comment(0)
H
2

It could be a possible bug.

Hyperaemia answered 17/10, 2009 at 15:43 Comment(1)
Aha! I hope they release a fix soon :/Bielefeld
C
1

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

Cap answered 30/10, 2009 at 10:32 Comment(1)
Aha excellent, thankyou for pointing this out to me, it is indeed fixed nowBielefeld

© 2022 - 2024 — McMap. All rights reserved.