Hi Doug,

nice, I didn't think of using a normal GWT application as a wave
gadget like that before. But I think that is just a way of manually
doing what the Gadget API for GWT is doing for you.

What you said about being able to see two different views of the
gadget side by side in local testing is easily accomplished in
WaveConnector (actually it's the primary design goal). We can view two
versions of the Gadget (which is no more than a GWT widget) side by
side in a browser. All we need to do is give them two different
eventBuses (to prevent them from interfering with one another) and
make sure that wave-related events are shared across the buses. (more
generally using singletons in the GWT widget might cause problems).

I don't think there is need to include a server in order to test the
gadget with more than one participant :)

We can also add a user interface to add/remove participants, switch
the wave mode etc.. I will try to get this done next week.

Thanks for your feedback. I'm glad you liked it!

Cheers, Jonas


On Feb 10, 6:08 pm, dougx <[email protected]> wrote:
> Mmm... did you realize you can use a normal GWT application in wave as
> a gadget?
>
> All you need is a frame:
> <?xml version="1.0" encoding="UTF-8" ?>
> <Module>
> <ModulePrefs title="State Example" height="220">
>   <Require feature="wave" />
> </ModulePrefs>
> <Content type="html">
> <![CDATA[
> <html>
>   <head>
>     <meta http-equiv="content-type" content="text/html;
> charset=UTF-8">
>     <script type="text/javascript" src="http://xxx.appspot.com/xxx/
> xxx.nocache.js"></script>
>     <link type="text/css" rel="stylesheet" href="http:/xxx.appspot.com/
> xxx/xxx.css">
>     <title>Jewels</title>
>   </head>
>   <body>
>   </body>
> </html>
>  ]]>
> </Content>
> </Module>
>
> Then use the cross domain compiler to compile the code (this is
> actually exactly what it's for...):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//
> EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-
> source/core/src/gwt-module.dtd">
> <module rename-to='xxx'>
>   <inherits name='com.google.gwt.user.User'/>
>   <inherits name='com.google.gwt.user.theme.standard.Standard'/>
>   <entry-point class='com.hax.wave.xxx.client.XXXWidget'/>
>   <add-linker name="xs"/> <-- You _must_ include this step to access
> teh wave API.
> </module>
>
> And finally, use JSNI to access the wave api:
> public static native boolean isInWaveContainer() throws Exception /*-{
>   var rtn = false;
>   if (($wnd.wave) && ($wnd.wave.isInWaveContainer()))
>     rtn = true;
>   return(rtn);
>
> }-*/;
>
> ...
>
> So yeah. Might find that helpful. Note that in 2.0 you can't debug
> using the xs linker, so you'll need to comment that line out while
> you're developing your widget, and then put it back when you do a
> deployment build.
>
> That wave connector is very cool; nice work! :)
>
> Hm... I wonder if we could add an app engine based data store based
> state so just when you're debugging locally you can have two browser
> windows open and it'll treat those as different viewers of the gadget,
> so you can do full testing. That'd involve defining separate servlet
> end points though; perhaps it'd be better as a separate gwt
> application, and you can include it on your testing pages...
>
> ~
> Doug.
>
> On Feb 11, 7:42 am, Jonas Huckestein <[email protected]> wrote:
>
> > Hi Everybody,
>
> > I have just released WaveConnector - a turnkey solution for developing
> > wave gadgets using GWT and testing them in hosted mode. Please head
> > over to my blog athttp://thezukunft.comorthe project page 
> > athttp://code.google.com/p/waveconnector-gwt/fordetails. It's as easy
> > as downloading a zip archive :D
>
> > Chris, how di you achieve the 90%? I assume you must also decouple the
> > GWT code from the Gadget/Wave API? I have simply implemented a mock
> > version of the wave API. That way I think I can do all testing
> > locally.
>
> > Kayode, WaveConnector is exactly the mock framework (+ some
> > convenience functions) I was talking about :)
>
> > Sorry for this shameless selfpromotion on this board but I think this
> > might actually help a lot of people or get them to develop for Wave in
> > the first place.
>
> > What do all of you think of a dedicated Wave+GWT group? I asked that
> > question on the GWT groups earlier and people seemed to be interested.
>
> > Cheers, Jonas
>
> > This is my first ever open source contribution so please give me
> > comments and feedback on my blog or the project page.
>
> > On Feb 10, 2:07 am, HaiColon <[email protected]> wrote:
>
> > > What I do is I write the gadget in a way that makes it work both
> > > locally (or as a website on a remote server) and then I add a layer on
> > > top that makes it work with Google Wave. That way I can test 90% of
> > > the gadget locally, no problem. And for the other 10% I just use the
> > > debug features of the sandbox Wave client. That has worked good so far
> > > even for bigger/more involved gadgets and the bonus is that your
> > > gadget then doesn't need to be Wave exclusive.
>
> > > If you'd want to use a test-driven development approach you could only
> > > test this 90% non-Wave part of the application but none of the Google
> > > Wave specific stuff in the other 10%, so this approach may not be good
> > > enough for everyone.
>
> > > Cheers,
> > > Chris
>
> > > On Feb 9, 6:52 am, Jonas Huckestein <[email protected]> wrote:
>
> > > > Hi guys,
>
> > > > so I just started developing Wave Gadgets and I'm currently using GWT.
> > > > While there are obvious benefits such as unit testability, cross-
> > > > browser support and code-splitting, there are also some downsides. For
> > > > instance I cannot easily test gadgets locally (not to mention testing
> > > > robots!). I had to create a local mock implementation of the wave API
> > > > for testing and every time I use a new API feature I have to add it to
> > > > my mock implementation. All in all it feels kind of clunky and
> > > > strange.
>
> > > > Are there any easier ways to develop (possibly very complex) wave
> > > > gadgets? What do you guys use?
>
> > > > In case you are interested, I wrote a tutorial in how to get started
> > > > developing gadgets with gwt. Also, I guess I will be uploading my
> > > > WaveMock framework to Google Cloud this week (if anybody is
> > > > interested):
>
> > > >http://thezukunft.com/2010/02/08/a-wave-gadget-robot-using-gwt-2-0-an...
>
> > > > Cheers, Jonas

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