Re: [Catalyst] OT: Recommendations for big-time hosting
Hi! So what's you recommendation for absolutely bullet-proof hosting that let's you sleep at night? I think pair Networks would perfectly do: http://www.pair.com - look into the Dedicated section. Talk to you soon, Michele. -- Michele Beltrame http://www.cattlegrid.info/ ICQ 76660101 - MSN [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] FormBuilder - Can't locate object method form via package
On 25/02/2008, Joshua McAdams [EMAIL PROTECTED] wrote: sub edit : Local Form { my ($self, $c) = @_; if ($c-form-submitted $c-form-validate) { $c-stash-{message} = 'Thanks for submitting the form'; } } Use $self-formbulder instead of $c-form. That chapter suffered from a quick rewrite and some of the examples use and older syntax for accessing formbuilder. $self-formbuilder Thanx. In the same section it uses [% form.render %] for the tt2. template that should read [% FormBuilder.render %] Dp. ___ 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/
[Catalyst] Needs some help with select and Controller::FormBuilder
Hello! I'm trying to make a form with select using Controller::FormBuilder. Code is quite straightforward === edit.fb === name: server_edit method: post fields: name: label: Server Name required: 1 type: text size: 60 descr: label: Description type: textarea rows: 4 cols: 60 ipid: label: IP type: select required: 1 === edit.fb === === from Server.pm === sub edit : Local Form { my ($self, $c, $lid, $sid) = @_; if (!defined $lid) { $c-response-redirect($c-uri_for('/location/list')); $c-detach(); } my $form = $self-formbuilder; my $iplist = $c-model('OurIP')-search(undef, {columns = [qw /ipid ipaddr/], order_by = 'ipaddr'}); $c-log-info(join(', ', map { $_-ipid.' '.$_-ipaddr } $iplist-all)); $form-field(name='ipid', type = 'select', options = [ map { [ $_-ipid, $_-ipaddr] } $iplist-all ], #other = 1,# create Other: box ); # No processing yet } === from Server.pm === Looks OK, doesn't it? Debug shows [CGI::FormBuilder::Field::select::tag] (debug2) ipid: generating select input type [CGI::FormBuilder::Field::tag_value] (debug2) ipid: called $field-tag_value [CGI::FormBuilder::Field::tag_value] (debug2) ipid: sticky ! force [CGI::FormBuilder::Field::cgi_value] (debug2) ipid: called $field-cgi_value [CGI::FormBuilder::Field::tag_value] (debug2) no cgi found, returning def_value [CGI::FormBuilder::Field::def_value] (debug2) ipid: called $field-def_value [CGI::FormBuilder::Field::def_value] (debug2) ipid: def value = () [CGI::FormBuilder::Field::inflate_value] (debug2) ipid: called $field-inflate_value [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94cfd54)) = (,-select-,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b27fc)) = (1,88.212.221.66,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94335cc)) = (23,88.212.221.67,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2b68)) = (24,88.212.221.68,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2bb0)) = (26,88.212.221.69,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3eec)) = (31,88.212.221.71,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3f04)) = (28,88.212.221.72,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3fc4)) = (27,88.212.221.73,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2010)) = (30,88.212.221.74,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2070)) = (2,88.212.221.75,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2088)) = (29,88.212.221.76,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2100)) = (3,88.212.221.77,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b213c)) = (4,88.212.221.78,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94334f4)) = (5,88.212.221.79,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2160)) = (17,88.212.221.81,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b21b4)) = (6,88.212.221.82,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22b0)) = (10,88.212.221.83,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22e0)) = (11,88.212.221.84,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22f8)) = (12,88.212.221.85,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b231c)) = (13,88.212.221.86,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b279c)) = (7,88.212.221.88,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2ab4)) = (8,88.212.221.89,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a367c)) = (25,88.212.221.90,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b25a4)) = (21,88.212.221.92,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b25e0)) = (14,88.212.221.93,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2040)) = (16,88.212.221.94,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2358)) = (9,88.212.221.95,) [CGI::FormBuilder::Field::select::tag] (debug2) ipid: generated tag = select id=ipid name=ipid option value=-select-/option option value=188.212.221.66/option option value=2388.212.221.67/option option value=2488.212.221.68/option option value=2688.212.221.69/option option value=3188.212.221.71/option option value=2888.212.221.72/option option value=2788.212.221.73/option option value=3088.212.221.74/option option
Re: [Catalyst] Google Summer of Code
Be sure to know about, http://code.google.com/apis/opensocial/ OpenSocial provides a common set of APIs for social applications across multiple websites. With standard JavaScript and HTML, developers can create apps that access a social network's friends and update feeds. On 2/26/08, Kieren Diment [EMAIL PROTECTED] wrote: So, it's that time again. I had a thought about this. I quite like some things about facebook. It's a useful way for me to be able to communicate with people I've known since before I left school. But there are two things that really irritate me about it, these are: * Closed single platform with one vendor in control of my data * They make me visit their website, and have pretty piss poor support for rss. Sooo, I thought that it would be interesting to produce a Simple Social Network Comminication Protocol. Essentially gluing existing stuff together like OpenID, FOAF, Various levels of access control, REST and the like to produce a distributed social networking system. That is a web or web-service server to provide a social network for a group, but that can also communicate with other SSNCP servers to provide a distributed social network system. So, I reckon this would be a two year process. Year one would be writing the spec and getting the bits and pieces gathered together and functioning properly on the workshop floor. Year two would involve lots of welding, duct tape and hot glue to get the package together. In year one, the benifit for catalyst is that lots of our bits and pieces get a nice oil and polish. In year two we get a product with a lot of potential to be influential on the applications scene (rather than the architecture scene). Any students out there who are up for applying for this? ___ 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] OT: Recommendations for big-time hosting
Michele Beltrame wrote: Hi! So what's you recommendation for absolutely bullet-proof hosting that let's you sleep at night? I think pair Networks would perfectly do: http://www.pair.com - look into the Dedicated section. Talk to you soon, Michele. Thanks Michele, I have heard many good things about PAIR... I will look into their offerings. Best, Brian ___ 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/
[Catalyst] Catalyst + Class::Workflow
Anyone done any integration with Class::Workflow and mapping object states to actions? I need to get back on the Mango wagon this week and I'm toying with making checkout nothing more than configurable states of an order. My first question is me wondering if checkout states are the same as order states, or if they should/could be two separate workflows. For example, once the customer places an order, we could have the following rather common order states: new processed authorized declined packed shipped refunded returned delivered During the checkout process, we have things like: initialized (create an order from cart) addressed (enter billto/shipto) shipmethod(selected ship method) preview submitted These can technically be states of the order preceding 'new', but I could also envision them as states of the checkout process itself and not necessarily states of the order itself. My other goal is to simply have /checkout/state be the uri structure for checkout, using transitions to kick off various plugins acting against the order. Thoughts? Anyone been down this road with Workflow in Catalyst? -=Chris signature.asc Description: OpenPGP digital signature ___ 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 + Class::Workflow
-Original Message- From: Christopher H. Laco [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 26, 2008 2:05 PM To: The elegant MVC web framework Subject: [Catalyst] Catalyst + Class::Workflow Anyone done any integration with Class::Workflow and mapping object states to actions? I need to get back on the Mango wagon this week and I'm toying with making checkout nothing more than configurable states of an order. My first question is me wondering if checkout states are the same as order states, or if they should/could be two separate workflows. I see them as separate workflows. When working on a site rebuild last year my boss and I addressed this question and we both agreed that a cart and an order are separate things. We drew the line at the point where a user enters billing information, but hasn't yet said submit my order. This is the point at which we copy the cart into an order and tie them together. For example, once the customer places an order, we could have the following rather common order states: new processed authorized declined packed shipped refunded returned delivered During the checkout process, we have things like: initialized (create an order from cart) addressed (enter billto/shipto) shipmethod(selected ship method) preview submitted These can technically be states of the order preceding 'new', but I could also envision them as states of the checkout process itself and not necessarily states of the order itself. My other goal is to simply have /checkout/state be the uri structure for checkout, using transitions to kick off various plugins acting against the order. Thoughts? Anyone been down this road with Workflow in Catalyst? Unfortunately no, but I think carts and workflows are a perfect fit. My controllers have built up too much control-flow logic because I can't do something as neat as... sub auto : Private { my ( $self, $c ) = @_; if ( $c-cart_exists ) { my $valid_action = '/checkout/' . $c-cart-state-stringify; if ( $c-req-action ne $valid_action ) { $c-res-redirect($c-uri_for($valid_action)); $c-detach; } } else { $c-flash-{alert} = Your cart contains zero items, please buy something; $c-res-redirect($c-uri_for('/store')); $c-detach; } } I have much less state-ful cart methods like... $c-cart-is_empty $c-cart-all_items_in_shipments etc... v/r -matt pitts ___ 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] Google Summer of Code
On 27 Feb 2008, at 03:17, Paul Makepeace wrote: Be sure to know about, http://code.google.com/apis/opensocial/ OpenSocial provides a common set of APIs for social applications across multiple websites. With standard JavaScript and HTML, developers can create apps that access a social network's friends and update feeds. Ah yes, I should have mentioned this. OpenSocial is a way to get existing web services talking to each other (and reception has been pretty cool as far as I can see). What it doesn't do is make it easier to write your own social networking application. OTOH perhaps SSNCP should speak a superset of the opensocial API, I don't know I haven't looked at it in much detail. ___ 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] Google Summer of Code
On 27 Feb 2008, at 01:15, Devin Austin wrote: Hi Kieren, I've always been interested in doing some sort of open source deal for social networks. So yes, I'd be interested in applying for this :-) -Devin Sounds good. I think that the deliverables for year one is to 'make it easier for others to write social network applications' - cleaning up and documenting existing social network modules, providing specs for specific functions co. Year two would be about actually packaging it together, into something coherent and off the shelf ... I think ... On Tue, Feb 26, 2008 at 5:59 AM, Kieren Diment [EMAIL PROTECTED] wrote: So, it's that time again. I had a thought about this. I quite like some things about facebook. It's a useful way for me to be able to communicate with people I've known since before I left school. But there are two things that really irritate me about it, these are: [snip] ___ 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] Google Summer of Code
Sounds good. I think that the deliverables for year one is to 'make it easier for others to write social network applications' - cleaning up and documenting existing social network modules, providing specs for specific functions co. Year two would be about actually packaging it together, into something coherent and off the shelf ... I think ... Looks like I'll get to put my PAUSE account to use finally :-) On Tue, Feb 26, 2008 at 1:24 PM, Kieren Diment [EMAIL PROTECTED] wrote: On 27 Feb 2008, at 01:15, Devin Austin wrote: Hi Kieren, I've always been interested in doing some sort of open source deal for social networks. So yes, I'd be interested in applying for this :-) -Devin Sounds good. I think that the deliverables for year one is to 'make it easier for others to write social network applications' - cleaning up and documenting existing social network modules, providing specs for specific functions co. Year two would be about actually packaging it together, into something coherent and off the shelf ... I think ... On Tue, Feb 26, 2008 at 5:59 AM, Kieren Diment [EMAIL PROTECTED] wrote: So, it's that time again. I had a thought about this. I quite like some things about facebook. It's a useful way for me to be able to communicate with people I've known since before I left school. But there are two things that really irritate me about it, these are: [snip] ___ 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/ -- Devin Austin Founder and Head Developer of CodedRight.net http://www.codedright.net - get your web app Coded Right http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost! ___ 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] Google Summer of Code
-Original Message- From: Kieren Diment [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 26, 2008 8:00 AM To: The elegant MVC web framework Subject: [Catalyst] Google Summer of Code So, it's that time again. I had a thought about this. I quite like some things about facebook. It's a useful way for me to be able to communicate with people I've known since before I left school. But there are two things that really irritate me about it, these are: * Closed single platform with one vendor in control of my data * They make me visit their website, and have pretty piss poor support for rss. Sooo, I thought that it would be interesting to produce a Simple Social Network Comminication Protocol. Essentially gluing existing stuff together like OpenID, FOAF, Various levels of access control, REST and the like to produce a distributed social networking system. That is a web or web-service server to provide a social network for a group, but that can also communicate with other SSNCP servers to provide a distributed social network system. So, I reckon this would be a two year process. Year one would be writing the spec and getting the bits and pieces gathered together and functioning properly on the workshop floor. Year two would involve lots of welding, duct tape and hot glue to get the package together. In year one, the benifit for catalyst is that lots of our bits and pieces get a nice oil and polish. In year two we get a product with a lot of potential to be influential on the applications scene (rather than the architecture scene). Any students out there who are up for applying for this? I'm far from being a student, so I couldn't participate via SOC, but I did start to write an all-encompassing library to access Google's GData API a while back for a social networking site that I wanted to launch. I didn't get very far into the project before life took over, but I'd enjoy getting involved in something like that again. Add me to your list of interested folks. v/r -matt pitts ___ 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/
[Catalyst] Re: Needs some help with select and Controller::FormBuilder
Alex Povolotsky wrote: Hello! I'm trying to make a form with select using Controller::FormBuilder. Code is quite straightforward === edit.fb === name: server_edit method: post fields: name: label: Server Name required: 1 type: text size: 60 descr: label: Description type: textarea rows: 4 cols: 60 ipid: label: IP type: select required: 1 === edit.fb === === from Server.pm === sub edit : Local Form { my ($self, $c, $lid, $sid) = @_; if (!defined $lid) { $c-response-redirect($c-uri_for('/location/list')); $c-detach(); } my $form = $self-formbuilder; my $iplist = $c-model('OurIP')-search(undef, {columns = [qw /ipid ipaddr/], order_by = 'ipaddr'}); $c-log-info(join(', ', map { $_-ipid.' '.$_-ipaddr } $iplist-all)); $form-field(name='ipid', type = 'select', options = [ map { [ $_-ipid, $_-ipaddr] } $iplist-all ], #other = 1,# create Other: box ); # No processing yet } === from Server.pm === Looks OK, doesn't it? Debug shows [CGI::FormBuilder::Field::select::tag] (debug2) ipid: generating select input type [CGI::FormBuilder::Field::tag_value] (debug2) ipid: called $field-tag_value [CGI::FormBuilder::Field::tag_value] (debug2) ipid: sticky ! force [CGI::FormBuilder::Field::cgi_value] (debug2) ipid: called $field-cgi_value [CGI::FormBuilder::Field::tag_value] (debug2) no cgi found, returning def_value [CGI::FormBuilder::Field::def_value] (debug2) ipid: called $field-def_value [CGI::FormBuilder::Field::def_value] (debug2) ipid: def value = () [CGI::FormBuilder::Field::inflate_value] (debug2) ipid: called $field-inflate_value [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94cfd54)) = (,-select-,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b27fc)) = (1,88.212.221.66,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94335cc)) = (23,88.212.221.67,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2b68)) = (24,88.212.221.68,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2bb0)) = (26,88.212.221.69,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3eec)) = (31,88.212.221.71,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3f04)) = (28,88.212.221.72,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a3fc4)) = (27,88.212.221.73,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2010)) = (30,88.212.221.74,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2070)) = (2,88.212.221.75,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2088)) = (29,88.212.221.76,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2100)) = (3,88.212.221.77,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b213c)) = (4,88.212.221.78,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94334f4)) = (5,88.212.221.79,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2160)) = (17,88.212.221.81,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b21b4)) = (6,88.212.221.82,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22b0)) = (10,88.212.221.83,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22e0)) = (11,88.212.221.84,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b22f8)) = (12,88.212.221.85,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b231c)) = (13,88.212.221.86,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b279c)) = (7,88.212.221.88,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2ab4)) = (8,88.212.221.89,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94a367c)) = (25,88.212.221.90,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b25a4)) = (21,88.212.221.92,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b25e0)) = (14,88.212.221.93,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2040)) = (16,88.212.221.94,) [CGI::FormBuilder::Field::select::tag] (debug2) optval(ARRAY(0x94b2358)) = (9,88.212.221.95,) [CGI::FormBuilder::Field::select::tag] (debug2) ipid: generated tag = select id=ipid name=ipid option value=-select-/option option value=188.212.221.66/option option value=2388.212.221.67/option option value=2488.212.221.68/option option value=2688.212.221.69/option option value=3188.212.221.71/option option value=2888.212.221.72/option option value=2788.212.221.73/option option
Re: [Catalyst] Testing Catalyst::Controller::REST based controllers
Hi Ash, Everyone, Thanks, that seemed to move me along further. I'm still unable to get the content part of the POST. I'm able to send the username and password through, but for some reason my controller gets empty content. Here is the request I've formed: # with mech object my $t1 = Test::WWW::Mechanize::Catalyst-new; $t1-add_header( 'Content-type' = 'text/x-json' ); $req = new HTTP::Request (POST, http://localhost/rest/something;, ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $res = $t1-request( $req ); ### fails with my Bad Request end In the above request, username and password are processed successfully, but no content is received. I look for the content in $c-req-data. Here is the analogous LWP request: # LWP object $ua = new LWP::UserAgent; $req = new HTTP::Request (POST, http://localhost:3000/rest/ something, ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $req-content_type('text/x-json'); $res = $ua-request($req); ### successfully creates the object end This works fine and creates the object. It seems like the content is not getting passed through to controller when using Mechanize. Any thoughts? Thanks, Damon On Feb 26, 2008, at 12:23 PM, Ash Berlin wrote: On 26 Feb 2008, at 20:20, Damon Snyder wrote: Hi Everyone, I'm developing a Catalyst::Controller::REST based controller in an app that I'm working on. I've created the _GET and _POST methods and now I'm trying to test them. They work fine if I test them using curl from the command line or LWP::UserAgent, but now I'm trying to add tests for them using Test::WWW::Mechanize::Catalyst. I'm having a hard time getting Test::WWW::Mechanize::Catalyst to interact my REST controller. I can build the request fine with HTTP::Request and LWP::UserAgent, but I can't seem to get it to work with Test::WWW::Mechanize::Catalyst. Does anyone have any example code where they were able to get the GET, POST, and PUT to test successfully using Test::WWW::Mechanize::Catalyst? Here is the basic construction of the POST with LWP::UserAgent and Test::More: my $ua = new LWP::UserAgent; $ua-default_header( 'X-Username' = '', 'X-Password' = 'x' ); #my $req = new HTTP::Request POST = http://localhost/rest/ something; $req-content_type('text/x-json'); $req-content(to_json(( { name = bla, foo = haaa } )); my $res = $ua-request($req); ok($res, Request was successful); ok($res-headers-{status} == 201); my $something = from_json($res-content); ok($something-{foo} eq 'haaa'); I could continue with LWP::UserAgent, but it seems easier and more maintainable to use the catalyst mechanize route if possible (testing against other servers, don't need local server running etc). Thanks, Damon sub make_json_request { my ($self, $uri, $data) = @_; my $req = POST( $uri, Content_Type = 'text/json', Content = $self-to_json($data) ); my $res = $self-mech-request($req); return unless $res-code == 200; die JSON request returned 200 but not correct Content-Type (@{[$res-content_type]}) unless $res-header('Content-Type') eq 'text/javascript'; return $self-from_json($res-content); } $self-mech returns a Test:WWW::Mechanize::Catalyst instance. POST method comes from use HTTP::Request::Common; Not that disimilar from what you had, just notice that $mech- request will take a HTTP::Request object as well as just a URI. Ash ___ 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/ Damon Snyder www.influxMEDIA.com (888) 266 6728 x1011 ___ 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] Testing Catalyst::Controller::REST based controllers
On 26 Feb 2008, at 21:43, Damon Snyder wrote: Hi Ash, Everyone, Thanks, that seemed to move me along further. I'm still unable to get the content part of the POST. I'm able to send the username and password through, but for some reason my controller gets empty content. Here is the request I've formed: # with mech object my $t1 = Test::WWW::Mechanize::Catalyst-new; $t1-add_header( 'Content-type' = 'text/x-json' ); $req = new HTTP::Request (POST, http://localhost/rest/something;, ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $res = $t1-request( $req ); ### fails with my Bad Request end In the above request, username and password are processed successfully, but no content is received. I look for the content in $c-req-data. Here is the analogous LWP request: # LWP object $ua = new LWP::UserAgent; $req = new HTTP::Request (POST, http://localhost:3000/rest/something , ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $req-content_type('text/x-json'); $res = $ua-request($req); ### successfully creates the object end Why not just change $ua-request there to $t1-request in your last snippet (i.e. set content_type on the request object, not on the mech object. It probably ignores it when you pass a Request object) ___ 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] Testing Catalyst::Controller::REST based controllers
Hi Ash, Tried that, but no luck. I'm starting to wonder if Test::WWW::Mechanize::Catalyst or Test::WWW::Mechanize is clobbering the content portion of the request... What versions of Test::WWW::Mechanize::Catalyst and Test::WWW::Mechanize are you using? I have 0.41 and 1.18 respectively. Damon On Feb 26, 2008, at 1:50 PM, Ash Berlin wrote: On 26 Feb 2008, at 21:43, Damon Snyder wrote: Hi Ash, Everyone, Thanks, that seemed to move me along further. I'm still unable to get the content part of the POST. I'm able to send the username and password through, but for some reason my controller gets empty content. Here is the request I've formed: # with mech object my $t1 = Test::WWW::Mechanize::Catalyst-new; $t1-add_header( 'Content-type' = 'text/x-json' ); $req = new HTTP::Request (POST, http://localhost/rest/something;, ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $res = $t1-request( $req ); ### fails with my Bad Request end In the above request, username and password are processed successfully, but no content is received. I look for the content in $c-req-data. Here is the analogous LWP request: # LWP object $ua = new LWP::UserAgent; $req = new HTTP::Request (POST, http://localhost:3000/rest/something , ['X-Username' = 'x', 'X-Password' = 'x'], to_json({ stuff }) ); $req-content_type('text/x-json'); $res = $ua-request($req); ### successfully creates the object end Why not just change $ua-request there to $t1-request in your last snippet (i.e. set content_type on the request object, not on the mech object. It probably ignores it when you pass a Request object) ___ 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/
[Catalyst] multiple database model support
hi I just developed a catalyst application and I was wondering how I could get it to support multiple databases. Instead of just one per application. Tyler ___ 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] Google Summer of Code
On Wed, Feb 27, 2008 at 8:07 AM, Matt Pitts [EMAIL PROTECTED] wrote: I'm far from being a student, so I couldn't participate via SOC, but I did start to write an all-encompassing library to access Google's GData API a while back for a social networking site that I wanted to launch. I didn't get very far into the project before life took over, but I'd enjoy getting involved in something like that again. Add me to your list of interested folks. Now, we do need a sponsoring organisation for this, so non students who can claim to be an organisation who want to sponsor this need to step up too. One of the disadvantages of not having a catalyst foundation :-( ___ 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] Testing Catalyst::Controller::REST based controllers
Hi Ash, Ah!!! Ok, here is what ended up working: $req = POST( http://localhost/rest/something;, 'X-Username' = 'x', 'X-Password' = 'x', 'Content_Type' = 'text/json', 'Content' = to_json({ stuff }), ); $res = $t1-request( $req ); my $thisres = $res-previous; ## if you get $res-content it will cause another request to be issued ok($thisres-code == 201); $something = from_json($thisres-content); Note the $res-previous above. I believe what was happening is that your POST suggestion may have been working when I first tried it, but when I did a $res-content to test the result, it was causing another request to be made to the catalyst app which was clobbering the request/response objects. Somewhat unexpected behavior. Maybe it is something you have to look out for when using Test::WWW::Mechanize::Catalyst. Thanks for you help! Damon On Feb 26, 2008, at 2:31 PM, Ash Berlin wrote: On 26 Feb 2008, at 22:20, Damon Snyder wrote: Hi Ash, Tried that, but no luck. I'm starting to wonder if Test::WWW::Mechanize::Catalyst or Test::WWW::Mechanize is clobbering the content portion of the request... What versions of Test::WWW::Mechanize::Catalyst and Test::WWW::Mechanize are you using? I have 0.41 and 1.18 respectively. Damon Same versions, Try using the POST function from HTTP::Request::Common that I showed since I *know* that works for me. ___ 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] Google Summer of Code
erm,I would like to ask the following: Are you reffering to building a framework used to create social networking sites ? Or to create something that analyses the social network site which already exists ? On Tue, Feb 26, 2008 at 3:09 PM, Kieren Diment [EMAIL PROTECTED] wrote: On Wed, Feb 27, 2008 at 8:07 AM, Matt Pitts [EMAIL PROTECTED] wrote: I'm far from being a student, so I couldn't participate via SOC, but I did start to write an all-encompassing library to access Google's GData API a while back for a social networking site that I wanted to launch. I didn't get very far into the project before life took over, but I'd enjoy getting involved in something like that again. Add me to your list of interested folks. Now, we do need a sponsoring organisation for this, so non students who can claim to be an organisation who want to sponsor this need to step up too. One of the disadvantages of not having a catalyst foundation :-( ___ 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/
[Catalyst] Re: Dumb question again: nowCatalyst::Controller::FormBuilder
Peter Sørensen wrote: Maybe FormBuilder don't like: .. fields: name: name: Location name .. You use name as both field and object name. Just a guess. Regards Peter Sorensen/University of Southern Denmark/mail: [EMAIL PROTECTED] -Oprindelig meddelelse- Fra: Alex Povolotsky [mailto:[EMAIL PROTECTED] Sendt: 24. februar 2008 00:25 Til: The elegant MVC web framework Emne: [Catalyst] Dumb question again: nowCatalyst::Controller::FormBuilder [info] *** Request 1 (1.000/s) [43248] [Sun Feb 24 02:05:17 2008] *** [debug] GET request for location/add from 89.222.147.9 [debug] Path is location/add [debug] Form (location/edit): Looking for config file location/edit.fb [debug] Form (location/edit): Found form config /usr/local/traffic/Traffic2/root/forms/location/edit.fb [error] Caught exception in Traffic2::C::Location-add Can't use string (location_edit) as a HASH ref while strict refs in use at /usr/local/lib/perl5/site_perl/5.8.8/CGI/FormBuilder/Source/File.pm line 150. [info] Request took 0.014863s (67.281/s) CGI::FormBulder, running on that file, yields no error File is simple name: location_edit method: post title: Location fields: name: name: Location name type: text size: 60 required: 1 descr: name: Location description type: textarea rows: 4 cols: 60 What has I done wrong?... Alex. ___ 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/ You should use label not name... name: location_edit method: post title: Location fields: label: Location name type: text size: 60 required: 1 descr: label: Location description type: textarea rows: 4 cols: 60 ___ 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] Re: Needs some help with select and Controller::FormBuilder
On 27 Feb 2008, at 08:21, Stephen Sykes wrote: Alex Povolotsky wrote: Hello! I'm trying to make a form with select using Controller::FormBuilder. Code is quite straightforward === edit.fb === name: server_edit method: post [snip spaghetti] Why not map directly from your model... $self-formbuilder-field( name = 'ipid', options = [ map { [ $_-ipid, $_-ipaddr ] } $c-model('OurIP')-all ], ); Any chance you can provide a patch to the documentation for Catalyst::Controller::FormBuilder for that please? By the way, my experience is that sometimes people are reluctant to provide documentation because they fear ridicule due to their poor writing skills. Personally I find that if I write any old crap, then i can edit it later, and a blank piece of paper is always more intimidating than incoherent ramblings. I promise to edit your ramblings if they need it. ___ 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::Authentication::Store::LDAP confusion
On 27 Feb 2008, at 17:30, Richardson, Matthew wrote: Hello, I am trying to following the documentation from CPAN on this, but I am confused. In MyApp.pm I have the following: use Catalyst qw/-Debug ConfigLoader Static::Simple Session Session::State::Cookie Session::Store::FastMmap Authentication Authentication::Store::LDAP Authentication::Credential::Password/; However when I start the Catalyst server with myapp_server.pl -r -d -k the following is ouput: [snip] have you tried reading the tests in the dist? That ought to provide a minimal working example, with the addition of alerting you to any 'orrible edge cases. If not, that's a bug that needs to be fixed. ___ 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 + Class::Workflow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27 Feb 2008, at 06:05, Christopher H. Laco wrote: Anyone done any integration with Class::Workflow and mapping object states to actions? I need to get back on the Mango wagon this week and I'm toying with making checkout nothing more than configurable states of an order. If you do that, do we get Mango::Sugar::EuggghTooRich for a sane default? -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFHxQTMdvUWlc3bSM8RAl7EAJ0aHU5N2TyRF7D+gT9+rH7FHTiaNQCfd7B1 usIwS4+0fYWzYBeAQuW92/Q= =M5+S -END PGP SIGNATURE- ___ 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/