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.


Reply via email to