Re: [Google Wave APIs] Re: multiple gadgets sharing state
It does work, and many robots do so, but there are some bugs filed about cases where it does not work. For example: http://code.google.com/p/google-wave-resources/issues/list?can=2q=setfieldcolspec=Stars+ID+Type+Status+Priority+Milestone+Owner+Summary+Internalcells=tiles http://code.google.com/p/google-wave-resources/issues/list?can=2q=setfieldcolspec=Stars+ID+Type+Status+Priority+Milestone+Owner+Summary+Internalcells=tiles On Mon, Nov 16, 2009 at 8:02 AM, Jacco jacc...@gmail.com wrote: I think currently communicating from robot to gadget is not possible? The gadget.setField does not change the state of the gadget in my tests. Regards, Jacco On 12 nov, 16:48, just marvin marvin.greenb...@gmail.com wrote: It occurs to me that since you'll need a bot and a gadget, you could just have the bot add the gadget(s) to the wave. Then you just need to add one thing to the wave and you'll know you have the correct environment for the gadgets. -- 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.comgoogle-wave-api%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=. -- 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=.
[Google Wave APIs] Re: multiple gadgets sharing state
I think currently communicating from robot to gadget is not possible? The gadget.setField does not change the state of the gadget in my tests. Regards, Jacco On 12 nov, 16:48, just marvin marvin.greenb...@gmail.com wrote: It occurs to me that since you'll need a bot and a gadget, you could just have the bot add the gadget(s) to the wave. Then you just need to add one thing to the wave and you'll know you have the correct environment for the gadgets. -- 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=.
[Google Wave APIs] Re: multiple gadgets sharing state
It occurs to me that since you'll need a bot and a gadget, you could just have the bot add the gadget(s) to the wave. Then you just need to add one thing to the wave and you'll know you have the correct environment for the gadgets. -- 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=.
[Google Wave APIs] Re: multiple gadgets sharing state
Thanks for comments, all. Now suppose I want the gadget to receive a state change notification every time the state has changed. (I don't want to have to continually poll an external site to see if something has changed; I want a callback notification.) Is it true that: 1) There is no good way to get a state-change callback if I use the method where I manually store state in an external site? 2) If I use the robot to manage the state, I _will_ get a callback when a robot changes the state of any gadget? Thanks, Rob On Nov 10, 9:27 pm, Vikram Dhillon dhillon...@gmail.com wrote: Hi, This could be possible, use a static variable to keep the track of the state and then since there's only one copy of that variable, it can accessed at any point in the program/robot :) -- Regards, Vikram On Tue, Nov 10, 2009 at 1:37 PM, Austin Chau (Google employee) api.aus...@google.com wrote: No gadget states are specific to each gadget and not shared among other gadgets within the same wave. There are several ways to maintain state among different gadgets of the same wave, you can maintained your own persistent storage on remote server and use some crossdomain mechanism (jsonp, script injection, etc) to share data. You can also use wave robot to maintain data for you and store them on the wave data document. Austin On Tue, Nov 10, 2009 at 10:00 AM, rgibson rgib...@astro.washington.edu wrote: I would like to share state between multiple gadgets. When I read the wave gadgets tutorial, it sounded as if the state was stored at the Wave level. (E.g., call wave.getState() to get the state, gadgets share state, etc.) So there would be one count per Wave, not one count per gadget. Of course, this introduces its own problems (e.g., every gadget developer has to know about the namespace of every other gadget.) And a quick check shows that if you run two examples of the count example gadget, they each have their own count variable that updates independently. So is there a way for two gadgets in a Wave to share their state? Or, what's the best way to do this? I am new at this and trying to poke my way through the documents, but I've gotten to the point where it's better to ask. Thanks, Rob --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Google Wave APIs] Re: multiple gadgets sharing state
1) You are correct. The callback mechanism provided by gadget library is only connected to the wave server. 2) Yes. When robot changed gadget states your gadget will receive the callback. Austin On Wed, Nov 11, 2009 at 12:48 PM, rgibson rgib...@astro.washington.eduwrote: Thanks for comments, all. Now suppose I want the gadget to receive a state change notification every time the state has changed. (I don't want to have to continually poll an external site to see if something has changed; I want a callback notification.) Is it true that: 1) There is no good way to get a state-change callback if I use the method where I manually store state in an external site? 2) If I use the robot to manage the state, I _will_ get a callback when a robot changes the state of any gadget? Thanks, Rob On Nov 10, 9:27 pm, Vikram Dhillon dhillon...@gmail.com wrote: Hi, This could be possible, use a static variable to keep the track of the state and then since there's only one copy of that variable, it can accessed at any point in the program/robot :) -- Regards, Vikram On Tue, Nov 10, 2009 at 1:37 PM, Austin Chau (Google employee) api.aus...@google.com wrote: No gadget states are specific to each gadget and not shared among other gadgets within the same wave. There are several ways to maintain state among different gadgets of the same wave, you can maintained your own persistent storage on remote server and use some crossdomain mechanism (jsonp, script injection, etc) to share data. You can also use wave robot to maintain data for you and store them on the wave data document. Austin On Tue, Nov 10, 2009 at 10:00 AM, rgibson rgib...@astro.washington.edu wrote: I would like to share state between multiple gadgets. When I read the wave gadgets tutorial, it sounded as if the state was stored at the Wave level. (E.g., call wave.getState() to get the state, gadgets share state, etc.) So there would be one count per Wave, not one count per gadget. Of course, this introduces its own problems (e.g., every gadget developer has to know about the namespace of every other gadget.) And a quick check shows that if you run two examples of the count example gadget, they each have their own count variable that updates independently. So is there a way for two gadgets in a Wave to share their state? Or, what's the best way to do this? I am new at this and trying to poke my way through the documents, but I've gotten to the point where it's better to ask. Thanks, Rob --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Google Wave APIs] Re: multiple gadgets sharing state
Makes sense. Is there any way to get the state change callbacks _without_ using the robot to manage the shared states? (And without writing my own communication protocol that is, at the bottom layers, just polling an offsite server?) Thanks, Rob On Nov 11, 12:54 pm, Austin Chau (Google employee) api.aus...@google.com wrote: 1) You are correct. The callback mechanism provided by gadget library is only connected to the wave server. 2) Yes. When robot changed gadget states your gadget will receive the callback. Austin On Wed, Nov 11, 2009 at 12:48 PM, rgibson rgib...@astro.washington.eduwrote: Thanks for comments, all. Now suppose I want the gadget to receive a state change notification every time the state has changed. (I don't want to have to continually poll an external site to see if something has changed; I want a callback notification.) Is it true that: 1) There is no good way to get a state-change callback if I use the method where I manually store state in an external site? 2) If I use the robot to manage the state, I _will_ get a callback when a robot changes the state of any gadget? Thanks, Rob On Nov 10, 9:27 pm, Vikram Dhillon dhillon...@gmail.com wrote: Hi, This could be possible, use a static variable to keep the track of the state and then since there's only one copy of that variable, it can accessed at any point in the program/robot :) -- Regards, Vikram On Tue, Nov 10, 2009 at 1:37 PM, Austin Chau (Google employee) api.aus...@google.com wrote: No gadget states are specific to each gadget and not shared among other gadgets within the same wave. There are several ways to maintain state among different gadgets of the same wave, you can maintained your own persistent storage on remote server and use some crossdomain mechanism (jsonp, script injection, etc) to share data. You can also use wave robot to maintain data for you and store them on the wave data document. Austin On Tue, Nov 10, 2009 at 10:00 AM, rgibson rgib...@astro.washington.edu wrote: I would like to share state between multiple gadgets. When I read the wave gadgets tutorial, it sounded as if the state was stored at the Wave level. (E.g., call wave.getState() to get the state, gadgets share state, etc.) So there would be one count per Wave, not one count per gadget. Of course, this introduces its own problems (e.g., every gadget developer has to know about the namespace of every other gadget.) And a quick check shows that if you run two examples of the count example gadget, they each have their own count variable that updates independently. So is there a way for two gadgets in a Wave to share their state? Or, what's the best way to do this? I am new at this and trying to poke my way through the documents, but I've gotten to the point where it's better to ask. Thanks, Rob --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Google Wave APIs] Re: multiple gadgets sharing state
Makes sense. Is there any way to get the state change callbacks _without_ using the robot to manage the shared states? I don't think so. To get a callback you either need - someone (robot or ordinary user) to join or leave the Wave, - or someone (robot or ordinary user) to change a gadget state, - or the user must change the mode of the gadget (start/stop playback or editing). At least, that's how I read http://code.google.com/apis/wave/extensions/gadgets/reference.html So it's a bot...or yourself with a pen and pencil. :-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Google Wave APIs] Re: multiple gadgets sharing state
If you end up using a Java robot and a static object variable - remember to ensure you synchronize on it or use a synchronized object. Otherwise, simultaneous Servlet requests can end up changing the shared static object's value before each request is done with it. On Nov 11, 10:05 pm, Niels H. Christensen mr.niels.christen...@gmail.com wrote: Makes sense. Is there any way to get the state change callbacks _without_ using the robot to manage the shared states? I don't think so. To get a callback you either need - someone (robot or ordinary user) to join or leave the Wave, - or someone (robot or ordinary user) to change a gadget state, - or the user must change the mode of the gadget (start/stop playback or editing). At least, that's how I read http://code.google.com/apis/wave/extensions/gadgets/reference.html So it's a bot...or yourself with a pen and pencil. :-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---