Quantcast

Updated DWR Plugin for DWR 3

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Updated DWR Plugin for DWR 3

Noah Sloan
For anyone who is interested, I've updated the DWR plugin for the
upcoming 3.0 release of DWR. I've applied to take ownership of the
plugin, but haven't heard anything yet, so in the meantime I've posted
my build of the plug-in here:
http://dl.getdropbox.com/u/139694/grails-dwr-0.3.zip

Just 'grails install-plugin path/to/zip', and remove the old plugin if
you have it installed.

One of the neat new features of DWR 3 is the ability of DWR to
generate a JavaScript class for each of your domain classes that you
can instantiate and pass to DWR methods.  I've made it simple to use
this feature in your BootStrap.dwrconfig:

       convert(domainClass:MyDomainClass) {
               param(name:'include',value:'id,name,whatever')
       }

Notice that domainClass is the actual class, not a String. Feedback
and feature requests are welcome. Hopefully I'll get access soon so I
can do an official release and update the documentation. There's more
about what's new in DWR 3 here:
http://www.slideshare.net/joewalker/whats-new-in-dwr-version-3-presentation

Cheers,
noah

P.S. If you have the ability to commit to the DWR plugin, I've
attached a patch with my changes. In addition to the patch, you'll
need to grails upgrade to a 1.x version and swap lib/dwr-2.0.1.jar for
the latest DWR jar
(https://dwr.dev.java.net/files/documents/2427/120387/dwr.jar).

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

grails-dwr3.patch (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

TomStrummer
Any update on this?  The DWR plugin looks like it hasn't been maintained since the 0.1 release, and it would be really nice to at least know somebody is keeping it compatible with the latest Grails and DWR versions.

Thanks.
-Tom

Noah Sloan wrote
For anyone who is interested, I've updated the DWR plugin for the
upcoming 3.0 release of DWR. I've applied to take ownership of the
plugin, but haven't heard anything yet, so in the meantime I've posted....
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

Noah Sloan
Unfortunately, DWR had something of a leadership crisis earlier this
year and 3.0 still hasn't been released.  I suppose we could do a 0.2
release that is compatible with the release candidate. I haven't used
DWR much this year, but I would guess that the plugin trunk should
still be compatible with rc1.

On Fri, Jul 24, 2009 at 12:01 PM, TomStrummer<[hidden email]> wrote:

>
> Any update on this?  The DWR plugin looks like it hasn't been maintained
> since the 0.1 release, and it would be really nice to at least know somebody
> is keeping it compatible with the latest Grails and DWR versions.
>
> Thanks.
> -Tom
>
>
> Noah Sloan wrote:
>>
>> For anyone who is interested, I've updated the DWR plugin for the
>> upcoming 3.0 release of DWR. I've applied to take ownership of the
>> plugin, but haven't heard anything yet, so in the meantime I've posted....
>>
>
> --
> View this message in context: http://www.nabble.com/Updated-DWR-Plugin-for-DWR-3-tp21421849p24648166.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

Tom Nichols
Hmm interesting.  I have to say, I had gotten really spoiled by how
easy DWR makes Ajax, particularly wrt serializaing exceptions to the
client, which is super handy for displaying errors.  I've actually
still been using DWR 2.0.3, but I was more concerned about how well
the plugin would work under Grails 1.0/ 1.1.

Thanks.
-Tom


On Fri, Jul 24, 2009 at 1:09 PM, noah<[hidden email]> wrote:

> Unfortunately, DWR had something of a leadership crisis earlier this
> year and 3.0 still hasn't been released.  I suppose we could do a 0.2
> release that is compatible with the release candidate. I haven't used
> DWR much this year, but I would guess that the plugin trunk should
> still be compatible with rc1.
>
> On Fri, Jul 24, 2009 at 12:01 PM, TomStrummer<[hidden email]> wrote:
>>
>> Any update on this?  The DWR plugin looks like it hasn't been maintained
>> since the 0.1 release, and it would be really nice to at least know somebody
>> is keeping it compatible with the latest Grails and DWR versions.
>>
>> Thanks.
>> -Tom
>>
>>
>> Noah Sloan wrote:
>>>
>>> For anyone who is interested, I've updated the DWR plugin for the
>>> upcoming 3.0 release of DWR. I've applied to take ownership of the
>>> plugin, but haven't heard anything yet, so in the meantime I've posted....
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Updated-DWR-Plugin-for-DWR-3-tp21421849p24648166.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

a.shneyderman
On Fri, Jul 24, 2009 at 7:32 PM, Tom Nichols<[hidden email]> wrote:
> Hmm interesting.  I have to say, I had gotten really spoiled by how
> easy DWR makes Ajax, particularly wrt serializaing exceptions to the
> client, which is super handy for displaying errors.  I've actually
> still been using DWR 2.0.3, but I was more concerned about how well
> the plugin would work under Grails 1.0/ 1.1.

if you have issues with it you should report them. It worked with all
the samples that DWR itself distributed in versions 1.0.* of Grails.
At the time I created the plugin I used DWR on a project. Nowadays
there are better alternatives. Better for me and better not in a sense
that they do a better job than DWR but better in terms of what they
provide on the UI side of things (ext for example) - that is where DWR
lacking any functionality hence becomes fairly useless very fast.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

caguy
What are alternatives to using DWR with Grails? Thanks.

Alex Shneyderman wrote
On Fri, Jul 24, 2009 at 7:32 PM, Tom Nichols<tmnichols@gmail.com> wrote:
> Hmm interesting.  I have to say, I had gotten really spoiled by how
> easy DWR makes Ajax, particularly wrt serializaing exceptions to the
> client, which is super handy for displaying errors.  I've actually
> still been using DWR 2.0.3, but I was more concerned about how well
> the plugin would work under Grails 1.0/ 1.1.

if you have issues with it you should report them. It worked with all
the samples that DWR itself distributed in versions 1.0.* of Grails.
At the time I created the plugin I used DWR on a project. Nowadays
there are better alternatives. Better for me and better not in a sense
that they do a better job than DWR but better in terms of what they
provide on the UI side of things (ext for example) - that is where DWR
lacking any functionality hence becomes fairly useless very fast.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

a.shneyderman
It depends on what your needs are.

If making ajax calls is all you need, you can use pretty much any
other JS library jQuery, ext, dojo, etc. Grails makes it trivial to
marshal and unmarshl from and to JSON; to use DWR for this purpose
feels like a fifth wheel on a carriage.

If you need back-end pushing changes onto your client, functionality
that is provided by DWR, you could use comet(or cometd) plugin that
specializes in this.

DWR never provided any UI functionality, and I never used its server
to client calls, so for my needs it was pretty useless, except in one
case when it was my first JS client framework to work with.

HTH,
Alex.

On Wed, Sep 30, 2009 at 6:18 AM, caguy <[hidden email]> wrote:

>
> What are alternatives to using DWR with Grails? Thanks.
>
>
> Alex Shneyderman wrote:
>>
>> On Fri, Jul 24, 2009 at 7:32 PM, Tom Nichols<[hidden email]> wrote:
>>> Hmm interesting.  I have to say, I had gotten really spoiled by how
>>> easy DWR makes Ajax, particularly wrt serializaing exceptions to the
>>> client, which is super handy for displaying errors.  I've actually
>>> still been using DWR 2.0.3, but I was more concerned about how well
>>> the plugin would work under Grails 1.0/ 1.1.
>>
>> if you have issues with it you should report them. It worked with all
>> the samples that DWR itself distributed in versions 1.0.* of Grails.
>> At the time I created the plugin I used DWR on a project. Nowadays
>> there are better alternatives. Better for me and better not in a sense
>> that they do a better job than DWR but better in terms of what they
>> provide on the UI side of things (ext for example) - that is where DWR
>> lacking any functionality hence becomes fairly useless very fast.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Updated-DWR-Plugin-for-DWR-3-tp21421849p25674790.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

Tom Nichols
I like DWR because, for one, it specifically handles exceptions thrown
from a service method.  So for example, my service can simply throw a
"LoginFailedException" and the DWR client-side proxy will turn that
into a Javascript exception that I can handle.  I find this terribly
convenient, and something that isn't very easy to otherwse do in
Grails.

DWR's javascript proxy is also really nice in general-- calling
MyService.serviceMethod in Javascript is much nicer IMO than creating
a new Ajax request for a URL that has to dynamically be rendered with
a ${createLink} GSP call.

Alex, does Grails provide built-in ways to deal with this sort of behavior?

Thanks.
-Tom


2009/9/30 Alex Shneyderman <[hidden email]>:

> It depends on what your needs are.
>
> If making ajax calls is all you need, you can use pretty much any
> other JS library jQuery, ext, dojo, etc. Grails makes it trivial to
> marshal and unmarshl from and to JSON; to use DWR for this purpose
> feels like a fifth wheel on a carriage.
>
> If you need back-end pushing changes onto your client, functionality
> that is provided by DWR, you could use comet(or cometd) plugin that
> specializes in this.
>
> DWR never provided any UI functionality, and I never used its server
> to client calls, so for my needs it was pretty useless, except in one
> case when it was my first JS client framework to work with.
>
> HTH,
> Alex.
>
> On Wed, Sep 30, 2009 at 6:18 AM, caguy <[hidden email]> wrote:
>>
>> What are alternatives to using DWR with Grails? Thanks.
>>
>>
>> Alex Shneyderman wrote:
>>>
>>> On Fri, Jul 24, 2009 at 7:32 PM, Tom Nichols<[hidden email]> wrote:
>>>> Hmm interesting.  I have to say, I had gotten really spoiled by how
>>>> easy DWR makes Ajax, particularly wrt serializaing exceptions to the
>>>> client, which is super handy for displaying errors.  I've actually
>>>> still been using DWR 2.0.3, but I was more concerned about how well
>>>> the plugin would work under Grails 1.0/ 1.1.
>>>
>>> if you have issues with it you should report them. It worked with all
>>> the samples that DWR itself distributed in versions 1.0.* of Grails.
>>> At the time I created the plugin I used DWR on a project. Nowadays
>>> there are better alternatives. Better for me and better not in a sense
>>> that they do a better job than DWR but better in terms of what they
>>> provide on the UI side of things (ext for example) - that is where DWR
>>> lacking any functionality hence becomes fairly useless very fast.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>     http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Updated-DWR-Plugin-for-DWR-3-tp21421849p25674790.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

a.shneyderman
On Wed, Sep 30, 2009 at 4:11 PM, Tom Nichols <[hidden email]> wrote:

> I like DWR because, for one, it specifically handles exceptions thrown
> from a service method.  So for example, my service can simply throw a
> "LoginFailedException" and the DWR client-side proxy will turn that
> into a Javascript exception that I can handle.  I find this terribly
> convenient, and something that isn't very easy to otherwse do in
> Grails.
>
> DWR's javascript proxy is also really nice in general-- calling
> MyService.serviceMethod in Javascript is much nicer IMO than creating
> a new Ajax request for a URL that has to dynamically be rendered with
> a ${createLink} GSP call.
>
> Alex, does Grails provide built-in ways to deal with this sort of behavior?

Exceptions, I am not sure - did not realize that java script has them
... really ... exceptions ... hmm ... I always thought of JS as second
class citizen ... well its rating just went up a bit :-)

Anyhow, services to expose is not automatic with DWR either, you would
need to provide a wrap-around, which is what DWR plugin was for. I
would imagine one could come up with plugin that does just that (if it
is not there already) without DWR in the picture.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updated DWR Plugin for DWR 3

caguy
This example with DWR plugin has checksum error http://docs.codehaus.org/download/attachments/70844/gdwrdemo.tar.gz?version=1
Who should I contact to have that fixed? Or can someone help me with setting up DWR?

This snippet is from plugin page explaining setup:
 def dwrconfig = { service(name:'testService', javascript:'TestService') { exclude('setMetaClass,getMetaClass,setProperty,getProperty') }

create(creator:'new', javascript:'AddressLookup') { param (name:'class') { 'uk.ltd.getahead.dwrdemo.address.AddressLookup' } } }


if I have a service called geoorders.GeocoderService and a domain object called geoorders.GeoOrder then how should it show in closure above?

Thanks for your help.

Alex Shneyderman wrote
On Wed, Sep 30, 2009 at 4:11 PM, Tom Nichols <tmnichols@gmail.com> wrote:
> I like DWR because, for one, it specifically handles exceptions thrown
> from a service method.  So for example, my service can simply throw a
> "LoginFailedException" and the DWR client-side proxy will turn that
> into a Javascript exception that I can handle.  I find this terribly
> convenient, and something that isn't very easy to otherwse do in
> Grails.
>
> DWR's javascript proxy is also really nice in general-- calling
> MyService.serviceMethod in Javascript is much nicer IMO than creating
> a new Ajax request for a URL that has to dynamically be rendered with
> a ${createLink} GSP call.
>
> Alex, does Grails provide built-in ways to deal with this sort of behavior?

Exceptions, I am not sure - did not realize that java script has them
... really ... exceptions ... hmm ... I always thought of JS as second
class citizen ... well its rating just went up a bit :-)

Anyhow, services to expose is not automatic with DWR either, you would
need to provide a wrap-around, which is what DWR plugin was for. I
would imagine one could come up with plugin that does just that (if it
is not there already) without DWR in the picture.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Loading...