Offer a GWT wrapper for the Google Wave Embed API

4 views
Skip to first unread message

Eric Ayers

unread,
Jun 2, 2009, 10:06:12 PM6/2/09
to gwt-google-apis, Mark Renouf
continuing conversation from issue 273
http://code.google.com/p/gwt-google-apis/issues/detail?id=273

See the Wave API at http://code.google.com/apis/wave

Mark Renouf writes:
Ok, I got something cooking. Couple questions:

Is it correct to use the new GWT 1.6 Event/Handler/HasXXXHandler pattern
directly from JSNI?

Will it work to simply construct the GwtEvent from JSNI and invoke the
fireEvent method directly? I assume HandlerManager has sufficient
exception handling, so we don't need to write all those static
fireXXXEvent methods anymore?

Example:

   public native void loadWave(String waveId, HasWaveLoadHandlers handler)
/*-{
        var event =
@com.google.gwt.wave.client.event.WaveLoadEvent::new(Ljava/lang/String;)(waveId);
        this.loadWave(waveId, function() {

handler.@com.google.gwt.event.shared.HasHandlers::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);
        })
    }-*/;

(I haven't tested this at all but GPE doesn't flag any errors)
Also how the the existing GWT Gadgets API fit with the Wave Gadgets
API? I think using GWT to build Wave Gadgets is going to be highly
requested.


--
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

Mark Renouf

unread,
Jun 2, 2009, 11:49:16 PM6/2/09
to Google API Libraries for GWT
Ok, Confirmed the above code works and I am getting the "developer
preview" error page with a login link within my Wave widget!

I've wrapped things up into a Widget. Should we call it
"WavePanel" (matching the API) or is that confusing because it's not a
Pane (in the GWT sense -- cannot put other Widgets into it)? For now
it's "WaveWidget" and "WaveEmbed".

My first draft: (comments, suggestions and refinements welcome!)

http://groups.google.com/group/gwt-google-apis/web/gwt-wave-0.1.tar.gz

