how to access sibling of root blip

0 views
Skip to first unread message

Vivek

unread,
Nov 12, 2009, 2:53:24 PM11/12/09
to Google Wave API
Hai ,

In the robot i'm making, i want to access all the blips that are in
the wavelet even before my robot is added to the wavelet. I cannot
find a suitable method in the API .
I know we can access the root blip directly, but then I could not
figure out how to access its siblings.

Please some one suggest me how can i access the already existing blips
in a wavelet.


-Vivek.

Antonio Garcia

unread,
Nov 12, 2009, 3:36:32 PM11/12/09
to google-...@googlegroups.com
I think you can use de Blip.getChild(arg) or Blip.getChildren() to access to any blip if you start in the root blip... but I didn't do that never.
Blips in the wave have the structure of a Tree (a graph)

2009/11/12 Vivek <vivekm...@gmail.com>

--

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



Vivek

unread,
Nov 12, 2009, 3:55:48 PM11/12/09
to Google Wave API


I tried it. Its giving "java.lang.NullPointerException " when im
trying to access the children of root blip.

栾瑞鹏

unread,
Nov 12, 2009, 8:29:01 PM11/12/09
to google-...@googlegroups.com
I tried, too. rootBlip.getChildren() not working.  get the same exception with you. 
Still looking for some other way by java.
It seems that python is easy to do that. 

On Fri, Nov 13, 2009 at 4:55 AM, Vivek <vivekm...@gmail.com> wrote:


I tried it. Its giving "java.lang.NullPointerException " when im
trying to access the children of root blip.
--

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





--
Best Regards,
Luan Rui Peng

Evgeniy Beschastnov

unread,
Nov 13, 2009, 8:18:16 AM11/13/09
to Google Wave API
I recommend you to take a look into logs of your robot. There you can
see all messages, which robot receives, so you can understand which
blips are really accessible. Anyway, there is no way to get content of
any blip when robot receives a single message, because only deltas
(updates) are sent to robot when some message occurs. And you can
append any information to any blip, if you know its id.

On Nov 13, 4:29 am, 栾瑞鹏 <luanruip...@gmail.com> wrote:
> I tried, too. rootBlip.getChildren() not working.  get the same exception
> with you.
> Still looking for some other way by java.
> It seems that python is easy to do that.
>
>
>
> On Fri, Nov 13, 2009 at 4:55 AM, Vivek <vivekmunag...@gmail.com> wrote:
>
> > I tried it. Its giving "java.lang.NullPointerException " when im
> > trying to access the children of root blip.
>
> > --
>
> > 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<google-wave-api%2Bunsu...@googlegroups.com>
> > .

Vivek

unread,
Nov 14, 2009, 6:16:15 AM11/14/09
to Google Wave API
i could not find the method to access a blip by its id.
Can you tell me how to do it in java?

Stephen George

unread,
Nov 22, 2009, 10:14:58 PM11/22/09
to Google Wave API
Hi Vivek, give this a try:
RobotMessageBundle.getBlip(String waveId, String waveletId, String
blipId)
<http://wave-robot-java-client.googlecode.com/svn/trunk/doc/com/google/
wave/api/RobotMessageBundle.html#getBlip(java.lang.String,
%20java.lang.String,%20java.lang.String)>

Stephen George

unread,
Nov 22, 2009, 10:37:21 PM11/22/09
to Google Wave API
By the way, I too am having difficulty trying to traverse every blip
of a wave in Java.

My current approach of recursively searching through every blip with
blip.getDocument().getInlineBlips() and blip.getChildren() is not
completely successful. I seem to get only the first 2 out of 7
sequential Blips. Blip 3 is there, but it's content is not in the
object.


Here's the structure of my test Wave (all blips are sequential - no
inline blips):

message 1
--------
message 2
--------
message 2
--------
message 2
--------
message 5


Here's the one capability that I'm listening for:
<w:capability name="WAVELET_SELF_ADDED"
context="PARENT,SIBLINGS,CHILDREN" />


And here's the logging output from my Servlet:

getBlipId(): b+xIimGfd3C
getParentBlipId(): null
hasChildren(): Y
getLastModifiedTime(): Mon Nov 23 01:57:03 UTC 2009
getDocument().getText(): message 1
******
getBlipId(): b+xIimGfd3D
getParentBlipId(): b+xIimGfd3C
hasChildren(): Y
getLastModifiedTime(): Mon Nov 23 01:57:13 UTC 2009
getDocument().getText(): message 2
******
getBlipId(): b+xIimGfd3E
getParentBlipId(): b+xIimGfd3D
hasChildren(): N
getLastModifiedTime(): Wed Dec 31 23:59:59 UTC 1969
getDocument().getText():

It's possible I may be doing something wrong. I'd be happy to post my
code for review, if you guys have the patience to read it. :) If
someone could tell me if they are having similar issues trying to
traverse an entire Wave, that would be helpful too.

Thanks,

Stephen

Stephen George

unread,
Nov 23, 2009, 7:08:35 PM11/23/09
to Google Wave API
...I believe I found the answer to my question from Olreich's helpful
post here:
"How to delete all the blips in a wave except the root blip??" <http://
groups.google.com/group/google-wave-api/browse_thread/thread/
8b63dc678eafa93d/cb9991744f26ab59?#cb9991744f26ab59>.

When your robot receives an event about an updated Blip, you can
expect to receive context of only a limited number of parents,
children, and siblings. This is to reduce the sheer size of the json
payload that the Wave server sends to your robot. Certainly,
transmitting the entire structure and content therein of a full Wave
with every subscribed event would be daunting for a large-sized Wave.

Makes sense, though it would be helpful to have at least a means of
receiving the full Wave structure, in the (hopefully seldom) instances
where your newly-added robot wants to read-up on all of the content
that it has been created before it began to participate in the Wave.

S

cmdskp

unread,
Nov 23, 2009, 11:04:39 PM11/23/09
to Google Wave API
Good day, Stephen!

Have a look at the reply I just left on that thread "How to delete all
the blips in a wave except the root blip??"

I'd given a shorter version of how the event design for robots is
specified before on the issue tracker to help Olreich a few days ago.

In essence you can (currently as of last night anyway) retrieve (I
believe) all the blips (it worked for my robots) for
WAVELET_SELF_ADDED - but make sure you have the extra attribute
context="children" as well as content="true" in your capabilities.xml
for that event.
However, this is a moving target - it used to be you couldn't get all
the children, but a bug was fixed recently and it seems now you can -
though I've not checked getting inline blips.

Stephen George

unread,
Nov 24, 2009, 2:26:10 AM11/24/09
to Google Wave API
Thanks cmdskip for the suggestion,

I've adapted my capabilities.xml as you suggested. Unfortunately that
doesn't seem to have changed the number of blips I can read through
(for my robot at least).

S

Vikram Dhillon

unread,
Nov 24, 2009, 3:57:46 PM11/24/09
to google-...@googlegroups.com
Thanks everyone for your help

--
Regards,
Vikram Dhillon

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

signature.asc
Message has been deleted

cmdskp

unread,
Nov 24, 2009, 8:34:50 PM11/24/09
to Google Wave API
Did you increase the capabilities.xml version number and change the
default application in the App Engine website? The changes wont take
effect without that and maybe that's the cause?
>  signature.asc
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages