wavelet.appendBlip("ID") doesn't set DataDocument

1 view
Skip to first unread message

atarno

unread,
Dec 16, 2009, 4:45:35 PM12/16/09
to Google Wave API
hey all,

i've noticed that when i run the following:

wavelet.appendBlip("ID") ;
String id = wavelet.getDataDocument("ID");

id is null.

but when i do this:

Blip initBlip = wavelet.appendBlip();
wavelet.setDataDocument("ID", initBlip.getBlipId());
String id = wavelet.getDataDocument("ID");

id gets the expected value of newly created blip id.

should not the two pieces of code above return the same value of id?

thanks.

pamela (Google employee)

unread,
Dec 30, 2009, 6:13:55 PM12/30/09
to Google Wave API
Hi Atarno -

In the first bit of code, you never set the data document, so I would
expect it to be null. Why were you expecting it to give a value?
(Maybe I'm missing something).

- pamela

atarno

unread,
Dec 31, 2009, 2:16:13 AM12/31/09
to Google Wave API
hi pamela,
thanks for you reply.
actually, i was expecting the behavior i described above after reading
the following in the api (http://wave-robot-java-client.googlecode.com/
svn/trunk/doc/com/google/wave/api/Wavelet.html):

Blip appendBlip(java.lang.String writeBackDataDocument)
Creates a new blip and appends it to the end of the wavelet. The
resulting blip id of the new blip will be stored in a data document on
the wavelet whose event was being processed at the time the blip was
created.
Parameters:
writeBackDataDocument - The name of the data document to
create.
Returns:
the newly created blip.

there is a chance i'm the one missing something here :)
thanks again, and happy new year.

On Dec 31, 1:13 am, "pamela (Google employee)" <pamela....@gmail.com>
wrote:

pamela (Google Employee)

unread,
Jan 3, 2010, 9:30:45 PM1/3/10
to google-...@googlegroups.com
Ah. I believe it means that the new ID will be stored there *after*
the operation has been processed.

The API doesn't know the actual ID of the blip until after the
operations are sent to the server, and just gives you a temporary ID.
The server then puts a datadocument of the new ID in the wavelet, so
that you can retrieve it after a DOCUMENT_CHANGED event.

I have used a similar technique to find out the ID of a new wave (see:
http://wave-samples-gallery.appspot.com/about_app?app_id=60017), I
haven't used it to find out the ID of a new blip. I imagine it is the
same technique.

- pamela

> --
>
> You received this message because you are subscribed to the Google Groups "Google Wave API" group.
> To post to this group, send email to google-...@googlegroups.com.
> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
>
>
>

Reply all
Reply to author
Forward
0 new messages