Hi Kartik - It seems like it should work. Here are steps I recommend for debugging: 1) When you set the annotation, check the outgoing JSON message to make sure it contains the instruction to set the annotation. (Use jsonlint.com if you want to format that nicely). 2) Then, check the "Editor debug" on the blip in wavesandbox.com, click "annotations" and look to see if the annotation is in the blip. 3) If it is, then check the incoming messages on the next event and make sure the annotation is in that message. 4) If all that is working, then it sounds like a client library issue.
- pamela On Dec 22, 5:42 pm, Kartik Bansal <[email protected]> wrote: > Hey Guys, > > I have a problem with annotations. See the below wirtten in Java for a wave > robot. In self added event, it adds a annotation "gadgetBlip". But in Blip > Submitted event, none of the blip has that annotation. The > hasAnnotation("gadgetBlip") returns false for each blip. > > *public void processEvents(RobotMessageBundle bundle) {* > Wavelet wavelet = bundle.getWavelet(); > Blip root = wavelet.getRootBlip(); > String waveId = wavelet.getWaveId().substring(18, > wavelet.getWaveId().length()); > for (Event e: bundle.getEvents()) { > > if(e.getType() == EventType.WAVELET_SELF_ADDED){ > Blip newBlip = wavelet.appendBlip(); > try{ > newBlip.getDocument().setAnnotation("gadgetBlip", "Yes");} > > catch(Exception ex) { > Logger.getAnonymousLogger().severe("Could not set the annotation : " > +ex.getMessage());} > } > > else if (e.getType() == EventType.BLIP_SUBMITTED) { > int i = 0; > int len = root.getChildren().size(); > StringBuilder s = new StringBuilder(""); > if(root != null){ > if(root.getDocument().hasAnnotation("gadgetBlip")){ > s.append("x Root " + > root.getDocument().getAnnotations("gadgetBlip").size());} > > else{ > s.append("y Root " + root.getDocument().getAnnotations("link/auto").size());} > } > > for(i=0;i<len;i++){ > if(root.getChild(i) != null){ > if(root.getChild(i).getDocument().hasAnnotation("gadgetBlip")){ > s.append(" x Child" + i + " " + > root.getChild(i).getDocument().getAnnotations("gadgetBlip").size());} > > else{ > s.append(" y Child" + i + " " + > root.getChild(i).getDocument().getAnnotations("link/auto").size());} > } > } > > Logger.getAnonymousLogger().severe(s.toString());} > } > > *}* -- You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
