How to pass value from gadget to robot by Java API

2 views
Skip to first unread message

hvt_kg

unread,
Dec 16, 2009, 2:12:32 AM12/16/09
to Google Wave API
Hi all,

Now. I want know how to get value of textbox from gadget pass to bot.
anyone can help me? example, etc...

thanks all,
Alex

Dragon Silicon

unread,
Dec 16, 2009, 4:59:14 AM12/16/09
to google-wave-api
Dear Alex,

The gadgets are capable of doing simple web requests, via the gadgets.io.makerequest call. 
This is pretty much detailed in the wave articles
Your bot is most probably a standard web application -that is, it can receive web requests. Put these together, and you've got working communication.
As a transport layer, we traditionally stick with JSON, but for simple purposes a basic HTTP POST usually do the trick.

Good luck
-SDr


--

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.



dougx

unread,
Dec 16, 2009, 6:41:30 PM12/16/09
to Google Wave API
Otherwise you can listen for DOCUMENT_CHANGED events in your robot and
pull data out of the gadget state.

...but here's an example, of using makeRequest():
(this is a gadget)

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="State Example" height="220">
<Require feature="wave" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<style>
#content_div {
height: 100px;
width: 400px;
border: 2px solid #efefef;
font-family: arial;
}
#msg_div {
height: 80px;
overflow: auto;
}
</style>
<div id="content_div">
<div id="msg_div"></div>

<!-- Gadget bootstrap. -->
<script type="text/javascript">
var obj = {
'msgs' : document.getElementById('msg_div'),
'init' : function() {
if (wave && wave.isInWaveContainer()) {
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
var url = "http://www.google.com";
var response = function(data) {
obj.msgs.innerHTML = 'cAllback from makerequest: ' +
data.text;
};
gadgets.io.makeRequest(url, response, params);
}
}
};
gadgets.util.registerOnLoadHandler(obj.init);
</script>
]]>
</Content>
</Module>

~
Doug.

On Dec 16, 4:59 am, Dragon Silicon <sdr...@gmail.com> wrote:
> Dear Alex,
>
> The gadgets are capable of doing simple web requests, via the
> gadgets.io.makerequest call.
> This is pretty much detailed in the wave

> articles<http://code.google.com/apis/wave/articles/gadgetdebugging.html>
> .


> Your bot is most probably a standard web application -that is, it can
> receive web requests. Put these together, and you've got working
> communication.
> As a transport layer, we traditionally stick with JSON, but for simple
> purposes a basic HTTP POST usually do the trick.
>
> Good luck
> -SDr
>

> On Wed, Dec 16, 2009 at 7:12 AM, hvt_kg <thaihuyn...@gmail.com> wrote:
> > Hi all,
>
> > Now. I want know how to get value of textbox from gadget pass to bot.
> > anyone can help me? example, etc...
>
> > thanks all,
> > Alex
>
> > --
>
> > 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>

hvt_kg

unread,
Dec 16, 2009, 8:21:15 PM12/16/09
to Google Wave API
Hi All,

thanks all. I had get solution.

Alex

Sol Wu

unread,
Dec 17, 2009, 1:58:11 AM12/17/09
to Google Wave API
Adding to what dougx said, robot can listen for BLIP_SUBMITTED event,
which get triggered whenever gadget makes a state change.

> > > google-wave-a...@googlegroups.com<google-wave-api%2Bunsubscribe@ googlegroups.com>

Reply all
Reply to author
Forward
0 new messages