Re: [Catalyst] Catalyst::*::REST and Javascript
Hi Robert, Whereas ExtJS seems to be of form: userResource = new Resource('http://example.com/users?id=001') ExtJS can send any sort of HTTP request you like - it doesn't really care how RESTful your URLs are. Like all Ajax toolkits the connectivity portion of the library is just a glorified wrapper around the browser's XHR object. Cheers, Patrick (author of the aforementioned RESTful Web Services article on the ExtJS wiki) ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
Ya I agree that doc is a little wacky - I tend to craft my own urls set the HTTP method appropriately - I stick the JSON-encoded data in a 'data' request parameter have my auto sub in my Root controller peel it off of there put it in $c-data so it all looks the same after that. like: if (my $data = $c-stash-{raw_params}-{data}) { $c-req-data(decode_json($data)); } Mark Robert Krimen wrote: On Mon, Aug 11, 2008 at 9:57 PM, Mark Trostler [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I've had good luck with ExtJS: http://extjs.com/learn/Manual:RESTful_Web_Services Mark Wikipedia demonstrates REST like: userResource = new Resource('http://example.com/users/001') userResource.delete() Whereas ExtJS seems to be of form: userResource = new Resource('http://example.com/users?id=001') The difference being that REST-proper encapsulates the id of the user in the URI path, where as ExtJS includes it as a query parameter. I like the former technique because it dovetails with Catalyst's chaining paradigm nicely. Looks like best practice for now is to craft URIs manually and feed them into your YUI, jQuery, or ExtJS AJAX routine of choice. Rob ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
Hi Robert, I have been using YUI along with Catalyst::Action::REST for the development of a prototype that is open to a limited set of users, it has been working out quite well for me. YUI is well documented with plenty of examples and is quite robust. I can't really provide a comparison to other libs simply because we chose YUI and have stuck with it from the start. cheers, -hani On Mon, Aug 11, 2008 at 6:46 PM, Robert Krimen [EMAIL PROTECTED]wrote: Hi, I'm starting to play around with Catalyst::Action::REST and was wondering if anyone had any recommendations on a javascript utility/library to play nice with RESTful services. I'm thinking of something more comprehensive than the basic YUI, jQuery, or Dojo AJAX functions. Jester (http://thoughtbot.com/projects/jester) is one but it's dependent on prototypejs. Thanks, Rob ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
On Aug 11, 2008, at 6:46 PM, Robert Krimen wrote: Hi, I'm starting to play around with Catalyst::Action::REST and was wondering if anyone had any recommendations on a javascript utility/ library to play nice with RESTful services. I'm thinking of something more comprehensive than the basic YUI, jQuery, or Dojo AJAX functions. Jester (http://thoughtbot.com/projects/jester) is one but it's dependent on prototypejs. Sproutcore pretty comprehensive - more of an application in javascript that uses REST for data transfer than a javascript library to spice up otherwise server-generated pages. http://www.sproutcore.com/ Cheers, Steve ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
On Mon, Aug 11, 2008 at 6:46 PM, Robert Krimen [EMAIL PROTECTED] wrote: Hi, I'm starting to play around with Catalyst::Action::REST and was wondering if anyone had any recommendations on a javascript utility/library to play nice with RESTful services. I'm thinking of something more comprehensive than the basic YUI, jQuery, or Dojo AJAX functions. Jester (http://thoughtbot.com/projects/jester) is one but it's dependent on prototypejs. Thanks, Rob I use YUI extensively in conjunction with REST -- it works great. Takes a very minimal amount of work to connect Catalyst::Controller::DBIC::API::REST with the YUI DataTable, too. YUI 2.5.1 has better methods for setting the content type, too, so you can serialize out as JSON without doing weird hacks that were previously needed (in case you saw someone, probably me, bitching about that last year :)) -J ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
J. Shirley wrote on 8/11/08 10:03 PM: I use YUI extensively in conjunction with REST -- it works great. Takes a very minimal amount of work to connect Catalyst::Controller::DBIC::API::REST with the YUI DataTable, too. YUI 2.5.1 has better methods for setting the content type, too, so you can serialize out as JSON without doing weird hacks that were previously needed (in case you saw someone, probably me, bitching about that last year :)) (YUI 2.5.x)++ There are examples of using YUI with both RPC and REST style services here: http://search.cpan.org/~karman/Rose-DBx-Garden-Catalyst-0.09_04/ That uses RDBO, RHTMLO, CatalysX::CRUD(::REST) and YUI 2.5.x specifically. -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::*::REST and Javascript
I've had good luck with ExtJS: http://extjs.com/learn/Manual:RESTful_Web_Services Mark Peter Karman wrote: J. Shirley wrote on 8/11/08 10:03 PM: I use YUI extensively in conjunction with REST -- it works great. Takes a very minimal amount of work to connect Catalyst::Controller::DBIC::API::REST with the YUI DataTable, too. YUI 2.5.1 has better methods for setting the content type, too, so you can serialize out as JSON without doing weird hacks that were previously needed (in case you saw someone, probably me, bitching about that last year :)) (YUI 2.5.x)++ There are examples of using YUI with both RPC and REST style services here: http://search.cpan.org/~karman/Rose-DBx-Garden-Catalyst-0.09_04/ That uses RDBO, RHTMLO, CatalysX::CRUD(::REST) and YUI 2.5.x specifically. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/