[Catalyst] $row-copy causing exit from controller(!)
I'm seeing something exceedingly odd: copying data causing a premature return from the controller, like a detach(), foreach my $table (@chart_related_tables) { my $rs = $ds-resultset($table); warn copying $table for , $new_chart-uid; for my $row ($rs-search({web_chart_spec_uid = $chart-uid})) { warn ..row , $row-web_chart_spec_uid, $row; $row-copy({web_chart_spec_uid = $new_chart-uid}); # XXX } #$_-copy({web_chart_spec_uid = $new_chart-uid}) #for $rs-search({web_chart_spec_uid = $chart-uid}); die cloned, $new_chart-uid; } There's no further execution past the line marked XXX: the template is rendered from that point on. The die is never called. I have a feeling it's something to do with has_many Chart: __PACKAGE__-has_many(chartview_company = 'IDL::Schema::ChartCompany' = 'web_chart_spec_uid', {cascade_delete = 0}); If I exclude from @chart_related_tables ChartCompany it works. ** I realize there's scads of debug I could provide but wanted to check first this wasn't something someone had run into before. If not, what kind of debug can I provide? DBIC $VERSION = '0.08009'; Catalyst 5.7012 Paul ___ 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: How to print/display some data in an end action
* Andreas Marienborg [EMAIL PROTECTED] [2008-05-01 10:50]: No point in forwarding to end, since that is done automaticly. In which case it would run twice, actually. But maybe he has a more specific `end` action and so forwarding to ::C::Root::end is actually a useful thing to do in his app. As I said, we have seen too little of the code to make any meaningful suggestions. Regards, -- Aristotle Pagaltzis // http://plasmasturm.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] $row-copy causing exit from controller(!)
* On Thu, May 01 2008, Paul Makepeace wrote: I'm seeing something exceedingly odd: copying data causing a premature return from the controller, like a detach(), foreach my $table (@chart_related_tables) { my $rs = $ds-resultset($table); warn copying $table for , $new_chart-uid; for my $row ($rs-search({web_chart_spec_uid = $chart-uid})) { warn ..row , $row-web_chart_spec_uid, $row; $row-copy({web_chart_spec_uid = $new_chart-uid}); # XXX } #$_-copy({web_chart_spec_uid = $new_chart-uid}) #for $rs-search({web_chart_spec_uid = $chart-uid}); die cloned, $new_chart-uid; } Is copy throwing an exception? Are you using an old version of stacktrace? If yes and yes: upgrade StackTrace (it eats exceptions) If no and no: something is horribly wrong (perl -d may help) If yes and no: see above. I have a feeling it's the first one. Another possibility is that copy is last-ing out of itself. Regards, Jonathan Rockway -- print just = another = perl = hacker = if $,=$ ___ 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] $row-copy causing exit from controller(!)
On 1 May 2008, at 13:33, Ash Berlin wrote: On 1 May 2008, at 13:25, Jonathan Rockway wrote: * On Thu, May 01 2008, Paul Makepeace wrote: I'm seeing something exceedingly odd: copying data causing a premature return from the controller, like a detach(), foreach my $table (@chart_related_tables) { my $rs = $ds-resultset($table); warn copying $table for , $new_chart-uid; for my $row ($rs-search({web_chart_spec_uid = $chart- uid})) { warn ..row , $row-web_chart_spec_uid, $row; $row-copy({web_chart_spec_uid = $new_chart-uid}); # XXX } #$_-copy({web_chart_spec_uid = $new_chart-uid}) #for $rs-search({web_chart_spec_uid = $chart-uid}); die cloned, $new_chart-uid; } Is copy throwing an exception? Are you using an old version of stacktrace? If yes and yes: upgrade StackTrace (it eats exceptions) If no and no: something is horribly wrong (perl -d may help) If yes and no: see above. I have a feeling it's the first one. Another possibility is that copy is last-ing out of itself. If also occasionally seen exceptions disappear without stack trace one. Its a right pain to track down what causes it (lots of source diving and perl -d) er... 'I've also stack trace plugin' ___ 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] $row-copy causing exit from controller(!)
On Thu, May 1, 2008 at 1:25 PM, Jonathan Rockway [EMAIL PROTECTED] wrote: * On Thu, May 01 2008, Paul Makepeace wrote: I'm seeing something exceedingly odd: copying data causing a premature return from the controller, like a detach(), foreach my $table (@chart_related_tables) { my $rs = $ds-resultset($table); warn copying $table for , $new_chart-uid; for my $row ($rs-search({web_chart_spec_uid = $chart-uid})) { warn ..row , $row-web_chart_spec_uid, $row; $row-copy({web_chart_spec_uid = $new_chart-uid}); # XXX } #$_-copy({web_chart_spec_uid = $new_chart-uid}) #for $rs-search({web_chart_spec_uid = $chart-uid}); die cloned, $new_chart-uid; } Is copy throwing an exception? Are you using an old version of stacktrace? There's no exception. Imagine a return; and that's what is happening AFAICT. How does one use perl -d in the context of a FastCGI instance? Any other debugging tips? P If yes and yes: upgrade StackTrace (it eats exceptions) If no and no: something is horribly wrong (perl -d may help) If yes and no: see above. I have a feeling it's the first one. Another possibility is that copy is last-ing out of itself. Regards, Jonathan Rockway -- print just = another = perl = hacker = if $,=$ ___ 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: $row-copy causing exit from controller(!)
Hi Paul, * Paul Makepeace [EMAIL PROTECTED] [2008-05-01 17:00]: How does one use perl -d in the context of a FastCGI instance? Any other debugging tips? does your problem happen only with the FastCGI engine or can you reproduce it with others? If you can, well, there you go. Regards, -- Aristotle Pagaltzis // http://plasmasturm.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] Tutorial
Hello gurus, I am newb for Catalyst so forgive me if I ask stupid questions. I have Rockway's book. I followed it. All went good so far (ignore FormBuilder stuff ). Now i want to customize application. Lets say FormBuilder.render gives me submit button automatically (no idea how). But what if I want One Registration button and another Cancel Button. Also Controller file (.PM) file, how can i write my business logic. I know its perl but as I include Catalyst::Controller::FormBuilder...Anychange gives me error. Where to find tutorial for extra METHODS. CGI::FormBuilder has some really nice tutorial online. But how can I do that kind of coding in Catalyst. What should I go through now? Template-Toolkit.org and Formbuilder.org ... Then what extra steps do I need to make Navigating Site with complex Business logic. -- View this message in context: http://www.nabble.com/Tutorial-tp16994039p16994039.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. ___ 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] Using URIs for my app in another program
Hi all I've run into a situation that I can't find a good solution to and am hoping to solicit some ideas from people on the list here. An app I've been working on consists of two main parts - a Catalyst-based web app which provides the UI, and a daemon that does the heavy lifting. They are totally separate applications that talk to one another via database. The daemon will sometimes send emails to users when it finishes certain tasks that the users are interested in, and I want to include links in the emails that would bring the user to a Results page on the web app where they can get more information about the result of the task. So, what I would like is to be able to call $c-uri_for() from my daemon. Is there any 'sanctioned' way of doing that? If possible, I'd like to avoid loading my whole catalyst app and somehow tricking it into believing its running under the same environment as my real app. Another option is to use the database to pass URIs around. Maybe a URI table that maps finished tasks to URIs. However, I would rather just be able to arbitrarily call $c-uri_for() whenever I decide I need to include a URI in my daemon instead of having to create a table or column whenever I decide I want to send a link to a new type of resource. Any suggestions? Maybe I'm just going about it all wrong? Thanks! Byron ___ 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] Using URIs for my app in another program
The most straightforward method I can think of is to factor out the URIs to a common config file. You can have your daemon read in the config file and generate URIs from that. Your Catalyst application can either continue to use base to generate URIs or you can generate some special URIs from the config file as well. The problem with having your daemon load up Catalyst to generate a URI is that I'm not sure how that would work. Catalyst generates URIs given a HTTP request. No HTTP request, no base URI. Another safety measure is that you can have your Catalyst appl do a sanity check against the URI config file to make sure it doesn't become out of date (maybe a startup test request). Rob On Thu, May 1, 2008 at 2:27 PM, Byron Young [EMAIL PROTECTED] wrote: Hi all I've run into a situation that I can't find a good solution to and am hoping to solicit some ideas from people on the list here. An app I've been working on consists of two main parts - a Catalyst-based web app which provides the UI, and a daemon that does the heavy lifting. They are totally separate applications that talk to one another via database. The daemon will sometimes send emails to users when it finishes certain tasks that the users are interested in, and I want to include links in the emails that would bring the user to a Results page on the web app where they can get more information about the result of the task. So, what I would like is to be able to call $c-uri_for() from my daemon. Is there any 'sanctioned' way of doing that? If possible, I'd like to avoid loading my whole catalyst app and somehow tricking it into believing its running under the same environment as my real app. Another option is to use the database to pass URIs around. Maybe a URI table that maps finished tasks to URIs. However, I would rather just be able to arbitrarily call $c-uri_for() whenever I decide I need to include a URI in my daemon instead of having to create a table or column whenever I decide I want to send a link to a new type of resource. Any suggestions? Maybe I'm just going about it all wrong? Thanks! Byron ___ 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] Tutorial
Considere reading the mailist thread about the possibilities for a new book here is the link http://www.gossamer-threads.com/lists/catalyst/users/18157 it will give you a better idea about the state of catalyst documentation and how to find answer Good luck On Thu, May 1, 2008 at 9:17 PM, gaurav001 [EMAIL PROTECTED] wrote: Hello gurus, I am newb for Catalyst so forgive me if I ask stupid questions. I have Rockway's book. I followed it. All went good so far (ignore FormBuilder stuff ). Now i want to customize application. Lets say FormBuilder.render gives me submit button automatically (no idea how). But what if I want One Registration button and another Cancel Button. Also Controller file (.PM) file, how can i write my business logic. I know its perl but as I include Catalyst::Controller::FormBuilder...Anychange gives me error. Where to find tutorial for extra METHODS. CGI::FormBuilder has some really nice tutorial online. But how can I do that kind of coding in Catalyst. What should I go through now? Template-Toolkit.org and Formbuilder.org ... Then what extra steps do I need to make Navigating Site with complex Business logic. -- View this message in context: http://www.nabble.com/Tutorial-tp16994039p16994039.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. ___ 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] Using URIs for my app in another program
Ah, right, I need a HTTP request to get base. I wasn't thinking straight about that. I think storing links in the database is what I'll do, because that leaves the responsibility of generating URIs solely with the catalyst app. If I refactor code or move things around I don't want to have to update my daemon at all. Thanks for your feedback, Robert. Byron From: Robert Krimen [mailto:[EMAIL PROTECTED] Sent: Thursday, May 01, 2008 3:34 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Using URIs for my app in another program The most straightforward method I can think of is to factor out the URIs to a common config file. You can have your daemon read in the config file and generate URIs from that. Your Catalyst application can either continue to use base to generate URIs or you can generate some special URIs from the config file as well. The problem with having your daemon load up Catalyst to generate a URI is that I'm not sure how that would work. Catalyst generates URIs given a HTTP request. No HTTP request, no base URI. Another safety measure is that you can have your Catalyst appl do a sanity check against the URI config file to make sure it doesn't become out of date (maybe a startup test request). Rob On Thu, May 1, 2008 at 2:27 PM, Byron Young [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Hi all I've run into a situation that I can't find a good solution to and am hoping to solicit some ideas from people on the list here. An app I've been working on consists of two main parts - a Catalyst-based web app which provides the UI, and a daemon that does the heavy lifting. They are totally separate applications that talk to one another via database. The daemon will sometimes send emails to users when it finishes certain tasks that the users are interested in, and I want to include links in the emails that would bring the user to a Results page on the web app where they can get more information about the result of the task. So, what I would like is to be able to call $c-uri_for() from my daemon. Is there any 'sanctioned' way of doing that? If possible, I'd like to avoid loading my whole catalyst app and somehow tricking it into believing its running under the same environment as my real app. Another option is to use the database to pass URIs around. Maybe a URI table that maps finished tasks to URIs. However, I would rather just be able to arbitrarily call $c-uri_for() whenever I decide I need to include a URI in my daemon instead of having to create a table or column whenever I decide I want to send a link to a new type of resource. Any suggestions? Maybe I'm just going about it all wrong? Thanks! Byron ___ List: Catalyst@lists.scsys.co.ukmailto: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] Using URIs for my app in another program
On Thu, May 1, 2008 at 4:00 PM, Byron Young [EMAIL PROTECTED] wrote: Ah, right, I need a HTTP request to get base. I wasn't thinking straight about that. I think storing links in the database is what I'll do, because that leaves the responsibility of generating URIs solely with the catalyst app. If I refactor code or move things around I don't want to have to update my daemon at all. Thanks for your feedback, Robert. Another option is to use a distributed cache system like memcached. Pretty easy to setup, and then you can have a warm cache action that populates the configured URIs in the cache. So, your daemon queries cache, if it comes up empty then make a call out to the app to generate the URLs and stuff them in cache. -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] Using URIs for my app in another program
J. Shirley wrote on 2008-05-01: On Thu, May 1, 2008 at 4:00 PM, Byron Young [EMAIL PROTECTED] wrote: Ah, right, I need a HTTP request to get base. I wasn't thinking straight about that. I think storing links in the database is what I'll do, because that leaves the responsibility of generating URIs solely with the catalyst app. If I refactor code or move things around I don't want to have to update my daemon at all. Thanks for your feedback, Robert. Another option is to use a distributed cache system like memcached. Pretty easy to setup, and then you can have a warm cache action that populates the configured URIs in the cache. So, your daemon queries cache, if it comes up empty then make a call out to the app to generate the URLs and stuff them in cache. -J Hey J. Yes, that could work too, but it requires making a call to the catalyst app, which means at least one hard-coded url will be in the daemon. I considered having a page on my app that would just serve up a requested url, which is similar to your proposal, but I'd rather avoid hard-coding any urls in the daemon. Thanks for the suggestion. byron ___ 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] Using URIs for my app in another program
On Thu, May 1, 2008 at 4:53 PM, Byron Young [EMAIL PROTECTED] wrote: Hey J. Yes, that could work too, but it requires making a call to the catalyst app, which means at least one hard-coded url will be in the daemon. I considered having a page on my app that would just serve up a requested url, which is similar to your proposal, but I'd rather avoid hard-coding any urls in the daemon. Thanks for the suggestion. Not necessarily hard-coded; you can store that either A) in the daemon config, B) with the jobs that are sent in or C) in the DB somewhere. ___ 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/