Indeed it helped!

Do you know of a way I can pass these IDs from the robot's code to the
embed JS API (event listeners perhaps) - I need a way to save the ID
of the newly created wave in my application...

Thanks

On Oct 26, 10:42 pm, Peter Svedberg <peter.o.s.svedb...@gmail.com>
wrote:
> Hi all,
>
> Yes you will get the ids with a self added event, but you don't get a
> self added event when you create a wavelet(wave) with a robot.
>
> Here's how to create a wave with a robot in java (assuming you have a
> handle on the current wavelet):
> Wavelet newWave = wavelet.createWavelet(wavelet.getParticipants(),
> "");
>
> After you submit the operations you will get an unsolicitied
> DOCUMENT_CHANGED event. I say unsolicited as you don't have to specify
> it in the capabilities.xml file.
>
> Look for the event in the servlet:
>     for (Event e : bundle.getEvents()) {
>       switch (e.getType()) {
>        ...
>        case DOCUMENT_CHANGED:
>         processNewIds();
>         break;
>       ...
>       }
>     }
>
>   public void processNewIds() {
>     if (wavelet.hasDataDocument("_new_ids_")) {
>       String newIds = wavelet.getDataDocument("_new_ids_");
>       // do whatever with the new ids
>     }
>   }
>
> newIds looks like this:
> :wavesandbox.com!w+Sxz7uLZkCxk wavesandbox.com!conv+root b+Sxz7uLZkCxl
> \n
> strip the colon and split on " " and you have waveId, waveletId and
> rootBlipId
>
> If we had specified a name for the writeback instead of the empty
> string it would have shown up before the colon.
>
> If you set the default logging level to INFO you'll see the event and
> the new ids data document in app engine's Logs view.
>
> Hope this helps
> -Peter
>
> On Oct 26, 7:58 pm, dLux <d...@dlux.hu> wrote:
>
> > Just an idea to try, I'm not sure it works: add your robot to the
> > wavelet, and then you'll get back a SELF_ADDED event. Then you'll have
> > the ID. You can relay information with data documents of the main
> > blip. Let me know if it works. (I'll probably need it soon also :) ).
>
> > On Oct 25, 4:29 pm, David Nesting <da...@fastolfe.net> wrote:
>
> > > On Sun, Oct 25, 2009 at 6:25 AM,yariv.snapir 
> > > <yariv.sna...@gmail.com>wrote:
>
> > > > produced the type of ID I need... (I got 'TBD0.8622343911850655' where
> > > > the ID needed looks more like: 'w+iFA2MNGuP'... I wonder what is the\
>
> > > The methods you use to respond to an event notification do not have
> > > immediate results.  The operations are all batched up and sent back to the
> > > server when you're done handling the event.  So, until that happens, all 
> > > of
> > > the IDs generated as you create new blips/wavelets are "TBD".  I don't
> > > believe there's a way for you to get these IDs after the fact, unless you
> > > left yourself some signal or annotation, and used some Yet To Be Developed
> > > API to iterate over the wave again (after the conclusion of handling your
> > > event) to find your signal and identify the content you added.
>
> > > David
--~--~---------~--~----~------------~-------~--~----~
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-wave-api@googlegroups.com
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to