On Jun 2, 10:06 pm, Eric Ayers <zun...@google.com> wrote:
> continuing conversation from issue 273http://code.google.com/p/gwt-google-apis/issues/detail?id=273
>
> See the Wave API athttp://code.google.com/apis/wave
>
> Mark Renouf writes:
>
> Ok, I got something cooking. Couple questions:
>
> Is it correct to use the new GWT 1.6 Event/Handler/HasXXXHandler pattern
> directly from JSNI?
>
> Will it work to simply construct the GwtEvent from JSNI and invoke the
> fireEvent method directly? I assume HandlerManager has sufficient
> exception handling, so we don't need to write all those static
> fireXXXEvent methods anymore?
>
> Example:
>
>    public native void loadWave(String waveId, HasWaveLoadHandlers handler)
> /*-{
>         var event =
> @com.google.gwt.wave.client.event.WaveLoadEvent::new(Ljava/lang/String;)(waveId);
>         this.loadWave(waveId, function() {
>
> handl...@com.google.gwt.event.shared.HasHandlers::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);

Eric Ayers

unread,
Jun 3, 2009, 6:12:31 AM6/3/09
to gwt-goo...@googlegroups.com, Sascha Haberling
Hi Mark,

On Tue, Jun 2, 2009 at 11:49 PM, Mark Renouf <mark....@gmail.com> wrote:
>
> Ok, Confirmed the above code works and I am getting the "developer
> preview" error page with a login link within my Wave widget!
>
> I've wrapped things up into a Widget. Should we call it
> "WavePanel" (matching the API) or is that confusing because it's not a
> Pane (in the GWT sense -- cannot put other Widgets into it)? For now
> it's "WaveWidget" and "WaveEmbed".

That sounds like a good choice. There is an unfortunate collision in
terminology.

>
> My first draft: (comments, suggestions and refinements welcome!)
>
> http://groups.google.com/group/gwt-google-apis/web/gwt-wave-0.1.tar.gz

I'd like to use the code review app in the future -
http://galgwt-reviews.appspot.com/ I think you can still use it if
you don't have commit access, but you can't use the upload.py script.

- When you mentioned event handling yesterday, it slipped my mind that
there are some useful classes in com.google.gwt.ajaxloader.client for
dealing with things like and handling the exceptions for hosted mode.
You can map that in with an svn:externals property as we've done for
maps, search, visualization and other APIs.
- Change your NOTE: lines to TODO(mark.renouf): so that the IDE's can flag them.
- In WaveEmbed.setUIConfig() - I haven't seen the assert(...):
<string>; pattern used before. Why not make the assertion a
RuntimeException()? So that it can be turned off?
- We need a simple demo like WaveWidgetTest. To get started,
WaveWidgetTest could be moved under wave/samples/hellowave/....
- Unit tests will go under wave/wave/test/ which you could probably
start soon - just a test to see that the API gets loaded is a good
start.

Before commit, the Apache license headers and Javadoc headers need to
be filled in.

There's also a Gadget API. I'm not sure if that should be a part of
this project or not.
http://code.google.com/apis/wave/extensions/gadgets/guide.html

The work on the OpenSocial gadget api is still ongoing.

Mark Renouf

unread,
Jun 3, 2009, 7:44:20 AM6/3/09
to Google API Libraries for GWT
> I'd like to use the code review app in the future -
> http://galgwt-reviews.appspot.com/ I think you can still use it if
> you don't have commit access, but you can't use the upload.py script.

I agree, it's a great tool. I'll get something commit-worthy together
soon for it.

> There's also a Gadget API

The Gadgets API seems to be the real sweet spot for GWT. I was
wondering how the Wave Gadgets API lines up with the existing Gadget
support in GAL-GWT? I have not had a chance to compare the
documentation. It should probably go into the same library, maybe as a
seperate Module?

Do you know if the Wave team has anything like this? Either they've
developed the current demos we saw directly in JavaScript, or what
they have done can't be released publicly right now?

> In WaveEmbed.setUIConfig() - I haven't seen the assert(...):

Look at UIObject.setElement(). If a RuntimeException is preferred
here, I'd be happy to change it. My understanding is the assertions go
into compiled JavaScript as well and trigger an AssertionError if they
do not evaluate true, same result, just more compact. Or are they
stripped under certain cases?

On Jun 3, 6:12 am, Eric Ayers <zun...@google.com> wrote:
> Hi Mark,
>
> On Tue, Jun 2, 2009 at 11:49 PM, Mark  Renouf <mark.ren...@gmail.com> wrote:
>
>
>
> > Ok, Confirmed the above code works and I am getting the "developer
> > preview" error page with a login link within my Wave widget!
>
> > I've wrapped things up into a Widget. Should we call it
> > "WavePanel" (matching the API) or is that confusing because it's not a
> > Pane (in the GWT sense -- cannot put other Widgets into it)? For now
> > it's "WaveWidget" and "WaveEmbed".
>
> That sounds like a good choice.  There is an unfortunate collision in
> terminology.
>
>
>
> > My first draft: (comments, suggestions and refinements welcome!)
>
> >http://groups.google.com/group/gwt-google-apis/web/gwt-wave-0.1.tar.gz
>
> I'd like to use the code review app in the future -http://galgwt-reviews.appspot.com/ I think you can still use it if
> you don't have commit access, but you can't use the upload.py script.
>
> - When you mentioned event handling yesterday, it slipped my mind that
> there are some useful classes in com.google.gwt.ajaxloader.client for
> dealing with things like and handling the exceptions for hosted mode.
>  You can map that in with an svn:externals property as we've done for
> maps, search, visualization and other APIs.
> - Change your NOTE: lines to TODO(mark.renouf): so that the IDE's can flag them.
> - In WaveEmbed.setUIConfig() - I haven't seen the assert(...):
> <string>; pattern used before.  Why not make the assertion a
> RuntimeException()?  So that it can be turned off?
> - We need a simple demo like WaveWidgetTest.  To get started,
> WaveWidgetTest could be moved under wave/samples/hellowave/....
> - Unit tests will go under wave/wave/test/  which you could probably
> start soon - just a test to see that the API gets loaded is a good
> start.
>
> Before commit, the Apache license headers and Javadoc headers need to
> be filled in.
>
> There's also a Gadget API.  I'm not sure if that should be a part of
> this project or not.http://code.google.com/apis/wave/extensions/gadgets/guide.html
Reply all
Reply to author
Forward
0 new messages