[aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

Matthias Wessendorf
Hi,

I was looking at the TODO app ([1]) and noticed that with the 'auth
module' the APP DEV has to specify 'contentType' and 'dataType' for
the login/register API calls. Not sure, but isn't that a bit
cumbersome?

This is not the case for any calls on the 'pipe' API, since it is
using the aerogear.ajax util (see [2]), which applies the above
'contentType' and 'dataType' as default (see [3]), which is nice!

The 'auth rest adapter', however is directly using the jQuery.ajax
without applying the same defaults (see [4]). Perhaps we should apply
the 'contentType' and 'dataType' default values for something like
login or register as well?

Thanks!
Matthias

[1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
[2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
[3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
[4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72

--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

Matthias Wessendorf
any comments ?

On Thu, Oct 4, 2012 at 12:19 PM, Matthias Wessendorf <[hidden email]> wrote:

> Hi,
>
> I was looking at the TODO app ([1]) and noticed that with the 'auth
> module' the APP DEV has to specify 'contentType' and 'dataType' for
> the login/register API calls. Not sure, but isn't that a bit
> cumbersome?
>
> This is not the case for any calls on the 'pipe' API, since it is
> using the aerogear.ajax util (see [2]), which applies the above
> 'contentType' and 'dataType' as default (see [3]), which is nice!
>
> The 'auth rest adapter', however is directly using the jQuery.ajax
> without applying the same defaults (see [4]). Perhaps we should apply
> the 'contentType' and 'dataType' default values for something like
> login or register as well?
>
> Thanks!
> Matthias
>
> [1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
> [2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
> [3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
> [4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

Kris Borchers-2
In reply to this post by Matthias Wessendorf
Sorry I didn't respond earlier. Locally, if I ever get this pushed, I have the contentType and dataType defaulted. The reasons I didn't use aerogear.ajax escape me right now and it seems like the right move but I will think on it some more to make sure and do some testing.

Sent from my Android phone using TouchDown (www.nitrodesk.com)


-----Original Message-----
From: Matthias Wessendorf [[hidden email]]
Received: Saturday, 06 Oct 2012, 5:48am
To: AeroGear Developer Mailing List [[hidden email]]
Subject: Re: [aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)


any comments ?

On Thu, Oct 4, 2012 at 12:19 PM, Matthias Wessendorf <[hidden email]> wrote:

> Hi,
>
> I was looking at the TODO app ([1]) and noticed that with the 'auth
> module' the APP DEV has to specify 'contentType' and 'dataType' for
> the login/register API calls. Not sure, but isn't that a bit
> cumbersome?
>
> This is not the case for any calls on the 'pipe' API, since it is
> using the aerogear.ajax util (see [2]), which applies the above
> 'contentType' and 'dataType' as default (see [3]), which is nice!
>
> The 'auth rest adapter', however is directly using the jQuery.ajax
> without applying the same defaults (see [4]). Perhaps we should apply
> the 'contentType' and 'dataType' default values for something like
> login or register as well?
>
> Thanks!
> Matthias
>
> [1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
> [2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
> [3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
> [4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf


--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
When updating the FAQ (https://gist.github.com/3857191) I ran into this again.

To not forget about this, I filed a JIRA ticket for it:
https://issues.jboss.org/browse/AEROGEAR-520

-Matthias

On Sat, Oct 6, 2012 at 12:48 PM, Matthias Wessendorf <[hidden email]> wrote:

> any comments ?
>
> On Thu, Oct 4, 2012 at 12:19 PM, Matthias Wessendorf <[hidden email]> wrote:
>> Hi,
>>
>> I was looking at the TODO app ([1]) and noticed that with the 'auth
>> module' the APP DEV has to specify 'contentType' and 'dataType' for
>> the login/register API calls. Not sure, but isn't that a bit
>> cumbersome?
>>
>> This is not the case for any calls on the 'pipe' API, since it is
>> using the aerogear.ajax util (see [2]), which applies the above
>> 'contentType' and 'dataType' as default (see [3]), which is nice!
>>
>> The 'auth rest adapter', however is directly using the jQuery.ajax
>> without applying the same defaults (see [4]). Perhaps we should apply
>> the 'contentType' and 'dataType' default values for something like
>> login or register as well?
>>
>> Thanks!
>> Matthias
>>
>> [1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
>> [2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
>> [3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
>> [4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Ajax usage (aerogear.ajax VS jquery.ajax)

Matthias Wessendorf
FYI,

with the recent JS changes AEROGEAR-520 has been addressed already.

TODO app will be updated soon...

-M

On Tue, Oct 9, 2012 at 10:35 AM, Matthias Wessendorf <[hidden email]> wrote:

> When updating the FAQ (https://gist.github.com/3857191) I ran into this again.
>
> To not forget about this, I filed a JIRA ticket for it:
> https://issues.jboss.org/browse/AEROGEAR-520
>
> -Matthias
>
> On Sat, Oct 6, 2012 at 12:48 PM, Matthias Wessendorf <[hidden email]> wrote:
>> any comments ?
>>
>> On Thu, Oct 4, 2012 at 12:19 PM, Matthias Wessendorf <[hidden email]> wrote:
>>> Hi,
>>>
>>> I was looking at the TODO app ([1]) and noticed that with the 'auth
>>> module' the APP DEV has to specify 'contentType' and 'dataType' for
>>> the login/register API calls. Not sure, but isn't that a bit
>>> cumbersome?
>>>
>>> This is not the case for any calls on the 'pipe' API, since it is
>>> using the aerogear.ajax util (see [2]), which applies the above
>>> 'contentType' and 'dataType' as default (see [3]), which is nice!
>>>
>>> The 'auth rest adapter', however is directly using the jQuery.ajax
>>> without applying the same defaults (see [4]). Perhaps we should apply
>>> the 'contentType' and 'dataType' default values for something like
>>> login or register as well?
>>>
>>> Thanks!
>>> Matthias
>>>
>>> [1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
>>> [2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
>>> [3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
>>> [4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72
>>>
>>> --
>>> Matthias Wessendorf
>>>
>>> blog: http://matthiaswessendorf.wordpress.com/
>>> sessions: http://www.slideshare.net/mwessendorf
>>> twitter: http://twitter.com/mwessendorf
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev