Values stored in database:
wave_id = "googlewave.com!w+qilt5TMWR)"
wavelet_id = "googlewave.com!conv+root"
blip_id = "b+qilt5TMWS"

code:

    context.AddWave({'waveId': wave_id, 'waveletIds': [wavelet_id],})
    collector_wave = context.GetWaveById(wave_id)
    collector_wavelet = collector_wave.CreateWavelet
(participants=context.GetRootWavelet().GetParticipants())
    if not collector_wavelet:
        return
    blip = context.builder.BlipCreateChild(wave_id, wavelet_id,
blip_id)
    context.AddBlip(blip)
    blip = context.GetBlipById(blip['blipId'])
    blip.GetDocument().SetText("New wave created:
"+context.GetRootWavelet().title+"\n")

resulting json:

{"operations": {"javaClass": "java.util.ArrayList", "list":
[{"blipId": "", "index": -1, "waveletId": "", "javaClass":
"com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
+qilt5TMWR", "property": {"waveletId": "conv+root", "javaClass":
"com.google.wave.api.impl.WaveletData", "participants": {"javaClass":
"java.util.ArrayList", "list": ["kypri...@googlewave.com",
"my...@appspot.com"]}, "rootBlipId": "TBD_conv+root_1", "waveId":
"TBD_1"}, "type": "WAVELET_CREATE"}, {"blipId": "b+qilt5TMWS",
"index": -1, "waveletId": "googlewave.com!conv+root", "javaClass":
"com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
+qilt5TMWR", "property": {"blipId": "TBD_googlewave.com!conv+root_2",
"javaClass": "com.google.wave.api.impl.BlipData", "waveId":
"googlewave.com!w+qilt5TMWR", "waveletId": "googlewave.com!conv
+root"}, "type": "BLIP_CREATE_CHILD"}, {"blipId": "TBD_googlewave.com!
conv+root_2", "index": -1, "waveletId": "googlewave.com!conv+root",
"javaClass": "com.google.wave.api.impl.OperationImpl", "waveId":
"googlewave.com!w+qilt5TMWR", "type": "DOCUMENT_DELETE"}, {"blipId":
"TBD_googlewave.com!conv+root_2", "index": 0, "waveletId":
"googlewave.com!conv+root", "javaClass":
"com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
+qilt5TMWR", "property": "New wave created: test wave\n", "type":
"DOCUMENT_INSERT"}]}, "javaClass":
"com.google.wave.api.impl.OperationMessageBundle", "version": "1"}

And no any new data added to the wave.
What's wrong with the code?

On 3 фев, 19:47, kyprizel <kypri...@gmail.com> wrote:
> Thank you for your answer.
> Should I store all the existing wave/wavelet data, then construct it
> and add blip there? Or there is an easy way?
> What happen if Wavelet info changes while I'll add it from my storage
> to context?
>
> On 3 фев, 11:06, Stephen Gigante <yeoldest...@gmail.com> wrote:
>
> > if you have the raw_data, use
> >   context.AddWave(raw_data)
> >   context.GetWaveById(waveid)
>
> > You'll need to manually add any waves, wavelets, and blips that you need
> > outside the original context before adding them.
>
> > This is (for reasons I don't quite understand), also necessary whenever you
> > use context.builder, which will give it's results as raw data.)
>
> > Hence my code looks like this:
> >   d = context.builder.BlipCreateChild(blip.GetWaveId(), blip.GetWaveletId(),
> > blip.GetId())
> >   context.AddBlip(d)
> >   d = context.GetBlipById(d['blipId'])
>
> >  - Stephen
>
> > On Wed, Feb 3, 2010 at 10:27 AM, kyprizel <kypri...@gmail.com> wrote:
> > > Trying to store waves id and then add data to the wave after getting
> > > notices from another wave:
>
> > > old_wave = context.GetWaveById(wave_id=waveid)
> > > old_wave always returns None, I think b/c context is based on another
> > > wave.
> > > how can i access another wave from the current context? or should i
> > > use cron?
>
> > > Thank you.
>
> > > --
> > > 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-...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-wave-api+unsubscr...@googlegroups.com<google-wave-api%2bunsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-wave-api?hl=en.

-- 
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-...@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