From conrad at mail.watersprite.com.au Mon Sep 1 14:38:47 2008 From: conrad at mail.watersprite.com.au (Conrad Canterford) Date: Mon Sep 1 14:38:58 2008 Subject: [Catalyst] Trouble with loading catalyst app onto different machine Message-ID: <1220276327.8570.32.camel@dellicious.fith.priv> Hi list, My app works just fine on my development machine, but when I copy it onto my live server (on a different machine), it fails with the following whenever I try to access anything past the first page (in this example, accessing something in the "users" controller): Couldn't forward to "Catalyst::Action". Does not implement "process" Couldn't forward to command "users/access_denied": Invalid action or component. This is the first time I've tried to copy it into the live server, so the cause is almost certainly something I don't have installed, or have installed differently, on that machine. My problem is that I cannot figure out what that is. I think its obvious that its attempting to do a forward(), and if I'm reading the messages correctly, its trying to forward to access_denied(), which is presumably called because the user doesn't have permission (using Catalyst::Plugin::Authorization::ACL). I have checked that I have the most recent versions (off CPAN) for Catalyst::Runtime, Catalyst::Devel, and the Authorization and Authentication plugins (on both the development and live machine). I have also checked that it is not caused by running under mod_perl in Apache2 (which it isn't - the same error occurs running the Catalyst server on that machine). I have googled for those error messages (and found the source code for Catalyst::Dispatcher where they reside), but nothing to point me to where to look next. In desperation, I copied the access_denied() code into my base controller class - it formerly lived in Root.pm - on the theory that maybe something was different about the path it was searching to find the code, but to no avail. So, I'm at a loss as to what to look at next. I'm certainly not an experienced Catalyst user (or even a particularly experienced perl user). Any pointers would be appreciated. Thanks, Conrad. From m.e at acm.org Mon Sep 1 14:53:25 2008 From: m.e at acm.org (Martin Ellison) Date: Mon Sep 1 14:53:29 2008 Subject: [Catalyst] Trouble with loading catalyst app onto different machine In-Reply-To: <1220276327.8570.32.camel@dellicious.fith.priv> References: <1220276327.8570.32.camel@dellicious.fith.priv> Message-ID: <7093a26c0809010653i4e4ce04au9812dbb0b9e2fd11@mail.gmail.com> VmVyc2lvbiBtaXNtYXRjaCBpbiB5b3VyIGxpYnJhcmllcz8KCjIwMDgvOS8xIENvbnJhZCBDYW50 ZXJmb3JkIDxjb25yYWRAbWFpbC53YXRlcnNwcml0ZS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LS0tLS0tLS0tLS0tCkFuIEhUTUwgYXR0YWNobWVudCB3YXMgc2NydWJiZWQuLi4KVVJMOiBo dHRwOi8vbGlzdHMuc2NzeXMuY28udWsvcGlwZXJtYWlsL2NhdGFseXN0L2F0dGFjaG1lbnRzLzIw MDgwOTAxL2QxZWEzY2RiL2F0dGFjaG1lbnQuaHRtCg== From oliver.gorwits at oucs.ox.ac.uk Mon Sep 1 21:33:06 2008 From: oliver.gorwits at oucs.ox.ac.uk (Oliver Gorwits) Date: Mon Sep 1 21:33:47 2008 Subject: [Catalyst] Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <48AB53D6.70101@oucs.ox.ac.uk> References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> Message-ID: <48BC5182.6070205@oucs.ox.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oliver Gorwits wrote: > > Moritz Onken wrote: > > possible to add this as a plugin to an existing catalyst | > > application (as an admin panel)? > > For now, you'll still have to set the DBIx::Class Model > configuration separately for LFB, which will mean some > duplication in your configuration. I'll look into fixing that > later. I think the "admin panel" work is now complete, and I've uploaded a new version of LFB to CPAN. As a plugin it scans & loads your DBIC-ish models so you no longer need the config duplication I mention above. CPAN docs and demo site have also been updated: http://search.cpan.org/perldoc?CatalystX::ListFramework::Builder http://dragonstaff.co.uk/oliverg/ regards, oliver. - -- Oliver Gorwits, Network and Telecommunications Group, Oxford University Computing Services -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIvFGC2NPq7pwWBt4RAuk8AKC4UNBZWN4RSjAvMRCew1QziQoCdQCgwEoz wa5yjbywUwule9xFIUyWmCY= =PPGw -----END PGP SIGNATURE----- From conrad at mail.watersprite.com.au Tue Sep 2 13:44:53 2008 From: conrad at mail.watersprite.com.au (Conrad Canterford) Date: Tue Sep 2 13:45:07 2008 Subject: [Catalyst] Trouble with loading catalyst app onto different machine - FIXED In-Reply-To: <7093a26c0809010653i4e4ce04au9812dbb0b9e2fd11@mail.gmail.com> References: <1220276327.8570.32.camel@dellicious.fith.priv> <7093a26c0809010653i4e4ce04au9812dbb0b9e2fd11@mail.gmail.com> Message-ID: <1220359494.8570.98.camel@dellicious.fith.priv> On Mon, 2008-09-01 at 21:53 +0800, Martin Ellison wrote: > Version mismatch in your libraries? Thanks Martin. I guess I was hoping for some suggestions as to which libraries ought to be next on my list of things to try, since I'd already checked all the Catalyst modules were latest versions. However, after lots of trial-and-error, I have tracked it down to the latest version of Catalyst::Plugin::Authorization::ACL (version 0.9). Reverting to 0.8 fixed the problem on both machines. I am much relieved! Conrad. > From enrico.sorcinelli at gmail.com Tue Sep 2 17:59:01 2008 From: enrico.sorcinelli at gmail.com (Enrico Sorcinelli) Date: Tue Sep 2 17:59:03 2008 Subject: [Catalyst] [OT] Catalyst 'celebrities' at Italian Perl Workshop 2008 Message-ID: Hi all, I'm happy and proud to announce that this year at Italian Perl Workshop 2008 (http://conferences.yapceurope.org/ipw2008/) we've invited several Catalyst "celebrities" :-) - Marcus Ramberg - Matt S Trout FYI, IPW2008 will feature also Tim Bunce (Perl DBI interface author, DBD::Oracle and more, more more) and Rafael Garcia-Suarez, lead developer and release manager of the latest Perl interpreter, Perl 5.10 So, the workshop will be an awesome opportunity to meet up with these Catalyst core developers! The workshop will be free of charge and there will be special recruitment sessions (for example, during the workshop, Opera Software will organize recruitment sessions for the participants in which anyone will be able to present his curriculum vitae. It is a great occasion not to lose for who will want to pick the opportunity to work in a highly international working environment!) I hope to see italian subscribers (and not only of course) :-) More info at http://conferences.yapceurope.org/ipw2008/ bye - Enrico From sharath.g at hcl.in Wed Sep 3 05:48:08 2008 From: sharath.g at hcl.in (cranky) Date: Wed Sep 3 05:48:10 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh Message-ID: <19282861.post@talk.nabble.com> Hi, I'm a newbie to catalyst. I have built a small app, similar to the one in catalyst manual (basic CRUD). I have a page wherein a displays its contents after getting it from the database (SQLite3), the problem is, it doesn't display the contents after I refresh the page. I'm using TT2 for html, here it is: ------------------------------------------------------
[% WHILE (item = data.next) %]
[% item.function | html %] [% item.testdate | html %] [% item.tester | html %] [% item.qalead | html %] [% item.nopassed | html %]
------------------------------------------------------- and the perl code looks like this: ------------------------------------------------------- sub ShowData : Local { my ($self, $c) = @_; my $data = $c->model('Ttrack::Ttrack'); $c->stash->{data} = $data; $c->stash->{template} = 'ShowData.tt2'; } ------------------------------------------------------- I generated the modules required under 'Model' by this command: C:\formdata\> perl script\formdata_create.pl model Ttrack DBIC::Schema formdata::Schema::Ttrack create=static dbi:SQLite:database Where am I doing wrong? -- View this message in context: http://www.nabble.com/Database-contents-not-displayed-after-hitting-page-refresh-tp19282861p19282861.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From tuco at pasteur.fr Wed Sep 3 08:04:23 2008 From: tuco at pasteur.fr (Emmanuel Quevillon) Date: Wed Sep 3 08:00:10 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <19282861.post@talk.nabble.com> References: <19282861.post@talk.nabble.com> Message-ID: <48BE36F7.10507@pasteur.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 cranky wrote: > Hi, I'm a newbie to catalyst. I have built a small app, similar to the one in > catalyst manual (basic CRUD). I have a page wherein a displays its > contents after getting it from the database (SQLite3), the problem is, it > doesn't display the contents after I refresh the page. > > I'm using TT2 for html, here it is: > > ------------------------------------------------------ >
> [% WHILE (item = data.next) %] > > > > > > >
[% item.function | html %] [% item.testdate | html %] [% item.tester | html %] [% item.qalead | html %] [% item.nopassed | html %]
> ------------------------------------------------------- > > and the perl code looks like this: > > ------------------------------------------------------- > sub ShowData : Local { > my ($self, $c) = @_; > my $data = $c->model('Ttrack::Ttrack'); > $c->stash->{data} = $data; > $c->stash->{template} = 'ShowData.tt2'; > } > ------------------------------------------------------- > > I generated the modules required under 'Model' by this command: > > C:\formdata\> perl script\formdata_create.pl model Ttrack DBIC::Schema > formdata::Schema::Ttrack create=static dbi:SQLite:database > > Where am I doing wrong? > Hi 'cranky', You need to perform a search in your 'ShowData' function to get data returned by the Resultset of your model 'Ttrack::Ttrack'. At this time, $data is only a resultset object without any data in it. Replace : my $data = $c->model('Ttrack::Ttrack'); with my $data = $c->model('Ttrack::Ttrack')->search(); This will return all the data contained inside your table Ttrack. Hope this will help. Regards Emmanuel - -- - ------------------------- Emmanuel Quevillon Biological Software and Databases Group Institut Pasteur +33 1 44 38 95 98 tuco at_ pasteur dot fr - ------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIvjb35ox+AMIKvTIRAhYfAKCDIRe8iSvmfVCDxhqDQ6jIDvB1rACeK6pQ K02JPJ6tRrarACA+k+fHIAk= =NaFY -----END PGP SIGNATURE----- From sharath.g at hcl.in Wed Sep 3 09:53:35 2008 From: sharath.g at hcl.in (cranky) Date: Wed Sep 3 09:53:39 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <19282861.post@talk.nabble.com> References: <19282861.post@talk.nabble.com> Message-ID: <19285334.post@talk.nabble.com> It's working now. Thanx Emmanuel, that really helped. cranky wrote: > > Hi, I'm a newbie to catalyst. I have built a small app, similar to the one > in catalyst manual (basic CRUD). I have a page wherein a displays > its contents after getting it from the database (SQLite3), the problem is, > it doesn't display the contents after I refresh the page. > > I'm using TT2 for html, here it is: > > ------------------------------------------------------ >
> [% WHILE (item = data.next) %] > > > > > > >
[% item.function | html %] [% item.testdate | html %] [% item.tester | html %] [% item.qalead | html %] [% item.nopassed | html %]
> ------------------------------------------------------- > > and the perl code looks like this: > > ------------------------------------------------------- > sub ShowData : Local { > my ($self, $c) = @_; > my $data = $c->model('Ttrack::Ttrack'); > $c->stash->{data} = $data; > $c->stash->{template} = 'ShowData.tt2'; > } > ------------------------------------------------------- > > I generated the modules required under 'Model' by this command: > > C:\formdata\> perl script\formdata_create.pl model Ttrack DBIC::Schema > formdata::Schema::Ttrack create=static dbi:SQLite:database > > Where am I doing wrong? > > -- View this message in context: http://www.nabble.com/Database-contents-not-displayed-after-hitting-page-refresh-tp19282861p19285334.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From sharath.g at hcl.in Wed Sep 3 09:55:35 2008 From: sharath.g at hcl.in (cranky) Date: Wed Sep 3 09:55:38 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <48BE36F7.10507@pasteur.fr> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> Message-ID: <19285358.post@talk.nabble.com> It's working now. Thanx Emmanuel, that really helped. Emmanuel Quevillon-3 wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > cranky wrote: >> Hi, I'm a newbie to catalyst. I have built a small app, similar to the >> one in >> catalyst manual (basic CRUD). I have a page wherein a displays >> its >> contents after getting it from the database (SQLite3), the problem is, it >> doesn't display the contents after I refresh the page. >> >> I'm using TT2 for html, here it is: >> >> ------------------------------------------------------ >>
>> [% WHILE (item = data.next) %] >> >> >> >> >> >> >>
[% item.function | html %] [% item.testdate | html %] [% item.tester | html %] [% item.qalead | html %] [% item.nopassed | html %]
>> ------------------------------------------------------- >> >> and the perl code looks like this: >> >> ------------------------------------------------------- >> sub ShowData : Local { >> my ($self, $c) = @_; >> my $data = $c->model('Ttrack::Ttrack'); >> $c->stash->{data} = $data; >> $c->stash->{template} = 'ShowData.tt2'; >> } >> ------------------------------------------------------- >> >> I generated the modules required under 'Model' by this command: >> >> C:\formdata\> perl script\formdata_create.pl model Ttrack DBIC::Schema >> formdata::Schema::Ttrack create=static dbi:SQLite:database >> >> Where am I doing wrong? >> > > Hi 'cranky', > > You need to perform a search in your 'ShowData' function to get data > returned by the Resultset of your model 'Ttrack::Ttrack'. > At this time, $data is only a resultset object without any data in it. > Replace : > > my $data = $c->model('Ttrack::Ttrack'); > > with > > my $data = $c->model('Ttrack::Ttrack')->search(); > > This will return all the data contained inside your table Ttrack. > > Hope this will help. > > Regards > > Emmanuel > > > - -- > - ------------------------- > Emmanuel Quevillon > Biological Software and Databases Group > Institut Pasteur > +33 1 44 38 95 98 > tuco at_ pasteur dot fr > - ------------------------- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFIvjb35ox+AMIKvTIRAhYfAKCDIRe8iSvmfVCDxhqDQ6jIDvB1rACeK6pQ > K02JPJ6tRrarACA+k+fHIAk= > =NaFY > -----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/ > > -- View this message in context: http://www.nabble.com/Database-contents-not-displayed-after-hitting-page-refresh-tp19282861p19285358.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From dbix-class at trout.me.uk Wed Sep 3 10:22:44 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 10:22:44 2008 Subject: [Catalyst] "Global $r object is not available" error In-Reply-To: <262E1ADF5FD0804084DA243718F5E4E003416F1B@excnapsd01.NAPS.napent.com> References: <262E1ADF5FD0804084DA243718F5E4E003416F1B@excnapsd01.NAPS.napent.com> Message-ID: <20080903092244.GV4964@agaton.scsys.co.uk> On Wed, Aug 27, 2008 at 05:22:12PM -0700, Bowei Chi wrote: > Hi List, > > > > I'm configuring apache mod_perl to work with Catalyst according to the > cookbook, but this error showed up when I restarts apache. It occurs > when my catalyst application tries to start up by calling > "__PACKAGE__->setup;" > > > > [error] Global $r object is not available. Set: > > PerlOptions +GlobalRequest > > in httpd.conf at /usr/lib/perl5/5.8.6/CGI.pm line 361. > > Compilation failed in require at (eval 2) line 3. Hrm. Catalyst under mod_perl shouldn't need CGI - Catalyst itself uses CGI::Simple. So I think the problem is something you've loaded, not Catalyst core. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Wed Sep 3 10:29:33 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 10:29:32 2008 Subject: [Catalyst] Intermittent blank pages In-Reply-To: <1219938271.48b6c7df102df@mail.funkreich.de> References: <1219938271.48b6c7df102df@mail.funkreich.de> Message-ID: <20080903092933.GW4964@agaton.scsys.co.uk> On Thu, Aug 28, 2008 at 05:44:31PM +0200, Tobias Kremer wrote: > Quoting Wade.Stuart@fallon.com: > > Tobias Kremer wrote on 08/28/2008 09:02:24 AM: > > > Quoting Sebastian Willert : > > > > Are you using Perlbal in front of FastCGI? Perlbal is prone to deliver > > > > blank pages if the back-end times out. Unfortunately I haven't found > > > > a way to avoid this behavior, but maybe someone on the list can help > > > > out ... > > > No, we're using lighttpd and nothing changed on that front during the > > last two > > > days :( > > Are they delivered instantly or after a long pause? > > Instantly. > > I just noticed that shortly after a series of those errors appear in the error > log, the process gets killed off (and restarted) by daemontools' softlimit due > to memory constraints. You might want to load Catalyst::Plugin::AutoRestart as well so the processes restart themselves gracefully at the end of a request before it hits the softlimit. I notice downthread you've solved the underlying problem, but adding AutoRestart into your setup would mean that if something similar goes wrong again you'll avoid the firing blanks problem. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From list at funkreich.de Wed Sep 3 10:57:27 2008 From: list at funkreich.de (Tobias Kremer) Date: Wed Sep 3 10:54:26 2008 Subject: [Catalyst] Intermittent blank pages In-Reply-To: <20080903092933.GW4964@agaton.scsys.co.uk> References: <1219938271.48b6c7df102df@mail.funkreich.de> <20080903092933.GW4964@agaton.scsys.co.uk> Message-ID: <1220435847.48be5f8751bf8@mail.funkreich.de> Quoting Matt S Trout : > You might want to load Catalyst::Plugin::AutoRestart as well so the processes > restart themselves gracefully at the end of a request before it hits the > softlimit. Awesome! Didn't know this plugin existed! I'll give it a try. > I notice downthread you've solved the underlying problem, but adding > AutoRestart into your setup would mean that if something similar goes wrong > again you'll avoid the firing blanks problem. Yes, the memory leak in Rose::HTML::Form caused the application to grow _very_ rapidly in size leading to many process restarts in the middle of a request. I suppose the blank page still shows up from time to time, but much less often. The plugin you mentioned should solve this once and for all though. --Tobias From dbix-class at trout.me.uk Wed Sep 3 10:57:14 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 10:57:12 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <48BE36F7.10507@pasteur.fr> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> Message-ID: <20080903095714.GC4964@agaton.scsys.co.uk> On Wed, Sep 03, 2008 at 09:04:23AM +0200, Emmanuel Quevillon wrote: > You need to perform a search in your 'ShowData' function to get data > returned by the Resultset of your model 'Ttrack::Ttrack'. > At this time, $data is only a resultset object without any data in it. > Replace : > > my $data = $c->model('Ttrack::Ttrack'); > > with > > my $data = $c->model('Ttrack::Ttrack')->search(); No, don't do that. Those two lines are exactly equivalent except that ->search will cause a completely pointless clone of the resultset. $c->model('Ttrack::Ttrack') is -already- a resultset for the whole table. That's why there's something in there to search on. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Wed Sep 3 10:57:51 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 10:57:49 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <19282861.post@talk.nabble.com> References: <19282861.post@talk.nabble.com> Message-ID: <20080903095751.GD4964@agaton.scsys.co.uk> On Tue, Sep 02, 2008 at 09:48:08PM -0700, cranky wrote: > > Hi, I'm a newbie to catalyst. I have built a small app, similar to the one in > catalyst manual (basic CRUD). I have a page wherein a displays its > contents after getting it from the database (SQLite3), the problem is, it > doesn't display the contents after I refresh the page. So it works on the first request but not on the second? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From sharath.g at hcl.in Wed Sep 3 11:33:27 2008 From: sharath.g at hcl.in (SHARATH GOPINATH RAO, Chennai) Date: Wed Sep 3 11:34:10 2008 Subject: [Catalyst] Database contents not displayed after hitting pagerefresh In-Reply-To: <20080903095714.GC4964@agaton.scsys.co.uk> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> <20080903095714.GC4964@agaton.scsys.co.uk> Message-ID: <4F46355018A3AE4DA8D8EDF41775A34C027CAACD@CHN-HCLT-EVS04.HCLT.CORP.HCL.IN> Matt: "So it works on the first request but not on the second?" Yes, it works on the first request and not on second. But, after changing it to this: $data = $c->model('Ttrack::Ttrack')->search(); it's working fine, although any more suggestions are welcome. Thanks -----Original Message----- From: Matt S Trout [mailto:dbix-class@trout.me.uk] Sent: Wednesday, September 03, 2008 3:27 PM To: tuco@pasteur.fr; The elegant MVC web framework Subject: Re: [Catalyst] Database contents not displayed after hitting pagerefresh On Wed, Sep 03, 2008 at 09:04:23AM +0200, Emmanuel Quevillon wrote: > You need to perform a search in your 'ShowData' function to get data > returned by the Resultset of your model 'Ttrack::Ttrack'. > At this time, $data is only a resultset object without any data in it. > Replace : > > my $data = $c->model('Ttrack::Ttrack'); > > with > > my $data = $c->model('Ttrack::Ttrack')->search(); No, don't do that. Those two lines are exactly equivalent except that ->search will cause a completely pointless clone of the resultset. $c->model('Ttrack::Ttrack') is -already- a resultset for the whole table. That's why there's something in there to search on. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ _______________________________________________ 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/ DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From orasnita at gmail.com Wed Sep 3 11:45:47 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Wed Sep 3 11:50:20 2008 Subject: [Catalyst] Intermittent blank pages References: <1219938271.48b6c7df102df@mail.funkreich.de> <20080903092933.GW4964@agaton.scsys.co.uk> Message-ID: <4334AD30B2B2487C935ADA44DAFD2516@octavian> From: "Matt S Trout" > You might want to load Catalyst::Plugin::AutoRestart as well so the processes > restart themselves gracefully at the end of a request before it hits the > softlimit. Do you know if there is a similar solution that can be used under Windows? Catalyst::Plugin::AutoRestart requires Proc::ProcessTable which can't be installed under Windows. Thanks. Octavian From dbix-class at trout.me.uk Wed Sep 3 16:05:31 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 16:05:30 2008 Subject: [Catalyst] Database contents not displayed after hitting pagerefresh In-Reply-To: <4F46355018A3AE4DA8D8EDF41775A34C027CAACD@CHN-HCLT-EVS04.HCLT.CORP.HCL.IN> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> <20080903095714.GC4964@agaton.scsys.co.uk> <4F46355018A3AE4DA8D8EDF41775A34C027CAACD@CHN-HCLT-EVS04.HCLT.CORP.HCL.IN> Message-ID: <20080903150531.GF4964@agaton.scsys.co.uk> On Wed, Sep 03, 2008 at 04:03:27PM +0530, SHARATH GOPINATH RAO, Chennai wrote: > > Matt: "So it works on the first request but not on the second?" > > Yes, it works on the first request and not on second. But, after > changing it to this: $data = $c->model('Ttrack::Ttrack')->search(); > it's working fine, although any more suggestions are welcome. You have an ancient version of something then that's caching the resultset. Upgrade Catalyst::Model::DBIC::Schema and DBIx::Class. ->search() is just a copy constructor. Emanuelle doesn't know what the fuck he's talking about. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Wed Sep 3 16:15:48 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 3 16:15:46 2008 Subject: [Catalyst] Intermittent blank pages In-Reply-To: <4334AD30B2B2487C935ADA44DAFD2516@octavian> References: <20080903092933.GW4964@agaton.scsys.co.uk> <4334AD30B2B2487C935ADA44DAFD2516@octavian> Message-ID: <20080903151548.GI4964@agaton.scsys.co.uk> On Wed, Sep 03, 2008 at 01:45:47PM +0300, Octavian Rasnita wrote: > From: "Matt S Trout" > > You might want to load Catalyst::Plugin::AutoRestart as well so the processes > > restart themselves gracefully at the end of a request before it hits the > > softlimit. > > Do you know if there is a similar solution that can be used under Windows? Write one and send it to the authors, I'm sure they'd be happy to take a patch. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From m9tn-oh4c at xemaps.com Wed Sep 3 16:59:00 2008 From: m9tn-oh4c at xemaps.com (ivorw) Date: Wed Sep 3 16:59:05 2008 Subject: [Catalyst] Database contents not displayed after hitting page refresh In-Reply-To: <20080903095714.GC4964@agaton.scsys.co.uk> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> <20080903095714.GC4964@agaton.scsys.co.uk> Message-ID: <48BEB444.2020800@tiscali.co.uk> Matt S Trout wrote: > On Wed, Sep 03, 2008 at 09:04:23AM +0200, Emmanuel Quevillon wrote: > >> You need to perform a search in your 'ShowData' function to get data >> returned by the Resultset of your model 'Ttrack::Ttrack'. >> At this time, $data is only a resultset object without any data in it. >> Replace : >> >> my $data = $c->model('Ttrack::Ttrack'); >> >> with >> >> my $data = $c->model('Ttrack::Ttrack')->search(); >> > > No, don't do that. > > Those two lines are exactly equivalent except that ->search will cause > a completely pointless clone of the resultset. > > $c->model('Ttrack::Ttrack') is -already- a resultset for the whole table. > > That's why there's something in there to search on. > I presume that what ->search gives you depends on the context. my @data = $c->model('Ttrack::Ttrack')->search; will give you an array of row objects, though I would expect to use ->all as we are not specifying any search criteria to go into the where clause. In scalar context, ->find will get you just the row that you want. From danielmcbrearty at gmail.com Thu Sep 4 15:10:18 2008 From: danielmcbrearty at gmail.com (Daniel McBrearty) Date: Thu Sep 4 15:10:21 2008 Subject: [Catalyst] Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <48BC5182.6070205@oucs.ox.ac.uk> References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> <48BC5182.6070205@oucs.ox.ac.uk> Message-ID: <9cf113670809040710m11f972f1k9efe64a57c4cee2e@mail.gmail.com> this is really very impressive. Thanks! From danielmcbrearty at gmail.com Thu Sep 4 15:11:26 2008 From: danielmcbrearty at gmail.com (Daniel McBrearty) Date: Thu Sep 4 15:11:30 2008 Subject: [Catalyst] Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <9cf113670809040710m11f972f1k9efe64a57c4cee2e@mail.gmail.com> References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> <48BC5182.6070205@oucs.ox.ac.uk> <9cf113670809040710m11f972f1k9efe64a57c4cee2e@mail.gmail.com> Message-ID: <9cf113670809040711j5de0202cq70355f9723f15724@mail.gmail.com> one question though, for the hard of understanding (me) : is the schema layout exposed to the client side js in any way? From oliver.gorwits at oucs.ox.ac.uk Fri Sep 5 00:11:52 2008 From: oliver.gorwits at oucs.ox.ac.uk (Oliver Gorwits) Date: Fri Sep 5 00:11:58 2008 Subject: [Catalyst] Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <9cf113670809040711j5de0202cq70355f9723f15724@mail.gmail.com> References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> <48BC5182.6070205@oucs.ox.ac.uk> <9cf113670809040710m11f972f1k9efe64a57c4cee2e@mail.gmail.com> <9cf113670809040711j5de0202cq70355f9723f15724@mail.gmail.com> Message-ID: <48C06B38.8030806@oucs.ox.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Daniel, Daniel McBrearty wrote: > one question though, for the hard of understanding (me) : is the > schema layout exposed to the client side js in any way? Not especially, no. The way LFB works is to poke at your DBIx::Class model(s) during the request handling phase, and generate a data structure with all kinds of information about the schema. This is used by templates in the View to customize the Javascript which is then sent to the browser. What the browser receives is essentially custom-written Javascript for that schema, but there's no knowledge of the schema. You can of course see the Javascript generated in the HTML source. You can also see the data structure I mentioned above by retrieving a path like //
/dumpmeta - this will return a blob of JSON which describes what LFB needs to know to write the UI for that table. I hope that helps, regards, oliver. - -- Oliver Gorwits, Network and Telecommunications Group, Oxford University Computing Services -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIwGs42NPq7pwWBt4RAtdEAKCwU+OLHu6QXgySNXjeO3HEZoc43gCePf5A n9/E4XgDgY8znq56uUUatBQ= =ZCZi -----END PGP SIGNATURE----- From jon at jrock.us Fri Sep 5 06:07:14 2008 From: jon at jrock.us (Jonathan Rockway) Date: Fri Sep 5 06:07:17 2008 Subject: [Catalyst] Duplicate entries with C::P::Session::Store::DBIC and MySQL - new findings In-Reply-To: <1219823674.48b5083adadc6@mail.funkreich.de> (Tobias Kremer's message of "Wed, 27 Aug 2008 09:54:34 +0200") References: <1219736879.48b3b52f251fc@mail.funkreich.de> <1219753098.48b3f48a9cab2@mail.funkreich.de> <20080826201239.GE26135@li3-126.members.linode.com> <1219823674.48b5083adadc6@mail.funkreich.de> Message-ID: <87prnjp4e5.fsf@bar.jrock.us> * On Wed, Aug 27 2008, Tobias Kremer wrote: > Quoting Daniel Westermann-Clark : > >> On 2008-08-26 14:18:18 +0200, Tobias Kremer wrote: >> > Just out of pure curiosity: Why is it that there are dedicated >> > "flash:" entries in the storage for the flash? Wouldn't the >> > session be enough? >> >> The "flash:" rows were used for compatibility with Store::DBI. We can >> break compatibility if people find the it not very useful. > > We definitely should! IMHO five queries per request to the database just for the > session and flash stuff is inacceptable. If your app is really slowed by the number of queries to load session/flash, use this: http://git.jrock.us/?p=Catalyst-Plugin-Session-HMAC.git;a=blob;f=lib/Catalyst/Plugin/Session/HMAC.pm;hb=HEAD Regards, Jonathan Rockway -- print just => another => perl => hacker => if $,=$" From list at funkreich.de Fri Sep 5 08:45:31 2008 From: list at funkreich.de (Tobias Kremer) Date: Fri Sep 5 08:42:30 2008 Subject: [Catalyst] Duplicate entries with C::P::Session::Store::DBIC and MySQL - new findings In-Reply-To: <87prnjp4e5.fsf@bar.jrock.us> References: <1219736879.48b3b52f251fc@mail.funkreich.de> <1219753098.48b3f48a9cab2@mail.funkreich.de> <20080826201239.GE26135@li3-126.members.linode.com> <1219823674.48b5083adadc6@mail.funkreich.de> <87prnjp4e5.fsf@bar.jrock.us> Message-ID: <1220600731.48c0e39b07ac4@mail.funkreich.de> Quoting Jonathan Rockway : > * On Wed, Aug 27 2008, Tobias Kremer wrote: > > We definitely should! IMHO five queries per request to the database just > > for the session and flash stuff is inacceptable. > If your app is really slowed by the number of queries to load > session/flash, use this: Hmm .. That wasn't really my point. I was trying to say that it should theoretically be possible to reduce the database queries from 5 down to 2 without losing any of the functionality just by changing the way the flash DBIC storage is implemented. On a side note: I have replaced all my $c->flash calls with a custom method that stores the flash message in the already existent $c->session hash. I haven't had a single "duplicate entry" error since that change. So implementing the suggested change would eliminate the race condition, too. Unfortunately I haven't had any luck patching the existing DBIC session store to utilize the session instead of separate "flash:" entries :( --Tobias From perlweb at cosmicperl.com Fri Sep 5 22:19:40 2008 From: perlweb at cosmicperl.com (Lyle) Date: Fri Sep 5 22:19:53 2008 Subject: [Catalyst] Perl Certified Hosting Message-ID: <48C1A26C.6060607@cosmicperl.com> Perl Certified Hosting The idea for this project was put forth by Amias of Bristol & Bath Perl Mongers. We are creating a Perl Certified Hosting scheme that will be open for all hosting companies to join. Requirements will include a set list of web related Perl Modules and proper webserver configuration. Please visit the site:- http://www.perlcertifiedhosting.com For more details and to get involved with helping this scheme become a reality. We'd like to at least have a representative from all the main web frameworks. From pm at flodhest.net Mon Sep 8 09:57:13 2008 From: pm at flodhest.net (Jan Henning Thorsen) Date: Mon Sep 8 09:57:16 2008 Subject: [Catalyst] [Announce] Catalyst-Runtime 5.7099_01 - Developer Release In-Reply-To: <20080824180143.GF14534@agaton.scsys.co.uk> References: <7E822796-9E13-47EF-A09E-41952F516F49@nordaaker.com> <20080720001320.GY4853@agaton.scsys.co.uk> <20080721213250.GQ14534@agaton.scsys.co.uk> <20080824180143.GF14534@agaton.scsys.co.uk> Message-ID: <1afcfe7a0809080157p1fb1d526l6a18b862e28d8bda@mail.gmail.com> On Sun, Aug 24, 2008 at 8:01 PM, Matt S Trout wrote: > > On Tue, Aug 12, 2008 at 12:27:26PM -0400, Charles Bailey wrote: > > On Mon, Jul 21, 2008 at 5:32 PM, Matt S Trout wrote: > > > On Mon, Jul 21, 2008 at 07:13:37AM -0400, Charles Bailey wrote: > > >> Agreed. I've had it on TODO for the past two weeks, but getting > > >> hammered at dayjob. Will try to do this week. > > > > > > We're one more dev release short of shipping. Please try because otherwise > > > it'll probably have to wait until 5.80 > > > > Patch attached, following a severe tuit drought. I'm sorry I was > > unable to turn it around faster, but I hope it's useful for the > > future. > > > > The dispatcher change is trivial; most of the size is tests. These > > are modelled closely on existing tests, with the thought that > > consistency in the test suite is better than streamlining each case. > > The dispatcher change is sadly insufficient. > > Because visit() returns, you really need to reset action and namespace. > > local is one option, simple code to do so another. > > Hi, Here's another *go* on "go" and "visit": http://flodhest.net/files/perl/catalyst-go/ All tests succeed. I've also added some tests that check if you're trying to ->go() to a view/model. -- Best regards, Jan Henning Thorsen http://flodhest.net From yadav.tirveni at gmail.com Mon Sep 8 15:24:02 2008 From: yadav.tirveni at gmail.com (tirveni yadav) Date: Mon Sep 8 15:24:08 2008 Subject: [Catalyst] Perl Catalyst : lexical error not displayed Message-ID: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> Hi, I am facing some issues in catalyst since upgrade to perl 5.10 from 5.8 in Debian 4.1 . Item 1) I am finding it hard to locate errors because of this : When a variable is not declared lexically: my $title =3D "Temp" ; #works fine whereas $title =3D "Temp" ; #Unknown Error These Messages are Displayed with different options for the error above : i) Running 'script/testapp_server.pl' with results in this error :: Unknown error Compilation failed in require at /usr/share/perl5/Catalyst/Utils.pm line 270. Compilation failed in require at script/testapp_server.pl line 55. ii) When running with restart option 'script/testapp_server.pl' results in this error :: [info] Testapp powered by Catalyst 5.7014 You can connect to your server at http://saturn:3000 File "/hm/Testapp/lib/Testapp/Controller/Author.pm" modified, not restarting ***************************************************************************= ***** Unknown error Compilation failed in require at (eval 1300) line 1. ***************************************************************************= ***** As No other error messages are displayed, it becomes difficult to locate erroneous line Item 2) Running 'script/testapp_server.pl' displays these warnings Subroutine can redefined at /usr/share/perl/5.10/mro.pm line 23. Subroutine method redefined at /usr/share/perl/5.10/mro.pm line 25. Subroutine method redefined at /usr/share/perl/5.10/mro.pm line 33. Versions: Perl Version : 5.10.0 libcatalyst-perl : 5.7014-1 libmro-compat-perl: 0.09-1 Debian : Linux version 2.6.18-3-k7 (Debian 2.6.18-7) -- = Regards, Tirveni Yadav What is this Universe ? From what it arises ? Into what does it go? In freedom it arises, In freedom it rests and into freedom it melts away. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080908/6d99b= 870/attachment.htm From bobtfish at bobtfish.net Mon Sep 8 18:30:09 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Mon Sep 8 18:30:11 2008 Subject: [Catalyst] Perl Catalyst : lexical error not displayed In-Reply-To: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> References: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> Message-ID: <1673BC87-25B5-4618-A89E-7ACE8E7EA1C5@bobtfish.net> On 8 Sep 2008, at 15:24, tirveni yadav wrote: > Hi, > > I am facing some issues in catalyst since upgrade to perl 5.10 > from 5.8 in Debian 4.1 . > > Item 1) > I am finding it hard to locate errors because of this : > When a variable is not declared lexically: > my $title = "Temp" ; #works fine whereas > $title = "Temp" ; #Unknown Error > > These Messages are Displayed with different options for the > error above : > i) > Running 'script/testapp_server.pl' with results in this error :: > > Unknown error > Compilation failed in require at /usr/share/perl5/Catalyst/Utils.pm > line 270. > Compilation failed in require at script/testapp_server.pl line 55. This is a bug in perl 5.10, and isn't anything to do with Catalyst / there isn't anything Catalyst can do about it... Sorry. Cheers t0m From josef.chladek at gmail.com Mon Sep 8 19:07:34 2008 From: josef.chladek at gmail.com (Josef Chladek) Date: Mon Sep 8 19:07:38 2008 Subject: [Catalyst] Perl Catalyst : lexical error not displayed In-Reply-To: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> References: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> Message-ID: <085499B3-B2AC-42C2-99DC-DCBD88DEEF85@gmail.com> Am 08.09.2008 um 16:24 schrieb tirveni yadav: > Hi, > > I am facing some issues in catalyst since upgrade to perl 5.10 from > 5.8 in Debian 4.1 . > > Item 1) > I am finding it hard to locate errors because of this : > When a variable is not declared lexically: > my $title = "Temp" ; #works fine whereas > $title = "Temp" ; #Unknown Error > > These Messages are Displayed with different options for the > error above : > i) > Running 'script/testapp_server.pl' with results in this error :: > > Unknown error > Compilation failed in require at /usr/share/perl5/Catalyst/Utils.pm > line 270. > Compilation failed in require at script/testapp_server.pl line 55. you have to patch and compile perl 5.10 yourself, the patch is described here http://www.nntp.perl.org/group/perl.perl5.changes/2008/02/msg21106.html download perl5.10 (http://www.cpan.org/src/perl-5.10.0.tar.gz), before ./Configure patch file toke.c (toplevel) line 692 #else parser->nexttoke = 0; #endif + parser->error_count = oparser ? oparser->error_count : 0; parser->copline = NOLINE; parser->lex_state = LEX_NORMAL; parser->expect = XSTATE; that's it, ./Confiure;make . I don't know if there's a deb-file of a patched perl around... josef From rw8cat at verizon.net Mon Sep 8 20:21:55 2008 From: rw8cat at verizon.net (Russ Weight) Date: Mon Sep 8 20:22:25 2008 Subject: [Catalyst] Re: make catalyst_par - Error 2 In-Reply-To: <4859E23E.9010704@verizon.net> References: <4859E23E.9010704@verizon.net> Message-ID: <48C57B53.303@verizon.net> Help? I set this aside for awhile and went with the standard deployment. I came back to it last week, and my first attempt just worked. However, on subsequent updates, I get the same error as before. I have found some emails that imply that if I "clean things up", it will work. Can anyone provide some clarification? What types of problems lead to these errors? What should I be looking for? - Russ Russ Weight wrote: > Hi, > > I have been trying to do a PAR deployment, however, when I run "make > catalyst_par", it appears to run fine for awhile, but ends with: > > Writing PAR "ipw.par" > > make: *** [catalyst_par] Error 2 > > After much digging, I found where the error is occurring in the > _execute method of > Module::ScanDeps ($VERSION = '0.84') at the following line: > > system($perl, (map { "-I$_" } @IncludeLibs), $fname) == 0 or die > "SYSTEM ERROR in executing $file: $?"; > > In this particular case, @IncludeLibs is empty. I'm not sure if that > is significant... > $perl and $fname have reasonable values. > > I appreciate any help in understanding this. Is it a bug? Or does it > indicate that something is missing from my Makefile.PL? > > Is there additional information that I should provide? > > Thanks, > > - Russ > > From jjn1056 at yahoo.com Mon Sep 8 20:29:32 2008 From: jjn1056 at yahoo.com (John Napiorkowski) Date: Mon Sep 8 20:29:38 2008 Subject: [Catalyst] Catamoose Interviews Part Two, Matt S. Trout speaks! Message-ID: <119216.91085.qm@web30403.mail.mud.yahoo.com> The project to port Catalyst to Moose continues. An interview with Core Team Member, Matt S. Trout, reports on this project's progress. If you are interested in where Catalyst is going as we finish up 2008, or would just like to hear Matt's thoughts about the project and community, you can read the full text: http://jjnapiorkowski.vox.com/library/post/catamoose-part-two-mst-speaks.html I personally would be gratefully for any and all feedback either directly on the blog or via this mailing list. Sincerely, John Napiorkowski From solar345 at gmail.com Tue Sep 9 06:08:05 2008 From: solar345 at gmail.com (Antano Solar John) Date: Tue Sep 9 06:08:18 2008 Subject: [Catalyst] Re: Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <48BC5182.6070205@oucs.ox.ac.uk> (Oliver Gorwits's message of "Mon, 01 Sep 2008 21:33:06 +0100") References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> <48BC5182.6070205@oucs.ox.ac.uk> Message-ID: <8663p5c3ey.fsf@gmail.com> > I think the "admin panel" work is now complete, and I've uploaded a > new version of LFB to CPAN. As a plugin it scans & loads your > DBIC-ish models so you no longer need the config duplication I > mention above. > > CPAN docs and demo site have also been updated: > > http://search.cpan.org/perldoc?CatalystX::ListFramework::Builder > http://dragonstaff.co.uk/oliverg/ > > regards, > oliver. > -- > Oliver Gorwits, Network and Telecommunications Group, > Oxford University Computing Services > Is a static version of this going to be implemented in the near furture? By static I mean the generation of the required files instead of them coming from the memory. This way it will be possible to edit the files manually and make appropriate changes -- Antano Solar John Consultant & Trainer (Web 2.0,Networks,VOIP) From orasnita at gmail.com Tue Sep 9 07:15:20 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Tue Sep 9 08:06:17 2008 Subject: [Catalyst] Catamoose Interviews Part Two, Matt S. Trout speaks! References: <119216.91085.qm@web30403.mail.mud.yahoo.com> Message-ID: Hi John, Thank you and Matt for this interview. It was very helpful. A few words made me understand better what can I use Moose for in Catalyst apps. For the moment I haven't seen examples of using business logic in models that don't use Moose. When I saw that the code uses Moose, it was harder to understand, so I prefered to use the bad style of business logic in Controllers, although I knew from the start that it is not a good way, because I won't be able to use the same code for command line programs. I always create the models, views and controllers using the helper tools and I expected to see what should I do to add business logic to the models. I am not one that says that Catalyst code is not perl code, but for using Catalyst, a beginner should be able to use DBIx::Class and most probably he should be able to use Template-Toolkit and maybe other modules like HTML::FormFu and from now on he should also learn to use Moose. If the programmer knows all these modules but one, it would be easy to learn to use that module, but if he can't use more of these modules, it would be harder to understand the POD docs because he won't understand if a certain piece of code is done in a certain way because of Moose, or because of DBIx::Class... I have used Class::Accessor modules, but only now I understood that Moose can be used for doing the same thing in a more advanced way. Octavian ----- Original Message ----- From: "John Napiorkowski" To: Sent: Monday, September 08, 2008 10:29 PM Subject: [Catalyst] Catamoose Interviews Part Two, Matt S. Trout speaks! > The project to port Catalyst to Moose continues. An interview with Core Team Member, Matt S. Trout, reports on this project's progress. If you are interested in where Catalyst is going as we finish up 2008, or would just like to hear Matt's thoughts about the project and community, you can read the full text: > > http://jjnapiorkowski.vox.com/library/post/catamoose-part-two-mst-speaks.html > > I personally would be gratefully for any and all feedback either directly on the blog or via this mailing list. > > Sincerely, > John Napiorkowski > > > > > _______________________________________________ > 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/ From pagaltzis at gmx.de Tue Sep 9 08:16:23 2008 From: pagaltzis at gmx.de (Aristotle Pagaltzis) Date: Tue Sep 9 08:15:28 2008 Subject: [Catalyst] Re: Announce: Instant AJAX web front-end for DBIx::Class In-Reply-To: <8663p5c3ey.fsf@gmail.com> References: <48A9E816.8070006@oucs.ox.ac.uk> <0BE5863F-4761-436E-9D80-444987E70EEB@houseofdesign.de> <48AB53D6.70101@oucs.ox.ac.uk> <48BC5182.6070205@oucs.ox.ac.uk> <8663p5c3ey.fsf@gmail.com> Message-ID: <20080909071623.GH20866@klangraum.plasmasturm.org> * Antano Solar John [2008-09-09 07:20]: > By static I mean the generation of the required files instead > of them coming from the memory. This way it will be possible to > edit the files manually and make appropriate changes Bad idea: makes it impossible to upgrade. Ask for a Moose-ified version instead. Regards, -- Aristotle Pagaltzis // From emily at burnham.org Tue Sep 9 23:19:49 2008 From: emily at burnham.org (Emily Heureux) Date: Tue Sep 9 23:19:59 2008 Subject: [Catalyst] Switching to a production server Message-ID: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> Hi, I have been developing a Catalyst application and just using the Catalyst myapp_server.pl script to run it. We server a very small market, currently less than 100 visits a day. The major issue we are having is that even small images are loaded very slowly, and therefore the pages are loaded slowly, on the order of more than 5 seconds for a first time visitor. At this time, I don't know anything about fast_cgi or configuring apache or what have you, to work with Catalyst, but before I take that on, my question is, is it likely that the slow loading of very small images has to do with the default myapp_server.pl, and switching to something else will make a big difference with loading images and possibly other files? Thanks, Emily -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080909/45ac4d26/attachment.htm From mikhail.maluyk at gmail.com Tue Sep 9 23:47:22 2008 From: mikhail.maluyk at gmail.com (mikhail maluyk) Date: Tue Sep 9 23:47:25 2008 Subject: [Catalyst] Switching to a production server In-Reply-To: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> References: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> Message-ID: <98c65a030809091547n52cddabesca3e7bdf2763c80b@mail.gmail.com> Hi Emily, For fast image serving you could use reverse proxy. For configuring nginx as reverse proxy, follow that link http://blog.kovyrin.net/2006/05/18/nginx-as-reverse-proxy/lang/en/ I'm not sure if the catalyst myapp_server.pl is more than a development server. I suggest you switch to apache with nginx or lighthttpd as a reverse proxy server. 2008/9/10 Emily Heureux : > Hi, I have been developing a Catalyst application and just using the > Catalyst myapp_server.pl script to run it. We server a very small market, > currently less than 100 visits a day. The major issue we are having is that > even small images are loaded very slowly, and therefore the pages are loaded > slowly, on the order of more than 5 seconds for a first time visitor. > > > > At this time, I don't know anything about fast_cgi or configuring apache or > what have you, to work with Catalyst, but before I take that on, my question > is, is it likely that the slow loading of very small images has to do with > the default myapp_server.pl, and switching to something else will make a big > difference with loading images and possibly other files? > > > > Thanks, > > Emily > > > > _______________________________________________ > 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/ > > -- Regards, Mikhail From bobtfish at bobtfish.net Wed Sep 10 00:12:34 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 10 00:12:37 2008 Subject: [Catalyst] Switching to a production server In-Reply-To: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> References: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> Message-ID: <9E9584AF-357E-4F0D-8E0C-44F80E7C1916@bobtfish.net> On 9 Sep 2008, at 23:19, Emily Heureux wrote: > At this time, I don?t know anything about fast_cgi or configuring > apache or what have you, to work with Catalyst, but before I take > that on, my question is, is it likely that the slow loading of very > small images has to do with the default myapp_server.pl, and > switching to something else will make a big difference with loading > images and possibly other files? > By default, the myapp_server.pl which comes with catalyst for development is _single threaded_. This means that if you have 200 images on the page, each image will be fetched one after the other, which will be slow. In a real deployment environment, you won't be single threaded (your browser is likely to download 4 things at once), which will help. Assuming that the images are static, you also want to configure your web server to serve them statically, so Catalyst will never see the image requests, this will significantly lower the overhead of serving these images. I recommend you set your app up with something like what your real deployment is going to be (e.g. if your real deployment is going to be fastcgi, then get fastcgi going on your development machine to test it with). See how your app looks then, and if you've still got speed issues you can look at profiling the request (if that's what is taking the time), and/or optimising the content (e.g. by using CSS sprites to reduce the number of images in the page).. Cheers t0m From m9tn-oh4c at xemaps.com Wed Sep 10 09:33:34 2008 From: m9tn-oh4c at xemaps.com (ivorw) Date: Wed Sep 10 09:33:47 2008 Subject: [Catalyst] Switching to a production server In-Reply-To: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> References: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> Message-ID: <48C7865E.5060402@tiscali.co.uk> Emily Heureux wrote: > > Hi, I have been developing a Catalyst application and just using the > Catalyst myapp_server.pl script to run it. We server a very small > market, currently less than 100 visits a day. The major issue we are > having is that even small images are loaded very slowly, and therefore > the pages are loaded slowly, on the order of more than 5 seconds for a > first time visitor. > > > > At this time, I don?t know anything about fast_cgi or configuring > apache or what have you, to work with Catalyst, but before I take that > on, my question is, is it likely that the slow loading of very small > images has to do with the default myapp_server.pl, and switching to > something else will make a big difference with loading images and > possibly other files? > > > I don't recommend going live by running myapp_server.pl - this is intended for development and debugging. I do recommend using a standalone fastcgi process farm (which could have just a single instance), talking through a named pipe in the /tmp directory. The fastcgi process runs in your application user account, saving you from having to open up the permissions of your files to the www-data user. This is quite well documented, see http://search.cpan.org/~mramberg/Catalyst-Runtime/lib/Catalyst/Engine/FastCGI.pm Also apart from in special circumstances, there's usually no reason to serve images through your Catalyst application. The special circumstances I imagine could be if the image is being stored in a database blob, or being tweaked on the fly with ImageMagick. One option could be to change the URLs for the images to be absolute ones on the webserver, rather than static/images/powered_by.jpg etc. which will deliver performance results with myapp_server.pl. You'd need to copy the root/static/images directory to somewhere more public, where the www-data user can see and use it. A recommended, documented option is to configure Apache to handle /static rather than pass these requests to the application with the following config snippet: SetHandler default-handler For more on configuring Apache 2.0, see http://search.cpan.org/~agrundma/Catalyst-Engine-Apache/lib/Catalyst/Engine/Apache2/MP20.pm Please bear it in mind that most of the information in this Pod is about configuring your Catalyst app to run under mod_perl. I much prefer fastcgi as it gives me much more control and awareness of machine resources, keeps my permissions sane, and allows me to run multiple different Catalyst applications and versions on the same box. Ivor. From chisel at herlpacker.co.uk Wed Sep 10 10:42:35 2008 From: chisel at herlpacker.co.uk (Chisel Wright) Date: Wed Sep 10 10:43:03 2008 Subject: [Catalyst] One (central) app, one schema, X databases Message-ID: <20080910094235.GC32258@herlpacker.co.uk> I'm just in the initial planning phase of a project. The basic idea is to have X locations running App::Location, each with a local database that has a App::Location::Schema. Everything's the same, just different data in the locations. We'd like to have a centralised tool to manage App::Location #1 ... App::Location #X - App::Central App::Central may have it's own App::Central::Schema, but it should also be able to interact with App::Location::Schema #1 .. App::Location::Schema #X. This is where I'm unsure how to proceed. I'd like to have a configuration list that boils down to something like: instance1: dsn_host=location1.foo.com instance2: dsn_host=location2.foo.com ... instanceX: dsn_host=locationX.foo.com and have some form of cunningness or magic that turns this into an accessible DBIC model. I'm aware that I could use http://search.cpan.org/~zarquon/Catalyst-Manual-5.7013/lib/Catalyst/Manual/Cookbook.pod#Using_existing_DBIC_(etc.)_classes_with_Catalyst (http://xrl.us/oqs9o) and create a MyApp::Model::Location1::DB and so on, but this seems wrong. If I've made any sense, does anyone have any docs that I should be looking at (I promise I had a look around), or examples of where they've done the same thing? I'm thinking that there might be a solution involving a App::Model::MiddleLayer that provides something like: App::Model::MiddleLayer->schema( $instance_name ) but it's a vague idea that I can't quite get to solidify in my head. Thanks for reading this far! Chisel -- Chisel Wright e: chisel@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Chuck Norris doesn?t wear a watch, HE decides what time it is. From kyle at lakeofburningfire.org Wed Sep 10 11:02:43 2008 From: kyle at lakeofburningfire.org (snookums) Date: Wed Sep 10 11:02:47 2008 Subject: [Catalyst] IE has problems with catalyst Message-ID: <19403592.post@talk.nabble.com> I hope someone can point out to me what's wrong here. I have a catalyst application that I've been developing. It takes a submitted link, processes it, and regurgitates it with some changes. It's a get request. The processing can take up to about 10 seconds. I thought everything was going fine, but I'm developing on mac. I've been testing it in Safari. I quickly found that IE users couldn't access my application. They can get to the front page, but when they submit a link, the browser runs for a little while and then gives a dns error page: cannot access this page, page not available, etc. Apache error and access logs don't even show the hit. I looked online and found that the problem might have something to do with the keep-alive option. I changed my main app file to look like this. use parent qw/Catalyst/; use Catalyst qw/-k -Debug ConfigLoader Static::Simple UserAgent Unicode Compress::Gzip/; our $VERSION = '0.01'; That didn't fix the problem, but I noticed some improvement for slower connections that weren't even getting the front page before. I also should mention that I'm using Catalyst with the latest versions of perl, apache, and mod_perl. I tried changing a few of my keep-alive options in apache conf as well to increase the time before dropping a connection. I haven't noticed any difference. Can anyone tell me how -k works? Is there a default timeout value that I can change? Is this even the problem? -- View this message in context: http://www.nabble.com/IE-has-problems-with-catalyst-tp19403592p19403592.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From yadav.tirveni at gmail.com Wed Sep 10 12:02:59 2008 From: yadav.tirveni at gmail.com (tirveni yadav) Date: Wed Sep 10 12:03:03 2008 Subject: [Catalyst] Perl Catalyst : lexical error not displayed In-Reply-To: <085499B3-B2AC-42C2-99DC-DCBD88DEEF85@gmail.com> References: <3db66edb0809080724oa9fcce7pa36631d6da443c83@mail.gmail.com> <085499B3-B2AC-42C2-99DC-DCBD88DEEF85@gmail.com> Message-ID: <3db66edb0809100402g47adf21ai91b953a8019817f0@mail.gmail.com> On Mon, Sep 8, 2008 at 11:37 PM, Josef Chladek wro= te: > > Am 08.09.2008 um 16:24 schrieb tirveni yadav: > > Hi, >> >> I am facing some issues in catalyst since upgrade to perl 5.10 from 5.8 >> in Debian 4.1 . >> >> Item 1) >> I am finding it hard to locate errors because of this : >> When a variable is not declared lexically: >> my $title =3D "Temp" ; #works fine whereas >> $title =3D "Temp" ; #Unknown Error >> >> These Messages are Displayed with different options for the error >> above : >> i) >> Running 'script/testapp_server.pl' with results in this error :: >> >> Unknown error >> Compilation failed in require at /usr/share/perl5/Catalyst/Utils.pm line >> 270. >> Compilation failed in require at script/testapp_server.pl line 55. >> > > you have to patch and compile perl 5.10 yourself, the patch is described > here > > http://www.nntp.perl.org/group/perl.perl5.changes/2008/02/msg21106.html > > download perl5.10 (http://www.cpan.org/src/perl-5.10.0.tar.gz), > before ./Configure patch file toke.c (toplevel) line 692 > > #else > parser->nexttoke =3D 0; > #endif > + parser->error_count =3D oparser ? oparser->error_count : 0; > parser->copline =3D NOLINE; > parser->lex_state =3D LEX_NORMAL; > parser->expect =3D XSTATE; > > that's it, ./Confiure;make . I don't know if there's a deb-file of a > patched perl around... > > Yes, Debian Repository don't have the Perl with this patch. Will patch and compile Perl . Thanks for the help . -- = Regards, Tirveni Yadav What is this Universe ? From what it arises ? Into what does it go? In freedom it arises, In freedom it rests and into freedom it melts away. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080910/b3980= 812/attachment.htm From kyle at lakeofburningfire.org Wed Sep 10 13:25:34 2008 From: kyle at lakeofburningfire.org (snookums) Date: Wed Sep 10 13:25:37 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <19403592.post@talk.nabble.com> References: <19403592.post@talk.nabble.com> Message-ID: <19412455.post@talk.nabble.com> After examining this some more, I started to think that IE was timing out because there was no data being sent to the server while waiting for the processing to be done. I added a couple $c->engine->write($c, ' ') calls throughout the code. That didn't help. IE is consistently throwing a dns error after 10 seconds on each request. I'd be appreciative of any suggestions. Thanks in advance. snookums wrote: > > I hope someone can point out to me what's wrong here. I have a catalyst > application that I've been developing. It takes a submitted link, > processes it, and regurgitates it with some changes. It's a get request. > The processing can take up to about 10 seconds. I thought everything was > going fine, but I'm developing on mac. I've been testing it in Safari. I > quickly found that IE users couldn't access my application. They can get > to the front page, but when they submit a link, the browser runs for a > little while and then gives a dns error page: cannot access this page, > page not available, etc. Apache error and access logs don't even show the > hit. > > I looked online and found that the problem might have something to do with > the keep-alive option. I changed my main app file to look like this. > > use parent qw/Catalyst/; > use Catalyst qw/-k > -Debug > ConfigLoader > Static::Simple > UserAgent > Unicode > Compress::Gzip/; > our $VERSION = '0.01'; > > That didn't fix the problem, but I noticed some improvement for slower > connections that weren't even getting the front page before. I also should > mention that I'm using Catalyst with the latest versions of perl, apache, > and mod_perl. I tried changing a few of my keep-alive options in apache > conf as well to increase the time before dropping a connection. I haven't > noticed any difference. > > Can anyone tell me how -k works? Is there a default timeout value that I > can change? Is this even the problem? > -- View this message in context: http://www.nabble.com/IE-has-problems-with-catalyst-tp19403592p19412455.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From laurent.dami at justice.ge.ch Wed Sep 10 13:35:32 2008 From: laurent.dami at justice.ge.ch (Dami Laurent (PJ)) Date: Wed Sep 10 13:35:42 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <19403592.post@talk.nabble.com> References: <19403592.post@talk.nabble.com> Message-ID: <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> >-----Message d'origine----- >De : snookums [mailto:kyle@lakeofburningfire.org] >Envoy? : mercredi, 10. septembre 2008 12:03 >? : catalyst@lists.scsys.co.uk >Objet : [Catalyst] IE has problems with catalyst > > >I hope someone can point out to me what's wrong here. I have a catalyst >application that I've been developing. It takes a submitted >link, processes >it, and regurgitates it with some changes. It's a get request. The >processing can take up to about 10 seconds. I thought >everything was going >fine, but I'm developing on mac. I've been testing it in >Safari. I quickly >found that IE users couldn't access my application. They can get to the >front page, but when they submit a link, the browser runs for >a little while >and then gives a dns error page: cannot access this page, page not >available, etc. Apache error and access logs don't even show the hit. > >I looked online and found that the problem might have >something to do with >the keep-alive option. I changed my main app file to look like this. > >use parent qw/Catalyst/; >use Catalyst qw/-k > -Debug > ConfigLoader > Static::Simple > UserAgent > Unicode > Compress::Gzip/; >our $VERSION = '0.01'; > >That didn't fix the problem, but I noticed some improvement for slower >connections that weren't even getting the front page before. I >also should >mention that I'm using Catalyst with the latest versions of >perl, apache, >and mod_perl. I tried changing a few of my keep-alive options >in apache conf >as well to increase the time before dropping a connection. I >haven't noticed >any difference. > >Can anyone tell me how -k works? Is there a default timeout >value that I can >change? Is this even the problem? >-- Hi, If your hypothesis about needing Keepalive is correct, and if your application in production runs under Apache, then you you need to activate Keepalive in your Apache configuration; its not a Catalyst property. So edit your httpd.conf and add KeepAlive On One reason why this might be important is if you use the Microsoft NTLM protocol for authentifying your users (mod_auth_ntlm or mod_auth_sspi or PerlAuthenHandler Apache2::AuthenNTLM); these definitely need KeepAlive to be on. Hope this helps, Best regards, Laurent Dami From kyle at lakeofburningfire.org Wed Sep 10 13:51:39 2008 From: kyle at lakeofburningfire.org (snookums) Date: Wed Sep 10 13:51:43 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> References: <19403592.post@talk.nabble.com> <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> Message-ID: <19412918.post@talk.nabble.com> No authentication is being used right now. I've also checked my apache config and used the LiveHeader add-on to Firefox. The keep-alive headers seem to be just as they should be. I'm beginning to suspect that the long processing time before the application can return content is the culprit. It can take a while before the body is returned. The browser consistently tries for about 10 seconds and then throws a dns error screen up. I tried placing $c->engine->write calls throughout to keep the connection active, but it doesn't seem to have done anything. Thanks for your reply. Dami Laurent (PJ) wrote: > > > >>-----Message d'origine----- >>De : snookums [mailto:kyle@lakeofburningfire.org] >>Envoy? : mercredi, 10. septembre 2008 12:03 >>? : catalyst@lists.scsys.co.uk >>Objet : [Catalyst] IE has problems with catalyst >> >> >>I hope someone can point out to me what's wrong here. I have a catalyst >>application that I've been developing. It takes a submitted >>link, processes >>it, and regurgitates it with some changes. It's a get request. The >>processing can take up to about 10 seconds. I thought >>everything was going >>fine, but I'm developing on mac. I've been testing it in >>Safari. I quickly >>found that IE users couldn't access my application. They can get to the >>front page, but when they submit a link, the browser runs for >>a little while >>and then gives a dns error page: cannot access this page, page not >>available, etc. Apache error and access logs don't even show the hit. >> >>I looked online and found that the problem might have >>something to do with >>the keep-alive option. I changed my main app file to look like this. >> >>use parent qw/Catalyst/; >>use Catalyst qw/-k >> -Debug >> ConfigLoader >> Static::Simple >> UserAgent >> Unicode >> Compress::Gzip/; >>our $VERSION = '0.01'; >> >>That didn't fix the problem, but I noticed some improvement for slower >>connections that weren't even getting the front page before. I >>also should >>mention that I'm using Catalyst with the latest versions of >>perl, apache, >>and mod_perl. I tried changing a few of my keep-alive options >>in apache conf >>as well to increase the time before dropping a connection. I >>haven't noticed >>any difference. >> >>Can anyone tell me how -k works? Is there a default timeout >>value that I can >>change? Is this even the problem? >>-- > > Hi, > > If your hypothesis about needing Keepalive is correct, and if your > application in production runs under Apache, then you you need to activate > Keepalive in your Apache configuration; its not a Catalyst property. So > edit your httpd.conf and add > > KeepAlive On > > One reason why this might be important is if you use the Microsoft NTLM > protocol for > authentifying your users (mod_auth_ntlm or mod_auth_sspi or > PerlAuthenHandler Apache2::AuthenNTLM); these definitely need KeepAlive to > be on. > > Hope this helps, > > Best regards, > > Laurent Dami > > _______________________________________________ > 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/ > > -- View this message in context: http://www.nabble.com/IE-has-problems-with-catalyst-tp19403592p19412918.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From bobtfish at bobtfish.net Wed Sep 10 14:11:27 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 10 14:11:25 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <19412918.post@talk.nabble.com> References: <19403592.post@talk.nabble.com> <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> <19412918.post@talk.nabble.com> Message-ID: <8BADDE5E-D186-462C-8701-CFC9D99B5E34@bobtfish.net> On 10 Sep 2008, at 13:51, snookums wrote: > > No authentication is being used right now. I've also checked my > apache config > and used the LiveHeader add-on to Firefox. The keep-alive headers > seem to be > just as they should be. I'm beginning to suspect that the long > processing > time before the application can return content is the culprit. It > can take a > while before the body is returned. The browser consistently tries > for about > 10 seconds and then throws a dns error screen up. I tried placing > $c->engine->write calls throughout to keep the connection active, > but it > doesn't seem to have done anything. Thanks for your reply. > IE is pretty unhelpful - you don't know if it is a DNS error, or some form of connection error, or anything really.. I'd recommend pulling out Paros proxy and/or wireshark to see what's actually going on, as currently you're just guessing... Cheers t0m From jleu at mindspring.com Wed Sep 10 14:19:43 2008 From: jleu at mindspring.com (James R. Leu) Date: Wed Sep 10 14:19:50 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <19412918.post@talk.nabble.com> References: <19403592.post@talk.nabble.com> <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> <19412918.post@talk.nabble.com> Message-ID: <20080910131942.GC13638@mindspring.com> Are you sure it not actually a DNS issue? Check the URLs being sent back by the cat app. Do they contain the FQDN you are expecting? Are you able to reproduce this issue on multiple IE machines? Have you tried running wireshark on the IE machine to watch exactly what it is doing on the wire? Good luck On Wed, Sep 10, 2008 at 05:51:39AM -0700, snookums wrote: > = > No authentication is being used right now. I've also checked my apache co= nfig > and used the LiveHeader add-on to Firefox. The keep-alive headers seem to= be > just as they should be. I'm beginning to suspect that the long processing > time before the application can return content is the culprit. It can tak= e a > while before the body is returned. The browser consistently tries for abo= ut > 10 seconds and then throws a dns error screen up. I tried placing > $c->engine->write calls throughout to keep the connection active, but it > doesn't seem to have done anything. Thanks for your reply. > = > = > Dami Laurent (PJ) wrote: > > = > > = > > = > >>-----Message d'origine----- > >>De : snookums [mailto:kyle@lakeofburningfire.org] = > >>Envoy=E9 : mercredi, 10. septembre 2008 12:03 > >>=C0 : catalyst@lists.scsys.co.uk > >>Objet : [Catalyst] IE has problems with catalyst > >> > >> > >>I hope someone can point out to me what's wrong here. I have a catalyst > >>application that I've been developing. It takes a submitted = > >>link, processes > >>it, and regurgitates it with some changes. It's a get request. The > >>processing can take up to about 10 seconds. I thought = > >>everything was going > >>fine, but I'm developing on mac. I've been testing it in = > >>Safari. I quickly > >>found that IE users couldn't access my application. They can get to the > >>front page, but when they submit a link, the browser runs for = > >>a little while > >>and then gives a dns error page: cannot access this page, page not > >>available, etc. Apache error and access logs don't even show the hit. > >> > >>I looked online and found that the problem might have = > >>something to do with > >>the keep-alive option. I changed my main app file to look like this. > >> > >>use parent qw/Catalyst/; > >>use Catalyst qw/-k > >> -Debug > >> ConfigLoader > >> Static::Simple > >> UserAgent > >> Unicode > >> Compress::Gzip/; > >>our $VERSION =3D '0.01'; > >> > >>That didn't fix the problem, but I noticed some improvement for slower > >>connections that weren't even getting the front page before. I = > >>also should > >>mention that I'm using Catalyst with the latest versions of = > >>perl, apache, > >>and mod_perl. I tried changing a few of my keep-alive options = > >>in apache conf > >>as well to increase the time before dropping a connection. I = > >>haven't noticed > >>any difference. > >> > >>Can anyone tell me how -k works? Is there a default timeout = > >>value that I can > >>change? Is this even the problem? > >>-- = > > = > > Hi, > > = > > If your hypothesis about needing Keepalive is correct, and if your > > application in production runs under Apache, then you you need to activ= ate > > Keepalive in your Apache configuration; its not a Catalyst property. So > > edit your httpd.conf and add > > = > > KeepAlive On > > = > > One reason why this might be important is if you use the Microsoft NTLM > > protocol for > > authentifying your users (mod_auth_ntlm or mod_auth_sspi or > > PerlAuthenHandler Apache2::AuthenNTLM); these definitely need KeepAlive= to > > be on. > > = > > Hope this helps, > > = > > Best regards, > > = > > Laurent Dami > > = > > _______________________________________________ > > 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/ > > = > > = > = > -- = > View this message in context: http://www.nabble.com/IE-has-problems-with-= catalyst-tp19403592p19412918.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.u= k/ > Dev site: http://dev.catalyst.perl.org/ -- = James R. Leu jleu@mindspring.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080910/b21d= 78a8/attachment.pgp From ash_cpan at firemirror.com Wed Sep 10 14:53:27 2008 From: ash_cpan at firemirror.com (Ash Berlin) Date: Wed Sep 10 14:53:42 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <20080910131942.GC13638@mindspring.com> References: <19403592.post@talk.nabble.com> <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> <19412918.post@talk.nabble.com> <20080910131942.GC13638@mindspring.com> Message-ID: <3A3A8578-518D-4ADA-957B-DBEDB7AD2532@firemirror.com> On 10 Sep 2008, at 14:19, James R. Leu wrote: > Are you sure it not actually a DNS issue? Check the URLs being sent > back > by the cat app. Do they contain the FQDN you are expecting? Are you > able to > reproduce this issue on multiple IE machines? Have you tried running > wireshark on the IE machine to watch exactly what it is doing on the > wire? > > Good luck > > On Wed, Sep 10, 2008 at 05:51:39AM -0700, snookums wrote: >> >> No authentication is being used right now. I've also checked my >> apache config >> and used the LiveHeader add-on to Firefox. The keep-alive headers >> seem to be >> just as they should be. I'm beginning to suspect that the long >> processing >> time before the application can return content is the culprit. It >> can take a >> while before the body is returned. The browser consistently tries >> for about >> 10 seconds and then throws a dns error screen up. I tried placing >> $c->engine->write calls throughout to keep the connection active, >> but it >> doesn't seem to have done anything. Thanks for your reply. >> >> >> Dami Laurent (PJ) wrote: >>> >>> >>> >>>> -----Message d'origine----- >>>> De : snookums [mailto:kyle@lakeofburningfire.org] >>>> Envoy? : mercredi, 10. septembre 2008 12:03 >>>> ? : catalyst@lists.scsys.co.uk >>>> Objet : [Catalyst] IE has problems with catalyst >>>> >>>> >>>> I hope someone can point out to me what's wrong here. I have a >>>> catalyst >>>> application that I've been developing. It takes a submitted >>>> link, processes >>>> it, and regurgitates it with some changes. It's a get request. The >>>> processing can take up to about 10 seconds. I thought >>>> everything was going >>>> fine, but I'm developing on mac. I've been testing it in >>>> Safari. I quickly >>>> found that IE users couldn't access my application. They can get >>>> to the >>>> front page, but when they submit a link, the browser runs for >>>> a little while >>>> and then gives a dns error page: cannot access this page, page not >>>> available, etc. Apache error and access logs don't even show the >>>> hit. >>>> >>>> I looked online and found that the problem might have >>>> something to do with >>>> the keep-alive option. I changed my main app file to look like >>>> this. >>>> >>>> use parent qw/Catalyst/; >>>> use Catalyst qw/-k >>>> -Debug >>>> ConfigLoader >>>> Static::Simple >>>> UserAgent >>>> Unicode >>>> Compress::Gzip/; >>>> our $VERSION = '0.01'; >>>> >>>> That didn't fix the problem, but I noticed some improvement for >>>> slower >>>> connections that weren't even getting the front page before. I >>>> also should >>>> mention that I'm using Catalyst with the latest versions of >>>> perl, apache, >>>> and mod_perl. I tried changing a few of my keep-alive options >>>> in apache conf >>>> as well to increase the time before dropping a connection. I >>>> haven't noticed >>>> any difference. >>>> >>>> Can anyone tell me how -k works? Is there a default timeout >>>> value that I can >>>> change? Is this even the problem? >>>> -- >>> >>> Hi, >>> >>> If your hypothesis about needing Keepalive is correct, and if your >>> application in production runs under Apache, then you you need to >>> activate >>> Keepalive in your Apache configuration; its not a Catalyst >>> property. So >>> edit your httpd.conf and add >>> >>> KeepAlive On >>> >>> One reason why this might be important is if you use the Microsoft >>> NTLM >>> protocol for >>> authentifying your users (mod_auth_ntlm or mod_auth_sspi or >>> PerlAuthenHandler Apache2::AuthenNTLM); these definitely need >>> KeepAlive to >>> be on. >>> >>> Hope this helps, >>> >>> Best regards, >>> >>> Laurent Dami >>> >>> I've had weird errors that look like a DNS error from IE before. Something along the lines of 'the site is unavailable'. This was infact the error of IE not liking the way i was serving the static PDF errors. Can you tell us the exeact wording of the error dialog IE shows? -ash From kyle at lakeofburningfire.org Wed Sep 10 15:00:01 2008 From: kyle at lakeofburningfire.org (snookums) Date: Wed Sep 10 15:00:05 2008 Subject: [Catalyst] IE has problems with catalyst In-Reply-To: <20080910131942.GC13638@mindspring.com> References: <19403592.post@talk.nabble.com> <24CBAF436498F1409E79F4E878A6F1720392DBED@mailjus.etat-ge.ch> <19412918.post@talk.nabble.com> <20080910131942.GC13638@mindspring.com> Message-ID: <19414224.post@talk.nabble.com> Found it. My apologies to all. I took the advice about paros proxy and found that all headers were perfect. It was a problem with my html: a mangled base tag. I should remember to always copy and paste generated html into a file and test it before crying for help. Thanks to everyone who responded. I appreciate it. If I ever have an opportunity to help you in the future, I will. James R. Leu wrote: > > Are you sure it not actually a DNS issue? Check the URLs being sent back > by the cat app. Do they contain the FQDN you are expecting? Are you able > to > reproduce this issue on multiple IE machines? Have you tried running > wireshark on the IE machine to watch exactly what it is doing on the wire? > > Good luck > > On Wed, Sep 10, 2008 at 05:51:39AM -0700, snookums wrote: >> >> No authentication is being used right now. I've also checked my apache >> config >> and used the LiveHeader add-on to Firefox. The keep-alive headers seem to >> be >> just as they should be. I'm beginning to suspect that the long processing >> time before the application can return content is the culprit. It can >> take a >> while before the body is returned. The browser consistently tries for >> about >> 10 seconds and then throws a dns error screen up. I tried placing >> $c->engine->write calls throughout to keep the connection active, but it >> doesn't seem to have done anything. Thanks for your reply. >> >> >> Dami Laurent (PJ) wrote: >> > >> > >> > >> >>-----Message d'origine----- >> >>De : snookums [mailto:kyle@lakeofburningfire.org] >> >>Envoy? : mercredi, 10. septembre 2008 12:03 >> >>? : catalyst@lists.scsys.co.uk >> >>Objet : [Catalyst] IE has problems with catalyst >> >> >> >> >> >>I hope someone can point out to me what's wrong here. I have a catalyst >> >>application that I've been developing. It takes a submitted >> >>link, processes >> >>it, and regurgitates it with some changes. It's a get request. The >> >>processing can take up to about 10 seconds. I thought >> >>everything was going >> >>fine, but I'm developing on mac. I've been testing it in >> >>Safari. I quickly >> >>found that IE users couldn't access my application. They can get to the >> >>front page, but when they submit a link, the browser runs for >> >>a little while >> >>and then gives a dns error page: cannot access this page, page not >> >>available, etc. Apache error and access logs don't even show the hit. >> >> >> >>I looked online and found that the problem might have >> >>something to do with >> >>the keep-alive option. I changed my main app file to look like this. >> >> >> >>use parent qw/Catalyst/; >> >>use Catalyst qw/-k >> >> -Debug >> >> ConfigLoader >> >> Static::Simple >> >> UserAgent >> >> Unicode >> >> Compress::Gzip/; >> >>our $VERSION = '0.01'; >> >> >> >>That didn't fix the problem, but I noticed some improvement for slower >> >>connections that weren't even getting the front page before. I >> >>also should >> >>mention that I'm using Catalyst with the latest versions of >> >>perl, apache, >> >>and mod_perl. I tried changing a few of my keep-alive options >> >>in apache conf >> >>as well to increase the time before dropping a connection. I >> >>haven't noticed >> >>any difference. >> >> >> >>Can anyone tell me how -k works? Is there a default timeout >> >>value that I can >> >>change? Is this even the problem? >> >>-- >> > >> > Hi, >> > >> > If your hypothesis about needing Keepalive is correct, and if your >> > application in production runs under Apache, then you you need to >> activate >> > Keepalive in your Apache configuration; its not a Catalyst property. So >> > edit your httpd.conf and add >> > >> > KeepAlive On >> > >> > One reason why this might be important is if you use the Microsoft NTLM >> > protocol for >> > authentifying your users (mod_auth_ntlm or mod_auth_sspi or >> > PerlAuthenHandler Apache2::AuthenNTLM); these definitely need KeepAlive >> to >> > be on. >> > >> > Hope this helps, >> > >> > Best regards, >> > >> > Laurent Dami >> > >> > _______________________________________________ >> > 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/ >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/IE-has-problems-with-catalyst-tp19403592p19412918.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/ > > -- > James R. Leu > jleu@mindspring.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/ > > -- View this message in context: http://www.nabble.com/IE-has-problems-with-catalyst-tp19403592p19414224.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From dbix-class at trout.me.uk Wed Sep 10 17:57:02 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 10 17:57:00 2008 Subject: [Catalyst] Database contents not displayed after hitting pagerefresh In-Reply-To: <4F46355018A3AE4DA8D8EDF41775A34C027CAACD@CHN-HCLT-EVS04.HCLT.CORP.HCL.IN> References: <19282861.post@talk.nabble.com> <48BE36F7.10507@pasteur.fr> <20080903095714.GC4964@agaton.scsys.co.uk> <4F46355018A3AE4DA8D8EDF41775A34C027CAACD@CHN-HCLT-EVS04.HCLT.CORP.HCL.IN> Message-ID: <20080910165702.GL4964@agaton.scsys.co.uk> On Wed, Sep 03, 2008 at 04:03:27PM +0530, SHARATH GOPINATH RAO, Chennai wrote: > > Matt: "So it works on the first request but not on the second?" > > Yes, it works on the first request and not on second. But, after > changing it to this: $data = $c->model('Ttrack::Ttrack')->search(); > it's working fine, although any more suggestions are welcome. It is *not* working, you've just papered over the underlying problem. Please debug as I suggested otherwise in a few months your app is going to break again. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From bailey.charles at gmail.com Wed Sep 10 21:48:49 2008 From: bailey.charles at gmail.com (Charles Bailey) Date: Wed Sep 10 21:48:52 2008 Subject: [Catalyst] [Announce] Catalyst-Runtime 5.7099_01 - Developer Release In-Reply-To: <1afcfe7a0809080157p1fb1d526l6a18b862e28d8bda@mail.gmail.com> References: <7E822796-9E13-47EF-A09E-41952F516F49@nordaaker.com> <20080720001320.GY4853@agaton.scsys.co.uk> <20080721213250.GQ14534@agaton.scsys.co.uk> <20080824180143.GF14534@agaton.scsys.co.uk> <1afcfe7a0809080157p1fb1d526l6a18b862e28d8bda@mail.gmail.com> Message-ID: On Mon, Sep 8, 2008 at 4:57 AM, Jan Henning Thorsen wrote: > On Sun, Aug 24, 2008 at 8:01 PM, Matt S Trout wrote: >> >> The dispatcher change is sadly insufficient. >> >> Because visit() returns, you really need to reset action and namespace. >> >> local is one option, simple code to do so another. Argh -- of course. > Here's another *go* on "go" and "visit": > http://flodhest.net/files/perl/catalyst-go/ > > All tests succeed. I've also added some tests that check if you're > trying to ->go() to a view/model. Thanks -- that's a step beyond the fix I was about to send. -- Regards, Charles Bailey Lists: bailey _dot_ charles _at_ gmail _dot_ com Other: bailey _at_ newman _dot_ upenn _dot_ edu From sergio.lists at salvi.ca Wed Sep 10 23:59:21 2008 From: sergio.lists at salvi.ca (Sergio Salvi) Date: Wed Sep 10 23:59:23 2008 Subject: [Catalyst] Race condition in Catalyst::Plugin::Session and Catalyst::Engine::Apache (possibly other engines too) Message-ID: <46e748b80809101559y3bad3fbai530ce18775736cd0@mail.gmail.com> There is a race condition in C::P::Session when using C::Engine::Apache (and probably other engines too): I have a simple controller action (let's call it /save) that gets data submitted from an HTML form via POST, process that request, stores some stuff in the session and flash and then redirects with HTTP 303 to another action (/display). The /display action then displays the regular "submit successful" message that was set on the previous action by using $c->flash. The problem is that the browser is GETting /display before /save is finished storing the session and flash rows in the database. Then, of course, /display thinks nothing has happened and doesn't display the data from flash. After a bunch of debugging and stack traces :), I figured out the problem is that C::P::Session's finalize() calls $c->NEXT::finalize() before calling $c->finalize_session, so C::Engine::Apache->finalize_body() gets executed *before* the session is flushed in the database, making the browser access /display even though the session may not be stored yet: # From C::P::Session: sub finalize { my $c = shift; my $ret = $c->NEXT::finalize(@_); # then finish the rest $c->finalize_session; return $ret; } I've solved this problem by extending C::P::Session and changing the behaviour of finalize(), like this: ### package Catalyst::Plugin::MySession; use base qw/Catalyst::Plugin::Session/; use strict; use warnings; sub finalize { my $c = shift; $c->finalize_session; my $ret = $c->NEXT::finalize(@_); return $ret; } 1; ### But I realize this may create problems later on if other plugins have finalize() that modify stuff in the session or flash, because then it would be too late to modify it as the session/flash was already stored. How can I tell Catalyst to call the Engine's finalize() method *last*, after every other finalize() has been called? I think that would be the safest way to fix this problem. It is probably related to C3 MRO, but I'm not sure how to approach this within Catalyst. Thank you! Sergio Salvi PS: My environment is: Debian 4.0, stock perl 5.8.8, Apache 2.2.3 with mod_perl 2.0.2 (prefork, no reverse proxy at this moment), MySQL 5.0.32 with InnoDB and the latest version of major Perl modules: Catalyst 5.7.014 C::P::Session 0.19 C::P::Session::Store::DBIC 0.06 From nigel.stuckey at systemgarden.com Thu Sep 11 23:58:31 2008 From: nigel.stuckey at systemgarden.com (Nigel Stuckey) Date: Thu Sep 11 23:59:21 2008 Subject: [Catalyst] Multiple DB, single instance of Cat In-Reply-To: <20080817190801.GF14534@agaton.scsys.co.uk> References: <74FF38D8-E3E6-4E3F-963C-68A40FAEF9F1@systemgarden.com> <20080817190801.GF14534@agaton.scsys.co.uk> Message-ID: Matt I stand corrected on DBIx! Yes, indeed I mean DBIx::Class. The code is in and works, but has a couple of issues. Firstly, it creates new classes and carries out a DB connect every time there is a request. Is there a way to make it more efficient by caching the classes and DB connects once there is a successful authentication? Secondly, there are loads of 'ACCEPT_CONTEXT redefined' messages, one per DB table defined to the DBIC model. When initialising, I have to give the 'dynamic' model an initial configuration to allow Catalyst o start. Once the code is working I will pop it on the wiki. cheers Nigel On 17 Aug 2008, at 8:08pm, Matt S Trout wrote: > On Fri, Aug 15, 2008 at 11:05:03AM +0100, Nigel Stuckey wrote: >> Another question about multiple databases. >> >> I have an existing application that uses a DBIx DB in the >> conventional >> way: as a model initialised at run time. All great so far... > > DBIx is the CPAN namespace for DBI extensions. There are hundres of > packages in there and you haven't told us which one of them you're > using. > > I'm going to assume you mean DBIx::Class but if you want to abbreviate > that please use 'DBIC' - it's really unfair to the authors of other > DBIx:: modules otherwise (compare to people saying "Linux 9" when they > actually mean "Red Hat Linux 9" or whatever :) > >> However, I now need to make the application multi-organisation in the >> same instance of catalyst: users will select their organisation or >> repository when they login or it will be stored as a preference, etc. >> Due to the size of the repository, this is implemented as multiple >> databases. Thus a single running Catalyst instance will need to open >> several DBs sharing the same schema, dynamically after run time. Then >> it will have to close unused connections after a while. >> >> What is the best way to do this with DBIx and where is the best place >> to store the handles/class references? A key to the active DB can be >> stored in the session. > > Something like the following (please write this up on the wiki once > you've > got a working version, mine's typed straight into mutt and obviously > isn't -quite- complete :) > > package MyApp::Model::DBIC; > > use Moose; > > extends 'Catalyst::Model::DBIC::Schema'; > > with 'Catalyst::Component::InstancePerContext'; > > sub build_per_context_instance { > my ($self, $c) = @_; > my $db_name = $c->session->{db_name}; > my $new = $self->new({ %$self }); > > $new->schema($self->schema->connect(@connect_info)); > return $new; > } > > 1; > > -- > Matt S Trout Need help with your Catalyst or > DBIx::Class project? > Technical Director http://www.shadowcat.co.uk/ > catalyst/ > Shadowcat Systems Ltd. Want a managed development or deployment > platform? > http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/ > servers/ > > _______________________________________________ > 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/ From arodland at comcast.net Fri Sep 12 00:25:03 2008 From: arodland at comcast.net (Andrew Rodland) Date: Fri Sep 12 00:25:15 2008 Subject: [Catalyst] Multiple DB, single instance of Cat In-Reply-To: References: <74FF38D8-E3E6-4E3F-963C-68A40FAEF9F1@systemgarden.com> <20080817190801.GF14534@agaton.scsys.co.uk> Message-ID: <200809111825.03374.arodland@comcast.net> On Thursday 11 September 2008 05:58:31 pm Nigel Stuckey wrote: > Matt > > I stand corrected on DBIx! Yes, indeed I mean DBIx::Class. > > The code is in and works, but has a couple of issues. Firstly, it > creates new classes and carries out a DB connect every time there is > a request. Is there a way to make it more efficient by caching the > classes and DB connects once there is a successful authentication? > If you know what all of the possible "organizations" are, then write a model that instantiates all the DB connections (schemas, whatever) at 'new' time, then returns the appropriate one at ACCEPT_CONTEXT time. It's the "here's one we prepared earlier" approach. If that's not feasible, it should be obvious how to change it to doing nothing at startup, creating connections on demand, and "caching" them for the life of the process. Andrew From zzbbyy at gmail.com Fri Sep 12 08:36:38 2008 From: zzbbyy at gmail.com (Zbigniew Lukasiak) Date: Fri Sep 12 08:36:41 2008 Subject: [Catalyst] Failing tests in Catalyst::Controller::SOAP Message-ID: Dear all, I have tried to install Catalyst::Controller::SOAP on both an Open SUSE 10.3 with Perl 5.8.8 and Ubuntu Hardy with the same Perl version. Both give the same errors as in the report at: http://www.nntp.perl.org/group/perl.cpan.testers/2008/09/msg2179625.html Can anyone with more knowledge of SOAP tell if that is something important? Cheers, Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/ From msupra at fnb.co.za Fri Sep 12 13:15:23 2008 From: msupra at fnb.co.za (Supra, Morne) Date: Fri Sep 12 13:15:33 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page Message-ID: Good afternoon all I am busy with a project where I need to read an RFID tag, get the data associated with the tag and then push the data to a web page for a security person to monitor. I can successfully read the tag by using LogicAlloy's ALE server. It then calls my Catalyst application at http://localhost/ale/notifier : sub notifier : Private { my ( $self, $c ) = @_; #$c->stash->{template} = 'notifier.tt2'; $c->stash->{tagdata} = $c->request->params->{tagdata}; open (TagData, '>C:\Eclipse Projects\Asset Tracker\AssetTracker\lib\AssetTracker\tagdata.txt'); print TagData $c->request->params->{tagdata}; close TagData; } As you can see I do not get the associated tag data yet, I am just trying to display the tag data received from the ALE server. I can see that the data is coming through correctly by monitoring the console debug and checking the tagdata.txt file. The problem that I have is that I have no idea how to push the data to a web page instead of pulling. I have tried using catalyst redirect, forward and subrequest with no luck. I am not a hard core developer, so any assistance will be greatly appreciated. Regards Morne Supra To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer. From sharath.g at hcl.in Fri Sep 12 13:41:19 2008 From: sharath.g at hcl.in (cranky) Date: Fri Sep 12 13:41:22 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: References: Message-ID: <19454995.post@talk.nabble.com> Supra, Morne wrote: > > > sub notifier : Private { > my ( $self, $c ) = @_; > > #$c->stash->{template} = 'notifier.tt2'; > $c->stash->{tagdata} = $c->request->params->{tagdata}; > open (TagData, '>C:\Eclipse Projects\Asset > Tracker\AssetTracker\lib\AssetTracker\tagdata.txt'); > print TagData $c->request->params->{tagdata}; > close TagData; > > } > > As you can see I do not get the associated tag data yet, I am just > trying to display the tag data received from the ALE server. > > I can see that the data is coming through correctly by monitoring the > console debug and checking the tagdata.txt file. > > The problem that I have is that I have no idea how to push the data to a > web page instead of pulling. > > I have tried using catalyst redirect, forward and subrequest with no > luck. > > I am not a hard core developer, so any assistance will be greatly > appreciated. > > Regards > Morne Supra > > If you want an upload of your data (i.e., tagdata.txt) to a web page, then I think its nothing to do with catalyst. Use the LWP module where you can POST file to a web page. This link might help-> http://lwp.interglacial.com/ch05_07.htm -- View this message in context: http://www.nabble.com/Pushing-data-to-Catalyst-powered-web-page-tp19454767p19454995.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From onken at houseofdesign.de Fri Sep 12 13:48:17 2008 From: onken at houseofdesign.de (Moritz Onken) Date: Fri Sep 12 13:48:26 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: References: Message-ID: <4DDC5CAD-3EC7-4C1E-9F5A-124AC4E4E83C@houseofdesign.de> > Good afternoon all > > I am busy with a project where I need to read an RFID tag, get the > data > associated with the tag and then push the data to a web page for a > security person to monitor. > > I can successfully read the tag by using LogicAlloy's ALE server. It > then calls my Catalyst application at http://localhost/ale/notifier : > > sub notifier : Private { > my ( $self, $c ) = @_; > > #$c->stash->{template} = 'notifier.tt2'; > $c->stash->{tagdata} = $c->request->params->{tagdata}; > open (TagData, '>C:\Eclipse Projects\Asset > Tracker\AssetTracker\lib\AssetTracker\tagdata.txt'); > print TagData $c->request->params->{tagdata}; > close TagData; > > } > > As you can see I do not get the associated tag data yet, I am just > trying to display the tag data received from the ALE server. > > I can see that the data is coming through correctly by monitoring the > console debug and checking the tagdata.txt file. > > The problem that I have is that I have no idea how to push the data > to a > web page instead of pulling. Hi, you might want to have a look at http://meteorserver.org/. This server pushes data to a client via a persistent http connection. To handle such things with catalyst is not a very good idea. the ALE server will talk to the meteor server and not the catalyst application. If you do not need realtime push you could reload a catalyst page every x seconds. This page opens the file tagdata.txt and prints its content. Add a html meta tag to reload the page every x seconds. moritz From jleu at mindspring.com Fri Sep 12 15:09:44 2008 From: jleu at mindspring.com (James R. Leu) Date: Fri Sep 12 15:09:50 2008 Subject: [Catalyst] Multiple DB, single instance of Cat In-Reply-To: References: <74FF38D8-E3E6-4E3F-963C-68A40FAEF9F1@systemgarden.com> <20080817190801.GF14534@agaton.scsys.co.uk> Message-ID: <20080912140943.GA5402@mindspring.com> To get rid of the ACCEPT_CONTEXT redefined messages I modified that last for loop in Catalyst::Model::DBIC::Schema::new() to be: foreach my $moniker ($self->schema->sources) { my $classname = "${class}::$moniker"; if (!defined(*{"${classname}::ACCEPT_CONTEXT"})) { *{"${classname}::ACCEPT_CONTEXT"} = sub { shift; shift->model($model_name)->resultset($moniker); } } } I'm not sure if it is the correct solution, but "it works for me". It would be nice to hear back from someone if this is truly a bad idea, or maybe hints for better ways to solve the issue. Thanks On Thu, Sep 11, 2008 at 11:58:31PM +0100, Nigel Stuckey wrote: > Matt > > I stand corrected on DBIx! Yes, indeed I mean DBIx::Class. > > The code is in and works, but has a couple of issues. Firstly, it > creates new classes and carries out a DB connect every time there is a > request. Is there a way to make it more efficient by caching the classes > and DB connects once there is a successful authentication? > > Secondly, there are loads of 'ACCEPT_CONTEXT redefined' messages, one > per DB table defined to the DBIC model. When initialising, I have to > give the 'dynamic' model an initial configuration to allow Catalyst o > start. > > Once the code is working I will pop it on the wiki. > > cheers > > Nigel > > On 17 Aug 2008, at 8:08pm, Matt S Trout wrote: > >> On Fri, Aug 15, 2008 at 11:05:03AM +0100, Nigel Stuckey wrote: >>> Another question about multiple databases. >>> >>> I have an existing application that uses a DBIx DB in the >>> conventional >>> way: as a model initialised at run time. All great so far... >> >> DBIx is the CPAN namespace for DBI extensions. There are hundres of >> packages in there and you haven't told us which one of them you're >> using. >> >> I'm going to assume you mean DBIx::Class but if you want to abbreviate >> that please use 'DBIC' - it's really unfair to the authors of other >> DBIx:: modules otherwise (compare to people saying "Linux 9" when they >> actually mean "Red Hat Linux 9" or whatever :) >> >>> However, I now need to make the application multi-organisation in the >>> same instance of catalyst: users will select their organisation or >>> repository when they login or it will be stored as a preference, etc. >>> Due to the size of the repository, this is implemented as multiple >>> databases. Thus a single running Catalyst instance will need to open >>> several DBs sharing the same schema, dynamically after run time. Then >>> it will have to close unused connections after a while. >>> >>> What is the best way to do this with DBIx and where is the best place >>> to store the handles/class references? A key to the active DB can be >>> stored in the session. >> >> Something like the following (please write this up on the wiki once >> you've >> got a working version, mine's typed straight into mutt and obviously >> isn't -quite- complete :) >> >> package MyApp::Model::DBIC; >> >> use Moose; >> >> extends 'Catalyst::Model::DBIC::Schema'; >> >> with 'Catalyst::Component::InstancePerContext'; >> >> sub build_per_context_instance { >> my ($self, $c) = @_; >> my $db_name = $c->session->{db_name}; >> my $new = $self->new({ %$self }); >> >> $new->schema($self->schema->connect(@connect_info)); >> return $new; >> } >> >> 1; >> >> -- >> Matt S Trout Need help with your Catalyst or DBIx::Class >> project? >> Technical Director http://www.shadowcat.co.uk/ >> catalyst/ >> Shadowcat Systems Ltd. Want a managed development or deployment >> platform? >> http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/ >> servers/ >> >> _______________________________________________ >> 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/ -- James R. Leu jleu@mindspring.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080912/ddf0f62c/attachment.pgp From moseley at hank.org Fri Sep 12 20:45:42 2008 From: moseley at hank.org (Bill Moseley) Date: Fri Sep 12 20:45:44 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: References: Message-ID: <20080912194542.GA2972@hank.org> On Fri, Sep 12, 2008 at 02:15:23PM +0200, Supra, Morne wrote: > > The problem that I have is that I have no idea how to push the data to a > web page instead of pulling. Pull with an AJAX update, perhaps. -- Bill Moseley moseley@hank.org Sent from my iMutt From Wade.Stuart at fallon.com Fri Sep 12 21:11:52 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Fri Sep 12 21:12:04 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: <20080912194542.GA2972@hank.org> Message-ID: Bill Moseley wrote on 09/12/2008 02:45:42 PM: > On Fri, Sep 12, 2008 at 02:15:23PM +0200, Supra, Morne wrote: > > > > The problem that I have is that I have no idea how to push the data to a > > web page instead of pulling. > > Pull with an AJAX update, perhaps. > Or, if you control both the app that reads the RFID and the webapp that is to display them, why not have the RFID app insert into the webapps db directly instead of some url post? -Wade From zzbbyy at gmail.com Sat Sep 13 21:01:53 2008 From: zzbbyy at gmail.com (Zbigniew Lukasiak) Date: Sat Sep 13 21:01:56 2008 Subject: [Catalyst] #catalyst Message-ID: Hi there, I did not see how it looked like at the channel a few days ago - but I hope that my irc client malfunction did not offend someone too severly (unlike that famous wardrobe of some US pop singer). And that the bane for my home machine is not eternal and can be released soon. Looking forward for those passionate discussions, Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/ From jon at jrock.us Sun Sep 14 04:09:26 2008 From: jon at jrock.us (Jonathan Rockway) Date: Sun Sep 14 04:09:30 2008 Subject: [Catalyst] #catalyst In-Reply-To: (Zbigniew Lukasiak's message of "Sat, 13 Sep 2008 22:01:53 +0200") References: Message-ID: <871vzntod5.fsf@bar.jrock.us> * On Sat, Sep 13 2008, Zbigniew Lukasiak wrote: > Hi there, > > I did not see how it looked like at the channel a few days ago - but I > hope that my irc client malfunction did not offend someone too severly > (unlike that famous wardrobe of some US pop singer). And that the > bane for my home machine is not eternal and can be released soon. You're unbanned now. In the future, just /msg an op (usually mst) and they will take care of it (especially if it's because your client malfunctioned). Regards, Jonathan Rockway -- print just => another => perl => hacker => if $,=$" From orasnita at gmail.com Sun Sep 14 13:00:48 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sun Sep 14 13:00:59 2008 Subject: [Catalyst] fcgid Message-ID: Hi, I understand that comparing it with mod_perl, fast CGI has the advantage of allowing us to restart the applications without restarting the server. But I have also understood that fcgid don't allow using the app as an external server. If this is true, than which is the advantage of fcgid? I ask this, because it seems that it works better than fastcgi, it is maintained and prefered, but I can't see why. Thank you. Octavian From thiago at aware.com.br Sun Sep 14 14:54:58 2008 From: thiago at aware.com.br (Thiago Rondon) Date: Sun Sep 14 14:55:20 2008 Subject: [Catalyst] fcgid In-Reply-To: References: Message-ID: <48CD17B2.9030701@aware.com.br> mod_cgid and mod_fastcgi just have FastCGI protocol in common. No, and I think it's not planned, because mod_fcgid has an adaptive-spawning design and does not support "static servers or external servers". -Thiago Rondon Octavian Rasnita escreveu: > Hi, > > I understand that comparing it with mod_perl, fast CGI has the > advantage of allowing us to restart the applications without > restarting the server. > But I have also understood that fcgid don't allow using the app as an > external server. > > If this is true, than which is the advantage of fcgid? > > I ask this, because it seems that it works better than fastcgi, it is > maintained and prefered, but I can't see why. > > Thank you. > > Octavian > > > _______________________________________________ > 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/ > > > From msupra at fnb.co.za Mon Sep 15 06:41:18 2008 From: msupra at fnb.co.za (Supra, Morne) Date: Mon Sep 15 06:41:28 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: <19454995.post@talk.nabble.com> Message-ID: Morning to everybody that has assisted so far. I have not been able to resolve the problem yet, most likely because I did not explain my issue correctly. I think that I require some kind of publish and subscribe solution for this. I really want to use Catalyst as far as possible, as it has really been useful in other projects. I need my "view tag data" page to subscribe to a publisher. When the publisher receives new tag data it should push it to the subscriber so the subscriber can then show it on its page automagically. Regards Morne -----Original Message----- From: cranky [mailto:sharath.g@hcl.in] Sent: 12 September 2008 02:41 PM To: catalyst@lists.scsys.co.uk Subject: Re: [Catalyst] Pushing data to Catalyst powered web page Supra, Morne wrote: > > > sub notifier : Private { > my ( $self, $c ) = @_; > > #$c->stash->{template} = 'notifier.tt2'; > $c->stash->{tagdata} = $c->request->params->{tagdata}; > open (TagData, '>C:\Eclipse Projects\Asset > Tracker\AssetTracker\lib\AssetTracker\tagdata.txt'); > print TagData $c->request->params->{tagdata}; > close TagData; > > } > > As you can see I do not get the associated tag data yet, I am just > trying to display the tag data received from the ALE server. > > I can see that the data is coming through correctly by monitoring the > console debug and checking the tagdata.txt file. > > The problem that I have is that I have no idea how to push the data to a > web page instead of pulling. > > I have tried using catalyst redirect, forward and subrequest with no > luck. > > I am not a hard core developer, so any assistance will be greatly > appreciated. > > Regards > Morne Supra > > If you want an upload of your data (i.e., tagdata.txt) to a web page, then I think its nothing to do with catalyst. Use the LWP module where you can POST file to a web page. This link might help-> http://lwp.interglacial.com/ch05_07.htm -- View this message in context: http://www.nabble.com/Pushing-data-to-Catalyst-powered-web-page-tp194547 67p19454995.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/ To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer. From terence at deeproot.co.in Mon Sep 15 09:47:22 2008 From: terence at deeproot.co.in (Terence Monteiro) Date: Mon Sep 15 09:47:38 2008 Subject: [Catalyst] Slow template processing on debian lenny Message-ID: <48CE211A.5050905@deeproot.co.in> Hi, I've been using TT for years and enjoy the features it provides. In one of my Catalyst applications, I'm processing a template which generates HTML to give me a table with counts taken from a hash. I'm using a lot of nested FOREACH to generate the table. On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to process the template. On a production server using debian lenny, it used to take around the same amount of time. But recently, I upgraded it to libperl 5.10 and updated the different Perl modules including Template and Catalyst::View::TT. After this upgrade, the same template takes 25 seconds on average to process. The times I am mentioning are the times taken on the server side, as shown by the Catalyst application debug logs. I tried to work around the problem by bypassing C::V::TT and using the following code to process the template inside the controller, but to no ava= il: my $tmpl =3D Template->new({ INCLUDE_PATH =3D> $c->config->{home} . '/root', RELATIVE =3D> 1 }); my $output =3D ''; $tmpl->process('index.tt', { %{$c->stash}, c =3D> $c }, \$output); $c->res->body($output); The sources.list reads: deb ftp://ftp.tw.debian.org/debian lenny main The output from perl Makefile.PL is: *** Module::AutoInstall version 1.03 *** Checking for Perl dependencies... [Core Features] - Catalyst ...loaded. (5.7014 >=3D 5.70= 10) - Catalyst::Controller ...loaded. (0) - Catalyst::Action::RenderView ...loaded. (0.08 >=3D 0.04) - Catalyst::Plugin::ConfigLoader ...loaded. (0.21 >=3D 0.14) - Catalyst::Plugin::Static::Simple ...loaded. (0.20 >=3D 0.20) - Catalyst::Plugin::Prototype ...loaded. (1.33 >=3D 1.33) - Catalyst::Plugin::Session ...loaded. (0.19 >=3D 0.14) - Catalyst::Plugin::Session::Store::FastMmap ...loaded. (0.05 >=3D 0.02) - Catalyst::Plugin::Session::State::Cookie ...loaded. (0.09 >=3D 0.07) - Catalyst::Plugin::Unicode ...loaded. (0.8 >=3D 0.2) - Catalyst::View::PNGTTGraph ...loaded. (0.02 >=3D 0.02) - Catalyst::View::TT ...loaded. (0.27 >=3D 0.25) - Catalyst::View::Download ...loaded. (0.04 >=3D 0.04) - Data::Page ...loaded. (2.00 >=3D 2.00) - Date::Calc ...loaded. (5.4 >=3D 5.4) - Date::Formatter ...loaded. (0.09 >=3D 0.09) - Date::Manip ...loaded. (5.54 >=3D 0.04) - DBI ...loaded. (1.607 >=3D 1.57) - FindBin ...loaded. (1.49 >=3D 1.47) - HTML::FormatText ...loaded. (2.04 >=3D 2.04) - HTML::TreeBuilder ...loaded. (3.23 >=3D 3.23) - MIME::Entity ...loaded. (5.420 >=3D 5.420) - Module::Install ...loaded. (0.75 >=3D 0.68) - Template ...loaded. (2.20 >=3D 2.19) - Template::Plugin::Date ...loaded. (2.77 >=3D 2.77) - Template::Plugin::HtmlToText ...loaded. (0.03 >=3D 0.02) - Time::Local ...loaded. (1.18 >=3D 1.17) - YAML ...loaded. (0.66) *** Module::AutoInstall configuration finished. Writing Makefile for tirt So though my modules are sufficiently recent, template processing is extremely slow. Please help if you have faced a similar problem or have an idea. I've attached the TT template. -- = Thanks and Regards, Terence Monteiro. DeepRoot Linux, Ph: +91 (80) 4112 4781 / 85. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080915/cdec4= 77b/summary.htm From onken at houseofdesign.de Mon Sep 15 10:02:46 2008 From: onken at houseofdesign.de (Moritz Onken) Date: Mon Sep 15 10:03:00 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48CE211A.5050905@deeproot.co.in> References: <48CE211A.5050905@deeproot.co.in> Message-ID: <78A767FD-A4C3-40FF-A9AE-4B77C233D9F8@houseofdesign.de> > Hi, > > I've been using TT for years and enjoy the features it provides. In > one of > my Catalyst applications, I'm processing a template which generates > HTML to > give me a table with counts taken from a hash. I'm using a lot of > nested > FOREACH to generate the table. > > On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to > process the template. On a production server using debian lenny, it > used to > take around the same amount of time. But recently, I upgraded it to > libperl > 5.10 and updated the different Perl modules including Template and > Catalyst::View::TT. After this upgrade, the same template takes 25 > seconds > on average to process. The times I am mentioning are the times taken > on the > server side, as shown by the Catalyst application debug logs. > > I tried to work around the problem by bypassing C::V::TT and using the > following code to process the template inside the controller, but to > no avail: > > my $tmpl = Template->new({ > INCLUDE_PATH => $c->config->{home} . '/root', > RELATIVE => 1 > }); > my $output = ''; > $tmpl->process('index.tt', { %{$c->stash}, c => $c }, \$output); > $c->res->body($output); > Try Template::Alloy instead. It's a fully compatible faster implementation of TT. replace > my $tmpl = Template->new({ > INCLUDE_PATH => $c->config->{home} . '/root', > RELATIVE => 1 > }); with > my $tmpl = Template::Alloy->new({ > INCLUDE_PATH => $c->config->{home} . '/root', > RELATIVE => 1 > }); and install Template::alloy, of course. From jlmartinez-lists-catalyst at capside.com Mon Sep 15 10:28:03 2008 From: jlmartinez-lists-catalyst at capside.com (Jose Luis Martinez) Date: Mon Sep 15 10:28:09 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48CE211A.5050905@deeproot.co.in> References: <48CE211A.5050905@deeproot.co.in> Message-ID: <48CE2AA3.5050208@capside.com> Terence Monteiro escribi?: > On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to > process the template. On a production server using debian lenny, it used to > take around the same amount of time. But recently, I upgraded it to libperl > 5.10 and updated the different Perl modules including Template and > Catalyst::View::TT. After this upgrade, the same template takes 25 seconds > on average to process. The times I am mentioning are the times taken on the > server side, as shown by the Catalyst application debug logs. Maybe Template Toolkit is packaged without the XS module enabled? http://search.cpan.org/~abw/Template-Toolkit-2.20/lib/Template/Stash/XS.pm Jose Luis Martinez jlmartinez@capside.com From drbean at freeshell.org Mon Sep 15 10:59:35 2008 From: drbean at freeshell.org (Greg Matheson) Date: Mon Sep 15 10:59:40 2008 Subject: [Catalyst] [patch] Catalyst::Authentication::Store::DBIx::Class's authenticate parameters Documentation Message-ID: <20080915095935.GA10726@sdf.freeshell.org> t0m and others on #catalyst helped me understand that the 'username' key-value pair I was passing to authenticate was resulting in the first user in the user_class table being authenticated, a problem that has apparently been met by others too. See the message at http://lists.scsys.co.uk/pipermail/catalyst/2008-August/019560.html. I had a different table column in id_field. I thought the POD could be made more informative about this problem, so prepared a patch. What it does is replace 'username' as the keyname passed to authenticate with 'user_id', the value of the id_field configuration option used in the example in the Synopsis. However, the exchange between Matt Trout and Jay Kuri following the above message has muddied my understanding and I haven't cleared this confusion by reading the source or by reading about DBIx::Class's search routine. So feel freee to ignore this patch if it makes what appears to be 'widespread' confusion worse. [drbean@localhost dic]$ diff -u Class.pm.orig Class.pm --- Class.pm.orig 2008-09-15 17:39:37.000000000 +0800 +++ Class.pm 2008-09-15 17:48:30.000000000 +0800 @@ -127,7 +127,7 @@ my ( $self, $c ) = @_; $c->authenticate({ - username => $c->req->params->username, + user_id => $c->req->params->username, password => $c->req->params->password, status => [ 'registered', 'loggedin', 'active'] })) @@ -270,7 +270,7 @@ is below: if ($c->authenticate({ - username => $c->req->params->{'username'}, + user_id => $c->req->params->{'username'}, password => $c->req->params->{'password'}, status => [ 'registered', 'active', 'loggedin'] })) { @@ -278,11 +278,12 @@ # ... authenticated user code here } -The above example would attempt to retrieve a user whose username column -matched the username provided, and whose status column matched one of the -values provided. These name => value pairs are used more or less directly in -the DBIx::Class' search() routine, so in most cases, you can use DBIx::Class -syntax to retrieve the user according to whatever rules you have. +The above example would attempt to retrieve a user whose username column (here, +'user_id') matched the username provided, and whose status column matched one +of the values provided. (The username column name may be specified by the +id_field configuration option.) These name => value pairs are used more or less +directly in the DBIx::Class' search() routine, so in most cases, you can use +DBIx::Class syntax to retrieve the user according to whatever rules you have. NOTE: Because the password in most cases is encrypted - it is not used directly but it's encryption and comparison with the value provided is usually From terence at deeproot.co.in Mon Sep 15 16:23:50 2008 From: terence at deeproot.co.in (Terence Monteiro) Date: Mon Sep 15 16:24:00 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48CE2AA3.5050208@capside.com> References: <48CE211A.5050905@deeproot.co.in> <48CE2AA3.5050208@capside.com> Message-ID: <48CE7E06.80202@deeproot.co.in> Jose Luis Martinez wrote: > Terence Monteiro escribi?: >> On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to >> process the template. On a production server using debian lenny, it >> used to >> take around the same amount of time. But recently, I upgraded it to >> libperl >> 5.10 and updated the different Perl modules including Template and >> Catalyst::View::TT. After this upgrade, the same template takes 25 >> seconds >> on average to process. The times I am mentioning are the times taken >> on the >> server side, as shown by the Catalyst application debug logs. > > Maybe Template Toolkit is packaged without the XS module enabled? > > http://search.cpan.org/~abw/Template-Toolkit-2.20/lib/Template/Stash/XS.pm When I run perl -MTemplate::Stash::XS -e 'print "No problem\n"' it tells me that Template::Stash::XS is present. I dumped c.session, c.config and c.stash into a YAML file, read it using a script and used the data to process my template. It took just 0.62 seconds, which is way faster than when C::V::TT processes it. I actually did some tests to verify whether it is a TT problem, but it does not occur when I use the Template module directly. The log information and test results seem strange, and I still cannot point my finger on a specific Perl module. Could it be a libperl issue? My libperl5.10 version is 5.10.0-13 from debian lenny. -- Thanks and Regards, Terence Monteiro. DeepRoot Linux, http://deeproot.co.in From Wade.Stuart at fallon.com Mon Sep 15 17:08:06 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Mon Sep 15 17:08:17 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48CE7E06.80202@deeproot.co.in> Message-ID: Terence Monteiro wrote on 09/15/2008 10:23:50 AM: > Jose Luis Martinez wrote: > > Terence Monteiro escribi?: > >> On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to > >> process the template. On a production server using debian lenny, it > >> used to > >> take around the same amount of time. But recently, I upgraded it to > >> libperl > >> 5.10 and updated the different Perl modules including Template and > >> Catalyst::View::TT. After this upgrade, the same template takes 25 > >> seconds > >> on average to process. The times I am mentioning are the times taken > >> on the > >> server side, as shown by the Catalyst application debug logs. > > > > Maybe Template Toolkit is packaged without the XS module enabled? > > > > http://search.cpan.org/~abw/Template-Toolkit-2.20 /lib/Template/Stash/XS.pm > > When I run > > perl -MTemplate::Stash::XS -e 'print "No problem\n"' > > it tells me that Template::Stash::XS is present. > > I dumped c.session, c.config and c.stash into a YAML file, read it using a > script and used the data to process my template. It took just 0.62 seconds, > which is way faster than when C::V::TT processes it. I actually did some > tests to verify whether it is a TT problem, but it does not occur when I > use the Template module directly. The log information and test results seem > strange, and I still cannot point my finger on a specific Perl module. > Could it be a libperl issue? My libperl5.10 version is 5.10.0-13 from > debian lenny. try: perl -V I bet you see !5.10. XS is not binary compatible a lot of the time with different perl versions, it is best to update perl to 5.10 too and then reinstall XS modules. -Wade From peter at capybara-software.com Mon Sep 15 20:09:20 2008 From: peter at capybara-software.com (Pedro Guevara) Date: Mon Sep 15 20:09:30 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: References: Message-ID: <48CEB2E0.6080605@capybara-software.com> hi everybody In a project I receive plenty of data like xml using Catalyst. I was wondering if you know some tool to convert this xml data to html. Peter From peter at capybara-software.com Mon Sep 15 20:11:55 2008 From: peter at capybara-software.com (Pedro Guevara) Date: Mon Sep 15 20:12:03 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEB2E0.6080605@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> Message-ID: <48CEB37B.6090108@capybara-software.com> hi everybody In a project I receive plenty of data like xml using Catalyst. I was wondering if you know some tool to convert this xml data to html. Thanks in advance Peter From thiago at aware.com.br Mon Sep 15 20:34:58 2008 From: thiago at aware.com.br (Thiago Rondon) Date: Mon Sep 15 20:35:29 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEB37B.6090108@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> Message-ID: <48CEB8E2.4000209@aware.com.br> Pedro, It's not a Catalyst job. Suggestion ? Try to understand this XML, make a script by yourself to do this job. You can find modules at CPAN to help you. -Thiago Rondon Pedro Guevara escreveu: > hi everybody > > In a project I receive plenty of data like xml using Catalyst. I was > wondering if you know some tool to convert this xml data to html. > > Thanks in advance > > Peter > > _______________________________________________ > 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/ > > > From jshirley at gmail.com Mon Sep 15 20:37:46 2008 From: jshirley at gmail.com (J. Shirley) Date: Mon Sep 15 20:37:53 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEB37B.6090108@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> Message-ID: <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> On Mon, Sep 15, 2008 at 12:11 PM, Pedro Guevara wrote: > hi everybody > > In a project I receive plenty of data like xml using Catalyst. I was > wondering if you know some tool to convert this xml data to html. > > Thanks in advance > > Peter > xslt? More info please. -J From peter at capybara-software.com Mon Sep 15 20:53:18 2008 From: peter at capybara-software.com (Pedro Guevara) Date: Mon Sep 15 20:53:33 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> Message-ID: <48CEBD2E.30907@capybara-software.com> Well I thought to make a script but It's going to take me a lot of time. Because is a complex tree of data, so I supossed that some module of = Catalyst would do it for me. It's like And it retrieves: like html Libraries
Library : Wolf Books: The King, The Queen
Library : Fox Books: The Castle, The Dragon
I expect you could understand me... Thanks for your help... Peter J. Shirley wrote: > On Mon, Sep 15, 2008 at 12:11 PM, Pedro Guevara > wrote: > = >> hi everybody >> >> In a project I receive plenty of data like xml using Catalyst. I was >> wondering if you know some tool to convert this xml data to html. >> >> Thanks in advance >> >> Peter >> >> = > > xslt? > > More info please. > > -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.u= k/ > Dev site: http://dev.catalyst.perl.org/ > > = -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080915/f9b44= 6c2/attachment.htm From jshirley at gmail.com Mon Sep 15 21:29:52 2008 From: jshirley at gmail.com (J. Shirley) Date: Mon Sep 15 21:29:55 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEBD2E.30907@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> <48CEBD2E.30907@capybara-software.com> Message-ID: <756703690809151329q4acc2fccg8a0dcfc829e6915e@mail.gmail.com> On Mon, Sep 15, 2008 at 12:53 PM, Pedro Guevara wrote: > Well I thought to make a script but It's going to take me a lot of time. > Because is a complex tree of data, so I supossed that some module of > Catalyst would do it for me. [stop] No, Catalyst is an MVC framework. It helps structure -your- code and other code into logical compartments so that it is easier to develop, maintain, etc. What you want is "perl". That's the programming language Catalyst is written in. > It's like > > > > > > > > > > > > And it retrieves: like html > > Libraries > > > > > > > > > >
Library : WolfBooks: The King, The Queen
Library : Fox Books: The Castle, The Dragon
> > I expect you could understand me... > Thanks for your help... You probably want XSLT, since it is exactly for transforming XML to other formats (such as HTML). There are many ways to do this, and many perl modules available to help: http://search.cpan.org/search?query=Xslt&mode=all -J From nickolay8 at gmail.com Mon Sep 15 22:57:57 2008 From: nickolay8 at gmail.com (Nickolay Platonov) Date: Mon Sep 15 22:58:06 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <756703690809151329q4acc2fccg8a0dcfc829e6915e@mail.gmail.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> <48CEBD2E.30907@capybara-software.com> <756703690809151329q4acc2fccg8a0dcfc829e6915e@mail.gmail.com> Message-ID: <642e0710809151457t2b64b34ah6a91d748f32acc2a@mail.gmail.com> If you are looking for XML Parser I can recomend to use XML::LibXML instead any other. On Tue, Sep 16, 2008 at 12:29 AM, J. Shirley wrote: > On Mon, Sep 15, 2008 at 12:53 PM, Pedro Guevara > wrote: > > Well I thought to make a script but It's going to take me a lot of time. > > Because is a complex tree of data, so I supossed that some module of > > Catalyst would do it for me. > > [stop] > > No, Catalyst is an MVC framework. It helps structure -your- code and > other code into logical compartments so that it is easier to develop, > maintain, etc. > > What you want is "perl". That's the programming language Catalyst is > written in. > > > It's like > > > > > > > > > > > > > > > > > > > > > > > > And it retrieves: like html > > > > Libraries > > > > > > > > > > > > > > > > > > > >
Library : WolfBooks: The King, The Queen
Library : Fox Books: The Castle, The Dragon
> > > > I expect you could understand me... > > Thanks for your help... > > You probably want XSLT, since it is exactly for transforming XML to > other formats (such as HTML). > > There are many ways to do this, and many perl modules available to help: > http://search.cpan.org/search?query=3DXslt&mode=3Dall > > -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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080916/26f63= 4ee/attachment.htm From xavier.caron at atmel.com Tue Sep 16 07:22:25 2008 From: xavier.caron at atmel.com (Xavier Caron) Date: Tue Sep 16 07:22:29 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEBD2E.30907@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> <48CEBD2E.30907@capybara-software.com> Message-ID: <20080916082225.7a68cd42.xavier.caron@atmel.com> Howdy, > I expect you could understand me... As already stated on the list, this is not Catalyst's work. You'll want to use XML::LibXML, XML::LibXSLT or XML::Twig for this matter instead. Here is a little sample of what you can do with XML::LibXSLT (by chance, I'm currently deep into this at the office ;^): - libraries.xml (fixed for it wasn't valid) - xml_to_html.xsl Pedro's Libraries

Pedro's Libraries

Library

- xml_to_html #!/usr/local/bin/perl use strict; use warnings; use XML::LibXSLT; use XML::LibXML; my $xslted_dom = transform ( document_file => 'libraries.xml', stylesheet_file => 'xml_to_html.xsl' ); print $xslted_dom->toString ( 1 ); # or toFile ( 'libraries.html', 1 ) see perldoc XML::LibXML::Document sub transform { my ( %h ) = @_; my $xml_parser = XML::LibXML->new; my $xslt_parser = XML::LibXSLT->new; $xml_parser->validation ( 0 ); # perldoc XML::LibXML::Parser $xml_parser->load_ext_dtd ( 0 ); my $xml_dom = $xml_parser->parse_file ( $h{document_file} ); my $xsl_dom = $xml_parser->parse_file ( $h{stylesheet_file} ); my $stylesheet = $xslt_parser->parse_stylesheet ( $xsl_dom ); $stylesheet->transform ( $xml_dom, @{$h{parameter_list}} ); } FYI, xml_to_html is Perl equivalent for xsltproc (libxslt) point-tool: % xsltproc xml_to_html.xsl libraries.xml This should help you for this XSLT rather steep learning curve. Cheers, X. From robin at berjon.com Tue Sep 16 17:00:53 2008 From: robin at berjon.com (Robin Berjon) Date: Tue Sep 16 17:00:56 2008 Subject: [Catalyst] Xml data to html In-Reply-To: <48CEBD2E.30907@capybara-software.com> References: <48CEB2E0.6080605@capybara-software.com> <48CEB37B.6090108@capybara-software.com> <756703690809151237l43cc4dcana52c20758eab9f3f@mail.gmail.com> <48CEBD2E.30907@capybara-software.com> Message-ID: <48B1AFF3-F86C-4B02-866D-C17CB59A3534@berjon.com> On Sep 15, 2008, at 21:53 , Pedro Guevara wrote: > Well I thought to make a script but It's going to take me a lot of > time. > Because is a complex tree of data, so I supossed that some module of > Catalyst would do it for me. > It's like > > > > > > > > > > > > And it retrieves: like html > > Libraries > > > > > > > > > >
Library : WolfBooks: The King, The Queen
Library : Fox Books: The Castle, The Dragon
Like everyone else I can only say that this has nothing to do with Catalyst. But what the heck. It's a trivial conversion, so simple that you don't even need XSLT (though you can still use it, I probably would). Old school approach: use XML::LibXML; my $doc = XML::LibXML->new->parse_file('libraries.xml'); print "\n"; for my $lib ($doc->getElementsByTagNameNS(undef, 'library')) { print " \n \n \n \n"; } print "
Library:" . $lib->getAttributeNS(undef, 'name') . "Books:" . join(', ', map { $_->getAttributeNS(undef, 'name') } $lib- >getElementsByTagNameNS(undef, 'book')) . "
\n"; I haven't tested the above, but if it doesn't work something a lot like it will. -- Robin Berjon - http://berjon.com/ Feel like hiring me? Go to http://robineko.com/ From emily at burnham.org Tue Sep 16 17:41:58 2008 From: emily at burnham.org (Emily Heureux) Date: Tue Sep 16 17:42:09 2008 Subject: [Catalyst] Switching to a production server In-Reply-To: <48C7865E.5060402@tiscali.co.uk> References: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> <48C7865E.5060402@tiscali.co.uk> Message-ID: <000901c9181b$23808a60$8ff1010a@burnham.org> Thanks, I read your suggestions and opinions and am switching to fastcgi with apache. I'd like to do this in steps: 1. Install FCGI::ProcManager 2. Run myapp_fastcgi.pl from the command line, just like myapp_server.pl 3. Then go through apache with mod_fastcgi. I am on step 2, and I am thinking that I can't do that with that fastcgi script like I can with myapp_server.pl. I need to combine 2 and 3? E > -----Original Message----- > From: ivorw [mailto:m9tn-oh4c@xemaps.com] > Sent: Wednesday, September 10, 2008 1:34 AM > To: catalyst@lists.scsys.co.uk > Subject: Re: [Catalyst] Switching to a production server > > Emily Heureux wrote: > > > > Hi, I have been developing a Catalyst application and just using the > > Catalyst myapp_server.pl script to run it. We server a very small > > market, currently less than 100 visits a day. The major issue we are > > having is that even small images are loaded very slowly, and therefore > > the pages are loaded slowly, on the order of more than 5 seconds for a > > first time visitor. > > > > > > > > At this time, I don't know anything about fast_cgi or configuring > > apache or what have you, to work with Catalyst, but before I take that > > on, my question is, is it likely that the slow loading of very small > > images has to do with the default myapp_server.pl, and switching to > > something else will make a big difference with loading images and > > possibly other files? > > > > > > > I don't recommend going live by running myapp_server.pl - this is > intended for development and debugging. I do recommend using a > standalone fastcgi process farm (which could have just a single > instance), talking through a named pipe in the /tmp directory. The > fastcgi process runs in your application user account, saving you from > having to open up the permissions of your files to the www-data user. > > This is quite well documented, see > http://search.cpan.org/~mramberg/Catalyst- > Runtime/lib/Catalyst/Engine/FastCGI.pm > > Also apart from in special circumstances, there's usually no reason to > serve images through your Catalyst application. The special > circumstances I imagine could be if the image is being stored in a > database blob, or being tweaked on the fly with ImageMagick. > > One option could be to change the URLs for the images to be absolute > ones on the webserver, rather than static/images/powered_by.jpg etc. > which will deliver performance results with myapp_server.pl. You'd need > to copy the root/static/images directory to somewhere more public, where > the www-data user can see and use it. A recommended, documented option > is to configure Apache to handle /static rather than pass these requests > to the application with the following config snippet: > > > SetHandler default-handler > > > > For more on configuring Apache 2.0, see > http://search.cpan.org/~agrundma/Catalyst-Engine- > Apache/lib/Catalyst/Engine/Apache2/MP20.pm > > Please bear it in mind that most of the information in this Pod is about > configuring your Catalyst app to run under mod_perl. I much prefer > fastcgi as it gives me much more control and awareness of machine > resources, keeps my permissions sane, and allows me to run multiple > different Catalyst applications and versions on the same box. > > > Ivor. > > _______________________________________________ > 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/ From m9tn-oh4c at xemaps.com Tue Sep 16 20:42:43 2008 From: m9tn-oh4c at xemaps.com (ivorw) Date: Tue Sep 16 20:42:55 2008 Subject: [Catalyst] Switching to a production server In-Reply-To: <000901c9181b$23808a60$8ff1010a@burnham.org> References: <049b01c912ca$2c7c7ee0$aaf0010a@burnham.org> <48C7865E.5060402@tiscali.co.uk> <000901c9181b$23808a60$8ff1010a@burnham.org> Message-ID: <48D00C33.1050101@tiscali.co.uk> Emily Heureux wrote: > Thanks, I read your suggestions and opinions and am switching to fastcgi > with apache. I'd like to do this in steps: > 1. Install FCGI::ProcManager > 2. Run myapp_fastcgi.pl from the command line, just like myapp_server.pl > 3. Then go through apache with mod_fastcgi. > > I am on step 2, and I am thinking that I can't do that with that fastcgi > script like I can with myapp_server.pl. I need to combine 2 and 3? > > E > > I would do 3 before 2. Configure Apache to be ready to handle a fastcgi connection through a socket (from the docs): FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket Alias /myapp/ /tmp/myapp/myapp.fcgi/ # Or, run at the root Alias / /tmp/myapp.fcgi/ # Optionally, rewrite the path when accessed without a trailing slash RewriteRule ^/myapp$ myapp/ [R] Now having reloaded or restarted Apache2, you should be in a position to point a browser at the new application, and get a 500 error page. The logs should be able to tell you whether your Apache configuration is doing the right thing. >From your application user account shell, now run $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 2 or however many server processes you want to run. >> -----Original Message----- >> From: ivorw [mailto:m9tn-oh4c@xemaps.com] >> Sent: Wednesday, September 10, 2008 1:34 AM >> To: catalyst@lists.scsys.co.uk >> Subject: Re: [Catalyst] Switching to a production server >> >> Emily Heureux wrote: >> >>> Hi, I have been developing a Catalyst application and just using the >>> Catalyst myapp_server.pl script to run it. We server a very small >>> market, currently less than 100 visits a day. The major issue we are >>> having is that even small images are loaded very slowly, and therefore >>> the pages are loaded slowly, on the order of more than 5 seconds for a >>> first time visitor. >>> >>> >>> >>> At this time, I don't know anything about fast_cgi or configuring >>> apache or what have you, to work with Catalyst, but before I take that >>> on, my question is, is it likely that the slow loading of very small >>> images has to do with the default myapp_server.pl, and switching to >>> something else will make a big difference with loading images and >>> possibly other files? >>> >>> >>> >>> >> I don't recommend going live by running myapp_server.pl - this is >> intended for development and debugging. I do recommend using a >> standalone fastcgi process farm (which could have just a single >> instance), talking through a named pipe in the /tmp directory. The >> fastcgi process runs in your application user account, saving you from >> having to open up the permissions of your files to the www-data user. >> >> This is quite well documented, see >> http://search.cpan.org/~mramberg/Catalyst- >> Runtime/lib/Catalyst/Engine/FastCGI.pm >> >> Also apart from in special circumstances, there's usually no reason to >> serve images through your Catalyst application. The special >> circumstances I imagine could be if the image is being stored in a >> database blob, or being tweaked on the fly with ImageMagick. >> >> One option could be to change the URLs for the images to be absolute >> ones on the webserver, rather than static/images/powered_by.jpg etc. >> which will deliver performance results with myapp_server.pl. You'd need >> to copy the root/static/images directory to somewhere more public, where >> the www-data user can see and use it. A recommended, documented option >> is to configure Apache to handle /static rather than pass these requests >> to the application with the following config snippet: >> >> >> SetHandler default-handler >> >> >> >> For more on configuring Apache 2.0, see >> http://search.cpan.org/~agrundma/Catalyst-Engine- >> Apache/lib/Catalyst/Engine/Apache2/MP20.pm >> >> Please bear it in mind that most of the information in this Pod is about >> configuring your Catalyst app to run under mod_perl. I much prefer >> fastcgi as it gives me much more control and awareness of machine >> resources, keeps my permissions sane, and allows me to run multiple >> different Catalyst applications and versions on the same box. >> >> >> Ivor. >> >> _______________________________________________ >> 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/ > > From jayk at ion0.com Wed Sep 17 02:01:25 2008 From: jayk at ion0.com (Jason Kuri) Date: Wed Sep 17 02:01:33 2008 Subject: [Catalyst] [patch] Catalyst::Authentication::Store::DBIx::Class's authenticate parameters Documentation In-Reply-To: <20080915095935.GA10726@sdf.freeshell.org> References: <20080915095935.GA10726@sdf.freeshell.org> Message-ID: Hi Greg, Thanks for the patch. You're right - this is confusing behavior. The cause of the problem is that any fields passed to authenticate that don't match fields in the user table are ignored. This is done to ensure that any fields that may relate to other credentials / stores / realms involved in authentication are not mistakenly passed to search. The practical upshot of this is that if your username field is different in the db than it is on the authenticate call, it winds up being ignored. The behavior you see is the same as calling $user_rs->search({})->first; I actually have a fix in my local sources which throws a big fit if it winds up with no fields to search with... which clears up the confusion pretty well. I've incorporated your 'username' change in the authenticate call to the docs also. Though the id_field explanation is not quite right. I've updated the id_field documentation, hopefully to clear things up. I'll see about pushing a new rev up in the next few days. The new id_field doc snippit is below. --- snip --- =item id_field In most cases, this config variable does not need to be set, as Catalyst::Authentication::Store::DBIx::Class will determine the primary key of the user table on it's own. If you need to override the default, or your user table has multiple primary keys, then id_field should contain the column name that should be used to restore the user. A given value in this column should correspond to a single user in the database. Note that this is used B when restoring a user from the session and has no bearing whatsoever in the initial authentication process. Note also that if use_userdata_from_session is enabled, this config parameter is not used at all. --- snip --- Does that clear things up for you? Jay On Sep 15, 2008, at 3:59 AM, Greg Matheson wrote: > t0m and others on #catalyst helped me understand that the > 'username' key-value pair I was passing to authenticate was > resulting in the first user in the user_class table being > authenticated, a problem that has apparently been met by others > too. See the message at > http://lists.scsys.co.uk/pipermail/catalyst/2008-August/019560.html. > > I had a different table column in id_field. > > I thought the POD could be made more informative about this > problem, so prepared a patch. > > What it does is replace 'username' as the keyname passed to > authenticate with 'user_id', the value of the id_field > configuration option used in the example in the Synopsis. > > However, the exchange between Matt Trout and Jay Kuri following > the above message has muddied my understanding and I haven't > cleared this confusion by reading the source or by reading about > DBIx::Class's search routine. > > So feel freee to ignore this patch if it makes what appears to be > 'widespread' confusion worse. > > [drbean@localhost dic]$ diff -u Class.pm.orig Class.pm > --- Class.pm.orig 2008-09-15 17:39:37.000000000 +0800 > +++ Class.pm 2008-09-15 17:48:30.000000000 +0800 > @@ -127,7 +127,7 @@ > my ( $self, $c ) = @_; > > $c->authenticate({ > - username => $c->req->params->username, > + user_id => $c->req->params->username, > password => $c->req->params->password, > status => [ 'registered', 'loggedin', > 'active'] > })) > @@ -270,7 +270,7 @@ > is below: > > if ($c->authenticate({ > - username => $c->req->params->{'username'}, > + user_id => $c->req->params->{'username'}, > password => $c->req->params->{'password'}, > status => [ 'registered', 'active', > 'loggedin'] > })) { > @@ -278,11 +278,12 @@ > # ... authenticated user code here > } > > -The above example would attempt to retrieve a user whose username > column > -matched the username provided, and whose status column matched one > of the > -values provided. These name => value pairs are used more or less > directly in > -the DBIx::Class' search() routine, so in most cases, you can use > DBIx::Class > -syntax to retrieve the user according to whatever rules you have. > +The above example would attempt to retrieve a user whose username > column (here, > +'user_id') matched the username provided, and whose status column > matched one > +of the values provided. (The username column name may be specified > by the > +id_field configuration option.) These name => value pairs are used > more or less > +directly in the DBIx::Class' search() routine, so in most cases, > you can use > +DBIx::Class syntax to retrieve the user according to whatever rules > you have. > > NOTE: Because the password in most cases is encrypted - it is not used > directly but it's encryption and comparison with the value provided > is usually > > > > _______________________________________________ > 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/ From drbean at freeshell.org Wed Sep 17 04:37:25 2008 From: drbean at freeshell.org (Greg Matheson) Date: Wed Sep 17 04:37:30 2008 Subject: [Catalyst] [patch] Catalyst::Authentication::Store::DBIx::Class's authenticate parameters Documentation In-Reply-To: References: <20080915095935.GA10726@sdf.freeshell.org> Message-ID: <20080917033725.GH26511@sdf.freeshell.org> On Tue, 16 Sep 2008, Jason Kuri wrote: > I've updated the id_field documentation, hopefully to clear things > up. I'll see about pushing a new rev up in the next few days. > The new id_field doc snippit is below. > =item id_field > ... > Note that this is used B when restoring a user from the session > and > has no bearing whatsoever in the initial authentication process. Note > also > that if use_userdata_from_session is enabled, this config parameter > is not used at all. > --- snip --- > Does that clear things up for you? Thanks, that helps. Setting id_field in the configuration to Catalyst::Authentication::Store::DBIx::Class, I was just cargo-culting from the Catalyst::Manual::Tutorial::Authentication documentation. If I hadn't seen it there, I wouldn't have tried fiddling with it. And I see the reason my application started working was not so much my fiddling with id_field, as my accidental inclusion of the primary key in the arguments to authenticate. Perhaps the id_field option should be removed from the Tutorial. From sardaukar.siet at gmail.com Wed Sep 17 17:47:14 2008 From: sardaukar.siet at gmail.com (sardaukar_siet) Date: Wed Sep 17 17:47:17 2008 Subject: [Catalyst] Help! Need help deploying app to Apache Message-ID: <19536440.post@talk.nabble.com> Hello all. I have a Catalyst app running fine with the _server.pl script, but trying to deploy it with mod_perl for Apache 2 has proven itself impossible... %-| Here is the file I include at the end of my httpd.conf: ----------------------------------------------------------------- PerlOptions +GlobalRequest PerlSwitches -I/home/LookingGlass/LookingGlass/lib/ PerlSwitches -I/home/LookingGlass/LookingGlass/lib/Net PerlModule LookingGlass SetHandler modperl PerlResponseHandler LookingGlass DocumentRoot /home/LookingGlass/LookingGlass/lib/ Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ErrorLog /var/log/httpd/LookingGlass_error.log LogLevel warn CustomLog /var/log/httpd/LookingGlass_access.log combined ServerSignature On ----------------------------------------------------------------- And here is a typical error msg when going to https://localhost/: ----------------------------------------------------------------- Request bless({ action => "index", address => "10.137.9.24", arguments => [], base => bless(do{\(my $o = "https://lgdeploy/")}, "URI::https"), body_parameters => {}, captures => [], cookies => { lookingglass_session => bless({ name => "lookingglass_session", path => "/", value => ["e56ac9d37cac79e47e1c6de681dc67313b0da6e0"], }, "CGI::Simple::Cookie"), }, headers => bless({ "accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "accept-charset" => "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "accept-encoding" => "gzip,deflate", "accept-language" => "en-us,en;q=0.5", connection => "keep-alive", cookie => "lookingglass_session=e56ac9d37cac79e47e1c6de681dc67313b0da6e0", host => "lgdeploy", "keep-alive" => 300, "user-agent" => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1", }, "HTTP::Headers"), hostname => undef, match => "", method => "GET", parameters => {}, path => "", protocol => "HTTP/1.1", query_parameters => {}, secure => 1, uploads => {}, uri => bless(do{\(my $o = "https://lgdeploy/")}, "URI::https"), user => undef, }, "Catalyst::Request") Response bless({ body => "", cookies => {}, headers => bless({ "content-type" => "text/html; charset=utf-8", "x-catalyst" => "5.7014", }, "HTTP::Headers"), status => 200, }, "Catalyst::Response") Stash {} Config do { my $a = { "Plugin::Authentication" => {}, "Plugin::ConfigLoader" => {}, debug => { ignore_classes => [ "DBIx::Class::ResultSource::Table", "DBIx::Class::ResultSourceHandle", "DateTime", ], scrubber_func => sub { "???" }, }, form => {}, home => "/home/LookingGlass/LookingGlass", name => "LookingGlass", root => bless({ dirs => ["", "home", "LookingGlass", "LookingGlass", "root"], file_spec_class => undef, volume => "", }, "Path::Class::Dir"), session => { cookie_name => "lookingglass_session", expires => 7200, namespace => "", storage => "/tmp/lookingglass/session/data", verify_address => 0, }, static => { debug => 1, dirs => [], ignore_dirs => [], ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"], include_path => ['fix'], mime_types => {}, mime_types_obj => bless({}, "MIME::Types"), no_logs => 1, }, }; $a->{static}{include_path}[0] = $a->{root}; $a; } Session ID "e56ac9d37cac79e47e1c6de681dc67313b0da6e0" Session { __created => 1221670415, __updated => 1221671167, command_detail => { config => { type => "normal" }, name => "show diag", param_list => [] }, user => { groups => [{ id => 1, name => "Admin" }], id => 1, name => "Admin" }, } ----------------------------------------------------------------- Here is Apache's ssl.conf: ----------------------------------------------------------------- LoadModule ssl_module modules/mod_ssl.so Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl SSLPassPhraseDialog builtin SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) SSLSessionCacheTimeout 300 SSLMutex default SSLRandomSeed startup file:/dev/urandom 256 SSLRandomSeed connect builtin SSLCryptoDevice builtin ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /etc/pki/tls/private/localhost.key SSLOptions +StdEnvVars SSLOptions +StdEnvVars SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" ----------------------------------------------------------------- And here is what I usually get in the server script debug output: [info] *** Request 1 (0.167/s) [30473] [Wed Sep 17 18:23:35 2008] *** [debug] "GET" request for "/" from "10.137.9.24" [debug] Rendering template "index.tt" [error] Couldn't render template "file error - index.tt: not found" [error] Couldn't render template "file error - index.tt: not found" [info] Request took 0.069101s (14.472/s) .----------------------------------------------------------------+-----------. | Action | Time | +----------------------------------------------------------------+-----------+ | /index | 0.000914s | | /end | 0.008844s | | -> LookingGlass::View::HTML->process | 0.004835s | '----------------------------------------------------------------+-----------' Is there a way to know what path Catalyst is looking for the file? What was the precise error? Whatever info more you need, I am able to provide. Please help me... Thanks for your time reading this, Bruno -- View this message in context: http://www.nabble.com/Help%21-Need-help-deploying-app-to-Apache-tp19536440p19536440.html Sent from the Catalyst Web Framework mailing list archive at Nabble.com. From amesdaq at websense.com Wed Sep 17 18:25:57 2008 From: amesdaq at websense.com (Mesdaq, Ali) Date: Wed Sep 17 18:26:16 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: <19536440.post@talk.nabble.com> References: <19536440.post@talk.nabble.com> Message-ID: <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Did you try also looking at the apache error log? Might have useful information in there about file paths or permissions Thanks, ------------------------------------------ Ali Mesdaq (CISSP, GIAC-GREM) Sr. Security Researcher Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ -----Original Message----- From: sardaukar_siet [mailto:sardaukar.siet@gmail.com] Sent: Wednesday, September 17, 2008 9:47 AM To: catalyst@lists.scsys.co.uk Subject: [Catalyst] Help! Need help deploying app to Apache Hello all. I have a Catalyst app running fine with the _server.pl script, but trying to deploy it with mod_perl for Apache 2 has proven itself impossible... %-| Here is the file I include at the end of my httpd.conf: ----------------------------------------------------------------- PerlOptions +GlobalRequest PerlSwitches -I/home/LookingGlass/LookingGlass/lib/ PerlSwitches -I/home/LookingGlass/LookingGlass/lib/Net PerlModule LookingGlass SetHandler modperl PerlResponseHandler LookingGlass DocumentRoot /home/LookingGlass/LookingGlass/lib/ Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ErrorLog /var/log/httpd/LookingGlass_error.log LogLevel warn CustomLog /var/log/httpd/LookingGlass_access.log combined ServerSignature On ----------------------------------------------------------------- And here is a typical error msg when going to https://localhost/: ----------------------------------------------------------------- Request bless({ action => "index", address => "10.137.9.24", arguments => [], base => bless(do{\(my $o = "https://lgdeploy/")}, "URI::https"), body_parameters => {}, captures => [], cookies => { lookingglass_session => bless({ name => "lookingglass_session", path => "/", value => ["e56ac9d37cac79e47e1c6de681dc67313b0da6e0"], }, "CGI::Simple::Cookie"), }, headers => bless({ "accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "accept-charset" => "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "accept-encoding" => "gzip,deflate", "accept-language" => "en-us,en;q=0.5", connection => "keep-alive", cookie => "lookingglass_session=e56ac9d37cac79e47e1c6de681dc67313b0da6e0", host => "lgdeploy", "keep-alive" => 300, "user-agent" => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1", }, "HTTP::Headers"), hostname => undef, match => "", method => "GET", parameters => {}, path => "", protocol => "HTTP/1.1", query_parameters => {}, secure => 1, uploads => {}, uri => bless(do{\(my $o = "https://lgdeploy/")}, "URI::https"), user => undef, }, "Catalyst::Request") Response bless({ body => "", cookies => {}, headers => bless({ "content-type" => "text/html; charset=utf-8", "x-catalyst" => "5.7014", }, "HTTP::Headers"), status => 200, }, "Catalyst::Response") Stash {} Config do { my $a = { "Plugin::Authentication" => {}, "Plugin::ConfigLoader" => {}, debug => { ignore_classes => [ "DBIx::Class::ResultSource::Table", "DBIx::Class::ResultSourceHandle", "DateTime", ], scrubber_func => sub { "???" }, }, form => {}, home => "/home/LookingGlass/LookingGlass", name => "LookingGlass", root => bless({ dirs => ["", "home", "LookingGlass", "LookingGlass", "root"], file_spec_class => undef, volume => "", }, "Path::Class::Dir"), session => { cookie_name => "lookingglass_session", expires => 7200, namespace => "", storage => "/tmp/lookingglass/session/data", verify_address => 0, }, static => { debug => 1, dirs => [], ignore_dirs => [], ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"], include_path => ['fix'], mime_types => {}, mime_types_obj => bless({}, "MIME::Types"), no_logs => 1, }, }; $a->{static}{include_path}[0] = $a->{root}; $a; } Session ID "e56ac9d37cac79e47e1c6de681dc67313b0da6e0" Session { __created => 1221670415, __updated => 1221671167, command_detail => { config => { type => "normal" }, name => "show diag", param_list => [] }, user => { groups => [{ id => 1, name => "Admin" }], id => 1, name => "Admin" }, } ----------------------------------------------------------------- Here is Apache's ssl.conf: ----------------------------------------------------------------- LoadModule ssl_module modules/mod_ssl.so Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl SSLPassPhraseDialog builtin SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) SSLSessionCacheTimeout 300 SSLMutex default SSLRandomSeed startup file:/dev/urandom 256 SSLRandomSeed connect builtin SSLCryptoDevice builtin ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /etc/pki/tls/private/localhost.key SSLOptions +StdEnvVars SSLOptions +StdEnvVars SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" ----------------------------------------------------------------- And here is what I usually get in the server script debug output: [info] *** Request 1 (0.167/s) [30473] [Wed Sep 17 18:23:35 2008] *** [debug] "GET" request for "/" from "10.137.9.24" [debug] Rendering template "index.tt" [error] Couldn't render template "file error - index.tt: not found" [error] Couldn't render template "file error - index.tt: not found" [info] Request took 0.069101s (14.472/s) .----------------------------------------------------------------+-----------. | Action | Time | +----------------------------------------------------------------+-----------+ | /index | 0.000914s | | /end | 0.008844s | | -> LookingGlass::View::HTML->process | 0.004835s | '----------------------------------------------------------------+-----------' Is there a way to know what path Catalyst is looking for the file? What was the precise error? Whatever info more you need, I am able to provide. Please help me... Thanks for your time reading this, Bruno -- View this message in context: http://www.nabble.com/Help%21-Need-help-deploying-app-to-Apache-tp19536440p19536440.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/ Protected by Websense Messaging Security -- www.websense.com From sardaukar.siet at gmail.com Wed Sep 17 18:33:28 2008 From: sardaukar.siet at gmail.com (Bruno Antunes) Date: Wed Sep 17 18:33:32 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> References: <19536440.post@talk.nabble.com> <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Message-ID: SSBzZW50IGFuIGV4YW1wbGUgb2YgdGhlIGVycm9ycyBpbiBBcGFjaGUncyBlcnJvcl9sb2csIGl0 IHdhcyBsaWtlIHRoaXM6CgpbV2VkIFNlcCAxNyAxODozMDoxOCAyMDA4XSBbbm90aWNlXSBBcGFj aGUvMi4yLjMgKENlbnRPUykgY29uZmlndXJlZCAtLQpyZXN1bWluZyBub3JtYWwgb3BlcmF0aW9u cwpbaW5mb10gKioqIFJlcXVlc3QgMSAoMC4xNDMvcykgWzMwNzA5XSBbV2VkIFNlcCAxNyAxODoz MDoyNCAyMDA4XSAqKioKW2RlYnVnXSAiR0VUIiByZXF1ZXN0IGZvciAiLyIgZnJvbSAiMTAuMTM3 LjkuMjQiCltkZWJ1Z10gUmVuZGVyaW5nIHRlbXBsYXRlICJpbmRleC50dCIKW2Vycm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ICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSAgPT4gImxvb2tpbmdnbGFzc19z ZXNzaW9uIiwKPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggID0+ICIvIiwKPiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0+Cj4gWyJlNTZhYzlkMzdjYWM3OWU0 N2UxYzZkZTY4MWRjNjczMTNiMGRhNmUwIl0sCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAg fSwgIkNHSTo6U2ltcGxlOjpDb29raWUiKSwKPiAgICAgICAgICAgICAgICAgICAgICB9LAo+ICBo ZWFkZXJzICAgICAgICAgID0+IGJsZXNzKHsKPiAgICAgICAgICAgICAgICAgICAgICAgICJhY2Nl cHQiID0+Cj4gInRleHQvaHRtbCxhcHBsaWNhdGlvbi94aHRtbCt4bWwsYXBwbGljYXRpb24veG1s O3E9MC45LCovKjtxPTAuOCIsCj4gICAgICAgICAgICAgICAgICAgICAgICAiYWNjZXB0LWNoYXJz ZXQiID0+Cj4gIklTTy04ODU5LTEsdXRmLTg7cT0wLjcsKjtxPTAuNyIsCj4gICAgICAgICAgICAg ICAgICAgICAgICAiYWNjZXB0LWVuY29kaW5nIiA9PiAiZ3ppcCxkZWZsYXRlIiwKPiAgICAgICAg ICAgICAgICAgICAgICAgICJhY2NlcHQtbGFuZ3VhZ2UiID0+ICJlbi11cyxlbjtxPTAuNSIsCj4g ICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uID0+ICJrZWVwLWFsaXZlIiwKPiAgICAg ICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9Pgo+ICJsb29raW5nZ2xhc3Nfc2Vzc2lvbj1lNTZh YzlkMzdjYWM3OWU0N2UxYzZkZTY4MWRjNjczMTNiMGRhNmUwIiwKPiAgICAgICAgICAgICAgICAg ICAgICAgIGhvc3QgPT4gImxnZGVwbG95IiwKPiAgICAgICAgICAgICAgICAgICAgICAgICJrZWVw LWFsaXZlIi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cyAgPT4gMjAwLAo+IH0sICJDYXRh bHlzdDo6UmVzcG9uc2UiKQo+Cj4gU3Rhc2gKPgo+IHt9Cj4KPiBDb25maWcKPgo+IGRvIHsKPiAg bXkgJGEgPSB7Cj4gICAgIlBsdWdpbjo6QXV0aGVudGljYXRpb24iID0+IHt9LAo+ICAgICJQbHVn aW46OkNvbmZpZ0xvYWRlciIgPT4ge30sCj4gICAgZGVidWcgPT4gewo+ICAgICAgICAgIGlnbm9y ZV9jbGFzc2VzID0+IFsKPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEQkl4OjpDbGFz czo6UmVzdWx0U291cmNlOjpUYWJsZSIsCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAi REJJeDo6Q2xhc3M6OlJlc3VsdFNvdXJjZUhhbmRsZSIsCj4gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiRGF0ZVRpbWUiLAo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sCj4gICAg ICAgICAgc2NydWJiZXJfZnVuYyAgPT4gc3ViIHsgIj8/PyIgfSwKPiAgICAgICAgfSwKPiAgICBm b3JtID0+IHt9LAo+ICAgIGhvbWUgPT4gIi9ob21lL0xvb2tpbmdHbGFzcy9Mb29raW5nR2xhc3Mi LAo+ICAgIG5hbWUgPT4gIkxvb2tpbmdHbGFzcyIsCj4gICAgcm9vdCA9PiBibGVzcyh7Cj4gICAg ICAgICAgZGlycyA9PiBbIiIsICJob21lIiwgIkxvb2tpbmdHbGFzcyIsICJMb29raW5nR2xhc3Mi LCAicm9vdCJdLAo+ICAgICAgICAgIGZpbGVfc3BlY19jbGFzcyA9PiB1bmRlZiwKPiAgICAgICAg ICB2b2x1bWUgPT4gIiIsCj4gICAgICAgIH0sICJQYXRoOjpDbGFzczo6RGlyIiksCj4gICAgc2Vz c2lvbiA9PiB7Cj4gICAgICAgICAgY29va2llX25hbWUgICAgPT4gImxvb2tpbmdnbGFzc19zZXNz aW9uIiwKPiAgICAgICAgICB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3LndlYnNlbnNlLmNvbQo+Cj4gX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KPiBMaXN0OiBDYXRhbHlzdEBsaXN0cy5zY3N5 cy5jby51awo+IExpc3RpbmZvOiBodHRwOi8vbGlzdHMuc2NzeXMuY28udWsvY2dpLWJpbi9tYWls bWFuL2xpc3RpbmZvL2NhdGFseXN0Cj4gU2VhcmNoYWJsZSBhcmNoaXZlOgo+IGh0dHA6Ly93d3cu bWFpbC1hcmNoaXZlLmNvbS9jYXRhbHlzdEBsaXN0cy5zY3N5cy5jby51ay8KPiBEZXYgc2l0ZTog aHR0cDovL2Rldi5jYXRhbHlzdC5wZXJsLm9yZy8KPgoKCgotLSAKQnJ1bm8KaHR0cDovL2lydWVs Lm5ldAotLS0tLS0tLS0tLS0tLSBuZXh0IHBhcnQgLS0tLS0tLS0tLS0tLS0KQW4gSFRNTCBhdHRh Y2htZW50IHdhcyBzY3J1YmJlZC4uLgpVUkw6IGh0dHA6Ly9saXN0cy5zY3N5cy5jby51ay9waXBl cm1haWwvY2F0YWx5c3QvYXR0YWNobWVudHMvMjAwODA5MTcvZjM5NmU0OWYvYXR0YWNobWVudC5o dG0K From sergio.lists at salvi.ca Wed Sep 17 18:36:12 2008 From: sergio.lists at salvi.ca (Sergio Salvi) Date: Wed Sep 17 18:36:13 2008 Subject: [Catalyst] Re: Race condition in Catalyst::Plugin::Session and Catalyst::Engine::Apache (possibly other engines too) In-Reply-To: <46e748b80809101559y3bad3fbai530ce18775736cd0@mail.gmail.com> References: <46e748b80809101559y3bad3fbai530ce18775736cd0@mail.gmail.com> Message-ID: <46e748b80809171036w1cac15dcl8d3722a0131004d@mail.gmail.com> On Wed, Sep 10, 2008 at 6:59 PM, Sergio Salvi wrote: > There is a race condition in C::P::Session when using > C::Engine::Apache (and probably other engines too): > > I have a simple controller action (let's call it /save) that gets data > submitted from an HTML form via POST, process that request, stores > some stuff in the session and flash and then redirects with HTTP 303 > to another action (/display). > > The /display action then displays the regular "submit successful" > message that was set on the previous action by using $c->flash. The > problem is that the browser is GETting /display before /save is > finished storing the session and flash rows in the database. Then, of > course, /display thinks nothing has happened and doesn't display the > data from flash. > > After a bunch of debugging and stack traces :), I figured out the > problem is that C::P::Session's finalize() calls $c->NEXT::finalize() > before calling $c->finalize_session, so > C::Engine::Apache->finalize_body() gets executed *before* the session > is flushed in the database, making the browser access /display even > though the session may not be stored yet: > > # From C::P::Session: > > sub finalize { > my $c = shift; > my $ret = $c->NEXT::finalize(@_); > > # then finish the rest > $c->finalize_session; > return $ret; > } > > I've solved this problem by extending C::P::Session and changing the > behaviour of finalize(), like this: > > ### > > package Catalyst::Plugin::MySession; > use base qw/Catalyst::Plugin::Session/; > > use strict; > use warnings; > > sub finalize { > my $c = shift; > $c->finalize_session; > my $ret = $c->NEXT::finalize(@_); > return $ret; > } > > 1; > ### > > But I realize this may create problems later on if other plugins have > finalize() that modify stuff in the session or flash, because then it > would be too late to modify it as the session/flash was already > stored. > > How can I tell Catalyst to call the Engine's finalize() method *last*, > after every other finalize() has been called? > > I think that would be the safest way to fix this problem. It is > probably related to C3 MRO, but I'm not sure how to approach this > within Catalyst. > > Thank you! > Sergio Salvi > > PS: My environment is: > > Debian 4.0, stock perl 5.8.8, Apache 2.2.3 with mod_perl 2.0.2 > (prefork, no reverse proxy at this moment), MySQL 5.0.32 with InnoDB > and the latest version of major Perl modules: > > Catalyst 5.7.014 > C::P::Session 0.19 > C::P::Session::Store::DBIC 0.06 > Bump :) All I'd like to know is this: How can I tell Catalyst to call the Engine's finalize() method *last*, after every other finalize() has been called? Thanks, Sergio From apv at sedition.com Wed Sep 17 18:52:54 2008 From: apv at sedition.com (Ashley) Date: Wed Sep 17 18:53:00 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Message-ID: On Sep 17, 2008, at 10:33 AM, Bruno Antunes wrote: > I sent an example of the errors in Apache's error_log, it was like > this: > > [Wed Sep 17 18:30:18 2008] [notice] Apache/2.2.3 (CentOS) > configured -- resuming normal operations > [info] *** Request 1 (0.143/s) [30709] [Wed Sep 17 18:30:24 2008] *** > [debug] "GET" request for "/" from "10.137.9.24" > [debug] Rendering template "index.tt" > [error] Couldn't render template "file error - index.tt: not found" > [error] Couldn't render template "file error - index.tt: not found" > [info] Request took 0.066461s (15.046/s) > Not very helpful, was hoping Catalyst could be more verbose. If software could debug itself there would be no bugs. The error in that batch seems pretty clear: Couldn't render template "file error - index.tt: not found" Looks like you either don't have an "index.tt" or you have the INCLUDE_PATH set badly in your TT stuff. -Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080917/9e9be3f0/attachment.htm From pjf at roxsoft.co.uk Wed Sep 17 19:28:11 2008 From: pjf at roxsoft.co.uk (Peter Flanigan) Date: Wed Sep 17 19:29:49 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Message-ID: <48D14C3B.2050203@roxsoft.co.uk> Bruno Antunes wrote: > [error] Couldn't render template "file error - index.tt > : not found" Type ps -ef | grep apache Make a note of the user that apache is running as. Su to root. Su to the user that apache is running as. Cd into the directory that index.tt is in. Cat index.tt. Do not chmod everything 777. Directories should be 755 and files 644 (mostly if your not too worried about tight permissions) Also please post as text not HTML your above error is getting mangled -- Regards From sardaukar.siet at gmail.com Wed Sep 17 20:35:58 2008 From: sardaukar.siet at gmail.com (Bruno Antunes) Date: Wed Sep 17 20:36:06 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Message-ID: SSB3YXMgbm90IGhvcGluZyBmb3IgdGhlIHNpdHVhdGlvbiB0by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cy5zY3N5cy5jby51ay8KPiBEZXYgc2l0 ZTogaHR0cDovL2Rldi5jYXRhbHlzdC5wZXJsLm9yZy8KPgo+CgoKLS0gCkJydW5vCmh0dHA6Ly9p cnVlbC5uZXQKLS0tLS0tLS0tLS0tLS0gbmV4dCBwYXJ0IC0tLS0tLS0tLS0tLS0tCkFuIEhUTUwg YXR0YWNobWVudCB3YXMgc2NydWJiZWQuLi4KVVJMOiBodHRwOi8vbGlzdHMuc2NzeXMuY28udWsv cGlwZXJtYWlsL2NhdGFseXN0L2F0dGFjaG1lbnRzLzIwMDgwOTE3LzBjOTc1YjgxL2F0dGFjaG1l bnQuaHRtCg== From apv at sedition.com Wed Sep 17 20:45:04 2008 From: apv at sedition.com (Ashley) Date: Wed Sep 17 20:45:10 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> <1BE349D4C1558248B6E323F697FB96EC1D81F4CF@SSDEXCH2.websense.com> Message-ID: <48C40CDD-08A1-42EA-B322-C4CFBB90445F@sedition.com> On Sep 17, 2008, at 12:35 PM, Bruno Antunes wrote: > I was not hoping for the situation to resolve itself - frankly, > there shouldn't be one since it runs in the test server perfectly. > And obviously, the index.tt file is were it is supposed to be as > far as making it work with the test server. > > I was wishing for more verbosity in saying where it is looking for > the file, so I can track the error in my httpd.conf and fix it. But > thanks for your remarks. Yep. Sorry, I didn't read the rest of the of the diagnostic info when the error log info ended up on top. :( -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080917/2a9404a0/attachment.htm From bobtfish at bobtfish.net Wed Sep 17 21:54:05 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 17 21:54:08 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: <19536440.post@talk.nabble.com> References: <19536440.post@talk.nabble.com> Message-ID: > Is there a way to know what path Catalyst is looking for the file? > What was > the precise error? Whatever info more you need, I am able to > provide. Please > help me... > > Thanks for your time reading this, strace is your friend. Copy your apache config to /tmp, reset it to a high port for testing, reduce the MinSpareServers to 0, MinSpareServers to 1, and set StartServers to 1 (assuming the prefork mpm here.. Then start your apache with strace -f, and grep out index.tt (i.e. say something like: sudo strace -f /usr/sbin/apache2 -f /tmp/ debugapache.conf 2>&1 | grep index.tt | tee /tmp/apache-syscalls.log) Then hit the index page of your app, and you'll get what you want in the output... Cheers t0m From sardaukar.siet at gmail.com Wed Sep 17 22:53:55 2008 From: sardaukar.siet at gmail.com (Bruno Antunes) Date: Wed Sep 17 22:53:59 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> Message-ID: V293LiBUaGFua3MgZm9yIHRoZSBpbmZvLCBJJ2xsIHRyeSB0aGlzIHRvbW9ycm93IQoKT24gV2Vk LCBTZXAgMTcsIDIwMDggYXQgMjE6NTQsIFRvbWFzIERvcmFuIDxib2J0ZmlzaEBib2J0ZmlzaC5u ZXQ+IHdyb3RlOgoKPiBJcyB0aGVyZSBhIHdheSB0byBrbm93IHdoYXQgcGF0aCBDYXRhbHlzdCBp cyBsb29raW5nIGZvciB0aGUgZmlsZT8gV2hhdCB3YXMKPj4gdGhlIHByZWNpc2UgZXJyb3I/IFdo YXRldmVyIGluZm8gbW9yZSB5b3UgbmVlZCwgSSBhbSBhYmxlIHRvIHByb3ZpZGUuCj4+IFBsZWFz ZQo+PiBoZWxwIG1lLi4uCj4+Cj4+IFRoYW5rcyBmb3IgeW91ciB0aW1lIHJlYWRpbmcgdGhpcywK Pj4KPgo+IHN0cmFjZSBpcyB5b3VyIGZyaWVuZC4KPgo+IENvcHkgeW91ciBhcGFjaGUgY29uZmln IHRvIC90bXAsIHJlc2V0IGl0IHRvIGEgaGlnaCBwb3J0IGZvciB0ZXN0aW5nLAo+IHJlZHVjZSB0 aGUgTWluU3BhcmVTZXJ2ZXJzIHRvIDAsIE1pblNwYXJlU2VydmVycyB0byAxLCBhbmQgc2V0IFN0 YXJ0U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y2F0YWx5c3QvYXR0YWNobWVudHMvMjAwODA5MTcvMjM4YmNlYTQvYXR0YWNobWVudC5odG0K From moldovenu at gmail.com Thu Sep 18 12:02:10 2008 From: moldovenu at gmail.com (Adam Bartosik) Date: Thu Sep 18 12:02:13 2008 Subject: [Catalyst] Failing tests in Catalyst::Controller::SOAP In-Reply-To: References: Message-ID: <3191ff7c0809180402n507e7cbepd669186ef340a13e@mail.gmail.com> 2008/9/12 Zbigniew Lukasiak : > Can anyone with more knowledge of SOAP tell if that is something important? Hi Zbyszek, try the previous versions of XML::Compile install MARKOV/XML-Compile-0.87.tar.gz install MARKOV/XML-Compile-SOAP-0.74.tar.gz Btw - anyone has any experience implementing ws-security with c::c::soap? Cheers, -- Adam http://langs-tech-stuff.blogspot.com/ From msupra at fnb.co.za Thu Sep 18 12:34:04 2008 From: msupra at fnb.co.za (Supra, Morne) Date: Thu Sep 18 12:34:08 2008 Subject: [Catalyst] Pushing data to Catalyst powered web page In-Reply-To: <20080912194542.GA2972@hank.org> Message-ID: Hi all I did the following to get data to push to the web page: Scenario: An RFID tag is read and processed by an ALE server. The ALE server then sends the data to my Catalyst URL: http://x.x.x.x:3000/ale/notifier?tagdata The ale/notifier action then extracts the tag id from the variable and then does a lookup in a database to get the data associated to the tag. It then puts the tag data in a queue and the last action is to make a socket connection, as a client, to a socket server running inside the /assettracker/display_tagdata action. The following code is an extract from the ale/notifier: sub notify_tag_read { use IO::Socket::INET; my $MySocket=new IO::Socket::INET->new(PeerPort=>26482,Proto=>'udp',PeerAddr=>'x.x.x.x'); my $msg = ""; $MySocket->send($msg); } When I access, via a browser, the url http://x.x.x.x:3000/assettracker/display_tagdata it loads a socket server and waits for a connection from a client. The following is a snippet of the /assettracker/display_tagdata action: sub display_tagdata : Local { my ( $self, $c ) = @_; my $text; my @args; $c->stash->{template} = 'sockettest.tt2'; use IO::Socket::INET; my $MySocket=new IO::Socket::INET->new(LocalPort=>26482,Proto=>'udp',Reuse=>1); $MySocket->recv($text,128); @args = [$text]; $c->forward('get_tagdata',\@args); } This action will then forward to /assettracker/get_data to retrieve the data from the queue and display it in the browser. I know that the code is not great, but it works. Thank you for all the assistance that I received. Regards Morne -----Original Message----- From: Bill Moseley [mailto:moseley@hank.org] Sent: 12 September 2008 09:46 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Pushing data to Catalyst powered web page On Fri, Sep 12, 2008 at 02:15:23PM +0200, Supra, Morne wrote: > > The problem that I have is that I have no idea how to push the data to a > web page instead of pulling. Pull with an AJAX update, perhaps. -- Bill Moseley moseley@hank.org Sent from my iMutt _______________________________________________ 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/ To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer. From sardaukar.siet at gmail.com Thu Sep 18 12:48:26 2008 From: sardaukar.siet at gmail.com (Bruno Antunes) Date: Thu Sep 18 12:48:30 2008 Subject: [Catalyst] Help! Need help deploying app to Apache In-Reply-To: References: <19536440.post@talk.nabble.com> Message-ID: VG9tYXMsIHlvdSBoYXZlIG1hZGUgbWUgc2VlIHRoZSBsaWdodCEgSSBtb3ZlZCB0aGUgRG9jdW1l bnRSb290IHRvCi9Mb29raW5nR2xhc3MgYW5kIGNob3duZWQgaXQgdG8gYXBhY2hlLmFwYWNoZSBh bmQgZXZlcnl0aGluZyB3b3Jrcywgbm93IQpIZXJlIGlzIG15IGNvbW1hbmQgbGluZSAoRmVkb3Jh IDkpOgoKc3VkbyBzdHJhY2UgLWYgL3Vzci9zYmluL2h0dHBkIC1mIC90bXAvaHR0cGQuY29uZiAt WAoKQW5kIGhlcmUgaXMgdGhlIC5jb25mIEkgdXNlZDoKCi0tLS0tLS0t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W50cy8yMDA4MDkxOC80ZTBmMzk5NS9hdHRhY2ht ZW50Lmh0bQo= From cub.uanic at gmail.com Thu Sep 18 23:49:36 2008 From: cub.uanic at gmail.com (Oleg Kostyuk) Date: Thu Sep 18 23:49:38 2008 Subject: [Catalyst] Patch for Catalyst/Engine/FastCGI.pm Message-ID: <60ef632f0809181549x656df4b3nc908039045b0ab98@mail.gmail.com> Little POD update --------------------------------------------------------------------------------------------- tux ~ # diff -u /usr/lib/perl5/vendor_perl/5.8.8/Catalyst/Engine/FastCGI.pm* --- /usr/lib/perl5/vendor_perl/5.8.8/Catalyst/Engine/FastCGI.pm 2008-07-31 03:45:35.000000000 +0300 +++ /usr/lib/perl5/vendor_perl/5.8.8/Catalyst/Engine/FastCGI.pm.new 2008-09-19 01:44:08.000000000 +0300 @@ -44,7 +44,9 @@ =item leave_umask -Set to 1 to disable setting umask to 0 for socket open =item nointr +Set to 1 to disable setting umask to 0 for socket open + +=item nointr Do not allow the listener to be interrupted by Ctrl+C --------------------------------------------------------------------------------------------- -- Sincerely yours, Oleg Kostyuk (CUB-UANIC) From bg271828 at yahoo.com Fri Sep 19 15:40:53 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Fri Sep 19 15:40:58 2008 Subject: [Catalyst] Simple blob upload example? Message-ID: <140306.50732.qm@web53408.mail.re2.yahoo.com> Hi, Im about to start an app where i'll need to upload PDFs from a user and store them in my database. Is there any quick example that might show how to do this? I browsed through the wiki and didnt see anything. I know its simple but ive never done this before. Thanks! Jen From jshirley at gmail.com Fri Sep 19 16:52:53 2008 From: jshirley at gmail.com (J. Shirley) Date: Fri Sep 19 16:52:56 2008 Subject: [Catalyst] Simple blob upload example? In-Reply-To: <140306.50732.qm@web53408.mail.re2.yahoo.com> References: <140306.50732.qm@web53408.mail.re2.yahoo.com> Message-ID: <756703690809190852x701ffc9al3bbabaecb3f893fe@mail.gmail.com> On Fri, Sep 19, 2008 at 7:40 AM, Dr. Jennifer Nussbaum wrote: > Hi, > > Im about to start an app where i'll need to upload PDFs from a user and store them in my database. Is there any quick example that might show > how to do this? I browsed through the wiki and didnt see anything. I know its simple but ive never done this before. > > Thanks! > > Jen > To divert this a bit, are you -really- sure you want to store them in a database? Storing large files in a database is not going to be ideal, as you'll lose abilities to replicate the files in a separate policy from you DB, etc. I really like MogileFS for storing files, and it really is easy enough to setup on a single host and get going... then from there, it's as simple as: $mogilefs->store_file( $key, $class, $upload->tempfile ); But to answer your question, the uploads are this object: http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7014/lib/Catalyst/Request/Upload.pm You can then just do $db_record->contents( $upload->slurp ); -J From catalyst at vivalog.com Fri Sep 19 18:11:29 2008 From: catalyst at vivalog.com (Goose Wohlt) Date: Fri Sep 19 18:11:31 2008 Subject: [Catalyst] full time catalyst hacker needed In-Reply-To: References: Message-ID: Hi folks - Sorry for the job plug, but this may be of interest to some here. We have a Sr. full time position open in Seattle for a catalyst hacker or a perl guru who's ready to take on catalyst. We have a pretty awesome ajax-based (yui, jquery, dojo) enterprise web application that uses catalystand mason on the backend. If you are interested, shoot me an e-mail at catalyst@vivalog.com and I can point you to the formal job posting. Thanks. :goose -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080919/a6c42= 654/attachment.htm From bg271828 at yahoo.com Fri Sep 19 19:58:15 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Fri Sep 19 19:58:21 2008 Subject: [Catalyst] Simple blob upload example? In-Reply-To: <756703690809190852x701ffc9al3bbabaecb3f893fe@mail.gmail.com> Message-ID: <57054.46905.qm@web53408.mail.re2.yahoo.com> --- On Fri, 9/19/08, J. Shirley wrote: > From: J. Shirley > Subject: Re: [Catalyst] Simple blob upload example? > To: bg271828@yahoo.com, "The elegant MVC web framework" > Date: Friday, September 19, 2008, 8:52 AM > On Fri, Sep 19, 2008 at 7:40 AM, Dr. Jennifer Nussbaum > wrote: > > Hi, > > > > Im about to start an app where i'll need to upload > PDFs from a user and store them in my database. Is there any > quick example that might show > > how to do this? I browsed through the wiki and didnt > see anything. I know its simple but ive never done this > before. > > > > Thanks! > > > > Jen > > > > To divert this a bit, are you -really- sure you want to > store them in > a database? Storing large files in a database is not going > to be > ideal, as you'll lose abilities to replicate the files > in a separate > policy from you DB, etc. Yes, but OTOH i gain the ability to back up everything at once, and move onto a different machine or even platform without having to worry about two seperate place. But this is a holywar that others have fought about for a long time, no need to, ah, replicate it here ;-) > > But to answer your question, the uploads are this object: > http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7014/lib/Catalyst/Request/Upload.pm > > You can then just do $db_record->contents( > $upload->slurp ); Yes, i saw the upload object but most of it looked like filesystem stuff, so i wasnt sure what to do then. So if i want to create a new record, for lets say a table called 'image' and a blob field called 'image' with a 'mime_type' description, i just do something like my $new_record = $c->model('MyDB::Image')->create({ image => $upload->slurp, mime_type => 'application/pdf' }); and thats all i have to do? Wow thats easy! Thanks, Jen From rafl at debian.org Sat Sep 20 02:39:35 2008 From: rafl at debian.org (Florian Ragwitz) Date: Sat Sep 20 02:39:38 2008 Subject: [Catalyst] Re: Patch for Catalyst/Engine/FastCGI.pm In-Reply-To: <60ef632f0809181549x656df4b3nc908039045b0ab98@mail.gmail.com> Message-ID: <20080920013935.GB3708@perldition.org> Thanks, applied as r8436. -- BOFH excuse #206: Police are examining all internet packets in the search for a narco-net-trafficker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080920/46e73ad8/attachment.pgp From abhishek.netjain at gmail.com Sat Sep 20 07:31:49 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Sat Sep 20 07:31:53 2008 Subject: [Catalyst] FormBuilder not working Message-ID: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> Hello Friends,I am new to Catalyst and need to implement FormBuilder. What i am doing is: a template called root/src/search2.tt2 with the following content; [% META title =3D "Edit a person" %] [% FormBuilder.render %] a form script on root/forms/search.db in controller i have the following function sub search2 : Local Form { my ( $self, $c ) =3D @_; $c->stash->{template} =3D 'project/search2.tt2'; } Do I need to do anything extra, i can get a page but without the form. Pl.help. -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080920/e9d80= ca8/attachment.htm From hanianani at gmail.com Sat Sep 20 07:58:47 2008 From: hanianani at gmail.com (Hani Anani) Date: Sat Sep 20 07:58:49 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> Message-ID: Hello Abhishek, I suspect the problem is with the naming of your files and dir structure. If search2 method is in the Project module you will need to do the following: 1. create a project sub dir in your root/forms dir 2. move your form definition file to the root/forms/project/search2.fb 3. Your template should be defined in root/project/search.tt2 you specify this in your code $c->stash->{template} =3D 'project/search2.tt2'; This is unecessary since Catalyst does this for you. I do have to say I am a little confused, cause you refer to root/src/search2.tt2 at the start of the email, in that case you might just need to rename your form file to search2.fb to match you method's name. Hope this helps you figure out what went wrong, -Hani On Fri, Sep 19, 2008 at 11:31 PM, abhishek jain wrote: > Hello Friends,I am new to Catalyst and need to implement FormBuilder. > What i am doing is: > a template called root/src/search2.tt2 with the following content; > > [% META title =3D "Edit a person" %] > [% FormBuilder.render %] > > a form script on root/forms/search.db > > in controller i have the following function > > sub search2 : Local Form { > my ( $self, $c ) =3D @_; > $c->stash->{template} =3D 'project/search2.tt2'; > } > > Do I need to do anything extra, i can get a page but without the form. > Pl.help. > -- > Thanks and kind Regards, > Abhishek jain > > _______________________________________________ > 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/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080919/c1423= 9ea/attachment.htm From abhishek.netjain at gmail.com Sat Sep 20 08:42:36 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Sat Sep 20 08:42:37 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> Message-ID: <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> On Sat, Sep 20, 2008 at 12:28 PM, Hani Anani wrote: > Hello Abhishek, > > I suspect the problem is with the naming of your files and dir structure. > > If search2 method is in the Project module you will need to do the > following: > > 1. create a project sub dir in your root/forms dir > 2. move your form definition file to the root/forms/project/search2.fb > 3. Your template should be defined in root/project/search.tt2 you specify > this in your code > $c->stash->{template} =3D 'project/search2.tt2'; > This is unecessary since Catalyst does this for you. > > I do have to say I am a little confused, cause you refer to > root/src/search2.tt2 at the start of the email, in that case you might ju= st > need to rename your form file to search2.fb to match you method's name. > > Hope this helps you figure out what went wrong, > -Hani > > On Fri, Sep 19, 2008 at 11:31 PM, abhishek jain < > abhishek.netjain@gmail.com> wrote: > >> Hello Friends,I am new to Catalyst and need to implement FormBuilder. >> What i am doing is: >> a template called root/src/search2.tt2 with the following content; >> >> [% META title =3D "Edit a person" %] >> [% FormBuilder.render %] >> >> a form script on root/forms/search.db >> >> in controller i have the following function >> >> sub search2 : Local Form { >> my ( $self, $c ) =3D @_; >> $c->stash->{template} =3D 'project/search2.tt2'; >> } >> >> Do I need to do anything extra, i can get a page but without the form. >> Pl.help. >> -- >> Thanks and kind Regards, >> Abhishek jain >> >> _______________________________________________ >> 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/ > > Thanks for the fast reply,The problem is solved -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080920/82af5= bfc/attachment.htm From orasnita at gmail.com Sat Sep 20 09:46:25 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sat Sep 20 09:46:59 2008 Subject: [Catalyst] C::P::Compress::Gzip Message-ID: Hi, I try to use C::P::Compress::Gzip, but if I add it to the list of plugins, the program gives an error in the browser telling "The requested URL / was not found on this server." And in the error_log I can see the following error: [Sat Sep 20 11:13:43 2008] [error] [client 127.0.0.1] Attempt to serve directory: E:/web/Acces/root/ If I remove C::P::Compress::Gzip from the list of plugins, the program works fine. Here are the plugins I use in the app: use Catalyst qw/ -Debug ConfigLoader Static::Simple Session Session::State::Cookie Session::Store::File Authentication Authorization::Roles Email Compress::Gzip /; In the Root.pm controller I have an empty "index" method that serves the root/index template. sub index :Path :Args(0) { my ( $self, $c ) = @_; } I have also tried to add in this method: $c->stash->{template} = "index"; but it gives the same error. Strangely, but if I add: $c->res->body($c->welcome_message); the welcome message is printed fine. Am I doing something wrong? Thank you. Octavian From abhishek.netjain at gmail.com Sat Sep 20 13:08:31 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Sat Sep 20 13:08:36 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> Message-ID: <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> On Sat, Sep 20, 2008 at 1:12 PM, abhishek jain wrote: > > > On Sat, Sep 20, 2008 at 12:28 PM, Hani Anani wrote: > >> Hello Abhishek, >> >> I suspect the problem is with the naming of your files and dir structure. >> >> If search2 method is in the Project module you will need to do the >> following: >> >> 1. create a project sub dir in your root/forms dir >> 2. move your form definition file to the root/forms/project/search2.fb >> 3. Your template should be defined in root/project/search.tt2 you specify >> this in your code >> $c->stash->{template} =3D 'project/search2.tt2'; >> This is unecessary since Catalyst does this for you. >> >> I do have to say I am a little confused, cause you refer to >> root/src/search2.tt2 at the start of the email, in that case you might j= ust >> need to rename your form file to search2.fb to match you method's name. >> >> Hope this helps you figure out what went wrong, >> -Hani >> >> On Fri, Sep 19, 2008 at 11:31 PM, abhishek jain < >> abhishek.netjain@gmail.com> wrote: >> >>> Hello Friends,I am new to Catalyst and need to implement FormBuilder. >>> What i am doing is: >>> a template called root/src/search2.tt2 with the following content; >>> >>> [% META title =3D "Edit a person" %] >>> [% FormBuilder.render %] >>> >>> a form script on root/forms/search.db >>> >>> in controller i have the following function >>> >>> sub search2 : Local Form { >>> my ( $self, $c ) =3D @_; >>> $c->stash->{template} =3D 'project/search2.tt2'; >>> } >>> >>> Do I need to do anything extra, i can get a page but without the form. >>> Pl.help. >>> -- >>> Thanks and kind Regards, >>> Abhishek jain >>> >>> ______ >> >> That problem is solved , i have yet another one, In my form definition i am writing the following: name: search method: post fields: dom: label: Dom type: text size: 30 required: 1 ext: label: Ext type: select required: 1 fieldopts: ext: options: id1 val1 id2 val2 I need a select option box with the id1 and id2 as option and val1 and val2 as values. I am not sure how to do so, Also where to get help if the next problem arises, Pl. help. -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080920/95e63= 386/attachment.htm From abhishek.netjain at gmail.com Sun Sep 21 18:59:23 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Sun Sep 21 18:59:26 2008 Subject: [Catalyst] Two Forms via FormBuilder on one page Message-ID: <7416d8590809211059s4d561be5x3681afb2c6dc6927@mail.gmail.com> Hi Friends,i know it may be silly to ask, but i need to have two forms on one page, i know Catalyst recognizes by the name of the function which form file to render but is there a way to render two files one after the another, also each going to a diff subroutine in catalyst in other words specifying the action as well, Pl. help. -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080921/c3610= e80/attachment.htm From terence at deeproot.co.in Mon Sep 22 10:53:47 2008 From: terence at deeproot.co.in (Terence Monteiro) Date: Mon Sep 22 10:53:59 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: References: Message-ID: <48D76B2B.7030003@deeproot.co.in> Wade.Stuart@fallon.com wrote: > > Terence Monteiro wrote on 09/15/2008 10:23:50 AM: > >> Jose Luis Martinez wrote: >>> Terence Monteiro escribi?: >>>> On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to >>>> process the template. On a production server using debian lenny, it >>>> used to >>>> take around the same amount of time. But recently, I upgraded it to >>>> libperl >>>> 5.10 and updated the different Perl modules including Template and >>>> Catalyst::View::TT. After this upgrade, the same template takes 25 >>>> seconds >>>> on average to process. The times I am mentioning are the times taken >>>> on the >>>> server side, as shown by the Catalyst application debug logs. >>> Maybe Template Toolkit is packaged without the XS module enabled? >>> >>> http://search.cpan.org/~abw/Template-Toolkit-2.20 > /lib/Template/Stash/XS.pm >> When I run >> >> perl -MTemplate::Stash::XS -e 'print "No problem\n"' >> >> it tells me that Template::Stash::XS is present. >> >> I dumped c.session, c.config and c.stash into a YAML file, read it using > a >> script and used the data to process my template. It took just 0.62 > seconds, >> which is way faster than when C::V::TT processes it. I actually did some >> tests to verify whether it is a TT problem, but it does not occur when I >> use the Template module directly. The log information and test results > seem >> strange, and I still cannot point my finger on a specific Perl module. >> Could it be a libperl issue? My libperl5.10 version is 5.10.0-13 from >> debian lenny. > > try: > > perl -V I bet you see !5.10. XS is not binary compatible a lot of the > time with different perl versions, it is best to update perl to 5.10 too > and then reinstall XS modules. > > -Wade > The output when I run perl -V is: Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.26.1, archname=i486-linux-gnu-thread-multi uname='linux ninsei 2.6.26.1 #1 smp preempt sun aug 3 22:34:07 pdt 2008 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.1 0 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/lib/perl/5.10.0 -D man1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pa ger -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.3.1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so.5.10.0 gnulibc_version='2.7' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Aug 8 2008 22:12:45 @INC: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl So it seems like perl is at version 5.10 -- Thanks and Regards, Terence Monteiro. DeepRoot Linux, Ph: +91 (80) 4112 4781 / 85. From lists at block-online.eu Mon Sep 22 12:28:22 2008 From: lists at block-online.eu (Oliver Block) Date: Mon Sep 22 12:28:45 2008 Subject: [Catalyst] Access context from within filter sub? (TT) Message-ID: <200809221328.22883.lists@block-online.eu> Hello group, I wonder if it's possible to access the the context from within a sub serving as filter for mytemplate.tt2? Is that possible? tia, Oliver Block From bogdan at wiz.ro Mon Sep 22 14:51:01 2008 From: bogdan at wiz.ro (Bogdan Lucaciu) Date: Mon Sep 22 14:51:07 2008 Subject: [Catalyst] Access context from within filter sub? (TT) In-Reply-To: <200809221328.22883.lists@block-online.eu> References: <200809221328.22883.lists@block-online.eu> Message-ID: <200809221651.01647.bogdan@wiz.ro> On Monday 22 September 2008 14:28:22 Oliver Block wrote: > I wonder if it's possible to access the the context from within a sub > serving as filter for mytemplate.tt2? > > Is that possible? I spotted an example in Angerwhale::View::HTML http://search.cpan.org/src/JROCKWAY/Angerwhale-0.062/lib/Angerwhale/View/HTML.pm enjoy -- Bogdan Lucaciu http://www.wiz.ro From abhishek.netjain at gmail.com Mon Sep 22 15:42:14 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Mon Sep 22 15:42:18 2008 Subject: [Catalyst] Re: Two Forms via FormBuilder on one page In-Reply-To: <7416d8590809211059s4d561be5x3681afb2c6dc6927@mail.gmail.com> References: <7416d8590809211059s4d561be5x3681afb2c6dc6927@mail.gmail.com> Message-ID: <7416d8590809220742o64ebd03bk6962fef93f2a183@mail.gmail.com> On Sun, Sep 21, 2008 at 11:29 PM, abhishek jain wrote: > Hi Friends,i know it may be silly to ask, but i need to have two forms on > one page, i know Catalyst recognizes by the name of the function which fo= rm > file to render but is there a way to render two files one after the anoth= er, > also each going to a diff subroutine in catalyst in other words specifying > the action as well, > Pl. help. > > -- > Thanks and kind Regards, > Abhishek jain > > Someone pl. reply, -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080922/54a73= f87/attachment.htm From montuori at gmail.com Mon Sep 22 16:54:49 2008 From: montuori at gmail.com (kevin montuori) Date: Mon Sep 22 16:54:52 2008 Subject: [Catalyst] Re: Two Forms via FormBuilder on one page In-Reply-To: <7416d8590809220742o64ebd03bk6962fef93f2a183@mail.gmail.com> (abhishek jain's message of "Mon, 22 Sep 2008 20:12:14 +0530") References: <7416d8590809211059s4d561be5x3681afb2c6dc6927@mail.gmail.com> <7416d8590809220742o64ebd03bk6962fef93f2a183@mail.gmail.com> Message-ID: >>>>> "aj" == abhishek jain writes: aj> Someone pl. reply, when you searched for catalyst::controller::formbuilder on cpan to see what else might come up, did you miss c::c::formbuilder::multiform? k. -- kevin montuori montuori@gmail.com From jonh at nmgi.com Mon Sep 22 16:55:54 2008 From: jonh at nmgi.com (Jonathan Hall) Date: Mon Sep 22 16:56:14 2008 Subject: [Catalyst] Access context from within filter sub? (TT) In-Reply-To: <200809221328.22883.lists@block-online.eu> References: <200809221328.22883.lists@block-online.eu> Message-ID: <48D7C00A.8000700@nmgi.com> Sure, if you pass it in... i.e. in your sub definition: sub foo { my ( $c ) = @_; . . . } And in your TT2: [% foo( Catalyst ); %] Oliver Block wrote: > Hello group, > > I wonder if it's possible to access the the context from within a sub serving > as filter for mytemplate.tt2? > > Is that possible? > > tia, > > Oliver Block > > _______________________________________________ > 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/ > -- Inbound and outbound email scanned for spam and viruses by the DoubleCheck Email Manager: http://www.doublecheckemail.com From gcoates at csuchico.edu Tue Sep 23 00:28:02 2008 From: gcoates at csuchico.edu (Greg Coates) Date: Tue Sep 23 00:27:03 2008 Subject: [Catalyst] FastCGI Deployment problem - can't find templates Message-ID: <48D82A02.9020402@csuchico.edu> I've written my first Catalyst app. Up until this point, I've been using the Catalyst development server, but now I'm working on deploying the application on my webserver using apache and FastCGI. The problem is, now that I have the app deployed, Catalyst can't seem to find my template files. These templates were found with no problem in the development environment. Here's the error I'm getting: [error] Couldn't render template "file error - comments/report.tt: not found" And here's my apache configuration: LoadModule fastcgi_module modules/mod_fastcgi.so FastCgiExternalServer /opt/myapp/myapp_fastcgi.pl -host 127.0.0.1:3001 ServerName blog-admin.myserver.com Alias /static /opt/myapp/root/static Alias / /opt/myapp/myapp_fastcgi.pl/ (I have the template files in the /opt/myapp/root/static/templates directory.) And the command I used to start the FastCGI server: ./myapp_fastcgi.pl -e -l 127.0.0.1:3001 -p /tmp/myapp.pid I'm stumped. Does anyone see a problem with my configuration or otherwise that might be keeping Catalyst from seeing my template files? Thanks, Greg Coates From taylor.andrew.j at gmail.com Tue Sep 23 01:43:44 2008 From: taylor.andrew.j at gmail.com (Drew Taylor) Date: Tue Sep 23 01:43:49 2008 Subject: [Catalyst] Failing tests in Catalyst::Controller::SOAP In-Reply-To: References: Message-ID: On Fri, Sep 12, 2008 at 8:36 AM, Zbigniew Lukasiak wrote: > Dear all, > > I have tried to install Catalyst::Controller::SOAP on both an Open > SUSE 10.3 with Perl 5.8.8 and Ubuntu Hardy with the same Perl version. > Both give the same errors as in the report at: > http://www.nntp.perl.org/group/perl.cpan.testers/2008/09/msg2179625.html > > Can anyone with more knowledge of SOAP tell if that is something important? I'll try to take a look at the test errors soon, but I'm pretty swamped at $work for the near future. That said, I'm using the latest C:C::SOAP in production without any problems. :-) Drew -- ---------------------------------------------------------------- Drew Taylor * Web development & consulting Email: drew@drewtaylor.com * Site implementation & hosting Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres ---------------------------------------------------------------- From paikkos at googlemail.com Tue Sep 23 11:53:05 2008 From: paikkos at googlemail.com (Dermot) Date: Tue Sep 23 11:53:08 2008 Subject: [Catalyst] A suitable method to redraw a page Message-ID: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> Hi, I have a controller who's job is to copy some files (4-6). These files can be quite big and the time it takes has been causing what looks like timeouts on the server. [Tue Sep 23 09:48:55 2008] [error] [client x.x.x.x] FastCGI: comm with server "/var/www/MyApp/script/motion_fastcgi.pl" aborted: idle timeout (30 sec), referer: http://somehost/cgi-bin/doit.cgi [Tue Sep 23 09:48:55 2008] [error] [client x.x.x.x] FastCGI: incomplete headers (0 bytes) received from server "/var/www/MyApp/script/myapp_fastcgi.pl" I could increase the timeout period on the httpd daemon. I thought a more elegant solution would be to present a page with the results for each file after it's copied that is updated with the status of each copied file. So the same window refreshes and the next file is listed with the copy status. I have achieved this in the past (CGI) by putting a form on the page and using javascript/onload/submit while items < 1. It's a bit of a hack but it works. Is there a method within Catalyst that might help me reach my goal? Something akin to Chained perhaps. Alternatively can I loop through the list of files and $c->{template} = 'files/rename.tt2'. My experiments haven't been successful. I get the whole page of results. Is there something like $c->forward that I should be using here? Here an abridged versions of the controller. sub rename : Local { my ($self, $c) = @_; die if ($c->request->param('id') !~ /\d+/); my $list = getFilesBySubID($c, $c->request->param('id')); my @moved; foreach my $file ( @{$list} ) { my $source = $file->path; my $type = getFileTypeFromName(basename($file->path)); my %state = ( 'id' => $c->request->param('id'), 'source' => $file->path, 'distin' => undef, ); my $path = getPathFromNumber($c->request->param('splnumber'), $type); my $x = copy($source,$path) or warn "Cannot copy $source to $path: $!\n"; $state{'success'} = $x; $state{'distin'} = $path; } else { $state{'success'} = 0; } push(@moved, \%state); $c->stash->{moved} = [@moved]; $c->stash->{template} = 'files/rename.tt2'; } } I hope this makes sense :-/. Any advice would be appreciated. Thanx, Dp. From amesdaq at websense.com Tue Sep 23 17:07:07 2008 From: amesdaq at websense.com (Mesdaq, Ali) Date: Tue Sep 23 17:07:13 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> Message-ID: <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> I think ajax would be your friend here. You could just make an ajax call to some function to check the status of the file copies and then update the DOM directly instead of refreshing the whole page. Or the actual call to start the copy can be made via ajax instead of the call to check the status that way your js code for that page can call the copy file function on the server sequentially for each file and update the page in a loop. There are a lot of ways to do this. You might even want to look into having a background process launched to do the actual copy so you don?t run into http timeout issues and just have your controllers start and check the copy process. Thanks, ------------------------------------------ Ali Mesdaq (CISSP, GIAC-GREM) Sr. Security Researcher Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ -----Original Message----- From: Dermot [mailto:paikkos@googlemail.com] Sent: Tuesday, September 23, 2008 3:53 AM To: The elegant MVC web framework Subject: [Catalyst] A suitable method to redraw a page Hi, I have a controller who's job is to copy some files (4-6). These files can be quite big and the time it takes has been causing what looks like timeouts on the server. [Tue Sep 23 09:48:55 2008] [error] [client x.x.x.x] FastCGI: comm with server "/var/www/MyApp/script/motion_fastcgi.pl" aborted: idle timeout (30 sec), referer: http://somehost/cgi-bin/doit.cgi [Tue Sep 23 09:48:55 2008] [error] [client x.x.x.x] FastCGI: incomplete headers (0 bytes) received from server "/var/www/MyApp/script/myapp_fastcgi.pl" I could increase the timeout period on the httpd daemon. I thought a more elegant solution would be to present a page with the results for each file after it's copied that is updated with the status of each copied file. So the same window refreshes and the next file is listed with the copy status. I have achieved this in the past (CGI) by putting a form on the page and using javascript/onload/submit while items < 1. It's a bit of a hack but it works. Is there a method within Catalyst that might help me reach my goal? Something akin to Chained perhaps. Alternatively can I loop through the list of files and $c->{template} = 'files/rename.tt2'. My experiments haven't been successful. I get the whole page of results. Is there something like $c->forward that I should be using here? Here an abridged versions of the controller. sub rename : Local { my ($self, $c) = @_; die if ($c->request->param('id') !~ /\d+/); my $list = getFilesBySubID($c, $c->request->param('id')); my @moved; foreach my $file ( @{$list} ) { my $source = $file->path; my $type = getFileTypeFromName(basename($file->path)); my %state = ( 'id' => $c->request->param('id'), 'source' => $file->path, 'distin' => undef, ); my $path = getPathFromNumber($c->request->param('splnumber'), $type); my $x = copy($source,$path) or warn "Cannot copy $source to $path: $!\n"; $state{'success'} = $x; $state{'distin'} = $path; } else { $state{'success'} = 0; } push(@moved, \%state); $c->stash->{moved} = [@moved]; $c->stash->{template} = 'files/rename.tt2'; } } I hope this makes sense :-/. Any advice would be appreciated. Thanx, 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/ Protected by Websense Messaging Security -- www.websense.com From bg271828 at yahoo.com Tue Sep 23 20:30:27 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Tue Sep 23 20:30:31 2008 Subject: [Catalyst] Simple blob upload example? In-Reply-To: <57054.46905.qm@web53408.mail.re2.yahoo.com> Message-ID: <31264.58670.qm@web53401.mail.re2.yahoo.com> --- On Fri, 9/19/08, Dr. Jennifer Nussbaum wrote: > From: Dr. Jennifer Nussbaum > Subject: Re: [Catalyst] Simple blob upload example? > To: "The elegant MVC web framework" , "J. Shirley" > Date: Friday, September 19, 2008, 11:58 AM > --- On Fri, 9/19/08, J. Shirley > wrote: > > > From: J. Shirley > > Subject: Re: [Catalyst] Simple blob upload example? > > To: bg271828@yahoo.com, "The elegant MVC web > framework" > > Date: Friday, September 19, 2008, 8:52 AM > > On Fri, Sep 19, 2008 at 7:40 AM, Dr. Jennifer Nussbaum > > wrote: > > > Hi, > > > > > > Im about to start an app where i'll need to > upload > > PDFs from a user and store them in my database. Is > there any > > quick example that might show > > > how to do this? I browsed through the wiki and > didnt > > see anything. I know its simple but ive never done > this > > before. > > > > > > Thanks! > > > > > > Jen > > > > > > > To divert this a bit, are you -really- sure you want > to > > store them in > > a database? Storing large files in a database is not > going > > to be > > ideal, as you'll lose abilities to replicate the > files > > in a separate > > policy from you DB, etc. > > Yes, but OTOH i gain the ability to back up everything at > once, and move onto a different machine or even platform > without having to worry about two seperate place. > > But this is a holywar that others have fought about for a > long time, no need to, ah, replicate it here ;-) > > > > > But to answer your question, the uploads are this > object: > > > http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7014/lib/Catalyst/Request/Upload.pm > > > > You can then just do $db_record->contents( > > $upload->slurp ); > > Yes, i saw the upload object but most of it looked like > filesystem stuff, so i wasnt sure what to do then. So if i > want to create a new record, for lets say a table called > 'image' and a blob field called 'image' with > a 'mime_type' description, i just do something like > > my $new_record = > $c->model('MyDB::Image')->create({ image => > $upload->slurp, mime_type => 'application/pdf' > }); > > and thats all i have to do? Wow thats easy! I did just want to report that i did this and it worked perfectly. My actual line was: $c->model('MyDB::Image')->create({ image => $upload->slurp, type => $upload->type }); I figured that i should use $upload->type so that just in case i later want to upload gifs or something i wouldnt have to change code. Perfect, simple, it worked. Thanks! Jen Thanks! From bg271828 at yahoo.com Tue Sep 23 20:38:59 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Tue Sep 23 20:39:05 2008 Subject: [Catalyst] Search example in any docs? Message-ID: <267816.48390.qm@web53403.mail.re2.yahoo.com> Hi. Im working on a new app which is working well. While doing it though i realised that i never get my serach done right. I mean, it works, but i end up spending a lot of code munging parameters, making adjustments, and so forth, and this cant be right. What should be a few lines takes a page or two of code, just for a simple one or two table search. I tried looking through the docs for a best-practices approach and unless i missed something there arent ANY examples of search in the docs, the tutorial, the wiki, the Advent.... (Oh in one place there was something about harder searches, fulltext in PostGres, but nothing general.) Is there any place that shows a simple example of a web form -> DBIC search in Catalyst? And if not, shouldnt there be? Thanks! Jen From Wade.Stuart at fallon.com Tue Sep 23 20:51:16 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Tue Sep 23 20:51:28 2008 Subject: [Catalyst] Simple blob upload example? In-Reply-To: <31264.58670.qm@web53401.mail.re2.yahoo.com> Message-ID: "Dr. Jennifer Nussbaum" wrote on 09/23/2008 02:30:27 PM: > > > --- On Fri, 9/19/08, Dr. Jennifer Nussbaum wrote: > > > From: Dr. Jennifer Nussbaum > > Subject: Re: [Catalyst] Simple blob upload example? > > To: "The elegant MVC web framework" , > "J. Shirley" > > Date: Friday, September 19, 2008, 11:58 AM > > --- On Fri, 9/19/08, J. Shirley > > wrote: > > > > > From: J. Shirley > > > Subject: Re: [Catalyst] Simple blob upload example? > > > To: bg271828@yahoo.com, "The elegant MVC web > > framework" > > > Date: Friday, September 19, 2008, 8:52 AM > > > On Fri, Sep 19, 2008 at 7:40 AM, Dr. Jennifer Nussbaum > > > wrote: > > > > Hi, > > > > > > > > Im about to start an app where i'll need to > > upload > > > PDFs from a user and store them in my database. Is > > there any > > > quick example that might show > > > > how to do this? I browsed through the wiki and > > didnt > > > see anything. I know its simple but ive never done > > this > > > before. > > > > > > > > Thanks! > > > > > > > > Jen > > > > > > > > > > To divert this a bit, are you -really- sure you want > > to > > > store them in > > > a database? Storing large files in a database is not > > going > > > to be > > > ideal, as you'll lose abilities to replicate the > > files > > > in a separate > > > policy from you DB, etc. > > > > Yes, but OTOH i gain the ability to back up everything at > > once, and move onto a different machine or even platform > > without having to worry about two seperate place. > > > > But this is a holywar that others have fought about for a > > long time, no need to, ah, replicate it here ;-) > > > > > > > > But to answer your question, the uploads are this > > object: > > > > > http://search.cpan.org/~mramberg/Catalyst-Runtime-5. > 7014/lib/Catalyst/Request/Upload.pm > > > > > > You can then just do $db_record->contents( > > > $upload->slurp ); > > > > Yes, i saw the upload object but most of it looked like > > filesystem stuff, so i wasnt sure what to do then. So if i > > want to create a new record, for lets say a table called > > 'image' and a blob field called 'image' with > > a 'mime_type' description, i just do something like > > > > my $new_record = > > $c->model('MyDB::Image')->create({ image => > > $upload->slurp, mime_type => 'application/pdf' > > }); > > > > and thats all i have to do? Wow thats easy! > > I did just want to report that i did this and it worked perfectly. > My actual line was: > > $c->model('MyDB::Image')->create({ image => $upload->slurp, type => > $upload->type }); > > I figured that i should use $upload->type so that just in case i > later want to upload gifs or something i wouldnt have to change code. Be careful, upload->type Returns the _client-supplied_ Content-Type. You may want just a bit more code around that to verify type and the fact that the client actually submitted a mime type. -Wade From peter at peknet.com Tue Sep 23 20:53:03 2008 From: peter at peknet.com (Peter Karman) Date: Tue Sep 23 20:53:06 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <267816.48390.qm@web53403.mail.re2.yahoo.com> References: <267816.48390.qm@web53403.mail.re2.yahoo.com> Message-ID: <48D9491F.5090409@peknet.com> Dr. Jennifer Nussbaum wrote on 09/23/2008 02:38 PM: > Is there any place that shows a simple example of a web form -> DBIC > search in Catalyst? And if not, shouldnt there be? The problem is that db search quickly becomes complicated when you're dealing with multiple tables, relationships, column types, etc. See Search::QueryParser::SQL on CPAN for my attempt at this. There is a dbic() method too. CatalystX::CRUD::Model::Utils depends on S::QP::S to turn $c->req->params into a query, if you want to look at one example. -- Peter Karman . peter@peknet.com . http://peknet.com/ From zzbbyy at gmail.com Tue Sep 23 21:02:43 2008 From: zzbbyy at gmail.com (Zbigniew Lukasiak) Date: Tue Sep 23 21:02:48 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <267816.48390.qm@web53403.mail.re2.yahoo.com> References: <267816.48390.qm@web53403.mail.re2.yahoo.com> Message-ID: On Tue, Sep 23, 2008 at 9:38 PM, Dr. Jennifer Nussbaum wrote: > Hi. > > Im working on a new app which is working well. While doing it though i realised that i never get my serach done right. I mean, it works, but > i end up spending a lot of code munging parameters, making adjustments, > and so forth, and this cant be right. What should be a few lines takes a page or two of code, just for a simple one or two table search. > > I tried looking through the docs for a best-practices approach and unless i missed something there arent ANY examples of search in the docs, the tutorial, the wiki, the Advent.... (Oh in one place there was something about harder searches, fulltext in PostGres, but nothing general.) > > Is there any place that shows a simple example of a web form -> DBIC search in Catalyst? And if not, shouldnt there be? Hi there, I am sure you are referring to http://www.catalystframework.org/calendar/2007/16 :) I don't really know what you need, but I start that article with a very a simple solution: my @records = $schema->ResultSet( 'MyTable' )->search( $reqest->params, { page => 1, rows => 5 } ); Only after presenting that I start discussing what to do when you need to add some more complex predicates to the query and propose a solution to that. Of course that article ignores the part of generating the HTML form code and getting the parameters from $c - I had to concentrate on somethign. -- Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/ From bg271828 at yahoo.com Tue Sep 23 21:21:25 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Tue Sep 23 21:21:30 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: Message-ID: <999511.70190.qm@web53410.mail.re2.yahoo.com> --- On Tue, 9/23/08, Zbigniew Lukasiak wrote: > From: Zbigniew Lukasiak > Subject: Re: [Catalyst] Search example in any docs? > To: bg271828@yahoo.com, "The elegant MVC web framework" > Date: Tuesday, September 23, 2008, 1:02 PM > On Tue, Sep 23, 2008 at 9:38 PM, Dr. Jennifer Nussbaum > wrote: > > Hi. > > > > Im working on a new app which is working well. While > doing it though i realised that i never get my serach done > right. I mean, it works, but > > i end up spending a lot of code munging parameters, > making adjustments, > > and so forth, and this cant be right. What should be a > few lines takes a page or two of code, just for a simple one > or two table search. > > > > I tried looking through the docs for a best-practices > approach and unless i missed something there arent ANY > examples of search in the docs, the tutorial, the wiki, the > Advent.... (Oh in one place there was something about harder > searches, fulltext in PostGres, but nothing general.) > > > > Is there any place that shows a simple example of a > web form -> DBIC search in Catalyst? And if not, shouldnt > there be? > > Hi there, > > I am sure you are referring to > http://www.catalystframework.org/calendar/2007/16 :) I > don't really > know what you need, but I start that article with a very a > simple > solution: > > my @records = $schema->ResultSet( 'MyTable' > )->search( > $reqest->params, > { page => 1, rows => 5 } > ); > > Only after presenting that I start discussing what to do > when you need > to add some more complex predicates to the query and > propose a > solution to that. Yes i did see that and i did try it, but i quickly found that i ran into all sorts of problems. For example my params would usually include something like a "action" param with the value "Submit query", whihc doesnt work so well when it hits the database ;-) Thanks to Peter Karman for his other suggestion, which i will look at in more detail. I guess i do stuff like that by hand all the time--i have code that looks like if ( $c->req->params->{title} ) { my $title = "%" . $c->req->params->{title} . "%"; push (@$query, { title => { like => $title } }); } # exact match here if ( $c->req->params->{author} ) { my $performer = $c->req->params->{author}; push (@$query, { author => { '=' => $author} }); } etc., which just looks messy. In any case i do think this should be at least MENTIONED in some of the docs. The fact that it gets complicated doesnt mean it should be ignored, surely everyone has to do this in Cat. Thanks! Jen From GCoates at csuchico.edu Tue Sep 23 23:24:57 2008 From: GCoates at csuchico.edu (Coates, Greg) Date: Tue Sep 23 23:28:35 2008 Subject: [Catalyst] FastCGI Deployment problem - can't find templates References: <48D82A02.9020402@csuchico.edu> <48D937C2.30205@cornell.edu> Message-ID: <9ADE954C5044754C8E0BF406B5A217552800FBD3@ESCHE.csuchico.edu> Okay. I've done this. I did some more checking, and I realize that I'm not sure where the static = files and templates should be installed on a production server. It doesn't= look like they get picked up in the make process. I currently have them in the /opt/myserver directory. My application perl = module files are in the standard site_perl location. Where should the templates, etc go? Thanks, Greg -----Original Message----- From: Gerda Shank [mailto:gs364@cornell.edu] Sent: Tue 9/23/2008 11:38 AM To: Coates, Greg Subject: Re: [Catalyst] FastCGI Deployment problem - can't find templates = Greg: Your template files are not static files. They shouldn't be in the = static directory. A fairly standard configuration is to have a templates = directory right underneath root, at the same level as the static directory. You should probably move the templates directory one level up and adjust = the config for your TT view. Gerda Greg Coates wrote: > I've written my first Catalyst app. Up until this point, I've been = > using the Catalyst development server, but now I'm working on = > deploying the application on my webserver using apache and FastCGI. > > The problem is, now that I have the app deployed, Catalyst can't seem = > to find my template files. These templates were found with no problem = > in the development environment. Here's the error I'm getting: > [error] Couldn't render template "file error - comments/report.tt: not = > found" > > And here's my apache configuration: > LoadModule fastcgi_module modules/mod_fastcgi.so > FastCgiExternalServer /opt/myapp/myapp_fastcgi.pl -host 127.0.0.1:3001 > > ServerName blog-admin.myserver.com > Alias /static /opt/myapp/root/static > Alias / /opt/myapp/myapp_fastcgi.pl/ > > > (I have the template files in the /opt/myapp/root/static/templates = > directory.) > > And the command I used to start the FastCGI server: > ./myapp_fastcgi.pl -e -l 127.0.0.1:3001 -p /tmp/myapp.pid > > I'm stumped. Does anyone see a problem with my configuration or = > otherwise that might be keeping Catalyst from seeing my template files? > > Thanks, > Greg Coates > > _______________________________________________ > 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080923/6990c= fff/attachment.htm From bobtfish at bobtfish.net Tue Sep 23 23:41:51 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Sep 23 23:41:51 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <999511.70190.qm@web53410.mail.re2.yahoo.com> References: <999511.70190.qm@web53410.mail.re2.yahoo.com> Message-ID: On 23 Sep 2008, at 21:21, Dr. Jennifer Nussbaum wrote: > i have > code that looks like > > if ( $c->req->params->{title} ) { > my $title = "%" . $c->req->params->{title} . "%"; > push (@$query, { title => { like => $title } }); > } > > # exact match here > if ( $c->req->params->{author} ) { > my $performer = $c->req->params->{author}; > push (@$query, { author => { '=' => $author} }); > } > > etc., which just looks messy. It's called refactoring - pull the common bits out and put them in a base class for your controllers. package MyApp::Controller; use strict; sub query_like { my ($self, $c, $name) = @_; return $self->query($c, $name, 'like', '%' . $c->req->param ($name) . '%'); } sub query_eq { my ($self, $c, $name) = @_; return $self->query($c, $name, '=', $c->req->param($name)); } sub _query { my ($self, $c, $name, $operator, $val) = @_; if ($c->req->param($name)) { push @{$c->stash->{query}}, { $name => { $operator => $val } }; } }; package MyApp::Controller::Search; sub foo : Local { my ($self, $c) = @_; $self->query_like($c, 'title'); $self->query_eq($c, 'author'); } Cheers t0m From bobtfish at bobtfish.net Tue Sep 23 23:46:53 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Sep 23 23:46:53 2008 Subject: [Catalyst] FastCGI Deployment problem - can't find templates In-Reply-To: <9ADE954C5044754C8E0BF406B5A217552800FBD3@ESCHE.csuchico.edu> References: <48D82A02.9020402@csuchico.edu> <48D937C2.30205@cornell.edu> <9ADE954C5044754C8E0BF406B5A217552800FBD3@ESCHE.csuchico.edu> Message-ID: <8647BA69-38B3-4FB0-9B50-6902380DF08D@bobtfish.net> On 23 Sep 2008, at 23:24, Coates, Greg wrote: > Okay. I've done this. > > I did some more checking, and I realize that I'm not sure where the > static files and templates should be installed on a production > server. It doesn't look like they get picked up in the make process. > > They should. If they aren't for any reason then you're doing something which breaks things ;( > I currently have them in the /opt/myserver directory. My > application perl module files are in the standard site_perl location. > > Where should the templates, etc go? > The template 'root' directory generally goes under the main directory of your application, so if you're MyApp, then it'll be MyApp/root Exactly where this is depends on your perl, but if you're installing locally, I'd expect the templates to end up somewhere similar to /usr/ local/share/perl/5.8.8/MyApp/root/ Cheers t0m From lists at block-online.eu Wed Sep 24 00:00:04 2008 From: lists at block-online.eu (Oliver Block) Date: Wed Sep 24 00:00:16 2008 Subject: [Catalyst] Access context from within filter sub? (TT) In-Reply-To: <200809221651.01647.bogdan@wiz.ro> References: <200809221328.22883.lists@block-online.eu> <200809221651.01647.bogdan@wiz.ro> Message-ID: <200809240100.04659.lists@block-online.eu> Thank you for the reference! I could solve the problem differently, but it helped me, besides others to understand it better. Best Regards, Oliver Block Am Montag, 22. September 2008 15:51:01 schrieb Bogdan Lucaciu: > On Monday 22 September 2008 14:28:22 Oliver Block wrote: > > I wonder if it's possible to access the the context from within a sub > > serving as filter for mytemplate.tt2? > > > > Is that possible? > > I spotted an example in Angerwhale::View::HTML > http://search.cpan.org/src/JROCKWAY/Angerwhale-0.062/lib/Angerwhale/View/HT >ML.pm > > enjoy From paikkos at googlemail.com Wed Sep 24 00:30:52 2008 From: paikkos at googlemail.com (Dermot) Date: Wed Sep 24 00:30:54 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> Message-ID: <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> 2008/9/23 Mesdaq, Ali : >I think ajax would be your friend here. I think I'll try something like that. As the files and Cat App are on one server and the referrer is a different server, I will have the referrer call a local script and fire a request from there. The question then is what type of Controller to use. There seems to be 2 choices, REST and XMLRPC. I'll try plugin::XMLRPC. Thanx, Dp. From bg271828 at yahoo.com Wed Sep 24 00:34:44 2008 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Wed Sep 24 00:34:49 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: Message-ID: <340264.71746.qm@web53409.mail.re2.yahoo.com> --- On Tue, 9/23/08, Tomas Doran wrote: > From: Tomas Doran > Subject: Re: [Catalyst] Search example in any docs? > To: bg271828@yahoo.com, "The elegant MVC web framework" > Date: Tuesday, September 23, 2008, 3:41 PM > On 23 Sep 2008, at 21:21, Dr. Jennifer Nussbaum wrote: > > i have > > code that looks like > > > > if ( $c->req->params->{title} ) { > > my $title = "%" . > $c->req->params->{title} . "%"; > > push (@$query, { title => { like => $title } > }); > > } > > > > # exact match here > > if ( $c->req->params->{author} ) { > > my $performer = > $c->req->params->{author}; > > push (@$query, { author => { '=' => > $author} }); > > } > > > > etc., which just looks messy. > > It's called refactoring - pull the common bits out and > put them in a > base class for your controllers. Thanks. I do appreciate this, and its a neat solution, but the problem wasnt that i dont know how to put common elements in a base class, the problem is that nowhere in the Cat docs, formal or informal, are there any examples of doing searches with web apps. In practice i tend to have more complicated apps, with difficult queries, that i do abstract out the query building, and then things that i throw together in a few minutes where everythings a mess. Usually when im just throwing things together, i forget about best practices and want to look them up. Jen From jshirley at gmail.com Wed Sep 24 01:45:17 2008 From: jshirley at gmail.com (J. Shirley) Date: Wed Sep 24 01:45:20 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <340264.71746.qm@web53409.mail.re2.yahoo.com> References: <340264.71746.qm@web53409.mail.re2.yahoo.com> Message-ID: <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> On Tue, Sep 23, 2008 at 4:34 PM, Dr. Jennifer Nussbaum wrote: > > --- On Tue, 9/23/08, Tomas Doran wrote: > >> From: Tomas Doran >> Subject: Re: [Catalyst] Search example in any docs? >> To: bg271828@yahoo.com, "The elegant MVC web framework" >> Date: Tuesday, September 23, 2008, 3:41 PM >> On 23 Sep 2008, at 21:21, Dr. Jennifer Nussbaum wrote: >> > i have >> > code that looks like >> > >> > if ( $c->req->params->{title} ) { >> > my $title = "%" . >> $c->req->params->{title} . "%"; >> > push (@$query, { title => { like => $title } >> }); >> > } >> > >> > # exact match here >> > if ( $c->req->params->{author} ) { >> > my $performer = >> $c->req->params->{author}; >> > push (@$query, { author => { '=' => >> $author} }); >> > } >> > >> > etc., which just looks messy. >> >> It's called refactoring - pull the common bits out and >> put them in a >> base class for your controllers. > > Thanks. I do appreciate this, and its a neat solution, but the problem wasnt that i dont know how to put common elements in a base class, the > problem is that nowhere in the Cat docs, formal or informal, are there any examples of doing searches with web apps. > Right, because any solution would be model specific. Which puts it in the realm of wiki nodes or CatalystX modules that profess preference for an ORM model. > In practice i tend to have more complicated apps, with difficult queries, that i do abstract out the query building, and then things that i > throw together in a few minutes where everythings a mess. Usually when im just throwing things together, i forget about best practices and want > to look them up. > > Jen > Wiki! Wiki! Document what you've done and post on here. Wiki nodes are a living document and can evolve with time and evolve into better solutions. What you're asking for is more a model, though, not Catalyst (which is just a framework, no more, no less). -J From jshirley at gmail.com Wed Sep 24 02:26:39 2008 From: jshirley at gmail.com (J. Shirley) Date: Wed Sep 24 02:26:43 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> Message-ID: <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> On Tue, Sep 23, 2008 at 4:30 PM, Dermot wrote: > 2008/9/23 Mesdaq, Ali : > >>I think ajax would be your friend here. > > I think I'll try something like that. As the files and Cat App are on > one server and the referrer is a different server, I will have the > referrer call a local script and fire a request from there. > > The question then is what type of Controller to use. There seems to be > 2 choices, REST and XMLRPC. I'll try plugin::XMLRPC. > > Thanx, > Dp. > Plugin::XMLRPC is -not- a controller, as such, you probably do want to use it. Ajax is nothing more than an async request from a browser, with a serialization format attached (but doesn't have to be, you can send out html snippets just fine). If you want to use a DWIM approach and fetch data REST will be the best bet. If you want html snippets, don't use any of the plugins, just return the snippet of the page you want to serve and code it in the JS. If you use Catalyst::Controller::REST handles serialization based on the Content-type header, with built-in support for JSON, YAML, XML and quite a few other formats. It also isn't intrusive to your other code (like a Plugin is). -J From GCoates at csuchico.edu Wed Sep 24 02:55:01 2008 From: GCoates at csuchico.edu (Coates, Greg) Date: Wed Sep 24 02:56:24 2008 Subject: [Catalyst] FastCGI Deployment problem - can't find templates References: <48D82A02.9020402@csuchico.edu> <48D937C2.30205@cornell.edu> <9ADE954C5044754C8E0BF406B5A217552800FBD3@ESCHE.csuchico.edu> <8647BA69-38B3-4FB0-9B50-6902380DF08D@bobtfish.net> Message-ID: <9ADE954C5044754C8E0BF406B5A217552800FBD4@ESCHE.csuchico.edu> Ah. That's it. I found a problem in the Makefile. Once that was fixed, the root directory= started being installed in the right place. Shockingly, with the files in= the right place, the templates were found. :-) Greg -----Original Message----- From: Tomas Doran [mailto:bobtfish@bobtfish.net] Sent: Tue 9/23/2008 3:46 PM To: The elegant MVC web framework Subject: Re: [Catalyst] FastCGI Deployment problem - can't find templates = On 23 Sep 2008, at 23:24, Coates, Greg wrote: > Okay. I've done this. > > I did some more checking, and I realize that I'm not sure where the = > static files and templates should be installed on a production = > server. It doesn't look like they get picked up in the make process. > > They should. If they aren't for any reason then you're doing = something which breaks things ;( > I currently have them in the /opt/myserver directory. My = > application perl module files are in the standard site_perl location. > > Where should the templates, etc go? > The template 'root' directory generally goes under the main directory = of your application, so if you're MyApp, then it'll be MyApp/root Exactly where this is depends on your perl, but if you're installing = locally, I'd expect the templates to end up somewhere similar to /usr/ = local/share/perl/5.8.8/MyApp/root/ Cheers t0m _______________________________________________ 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080923/7d973= e0b/attachment.htm From theshz at gmail.com Wed Sep 24 08:15:08 2008 From: theshz at gmail.com (theshz) Date: Wed Sep 24 08:15:16 2008 Subject: [Catalyst] getting database handles and run arbitrary SQL Message-ID: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> Hi, I'm new to Catalyst, just went through the Tutorial, everything worked = fine. But for my reporting application (part of a bigger application where = CRUD will be more often), I need to run some complicated querries. I did fi= nd the "Arbitray SQL" article in DBIx's FAQ, but I don't even know how to g= et to DBIx, if that's the right way, more specifically, = Is it possible to get the database handle and run SQL directly as in DBI? I= read that from Schema I can get its storage, which is the db handle. But f= rom a Controller, how do I get the schema object, or the db handle? If the = DBIx is the correct way to go (which seems a lengthy way to "just" run a qu= ery), do I do $c->model('Some::Model')->resultset....? Thanks. Z. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080924/3e048= c7f/attachment.htm From plu at pqpq.de Wed Sep 24 08:37:12 2008 From: plu at pqpq.de (Johannes Plunien) Date: Wed Sep 24 08:37:19 2008 Subject: [Catalyst] getting database handles and run arbitrary SQL In-Reply-To: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> References: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> Message-ID: Hi, On 24.09.2008, at 09:15, theshz wrote: > Is it possible to get the database handle and run SQL directly as in > DBI? yes, try: my $dbh = $c->model('DBIC::User')->result_source->storage->dbh; (assuming your model based on Catalyst::Model::DBIC::Schema is named DBIC and you got a schema called User) Kind regards, plu -- Johannes Plunien | mailto:plu@pqpq.de | http://www.pqpq.de/contact/ -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2436 bytes Desc: not available Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080924/9105dead/smime.bin From bobtfish at bobtfish.net Wed Sep 24 09:19:34 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 24 09:19:38 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> Message-ID: <6AA23F2A-7081-4F37-8CAF-85EB78987BB1@bobtfish.net> On 24 Sep 2008, at 00:30, Dermot wrote: > 2008/9/23 Mesdaq, Ali : > >> I think ajax would be your friend here. > > I think I'll try something like that. As the files and Cat App are on > one server and the referrer is a different server, I will have the > referrer call a local script and fire a request from there. Are you sure that you actually want your web server running this script? It may not be an issue for you, but if this needs to be scalable then I'd highly recommend using a distributed job queue such as TheSchwartz.. This also buys you other architectural benefits as you've done a load of decoupling, so you can now trivially have command line admin tools which monitor jobs in progress etc... If you take this approach, you don't have a problem, your first hit does a POST which submits a job (quick), then redirects the user to a page which refreshes regularly that reports on the job status, and once the job is complete, the next refresh can display a different page / redirect the user again as appropriate. Also, you don't need no steenkin Javascipt (although you're free to use it to improve the user experience, you have graceful degredation), and you've got a system that can trivially be abstracted to handle running / reporting status on a whole multitude of jobs... Cheers t0m From paikkos at googlemail.com Wed Sep 24 09:20:43 2008 From: paikkos at googlemail.com (Dermot) Date: Wed Sep 24 09:20:46 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> Message-ID: <9c7446e70809240120s4dde3789r3b351511dce3faaf@mail.gmail.com> 2008/9/24 J. Shirley : > On Tue, Sep 23, 2008 at 4:30 PM, Dermot wrote: > > Plugin::XMLRPC is -not- a controller, as such, you probably do want to use it. Do you mean do or 'do not' want to use it. > > If you use Catalyst::Controller::REST handles serialization based on > the Content-type header, with built-in support for JSON, YAML, XML and > quite a few other formats. It also isn't intrusive to your other code > (like a Plugin is). I installed this module and am trying to connect to it. Perhaps I should start a new thread but I ask anyway. If my the root of my app is /myapp. I have installed a the REST Controller as lib/MyApp/Controller/REST.pm The Controller has this for now. sub files : Local : ActionClass('REST') { my ($self, $c) = @_; $c->log->debug("Hello from REST Controller"); } sub files_GET { my ($self, $c) = @_; $self->status_ok( $c, entity => { result => 'acceptable', }, ); } My remote LWP client reads ... my $server = 'http://server.mydomain.com:3000' my $url = $server."/myapp/rest"; my $req = HTTP::Request->new(GET => $url); $req->content('files'); my $ua = LWP::UserAgent->new(); $ua->timeout(5); my $res = $ua->request($req); if ($res->is_success) { print "Content type=",$res->content_type,"\n"; print $res->decoded_content; } else { $res->status_line; } But the result is alway not found. .-------------------------------------+--------------------------------------. | Path | Private | +-------------------------------------+--------------------------------------+ | /rest/files | /rest/files .. [info] *** Request 7 (0.019/s) [16196] [Wed Sep 24 09:12:33 2008] *** [debug] "GET" request for "motion/rest" from "x.x.x.x" [debug] Arguments are "myapp/rest" The whole thing needs fleshing out but I can't seems to get a basic connection established. Any tips? From bobtfish at bobtfish.net Wed Sep 24 09:31:19 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 24 09:31:24 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <9c7446e70809240120s4dde3789r3b351511dce3faaf@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> <9c7446e70809240120s4dde3789r3b351511dce3faaf@mail.gmail.com> Message-ID: <860927DF-1859-45AB-9109-3831ECCA1531@bobtfish.net> On 24 Sep 2008, at 09:20, Dermot wrote: > If my the root of my app is /myapp. I have installed a the REST > Controller as lib/MyApp/Controller/REST.pm > > The Controller has this for now. > > sub files : Local : ActionClass('REST') { > my ($self, $c) = @_; > $c->log->debug("Hello from REST Controller"); > } > So that's the public path /rest/files > sub files_GET { > And that should be called for GET requests. > > > My remote LWP client reads > > ... > my $server = 'http://server.mydomain.com:3000' > my $url = $server."/myapp/rest"; > I think you need /rest/files > > .------------------------------------- > +--------------------------------------. > | Path | > Private | > +------------------------------------- > +--------------------------------------+ > | /rest/files | /rest/files > .. > [info] *** Request 7 (0.019/s) [16196] [Wed Sep 24 09:12:33 2008] *** > [debug] "GET" request for "motion/rest" from "x.x.x.x" > [debug] Arguments are "myapp/rest" And this explains why - you're asking for /myapp/rest, but you only have /myapp/rest/files Cheers t0m From bobtfish at bobtfish.net Wed Sep 24 09:31:33 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 24 09:31:35 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <340264.71746.qm@web53409.mail.re2.yahoo.com> References: <340264.71746.qm@web53409.mail.re2.yahoo.com> Message-ID: On 24 Sep 2008, at 00:34, Dr. Jennifer Nussbaum wrote: > Thanks. I do appreciate this, and its a neat solution, but the > problem wasnt that i dont know how to put common elements in a base > class, the > problem is that nowhere in the Cat docs, formal or informal, are > there any examples of doing searches with web apps. You're making the assumption here that Catalyst and DBIx::Class are the same thing. I'm not actually a DBIx::Class user myself, and there are plenty of people who aren't using it.. > In practice i tend to have more complicated apps, with difficult > queries, that i do abstract out the query building, and then things > that i > throw together in a few minutes where everythings a mess. Usually > when im just throwing things together, i forget about best > practices and want > to look them up. However, here you have a good point. One of the main strengths of Catalyst is that it's so easy to combine it with whatever set of other technologies you're using - but that doesn't mean that the documentation or community currently does the right thing by newer users who are confused by the level/number of choices open to them.. Also, having made a choice - there is little documentation about the common / recommended patterns and practices for combining various components in a non-trivial manor. It would be fantastic if there were more higher level documentation about the available components, and when/why you would want to employ them, combined with a lot more in-depth documentation about patterns and practices for combining Catalyst with a particular model / component to form a non-trivial application, accompanied by annotated demo applications showing the features/patterns in use. A lot of this knowledge is already buried in Catalyst applications (for example MojoMojo and Angerwhale both make pretty good reading, and if you're feeling like you need your brain stretched, Reaction will certainly do that) - however developing and maintaining comprehensive documentation / annotated commentary is non-trivial in itself, keeping it in pace with the applications themselves is probably a non-starter. Extracting enough of the complexity to show the patterns to good use into a demo application (and then maintaining said application) is also nontrivial undertaking. This isn't any criticism to the Catalyst documentation team - I think that the docs we do have are great, and well maintained in line with Catalyst itself. Another key problem is that it's also extremely hard for people who are familiar with the code bases in question to write good documentation - you can only do that as you're learning. My recommendation to anyone trying Catalyst for the first time, or trying a new piece of software with Catalyst / trying to find patterns or examples of prior art would be that once you've been through the available documentation on CPAN and the wiki, had a play, and formed your problem domain in your head, is to pop by irc - #catalyst is one of the most helpful channels I've ever been in, and whilst the inhabitants can be brusque, I see people wander by and take great advice away daily. (Note, as you're using DBIx::Class, they're likely to send you to #dbic). People there will also have no problem with deconstructing the specific problem you're trying to solve back to your problem domain, finding the higher level problem, and then telling you that you're solving it in a non-optimum way (and the approach they recommend for solving it). If everyone who came into irc and was helped were to spend the same time people had donated to helping them in writing up the help / knowledge they'd just received on the wiki, then all the things which I dismissed as 'nontrivial' above, would suddenly become possible. Some dream eh? Cheers t0m P.S. Come ask about what you want in #catalyst / #dbic and get it written up on the catalyst wiki, plzkthnx? From paikkos at googlemail.com Wed Sep 24 09:33:52 2008 From: paikkos at googlemail.com (Dermot) Date: Wed Sep 24 09:33:56 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <9c7446e70809240120s4dde3789r3b351511dce3faaf@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> <9c7446e70809240120s4dde3789r3b351511dce3faaf@mail.gmail.com> Message-ID: <9c7446e70809240133ue019cb0wf6449f1e32514610@mail.gmail.com> 2008/9/24 Dermot : > 2008/9/24 J. Shirley : >> On Tue, Sep 23, 2008 at 4:30 PM, Dermot wrote: > >> >> Plugin::XMLRPC is -not- a controller, as such, you probably do want to use it. > > Do you mean do or 'do not' want to use it. > My remote LWP client reads > > ... > my $server = 'http://server.mydomain.com:3000' > my $url = $server."/myapp/rest"; > > my $req = HTTP::Request->new(GET => $url); > $req->content('files'); > my $ua = LWP::UserAgent->new(); > $ua->timeout(5); > my $res = $ua->request($req); > Opps, dissgard that. My error. I need to drop the /myapp while is running in debug mode ...:3000/rest/file works. Thanx, Dp. From bobtfish at bobtfish.net Wed Sep 24 09:34:04 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Sep 24 09:34:08 2008 Subject: [Catalyst] getting database handles and run arbitrary SQL In-Reply-To: References: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> Message-ID: <94CAF052-4950-443C-A028-4576AB76F6EA@bobtfish.net> On 24 Sep 2008, at 08:37, Johannes Plunien wrote: > On 24.09.2008, at 09:15, theshz wrote: > >> Is it possible to get the database handle and run SQL directly as >> in DBI? > > yes, try: > > my $dbh = $c->model('DBIC::User')->result_source->storage->dbh; However - please note that doing this in your Controller is _not_ a recommended application pattern. If you do that, you will swiftly have domain logic in your controllers, and any useful testing you can do will be forced to be system testing with WWW::Mechanize. (There is nothing to test in the model, and mocking the whole of Catalyst + Model to test is just too much). I highly recommend that you implement your domain logic in a model class (it doesn't matter if that is a DBIC class, or a class with methods that work on a $dbh - see Catalyst::Model::DBI, or anything else). Then your controller code becomes a case of marshaling some request parameters, throwing them into your model and stashing the resultant data structures produced by the model. Controller means that it controls the other objects actions, *not* that it does the heavy lifting itself. You can then reuse your domain logic outside of Catalyst and test it in isolation (and trivially write command line scripts which also interact with the model), and the controllers are simple enough that testing them using mock objects is doable. Cheers t0m From zzbbyy at gmail.com Wed Sep 24 10:26:27 2008 From: zzbbyy at gmail.com (Zbigniew Lukasiak) Date: Wed Sep 24 10:26:31 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <999511.70190.qm@web53410.mail.re2.yahoo.com> References: <999511.70190.qm@web53410.mail.re2.yahoo.com> Message-ID: On Tue, Sep 23, 2008 at 10:21 PM, Dr. Jennifer Nussbaum wrote: > > --- On Tue, 9/23/08, Zbigniew Lukasiak wrote: > >> Hi there, >> >> I am sure you are referring to >> http://www.catalystframework.org/calendar/2007/16 :) I >> don't really >> know what you need, but I start that article with a very a >> simple >> solution: >> >> my @records = $schema->ResultSet( 'MyTable' >> )->search( >> $reqest->params, >> { page => 1, rows => 5 } >> ); >> >> Only after presenting that I start discussing what to do >> when you need >> to add some more complex predicates to the query and >> propose a >> solution to that. > > Yes i did see that and i did try it, but i quickly found that i ran into all sorts of problems. For example my params would usually include something > like a "action" param with the value "Submit query", whihc doesnt work so well when it hits the database ;-) Perhaps something like: $params = $c->req->params; delete $params->{action}; ? You further talk about the 'LIKE' queries etc. It must be my writing skills or maybe I did a too big step between the simple solution and the complex ones - but answering the question on how to extend the basic search in a clean way was exactly the point of my article. If you ask this question then I must have failed in my goal - so excuse my persistance but I would like to persue it a bit further. So here is a simple search with a 'LIKE' operator on mycolumn. sub search_for_mycolumn { my ( $self, $params ) = @_; my %search_params = { mycolumn => { 'like' => '%' . $params->{my_column} . '%' }; $self = $self->search( \%search_params ); return $self; } The key is that advanced_search will look for methods called search_for_* and use them automatically for the search. You can combine it with the exact matches (that you don't need to write any additional method for) and any other complex predicates. The full advantage of this technique might not be visible for simple cases like this one - but I am sure that as soon as you add tags into that you'll find it cleaner. Now I think I should have written a full example - so that the reader would see how the parts need to be assembled. So your ResultSet class would be something like: use base AdvancedSearch; sub search_for_mycolumn { my ( $self, $params ) = @_; my %search_params = { mycolumn => { 'like' => '%' . $params->{my_column} . '%' }; $self = $self->search( \%search_params ); return $self; } ... (other complex searches here) ... 1; And the code in your controller would be similar to: my $params = $c->req->params; delete $params->{action}; my $result_set = $c->model( 'MyModel')->ResultSet( 'MyTable' ); my @records = $result_set->advanced_search( $params, { page => 1, rows => 5 } ); Maybe an update would fit for the next Advent Calendar? Cheers, Zbigniew From moldovenu at gmail.com Wed Sep 24 10:43:03 2008 From: moldovenu at gmail.com (Adam Bartosik) Date: Wed Sep 24 10:43:07 2008 Subject: [Catalyst] Failing tests in Catalyst::Controller::SOAP In-Reply-To: References: Message-ID: <3191ff7c0809240243g1d0db73em868d4465ee73f4cd@mail.gmail.com> > I'll try to take a look at the test errors soon, but I'm pretty > swamped at $work for the near future. That said, I'm using the latest > C:C::SOAP in production without any problems. :-) Hi Drew, Which versions of XML::Compile, XML::Compile::SOAP do you use there? Adam -- Adam Bartosik http://langs-tech-stuff.blogspot.com/ From fireartist at gmail.com Wed Sep 24 12:41:23 2008 From: fireartist at gmail.com (Carl Franks) Date: Wed Sep 24 12:41:32 2008 Subject: [Catalyst] persistent perl engine Message-ID: <4f352aae0809240441t52d69900s9c359cca53f5fd7f@mail.gmail.com> I'm just posting this here in case it's useful to anyone else. `perperl` provided by the PersistentPerl distribution seems to work fine with myapp_cgi.pl - with one exception... sysread() seems to always return 0 when running under perperl. I've created a basic engine that simply overrides read_chunk(), so it uses read() instead. This should also work with CGI::SpeedyCGI - which as far as I'm aware, it the same code as PersistentPerl, under a different name. Now to start repressing my memory of how long it's taken me to fix this... Cheers, Carl package Catalyst::Engine::PerPerl; use strict; use base 'Catalyst::Engine::CGI'; sub read_chunk { shift; # $self shift; # $c *STDIN->read( @_ ); } 1; From jester at panix.com Wed Sep 24 15:00:48 2008 From: jester at panix.com (Jesse Sheidlower) Date: Wed Sep 24 15:00:52 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> References: <340264.71746.qm@web53409.mail.re2.yahoo.com> <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> Message-ID: <20080924140048.GA23908@panix.com> On Tue, Sep 23, 2008 at 05:45:17PM -0700, J. Shirley wrote: > On Tue, Sep 23, 2008 at 4:34 PM, Dr. Jennifer Nussbaum > wrote: > > > > > > Thanks. I do appreciate this, and its a neat solution, but the problem wasnt that i dont know how to put common elements in a base class, the > > problem is that nowhere in the Cat docs, formal or informal, are there any examples of doing searches with web apps. > > > > Right, because any solution would be model specific. Which puts it in > the realm of wiki nodes or CatalystX modules that profess preference > for an ORM model. [...] > Wiki! Wiki! Document what you've done and post on here. Wiki nodes > are a living document and can evolve with time and evolve into better > solutions. > > What you're asking for is more a model, though, not Catalyst (which is > just a framework, no more, no less). I'm about to get on a plane now, but I did want to comment on this thread, as someone at least theoretically concerned with the docs. Though there have now been several responses along J. Shirley's lines, I have to say that I agree with the OP here. It doesn't matter if a search-generation routine is tied to one or another ORM, it should be documented somewhere, as this is a very common task. The docs are very heavily tied to specific elements--most of them assume you're using DBIC; the Tutorial shows the use of DBIC and FormFu; everything shows TT views, etc. If you're using the Rose modules for your DB layer, there's a lot less in the docs; if you're using DFV for forms (as I do) there's not much there; etc. So there's no reason that search can't also be demonstrated using DBIC. So I don't think that showing a basic search example using DBIC would somehow violate the idea of Catalyst-as-framework. I hope the OP does document her ideas on the wiki, and it would be nice if Zbigniew does exend the Advent article. But a short addition to the Tutorial showing a simple search, or a Cookbook entry on this, would, I think, be a Good Thing. Jesse Sheidlower From publiustemp-catalyst at yahoo.com Wed Sep 24 15:10:38 2008 From: publiustemp-catalyst at yahoo.com (Ovid) Date: Wed Sep 24 15:10:43 2008 Subject: [Catalyst] Chained Regexes Message-ID: <964122.30514.qm@web65716.mail.ac4.yahoo.com> Pursuant to a refactoring issue I explained at http://use.perl.org/~Ovid/journal/37525, it would be nice if I could mix regexes with Chained actions. There are some nice refactoring potential. Plus, by allowing me to apply a regex to a CaptureArg or Arg, I could get 404s for free. Having to write this manually is a bit disappointing. Or if someone could kindly point me to the docs on where I messed up, that would be great :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6 From jshirley at gmail.com Wed Sep 24 15:53:56 2008 From: jshirley at gmail.com (J. Shirley) Date: Wed Sep 24 15:53:59 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <20080924140048.GA23908@panix.com> References: <340264.71746.qm@web53409.mail.re2.yahoo.com> <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> <20080924140048.GA23908@panix.com> Message-ID: <756703690809240753u5b13dea9s6d93bd33c00ede02@mail.gmail.com> On Wed, Sep 24, 2008 at 7:00 AM, Jesse Sheidlower wrote: > On Tue, Sep 23, 2008 at 05:45:17PM -0700, J. Shirley wrote: >> On Tue, Sep 23, 2008 at 4:34 PM, Dr. Jennifer Nussbaum >> wrote: >> > >> > >> > Thanks. I do appreciate this, and its a neat solution, but the problem wasnt that i dont know how to put common elements in a base class, the >> > problem is that nowhere in the Cat docs, formal or informal, are there any examples of doing searches with web apps. >> > >> >> Right, because any solution would be model specific. Which puts it in >> the realm of wiki nodes or CatalystX modules that profess preference >> for an ORM model. > > [...] > >> Wiki! Wiki! Document what you've done and post on here. Wiki nodes >> are a living document and can evolve with time and evolve into better >> solutions. >> >> What you're asking for is more a model, though, not Catalyst (which is >> just a framework, no more, no less). > > I'm about to get on a plane now, but I did want to comment on this > thread, as someone at least theoretically concerned with the docs. > > Though there have now been several responses along > J. Shirley's lines, I have to say that I agree with the OP > here. It doesn't matter if a search-generation routine is tied > to one or another ORM, it should be documented somewhere, as > this is a very common task. The docs are very heavily tied to > specific elements--most of them assume you're using DBIC; the > Tutorial shows the use of DBIC and FormFu; everything shows TT > views, etc. If you're using the Rose modules for your DB > layer, there's a lot less in the docs; if you're using DFV for > forms (as I do) there's not much there; etc. So there's no > reason that search can't also be demonstrated using DBIC. > The tutorial is the only one that assumes DBIC. That isn't necessarily the technical documentation of Catalyst. That is a Catalyst Tutorial. I view docs as what is under the Catalyst::Manual space, though. If you count wiki and advent calendars, sure, but the problem has been posted about on the advent calendars. I suggested the wiki, though. I do think that TT is the standard view in the docs, mostly because it has the least offensive syntax to people just wanted to read what is going on. DBIC (or any model class) is not that way. You have to learn DBIC for it to really make sense. > So I don't think that showing a basic search example using > DBIC would somehow violate the idea of Catalyst-as-framework. > I hope the OP does document her ideas on the wiki, and it would > be nice if Zbigniew does exend the Advent article. But a short > addition to the Tutorial showing a simple search, or a Cookbook > entry on this, would, I think, be a Good Thing. > CatalystX::Cookbook would probably be the better place for it, rather than in Catalyst::Manual. Bonus points for included code (perhaps in the form of t/search.t and t/lib/TestApp/Controller/Search.pm?) -J From dbix-class at trout.me.uk Wed Sep 24 16:04:30 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 24 16:04:32 2008 Subject: [Catalyst] Multiple DB, single instance of Cat In-Reply-To: References: <74FF38D8-E3E6-4E3F-963C-68A40FAEF9F1@systemgarden.com> <20080817190801.GF14534@agaton.scsys.co.uk> Message-ID: <20080924150430.GA9470@agaton.scsys.co.uk> On Thu, Sep 11, 2008 at 11:58:31PM +0100, Nigel Stuckey wrote: > Matt > > I stand corrected on DBIx! Yes, indeed I mean DBIx::Class. > > The code is in and works, but has a couple of issues. Firstly, it > creates new classes and carries out a DB connect every time there is > a request. Is there a way to make it more efficient by caching the > classes and DB connects once there is a successful authentication? It should only be creating a new $schema object, see below. No reasony you can't do __PACKAGE__->mk_accessors('connection_cache'); and then set that to {} somewhere early and keep the $schema objects in there. I didn't do this in my example because (1) IT WAS A SIMPLE EXAMPLE (2) writing caching code is simple, except you need to handle cache expiry and stuff and I didn't have time to write example code for all of that :) > Secondly, there are loads of 'ACCEPT_CONTEXT redefined' messages, one > per DB table defined to the DBIC model. When initialising, I have to > give the 'dynamic' model an initial configuration to allow Catalyst o > start. Ah, the class creation and stuff shouldn't be happening. That's me being silly, what you want to do is my $new = bless({ %$self }, ref($self)); to bypass the initialisation phase. > Once the code is working I will pop it on the wiki. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From abuse at cabal.org.uk Wed Sep 24 17:01:00 2008 From: abuse at cabal.org.uk (Peter Corlett) Date: Wed Sep 24 17:00:35 2008 Subject: [Catalyst] C::P::Compress::Gzip In-Reply-To: References: Message-ID: <20080924160100.GA22514@cabal.org.uk> On Sat, Sep 20, 2008 at 11:46:25AM +0300, Octavian Rasnita wrote: > I try to use C::P::Compress::Gzip, but if I add it to the list of plugins, > the program gives an error in the browser telling "The requested URL / was > not found on this server." It's probably easier to just configure Apache to do the compression for you. That way the static content not processed by Catalyst will also be compressed. I just stick "SetOutputFilter DEFLATE" inside the . In theory, you ought to also put it inside a to exclude already-compressed files, but I don't bother. From dbix-class at trout.me.uk Wed Sep 24 17:02:15 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 24 17:02:17 2008 Subject: [Catalyst] One (central) app, one schema, X databases In-Reply-To: <20080910094235.GC32258@herlpacker.co.uk> References: <20080910094235.GC32258@herlpacker.co.uk> Message-ID: <20080924160215.GH9470@agaton.scsys.co.uk> On Wed, Sep 10, 2008 at 10:42:35AM +0100, Chisel Wright wrote: > I'm just in the initial planning phase of a project. > > The basic idea is to have X locations running App::Location, each with a > local database that has a App::Location::Schema. > > Everything's the same, just different data in the locations. > > We'd like to have a centralised tool to manage App::Location #1 ... > App::Location #X - App::Central > > App::Central may have it's own App::Central::Schema, but it should also > be able to interact with App::Location::Schema #1 .. > App::Location::Schema #X. If you only need one location at once, use the approach I was discussing in an earlier thread for multiple users. If you need multiple, maybe add an ACCEPT_CONTEXT onto your M::DBIC::Schema that takes a location name, and then modify *{"${classname}::ACCEPT_CONTEXT"} = sub { shift; shift->model($model_name)->resultset($moniker); } in M::DBIC::Schema itself to do ->model($model_name, @_) then you can do $c->model('DB::Foo', 'location1'); -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Wed Sep 24 17:05:14 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 24 17:05:15 2008 Subject: [Catalyst] Race condition in Catalyst::Plugin::Session and Catalyst::Engine::Apache (possibly other engines too) In-Reply-To: <46e748b80809101559y3bad3fbai530ce18775736cd0@mail.gmail.com> References: <46e748b80809101559y3bad3fbai530ce18775736cd0@mail.gmail.com> Message-ID: <20080924160514.GI9470@agaton.scsys.co.uk> On Wed, Sep 10, 2008 at 06:59:21PM -0400, Sergio Salvi wrote: > There is a race condition in C::P::Session when using > C::Engine::Apache (and probably other engines too): > > I have a simple controller action (let's call it /save) that gets data > submitted from an HTML form via POST, process that request, stores > some stuff in the session and flash and then redirects with HTTP 303 > to another action (/display). > > The /display action then displays the regular "submit successful" > message that was set on the previous action by using $c->flash. The > problem is that the browser is GETting /display before /save is > finished storing the session and flash rows in the database. Then, of > course, /display thinks nothing has happened and doesn't display the > data from flash. > > After a bunch of debugging and stack traces :), I figured out the > problem is that C::P::Session's finalize() calls $c->NEXT::finalize() > before calling $c->finalize_session, so > C::Engine::Apache->finalize_body() gets executed *before* the session > is flushed in the database, making the browser access /display even > though the session may not be stored yet: This was changed by Bill Moseley in order to fix a bunch of other bugs. Have a look at the ChangeLog - maybe we could provide an option to reverse the order or find another approach? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Wed Sep 24 18:03:04 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Wed Sep 24 18:03:05 2008 Subject: [Catalyst] #catalyst In-Reply-To: <871vzntod5.fsf@bar.jrock.us> References: <871vzntod5.fsf@bar.jrock.us> Message-ID: <20080924170304.GK9470@agaton.scsys.co.uk> On Sat, Sep 13, 2008 at 10:09:26PM -0500, Jonathan Rockway wrote: > * On Sat, Sep 13 2008, Zbigniew Lukasiak wrote: > > Hi there, > > > > I did not see how it looked like at the channel a few days ago - but I > > hope that my irc client malfunction did not offend someone too severly > > (unlike that famous wardrobe of some US pop singer). And that the > > bane for my home machine is not eternal and can be released soon. > > You're unbanned now. In the future, just /msg an op (usually mst) and > they will take care of it (especially if it's because your client > malfunctioned). Yeah. The problem was the malfunction meant I also couldn't effectively /msg you to say it was just a tempban. And then I was off to IPW and had no internet and forgot to unban you before I left because I suck :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From kennyg at pobox.com Wed Sep 24 18:46:18 2008 From: kennyg at pobox.com (Kenny Gatdula) Date: Wed Sep 24 18:46:29 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> References: <340264.71746.qm@web53409.mail.re2.yahoo.com> <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> Message-ID: On Sep 23, 2008, at 8:45 PM, J. Shirley wrote: > > Wiki! Wiki! Document what you've done and post on here. Wiki nodes > are a living document and can evolve with time and evolve into better > solutions. Because I love little diversions like this, here you go. http://dev.catalystframework.org/wiki/wikicookbook/searchexample Kenny From sri-lists at labs.kraih.com Wed Sep 24 19:27:19 2008 From: sri-lists at labs.kraih.com (Sebastian Riedel) Date: Wed Sep 24 19:22:35 2008 Subject: [Catalyst] Mojo, a new kind of web framework Message-ID: <34D5038E-1E98-41BA-AEDA-48FB9C132069@labs.kraih.com> It started as a Catalyst competitor but resulted in something different, the good kind of different. :) Here's the first part of my upcoming blog article series, "Why Mojo won't kill Catalyst". http://labs.kraih.com/blog/2008/09/why-mojo-wont-kill-catalyst.html -- sebastian From john.beppu at gmail.com Wed Sep 24 19:45:17 2008 From: john.beppu at gmail.com (John Beppu) Date: Wed Sep 24 19:45:21 2008 Subject: [Catalyst] Mojo, a new kind of web framework In-Reply-To: <34D5038E-1E98-41BA-AEDA-48FB9C132069@labs.kraih.com> References: <34D5038E-1E98-41BA-AEDA-48FB9C132069@labs.kraih.com> Message-ID: <21a10fe00809241145q62051e7bqbf9d2e0a8c81e9b@mail.gmail.com> Nice. Where can we download it? On Wed, Sep 24, 2008 at 11:27 AM, Sebastian Riedel wrote: > It started as a Catalyst competitor but resulted in something different, > the good kind of different. :) > > Here's the first part of my upcoming blog article series, "Why Mojo won't > kill Catalyst". > http://labs.kraih.com/blog/2008/09/why-mojo-wont-kill-catalyst.html > > -- > sebastian > > _______________________________________________ > 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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080924/3965e= 524/attachment.htm From sri-lists at labs.kraih.com Wed Sep 24 20:36:46 2008 From: sri-lists at labs.kraih.com (Sebastian Riedel) Date: Wed Sep 24 20:32:01 2008 Subject: [Catalyst] Mojo, a new kind of web framework In-Reply-To: <21a10fe00809241145q62051e7bqbf9d2e0a8c81e9b@mail.gmail.com> References: <34D5038E-1E98-41BA-AEDA-48FB9C132069@labs.kraih.com> <21a10fe00809241145q62051e7bqbf9d2e0a8c81e9b@mail.gmail.com> Message-ID: <3A5327B1-AB21-4FE5-B5DB-112568291828@labs.kraih.com> Pause seems not to work atm. so it's just on kraih.com for now. http://kraih.com/Mojo-0.2.tar.gz From the pod: *IMPORTANT!* This is beta software, don't use it for anything serious, it might eat your puppy or cause the apocalypse. (You've been warned...) -- sebastian 24.09.2008 20:45 John Beppu: > Nice. Where can we download it? > > On Wed, Sep 24, 2008 at 11:27 AM, Sebastian Riedel > wrote: > It started as a Catalyst competitor but resulted in something > different, the good kind of different. :) > > Here's the first part of my upcoming blog article series, "Why Mojo > won't kill Catalyst". > http://labs.kraih.com/blog/2008/09/why-mojo-wont-kill-catalyst.html > > -- > sebastian > > _______________________________________________ > 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/ From gcoates at csuchico.edu Wed Sep 24 22:52:03 2008 From: gcoates at csuchico.edu (Greg Coates) Date: Wed Sep 24 22:52:40 2008 Subject: [Catalyst] DBIC Authentication Errors Message-ID: <48DAB683.6040405@csuchico.edu> I'm getting errors when I try to login to my web app, which is set up to use the DBIC authentication plugin. Here's the relevant portion of my config file: authentication: default_realm: dbic realms: dbic: credential: class: Password password_field: usr_password password_type: clear store: class: DBIx::Class user_class: BlogDB::Users id_field: usr_login_name When I start the dev server, I see this: [debug] Loaded Config "/path/to/my/config/dev.yml" [debug] Setting up auth realm dbic Here's the login controller: sub login : Local { my ($self, $c) = @_; if ($c->request->params->{submitted} eq 'yes') { my $username = $c->request->params->{usr_login_name} || ""; my $password = $c->request->params->{usr_password} || ""; if ($c->authenticate({ username => $username, password => $password })) { $c->response->redirect( $c->uri_for('/posts') ); return; } else { $c->stash->{message} = "Invalid user ID or password."; } } $c->stash->{template} = 'users/login.tt'; $c->stash->{stylesheet} = 'form.css'; } The login form displays fine, but when I try to log in using a uid/password combo that IS in the database, I get this error: [debug] "POST" request for "users/login" [debug] Path is "users/login" [error] Caught exception in MyApp::Controller::Users->login "User retrieval failed: no columns from BlogDB::Users were provided at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm line 63" I've googled for solutions until my fingertips are numb with no luck. I suspect there's some stupid little problem that I'm missing. Can anyone shed some light on this issue for me? Thanks, Greg From jshirley at gmail.com Wed Sep 24 23:38:32 2008 From: jshirley at gmail.com (J. Shirley) Date: Wed Sep 24 23:38:34 2008 Subject: [Catalyst] Search example in any docs? In-Reply-To: References: <340264.71746.qm@web53409.mail.re2.yahoo.com> <756703690809231745l7c2a79e9lf1336e662a41c93f@mail.gmail.com> Message-ID: <756703690809241538o579d7efi43d0393b2bfb7187@mail.gmail.com> On Wed, Sep 24, 2008 at 10:46 AM, Kenny Gatdula wrote: > > On Sep 23, 2008, at 8:45 PM, J. Shirley wrote: >> >> Wiki! Wiki! Document what you've done and post on here. Wiki nodes >> are a living document and can evolve with time and evolve into better >> solutions. > > Because I love little diversions like this, here you go. > http://dev.catalystframework.org/wiki/wikicookbook/searchexample > > Kenny > Everybody owes Kenny a beer for starting it, and then please add in your own recipes and comments (or add your comments, then buy him a beer) Although linking to localhost:3000 may not DWYM :) From jshirley at gmail.com Wed Sep 24 23:40:21 2008 From: jshirley at gmail.com (J. Shirley) Date: Wed Sep 24 23:40:26 2008 Subject: [Catalyst] DBIC Authentication Errors In-Reply-To: <48DAB683.6040405@csuchico.edu> References: <48DAB683.6040405@csuchico.edu> Message-ID: <756703690809241540h5697f2aawc4f7a03404ff5507@mail.gmail.com> On Wed, Sep 24, 2008 at 2:52 PM, Greg Coates wrote: > I'm getting errors when I try to login to my web app, which is set up to use > the DBIC authentication plugin. > > > > Here's the relevant portion of my config file: > > authentication: > default_realm: dbic > realms: > dbic: > credential: > class: Password > password_field: usr_password > password_type: clear > store: > class: DBIx::Class > user_class: BlogDB::Users > id_field: usr_login_name > > > > When I start the dev server, I see this: > [debug] Loaded Config "/path/to/my/config/dev.yml" > [debug] Setting up auth realm dbic > > > > Here's the login controller: > > sub login : Local { > my ($self, $c) = @_; > > if ($c->request->params->{submitted} eq 'yes') { > my $username = $c->request->params->{usr_login_name} || ""; > my $password = $c->request->params->{usr_password} || ""; > if ($c->authenticate({ username => $username, > password => $password })) { > $c->response->redirect( $c->uri_for('/posts') ); > return; > } else { > $c->stash->{message} = "Invalid user ID or password."; > } > } > > $c->stash->{template} = 'users/login.tt'; > $c->stash->{stylesheet} = 'form.css'; > } > > > The login form displays fine, but when I try to log in using a uid/password > combo that IS in the database, I get this error: > > [debug] "POST" request for "users/login" > [debug] Path is "users/login" > [error] Caught exception in MyApp::Controller::Users->login "User retrieval > failed: no columns from BlogDB::Users were provided at > /usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm > line 63" > > > I've googled for solutions until my fingertips are numb with no luck. I > suspect there's some stupid little problem that I'm missing. Can anyone > shed some light on this issue for me? > > Thanks, > Greg > You probably want $c->authenticate({ usr_login_name => $username, usr_password => $password }); The parameters passed into authenticate match what your DBIC schema class declares. -J From gcoates at csuchico.edu Wed Sep 24 23:50:25 2008 From: gcoates at csuchico.edu (Greg Coates) Date: Wed Sep 24 23:51:11 2008 Subject: [Catalyst] DBIC Authentication Errors In-Reply-To: <756703690809241540h5697f2aawc4f7a03404ff5507@mail.gmail.com> References: <48DAB683.6040405@csuchico.edu> <756703690809241540h5697f2aawc4f7a03404ff5507@mail.gmail.com> Message-ID: <48DAC431.6020008@csuchico.edu> Yep, that fixed it. I knew it had to be something simple! Thanks, Greg J. Shirley wrote: > On Wed, Sep 24, 2008 at 2:52 PM, Greg Coates wrote: >> I'm getting errors when I try to login to my web app, which is set up to use >> the DBIC authentication plugin. >> >> >> >> Here's the relevant portion of my config file: >> >> authentication: >> default_realm: dbic >> realms: >> dbic: >> credential: >> class: Password >> password_field: usr_password >> password_type: clear >> store: >> class: DBIx::Class >> user_class: BlogDB::Users >> id_field: usr_login_name >> >> >> >> When I start the dev server, I see this: >> [debug] Loaded Config "/path/to/my/config/dev.yml" >> [debug] Setting up auth realm dbic >> >> >> >> Here's the login controller: >> >> sub login : Local { >> my ($self, $c) = @_; >> >> if ($c->request->params->{submitted} eq 'yes') { >> my $username = $c->request->params->{usr_login_name} || ""; >> my $password = $c->request->params->{usr_password} || ""; >> if ($c->authenticate({ username => $username, >> password => $password })) { >> $c->response->redirect( $c->uri_for('/posts') ); >> return; >> } else { >> $c->stash->{message} = "Invalid user ID or password."; >> } >> } >> >> $c->stash->{template} = 'users/login.tt'; >> $c->stash->{stylesheet} = 'form.css'; >> } >> >> >> The login form displays fine, but when I try to log in using a uid/password >> combo that IS in the database, I get this error: >> >> [debug] "POST" request for "users/login" >> [debug] Path is "users/login" >> [error] Caught exception in MyApp::Controller::Users->login "User retrieval >> failed: no columns from BlogDB::Users were provided at >> /usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm >> line 63" >> >> >> I've googled for solutions until my fingertips are numb with no luck. I >> suspect there's some stupid little problem that I'm missing. Can anyone >> shed some light on this issue for me? >> >> Thanks, >> Greg >> > > You probably want $c->authenticate({ usr_login_name => $username, > usr_password => $password }); > > The parameters passed into authenticate match what your DBIC schema > class declares. > > -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/ From paikkos at googlemail.com Thu Sep 25 02:30:18 2008 From: paikkos at googlemail.com (Dermot) Date: Thu Sep 25 02:30:22 2008 Subject: [Catalyst] A suitable method to redraw a page In-Reply-To: <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> References: <9c7446e70809230353v1226144gcb19797277d40669@mail.gmail.com> <1BE349D4C1558248B6E323F697FB96EC1DBA20B6@SSDEXCH2.websense.com> <9c7446e70809231630x589e37ag748fc28179aeaff9@mail.gmail.com> <756703690809231826t1f0d70d3w2ccc45808dd7af47@mail.gmail.com> Message-ID: <9c7446e70809241830m6fd479eewda186ff887a78a01@mail.gmail.com> 2008/9/24 J. Shirley : > If you use Catalyst::Controller::REST Wow. It's quite a nifty module. I really like it. Thanx, Dp. From kai.andresen at gmail.com Thu Sep 25 09:42:18 2008 From: kai.andresen at gmail.com (Kai Andresen) Date: Thu Sep 25 09:42:20 2008 Subject: [Catalyst] How to register a stored procedure with the model? Message-ID: <38bac53e0809250142k499f9c89maa0864c81e883a4e@mail.gmail.com> SGkgYWxsLAoKSSBuZWVkIHRvIGNhbGwgYW4gT3JhY2xlIHN0b3JlZCBwcm9jZWR1cmUsIGFuZCBh IGZ1bmN0aW9uLCB3aGVyZSBjYW4gSSBmaW5kCnNvbSByZWZlcmVuY2UgbWF0ZXJpYWwgb24gdGhh dD8KSSd2ZSBiZWVuIHRyeWluZyB0byBzZWFyY2ggdGhlIHdlYiwgYnV0IEkndmUgcHJvYmFibHkg ZmFpbGVkIHRvIGdldCB0aGUKc2VhcmNoIHRlcm1zIHJpZ2h0LgoKV2UgdXNlIENhdGFseXN0OjpN b2RlbDo6REJJQzo6U2NoZW1hLCBhbmQgdGhlIGRhdGFiYXNlIGZ1bmN0aW9uIGFuZCBzdG9yZWQK cHJvY2VkdXJlIHJlc2lkZXMgaW4gdGhlIHNhbWUgZGF0YWJhc2UgYXMgdGhlIGRhdGEuCgpBbnkg cG9pbnRlcnMgd291bGQgYmUgZ3JlYXRseSBhcHByZWNpYXRlZAoKcmVnYXJkcywKS2FpIEFuZHJl c2VuCi0tLS0tLS0tLS0tLS0tIG5leHQgcGFydCAtLS0tLS0tLS0tLS0tLQpBbiBIVE1MIGF0dGFj aG1lbnQgd2FzIHNjcnViYmVkLi4uClVSTDogaHR0cDovL2xpc3RzLnNjc3lzLmNvLnVrL3BpcGVy bWFpbC9jYXRhbHlzdC9hdHRhY2htZW50cy8yMDA4MDkyNS9lMWJmM2JlYi9hdHRhY2htZW50Lmh0 bQo= From wdhawes at gmail.com Thu Sep 25 09:56:56 2008 From: wdhawes at gmail.com (Will Hawes) Date: Thu Sep 25 09:56:59 2008 Subject: [Catalyst] How to register a stored procedure with the model? In-Reply-To: <38bac53e0809250142k499f9c89maa0864c81e883a4e@mail.gmail.com> References: <38bac53e0809250142k499f9c89maa0864c81e883a4e@mail.gmail.com> Message-ID: <360eac500809250156s125203e1h3dd1756dbbe4baeb@mail.gmail.com> 2008/9/25 Kai Andresen : > Hi all, > > I need to call an Oracle stored procedure, and a function, where can I find > som reference material on that? http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Using_database_functions_or_stored_procedures From gavin at openfusion.com.au Thu Sep 25 12:02:43 2008 From: gavin at openfusion.com.au (Gavin Carr) Date: Thu Sep 25 12:02:52 2008 Subject: [Catalyst] Conditional GET with Catalyst::Controller::REST Message-ID: <20080925110243.GD3399@openfusion.com.au> I'm seeing a weird problem trying to get conditional GETs working under Catalyst::Controller::REST (0.66). Short version is that everything works beautifully when doing a HEAD, and my 304 is happily returned, but the same code on a GET causes a 500, with nothing helpful logged. Code snippet is: sub index_GET { my ($self, $c) = @_; my $sset = $c->stash->{sset} or return; my $ifmod_ts = $c->request->headers->if_modified_since; my $sset_ts = $sset->modify_ts->epoch; if ($ifmod_ts && $ifmod_ts == $sset_ts) { $c->log->debug("not modified: ifmod_ts == sset_ts ($sset_ts)"); $c->response->status(304); $c->log->debug('Status: ' . $c->response->status); return 1; } # Rest of GET # ... } In the logs I see the two debug lines, and then nothing else: [debug] not modified: ifmod_ts == sset_ts (1222241031) [debug] Status: 304 Any cluesticks as to what might be going on here? If I change the status to almost anything else but 304 it all works fine. And it doesn't seem to be the serialisation code either, as that explicitly checks for 3xx status codes and exits. Baffled. Anyone have conditional GETs working with C::C::REST? Cheers, Gavin From taylor.andrew.j at gmail.com Thu Sep 25 13:43:29 2008 From: taylor.andrew.j at gmail.com (Drew Taylor) Date: Thu Sep 25 13:43:33 2008 Subject: [Catalyst] Failing tests in Catalyst::Controller::SOAP In-Reply-To: <3191ff7c0809240243g1d0db73em868d4465ee73f4cd@mail.gmail.com> References: <3191ff7c0809240243g1d0db73em868d4465ee73f4cd@mail.gmail.com> Message-ID: On Wed, Sep 24, 2008 at 10:43 AM, Adam Bartosik wrote: >> I'll try to take a look at the test errors soon, but I'm pretty >> swamped at $work for the near future. That said, I'm using the latest >> C:C::SOAP in production without any problems. :-) > > Hi Drew, > Which versions of XML::Compile, XML::Compile::SOAP do you use there? I'm no longer on the cutting edge: X::C 0.86, X::C::SOAP 0.73. I remember from the changelog in recent versions of XML::Compile that there were some changes to attributes(?). I'm guessing this is what causes the tests to fail, but it's just a guess at this point. Drew -- ---------------------------------------------------------------- Drew Taylor * Web development & consulting Email: drew@drewtaylor.com * Site implementation & hosting Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres ---------------------------------------------------------------- From cub.uanic at gmail.com Thu Sep 25 14:34:50 2008 From: cub.uanic at gmail.com (Oleg Kostyuk) Date: Thu Sep 25 14:34:54 2008 Subject: [Catalyst] Conditional GET with Catalyst::Controller::REST In-Reply-To: <20080925110243.GD3399@openfusion.com.au> References: <20080925110243.GD3399@openfusion.com.au> Message-ID: <60ef632f0809250634w926b255j1ae4c7e02c6ce3e8@mail.gmail.com> > Short version is that everything works beautifully when > doing a HEAD, and my 304 is happily returned, but the same > code on a GET causes a 500, with nothing helpful logged. > Code snippet is: > > sub index_GET { > my ($self, $c) = @_; > my $sset = $c->stash->{sset} or return; Probably, when "return" is executed - you'll get unexpected result. -- Sincerely yours, Oleg Kostyuk (CUB-UANIC) From jshirley at gmail.com Thu Sep 25 15:01:52 2008 From: jshirley at gmail.com (J. Shirley) Date: Thu Sep 25 15:01:57 2008 Subject: [Catalyst] How to register a stored procedure with the model? In-Reply-To: <38bac53e0809250142k499f9c89maa0864c81e883a4e@mail.gmail.com> References: <38bac53e0809250142k499f9c89maa0864c81e883a4e@mail.gmail.com> Message-ID: <756703690809250701tefbdc38t1ce2509ff84e1a31@mail.gmail.com> On Thu, Sep 25, 2008 at 1:42 AM, Kai Andresen wrote: > Hi all, > > I need to call an Oracle stored procedure, and a function, where can I find > som reference material on that? > I've been trying to search the web, but I've probably failed to get the > search terms right. > > We use Catalyst::Model::DBIC::Schema, and the database function and stored > procedure resides in the same database as the data. > > Any pointers would be greatly appreciated > > regards, > Kai Andresen > Please also note that there is a dedicated DBIx::Class mailing list: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ From christian at lackas.net Thu Sep 25 19:35:14 2008 From: christian at lackas.net (Christian Lackas) Date: Thu Sep 25 19:35:20 2008 Subject: [Catalyst] How to send raw HTTP response Message-ID: <20080925183514.GA2414@xaxax.de> Hi Everybody, is it possible for a controller method to directly produce the raw HTTP response? My application generates a (potentially large)) ZIP file on the fly, which I don't want to store (on disk or in memory) but rather send it directly to the client while producing it. In a CGI script I use Archive::Zip such as print CGI::header(...); $ZIP->writeToFileHandle(*STDOUT); for my $f (@files) { $ZIP->addFile($f, basename($f)); } How can I achieve something similar under Catalyst? Thanks, Christian -- http://www.spect-ct.com/ Molecular Imaging http://www.invicro.com/ inviCRO http://www.lackas.net/ Perl Delphi Linux MP3 Searchengines Domainchecker From abhishek.netjain at gmail.com Thu Sep 25 20:10:46 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Thu Sep 25 20:10:50 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> Message-ID: <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> > > >>>> That problem is solved , i have yet another one, > In my form definition i am writing the following: > > name: search > method: post > fields: > dom: > label: Dom > type: text > size: 30 > required: 1 > ext: > label: Ext > type: select > required: 1 > fieldopts: > ext: > options: > id1 > val1 > id2 > val2 > > > I need a select option box with the id1 and id2 as option and val1 and > val2 as values. > > I am not sure how to do so, > Also where to get help if the next problem arises, > Pl. help. > -- > Thanks and kind Regards, > Abhishek jain > Someone pl. reply, Thank, abhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080926/8349f= 4d0/attachment.htm From paikkos at googlemail.com Thu Sep 25 21:06:46 2008 From: paikkos at googlemail.com (Dermot) Date: Thu Sep 25 21:06:49 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> Message-ID: <9c7446e70809251306l7bc6130as5440080372fb17cd@mail.gmail.com> 2008/9/25 abhishek jain : > > > Someone pl. reply, > Thank, > abhi I can't answer your question but I would point out that FormBuilder is no longer being developed. HTML::FormFu and friends are the *preferred modules these days. It's active and the mailing list works. Dp. From jshirley at gmail.com Thu Sep 25 21:10:56 2008 From: jshirley at gmail.com (J. Shirley) Date: Thu Sep 25 21:11:01 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <20080925183514.GA2414@xaxax.de> References: <20080925183514.GA2414@xaxax.de> Message-ID: <756703690809251310q498f06a9n4b7bd1eaedbdf9a2@mail.gmail.com> On Thu, Sep 25, 2008 at 11:35 AM, Christian Lackas wrote: > Hi Everybody, > > is it possible for a controller method to directly produce the raw HTTP response? > My application generates a (potentially large)) ZIP file on the fly, > which I don't want to store (on disk or in memory) but rather send it > directly to the client while producing it. > > In a CGI script I use Archive::Zip such as > > print CGI::header(...); > $ZIP->writeToFileHandle(*STDOUT); > for my $f (@files) { > $ZIP->addFile($f, basename($f)); > } > > How can I achieve something similar under Catalyst? > > Thanks, > Christian > You can use IO::Scalar, then pass that to $c->res->body... that's what I do for XLS reports and it works fine, but they're not that large and it doesn't do incremental writes. -J From bobtfish at bobtfish.net Thu Sep 25 22:04:58 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Thu Sep 25 22:05:01 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <20080925183514.GA2414@xaxax.de> References: <20080925183514.GA2414@xaxax.de> Message-ID: <0B422D63-E91A-49D7-B56A-EAEFAFD24EDD@bobtfish.net> On 25 Sep 2008, at 19:35, Christian Lackas wrote: > > print CGI::header(...); > $ZIP->writeToFileHandle(*STDOUT); > for my $f (@files) { > $ZIP->addFile($f, basename($f)); > } > > How can I achieve something similar under Catalyst? Looking at the source code for Catalyst::write, and Catalyst::Engine::write, you need to say $c->finalize_headers, after which just writing to STDOUT as above should do the right thing.. However, I'd have thought that clients on the other end would be somewhat unhappy with not getting a Content-Length header... Cheers t0m From Wade.Stuart at fallon.com Thu Sep 25 23:20:00 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Thu Sep 25 23:20:12 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <0B422D63-E91A-49D7-B56A-EAEFAFD24EDD@bobtfish.net> Message-ID: Tomas Doran wrote on 09/25/2008 04:04:58 PM: > > On 25 Sep 2008, at 19:35, Christian Lackas wrote: > > > > print CGI::header(...); > > $ZIP->writeToFileHandle(*STDOUT); > > for my $f (@files) { > > $ZIP->addFile($f, basename($f)); > > } > > > > How can I achieve something similar under Catalyst? > > Looking at the source code for Catalyst::write, and > Catalyst::Engine::write, you need to say $c->finalize_headers, after > which just writing to STDOUT as above should do the right thing.. > > However, I'd have thought that clients on the other end would be > somewhat unhappy with not getting a Content-Length header... The only two consequences I know of for not including the content length is that the download bar for the transfer lists unknown in browsers, and if the transfer fails midway the browser does not "know". -Wade From giancarlo at capybara-software.com Thu Sep 25 23:40:06 2008 From: giancarlo at capybara-software.com (Giancarlo Corcuera) Date: Thu Sep 25 23:40:13 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> Message-ID: <48DC1346.90508@capybara-software.com> abhishek jain wrote: > > > That problem is solved , i have yet another one, > In my form definition i am writing the following: > > name: search > method: post > fields: > dom: > label: Dom > type: text > size: 30 > required: 1 > ext: > label: Ext > type: select > required: 1 > fieldopts: > ext: > options: > id1 > val1 > id2 > val2 > > > I need a select option box with the id1 and id2 as option and > val1 and val2 as values. > > I am not sure how to do so, > Also where to get help if the next problem arises, > Pl. help. > -- > Thanks and kind Regards, > Abhishek jain > > > > Someone pl. reply, > Thank, > abhi > ------------------------------------------------------------------------ > > _______________________________________________ > 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/ > For example I do something like this for a radio button lang_publish: label: Publish options: Y=Yes, N=No value: N required: 1 For a select like you want it should be lang_publish: label: Publish options: Y=Yes,N=No type: select required: 1 also youcan add the multiple attribute to specify if more than one can be selected Hope this helps Regards, Giancarlo Corcuera From gavin at openfusion.com.au Fri Sep 26 03:01:24 2008 From: gavin at openfusion.com.au (Gavin Carr) Date: Fri Sep 26 03:01:33 2008 Subject: [Catalyst] Conditional GET with Catalyst::Controller::REST In-Reply-To: <60ef632f0809250634w926b255j1ae4c7e02c6ce3e8@mail.gmail.com> References: <20080925110243.GD3399@openfusion.com.au> <60ef632f0809250634w926b255j1ae4c7e02c6ce3e8@mail.gmail.com> Message-ID: <20080926020124.GA25952@openfusion.com.au> On Thu, Sep 25, 2008 at 04:34:50PM +0300, Oleg Kostyuk wrote: > > Short version is that everything works beautifully when > > doing a HEAD, and my 304 is happily returned, but the same > > code on a GET causes a 500, with nothing helpful logged. > > Code snippet is: > > > > sub index_GET { > > my ($self, $c) = @_; > > my $sset = $c->stash->{sset} or return; > > Probably, when "return" is executed - you'll get unexpected result. Thanks, but the return behaves fine. It's the codepath where the 304 is returned that is breaking. Thanks, Gavin From jshirley at gmail.com Fri Sep 26 03:45:13 2008 From: jshirley at gmail.com (J. Shirley) Date: Fri Sep 26 03:45:16 2008 Subject: [Catalyst] Conditional GET with Catalyst::Controller::REST In-Reply-To: <20080925110243.GD3399@openfusion.com.au> References: <20080925110243.GD3399@openfusion.com.au> Message-ID: <756703690809251945g14dcfacmff4bc3c621074451@mail.gmail.com> On Thu, Sep 25, 2008 at 4:02 AM, Gavin Carr wrote: > I'm seeing a weird problem trying to get conditional GETs > working under Catalyst::Controller::REST (0.66). > > Short version is that everything works beautifully when > doing a HEAD, and my 304 is happily returned, but the same > code on a GET causes a 500, with nothing helpful logged. > > Code snippet is: > > sub index_GET { > my ($self, $c) = @_; > > my $sset = $c->stash->{sset} or return; > > my $ifmod_ts = $c->request->headers->if_modified_since; > my $sset_ts = $sset->modify_ts->epoch; > if ($ifmod_ts && $ifmod_ts == $sset_ts) { > $c->log->debug("not modified: ifmod_ts == sset_ts ($sset_ts)"); > $c->response->status(304); > $c->log->debug('Status: ' . $c->response->status); > return 1; > } > > # Rest of GET > # ... > } > > In the logs I see the two debug lines, and then nothing else: > > [debug] not modified: ifmod_ts == sset_ts (1222241031) > [debug] Status: 304 > > Any cluesticks as to what might be going on here? If I change the > status to almost anything else but 304 it all works fine. And it > doesn't seem to be the serialisation code either, as that explicitly > checks for 3xx status codes and exits. > > Baffled. Anyone have conditional GETs working with C::C::REST? > > Cheers, > Gavin > > What is the full output from something like GET -e -d -s {path}? I added a simple test to t/catalyst-action-rest.t that returns a 304 status and it passed as expected. I'm guessing something somewhere else is breaking things. Do you have a begin/end and can you post a simplified controller exhibiting the behaviors and a complete request cycle? Patch below, if you want to test: === t/catalyst-action-rest.t ================================================================== --- t/catalyst-action-rest.t (revision 5986) +++ t/catalyst-action-rest.t (local) @@ -81,6 +81,15 @@ $c->forward('ok'); } +sub not_modified : Local : ActionClass('REST') { } + +sub not_modified_GET { + my ( $self, $c ) = @_; + $c->res->status(304); + return 1; +} + + sub ok : Private { my ( $self, $c ) = @_; @@ -135,6 +144,9 @@ is( $options_res->header('allow'), "GET", "OPTIONS request allow header properly set." ); +my $modified_res = request( $t->get( url => '/not_modified' ) ); +is( $modified_res->code, 304, "Not Modified request handler succeeded" ); + my $ni_res = request( $t->delete( url => '/not_implemented' ) ); is( $ni_res->code, 200, "Custom not_implemented handler succeeded" ); is( From sri-lists at labs.kraih.com Fri Sep 26 07:14:51 2008 From: sri-lists at labs.kraih.com (Sebastian Riedel) Date: Fri Sep 26 07:10:07 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: References: Message-ID: 26.09.2008 00:20 Wade.Stuart@fallon.com: > Tomas Doran wrote on 09/25/2008 04:04:58 PM: > >> >> On 25 Sep 2008, at 19:35, Christian Lackas wrote: >>> >>> print CGI::header(...); >>> $ZIP->writeToFileHandle(*STDOUT); >>> for my $f (@files) { >>> $ZIP->addFile($f, basename($f)); >>> } >>> >>> How can I achieve something similar under Catalyst? >> >> Looking at the source code for Catalyst::write, and >> Catalyst::Engine::write, you need to say $c->finalize_headers, after >> which just writing to STDOUT as above should do the right thing.. >> >> However, I'd have thought that clients on the other end would be >> somewhat unhappy with not getting a Content-Length header... > > The only two consequences I know of for not including the content > length is > that the download bar for the transfer lists unknown in browsers, > and if > the transfer fails midway the browser does not "know". Things will go wrong, they always do. Not following the RFC is a very bad idea, without a content-length header the client could react completely random. The right way to do it would be a response with chunked transfer encoding. -- sebastian From miyagawa at gmail.com Fri Sep 26 07:41:10 2008 From: miyagawa at gmail.com (Tatsuhiko Miyagawa) Date: Fri Sep 26 07:41:12 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: References: Message-ID: <693254b90809252341g34e15ae8g66e3f6a25e5a9209@mail.gmail.com> On Fri, Sep 26, 2008 at 3:14 PM, Sebastian Riedel wrote: >> The only two consequences I know of for not including the content length >> is >> that the download bar for the transfer lists unknown in browsers, and if >> the transfer fails midway the browser does not "know". > > Things will go wrong, they always do. > Not following the RFC is a very bad idea, without a content-length header > the client could react completely random. > > The right way to do it would be a response with chunked transfer encoding. If you run your app in CGI or mod_perl under Apache, the response will be automatically turned into chunked transfer encoding by Apache if your response header doesn't have Content-Length and the request is made in HTTP/1.1. -- Tatsuhiko Miyagawa From laurent.dami at justice.ge.ch Fri Sep 26 08:28:32 2008 From: laurent.dami at justice.ge.ch (Dami Laurent (PJ)) Date: Fri Sep 26 08:29:50 2008 Subject: [Catalyst] ANNOUNCE: DBIx::DataModel 1.04 Message-ID: <24CBAF436498F1409E79F4E878A6F1720399A287@mailjus.etat-ge.ch> Hi all, For info : DBIx::DataModel v1.04 has been released to CPAN. This is a major revision from previous v0.35, with several architectural changes and added functionalities. DBIx::DataModel is an Object-Relational mapping layer (ORM). Some of its strong points are : - UML-style declaration of relationships (instead of 'has_many', 'belongs_to', etc.) - efficiency through fine control of collaboration with the DBI layer (prepare/execute, fetch into reusable memory location, etc.) - improved API for SQL::Abstract (named parameters, simplified 'orderBy') - clear conceptual distinction between - data sources (tables and views), - database statements (stateful objects representing stepwise building of an SQL query and stepwise retrieval of results), - data rows (lightweight hashrefs containing nothing but column names and values) - joins with simple syntax and possible override of default INNER JOIN/LEFT JOIN properties; instances of joins multiply inherit from their member tables - named placeholders at the ORM level - nested, cross-database transactions The synopsis is in http://search.cpan.org/dist/DBIx-DataModel/lib/DBIx/DataModel.pm; the design principles and general architecture are explained in http://search.cpan.org/dist/DBIx-DataModel/lib/DBIx/DataModel/Doc/Design .pod Enjoy, Laurent Dami From christian at lackas.net Fri Sep 26 13:38:47 2008 From: christian at lackas.net (Christian Lackas) Date: Fri Sep 26 13:38:52 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <0B422D63-E91A-49D7-B56A-EAEFAFD24EDD@bobtfish.net> References: <20080925183514.GA2414@xaxax.de> <0B422D63-E91A-49D7-B56A-EAEFAFD24EDD@bobtfish.net> Message-ID: <20080926123847.GA15596@xaxax.de> * Tomas Doran [080925 23:06]: Hi Tomas, thanks for the prompt reply (also to all others). > Looking at the source code for Catalyst::write, and > Catalyst::Engine::write, you need to say $c->finalize_headers, after > which just writing to STDOUT as above should do the right thing.. This is supposed to print out the HTTP header immediately, right? I tried this here: sub download : Local { my ($self, $c) = @_; my ($filename, @files) = getAllfiles(); $c->response->content_type('application/zip'); $c->response->header('Content-Disposition' => "attachment; filename=$filename.zip"); $c->finalize_headers(); $c->response->{body} = undef; my $ZIP = Archive::Zip->new(); foreach my $file (@files) { my ($basename) = $file =~ m{.*/(.*)}; $ZIP->addFile($file, $basename); } $ZIP->writeToFileHandle(*STDOUT); } However, with this code I don't get a HTTP header at all (when run under Catalyst server) and additionally Catalyst appends an error message after my ZIP file. So my questions are: How do I tell Catalyst: - to either send no HTTP header at all, or to force it to print the header at a time convenient for me (e.g. just before the ZIP)? - that I handled everything in the controller and that it should just stop with processing the request (so nothing is send afterwards). > However, I'd have thought that clients on the other end would be > somewhat unhappy with not getting a Content-Length header... As pointed out in this thread already, this mainly means that a browser is not able to show a proper progress bar. If the ZIP is downloaded incompletely, even though the browser may not able to report that correctly, the uncompressing will fail with a truncation warning. Christian From terence at deeproot.co.in Fri Sep 26 13:56:16 2008 From: terence at deeproot.co.in (Terence Monteiro) Date: Fri Sep 26 13:56:24 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <78A767FD-A4C3-40FF-A9AE-4B77C233D9F8@houseofdesign.de> References: <48CE211A.5050905@deeproot.co.in> <78A767FD-A4C3-40FF-A9AE-4B77C233D9F8@houseofdesign.de> Message-ID: <48DCDBF0.3040106@deeproot.co.in> Moritz Onken wrote: > >> Hi, >> >> I've been using TT for years and enjoy the features it provides. In >> one of >> my Catalyst applications, I'm processing a template which generates >> HTML to >> give me a table with counts taken from a hash. I'm using a lot of nested >> FOREACH to generate the table. >> >> On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to >> process the template. On a production server using debian lenny, it >> used to >> take around the same amount of time. But recently, I upgraded it to >> libperl >> 5.10 and updated the different Perl modules including Template and >> Catalyst::View::TT. After this upgrade, the same template takes 25 >> seconds >> on average to process. The times I am mentioning are the times taken >> on the >> server side, as shown by the Catalyst application debug logs. >> >> I tried to work around the problem by bypassing C::V::TT and using the >> following code to process the template inside the controller, but to >> no avail: >> >> my $tmpl = Template->new({ >> INCLUDE_PATH => $c->config->{home} . '/root', >> RELATIVE => 1 >> }); >> my $output = ''; >> $tmpl->process('index.tt', { %{$c->stash}, c => $c }, \$output); >> $c->res->body($output); >> > > Try Template::Alloy instead. It's a fully compatible faster > implementation of TT. > > replace >> my $tmpl = Template->new({ >> INCLUDE_PATH => $c->config->{home} . '/root', >> RELATIVE => 1 >> }); > > with > >> my $tmpl = Template::Alloy->new({ >> INCLUDE_PATH => $c->config->{home} . '/root', >> RELATIVE => 1 >> }); > > and install Template::alloy, of course. Thanks! Template::Alloy does the trick. Some conflict when the Template module runs inside of Catalyst on this particular server. Nothing else seems to work, and outside of catalyst the same template was processing much faster with the same data. The only thing with Template::Alloy is that it does'nt seem to support the list import vmethod, does someone have a patch, or do I modify my template to get import working? -- Thanks and Regards, Terence Monteiro. DeepRoot Linux, http://www.deeproot.in Ph: +91 (80) 4112 4781 / 84 / 85 Getting GNU/Linux to work for you. Faster. Better. Today. Every way From fireartist at gmail.com Fri Sep 26 14:03:58 2008 From: fireartist at gmail.com (Carl Franks) Date: Fri Sep 26 14:04:02 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48DCDBF0.3040106@deeproot.co.in> References: <48CE211A.5050905@deeproot.co.in> <78A767FD-A4C3-40FF-A9AE-4B77C233D9F8@houseofdesign.de> <48DCDBF0.3040106@deeproot.co.in> Message-ID: <4f352aae0809260603m47193e77j614b59996a3622bd@mail.gmail.com> 2008/9/26 Terence Monteiro : > The only thing with Template::Alloy is that > it does'nt seem to support the list import vmethod, does someone have a > patch, or do I modify my template to get import working? In my experience, the Template::Alloy author has been very good about accepting patches / suggestions - so I'd suggest emailing him. Carl From romkey at apocalypse.org Fri Sep 26 16:17:05 2008 From: romkey at apocalypse.org (John Romkey) Date: Fri Sep 26 16:17:09 2008 Subject: [Catalyst] minor typo in Catalyst::Authentication::Store::DBIx::Class::User Message-ID: In 0.106, line 89 calls Catalyst::Exeption->throw should be Catalyst::Exception->throw johns-macbook:tmp romkey$ diff -u User.pm.orig User.pm --- User.pm.orig 2008-09-26 11:05:07.000000000 -0400 +++ User.pm 2008-09-26 11:08:08.000000000 -0400 @@ -86,7 +86,7 @@ if (keys %{$searchargs}) { $self->_user($self->resultset->search($searchargs)- >first); } else { - Catalyst::Exeption->throw("User retrieval failed: no columns from " . $self->config->{'user_class'} . " were provided"); + Catalyst::Exception->throw("User retrieval failed: no columns from " . $self->config->{'user_class'} . " were provided"); } } - john romkey http://www.romkey.com/ From dwc at pobox.com Fri Sep 26 21:49:08 2008 From: dwc at pobox.com (Daniel Westermann-Clark) Date: Fri Sep 26 21:49:15 2008 Subject: [Catalyst] Duplicate entries with C::P::Session::Store::DBIC and MySQL - new findings In-Reply-To: <1219736879.48b3b52f251fc@mail.funkreich.de> References: <1219736879.48b3b52f251fc@mail.funkreich.de> Message-ID: <20080926204908.GM21302@li3-126.members.linode.com> On 2008-08-26 09:47:59 +0200, Tobias Kremer wrote: > a) Patch Catalyst::Plugin::Session::Store::DBIC to wrap the flash > functionality in a transaction (of course, this must be > configurable). I've released a new version which includes this functionality: 0.07 Wed Sep 24 17:08:34 EDT 2008 - Code was silently truncating storage to MySQL, rendering the session unreadable. Patched to check DBIx::Class size from column_info (if available) - Wrap find_or_create calls in a transaction to (hopefully) avoid issues with duplicate flash rows Thanks, -- Daniel Westermann-Clark From hhunter at gmail.com Sat Sep 27 14:51:54 2008 From: hhunter at gmail.com (Hugh Hunter) Date: Sat Sep 27 14:53:53 2008 Subject: [Catalyst] Passing UTF-8 arg in URL to DBIC search Message-ID: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> Hello all, I've been struggling with this for some time and know there must be an answer out there. I'm using URL arguments to pass parameters to my controller. It's a site about names, so take the url http://domain.com/name/Jes?s (note the accented u). The Name.pm controller has an :Args(1) decorator so Jes?s is stored in $name and then passed to my DBIC model in a - >search({name => $name}) call. This doesn't manage to find the row that exists in mysql. When I dump $name I get: 'name' => 'Jes\xc3\xbas' which I think I understand as being perl's internal escaping of utf-8 characters. I've done everything recommended on http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode and the name column in my mysql database uses the utf-8 charset. Where am I going wrong? Best regards, --Hugh From moseley at hank.org Sat Sep 27 16:38:20 2008 From: moseley at hank.org (Bill Moseley) Date: Sat Sep 27 16:38:15 2008 Subject: [Catalyst] Passing UTF-8 arg in URL to DBIC search In-Reply-To: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> Message-ID: <20080927153820.GA32185@hank.org> On Sat, Sep 27, 2008 at 09:51:54AM -0400, Hugh Hunter wrote: > > I'm using URL arguments to pass parameters to my controller. It's a > site about names, so take the url http://domain.com/name/Jes?s (note > the accented u). The Name.pm controller has an :Args(1) decorator so > Jes?s is stored in $name and then passed to my DBIC model in a - > >search({name => $name}) call. This doesn't manage to find the row > that exists in mysql. When I dump $name I get: > > > I've done everything recommended on > http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode > and the name column in my mysql database uses the utf-8 charset. > Where am I going wrong? The plugin does not decode the path, only the query parameters.[1] I'm not clear on passing utf8 on the path -- I thought you would have to url-encode it, but maybe the browser will do that. Although, I'm not clear how it knows what encoding to use. [1] also note that it doesn't decoded the body params, so if you access those via the body_parameters request method they won't be decoded. Accessing them via ->parameters is ok, though. -- Bill Moseley moseley@hank.org Sent from my iMutt From dbix-class at trout.me.uk Sat Sep 27 16:42:32 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sat Sep 27 16:42:33 2008 Subject: [Catalyst] fcgid In-Reply-To: References: Message-ID: <20080927154232.GM9470@agaton.scsys.co.uk> On Sun, Sep 14, 2008 at 03:00:48PM +0300, Octavian Rasnita wrote: > Hi, > > I understand that comparing it with mod_perl, fast CGI has the advantage of > allowing us to restart the applications without restarting the server. > But I have also understood that fcgid don't allow using the app as an > external server. > > If this is true, than which is the advantage of fcgid? fcgid is designed for shared hosting. it's basically useless for dedicated setups. > I ask this, because it seems that it works better than fastcgi, it is > maintained and prefered, but I can't see why. mod_fastcgi is maintained, just minimally and quietly, and it works perfectly. For dedicated setups it's the only option; I dunno who you think prefers fcgid but I'm certainly not one of them. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Sat Sep 27 16:48:39 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sat Sep 27 16:48:41 2008 Subject: [Catalyst] Slow template processing on debian lenny In-Reply-To: <48CE211A.5050905@deeproot.co.in> References: <48CE211A.5050905@deeproot.co.in> Message-ID: <20080927154839.GP9470@agaton.scsys.co.uk> On Mon, Sep 15, 2008 at 02:17:22PM +0530, Terence Monteiro wrote: > Hi, > > I've been using TT for years and enjoy the features it provides. In one of > my Catalyst applications, I'm processing a template which generates HTML to > give me a table with counts taken from a hash. I'm using a lot of nested > FOREACH to generate the table. > > On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to > process the template. On a production server using debian lenny, it used to > take around the same amount of time. But recently, I upgraded it to libperl > 5.10 and updated the different Perl modules including Template and > Catalyst::View::TT. After this upgrade, the same template takes 25 seconds > on average to process. The times I am mentioning are the times taken on the > server side, as shown by the Catalyst application debug logs. Use Devel::NYTProf to find out what specific piece of code causes the slowness. Currently you're just waving a torch around in a 20 mile wide pitch black cave - sure, there's illumination involved, but not of anything relevant to your problem. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Sat Sep 27 17:59:28 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sat Sep 27 17:59:29 2008 Subject: [Catalyst] getting database handles and run arbitrary SQL In-Reply-To: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> References: <003401c91e15$47d6dd60$093310ac@sv.us.sonicwall.com> Message-ID: <20080927165928.GW9470@agaton.scsys.co.uk> On Wed, Sep 24, 2008 at 12:15:08AM -0700, theshz wrote: > Hi, I'm new to Catalyst, just went through the Tutorial, everything worked fine. But for my reporting application (part of a bigger application where CRUD will be more often), I need to run some complicated querries. I did find the "Arbitray SQL" article in DBIx's FAQ, but I don't even know how to get to DBIx, if that's the right way, more specifically, > > Is it possible to get the database handle and run SQL directly as in DBI? I read that from Schema I can get its storage, which is the db handle. But from a Controller, how do I get the schema object, or the db handle? If the DBIx is the correct way to go (which seems a lengthy way to "just" run a query), do I do $c->model('Some::Model')->resultset....? If you aren't planning to use DBIx::Class at all, I'd recommend Catalyst::Model::DBI If you're using DBIx::Class, I'd recommend abstracting the query away behind a resultset method - something like sub my_custom_query { my ($self, @args) = @_; my $code = sub { my $dbh = shift; }; $self->result_source->schema->storage->dbh_do($code); } If this example isn't sufficient, you should be asking on the dbix-class list, not here. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Sat Sep 27 18:36:21 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sat Sep 27 18:36:22 2008 Subject: [Catalyst] Chained Regexes In-Reply-To: <964122.30514.qm@web65716.mail.ac4.yahoo.com> References: <964122.30514.qm@web65716.mail.ac4.yahoo.com> Message-ID: <20080927173621.GF9470@agaton.scsys.co.uk> On Wed, Sep 24, 2008 at 07:10:38AM -0700, Ovid wrote: > Pursuant to a refactoring issue I explained at http://use.perl.org/~Ovid/journal/37525, it would be nice if I could mix regexes with Chained actions. There are some nice refactoring potential. Plus, by allowing me to apply a regex to a CaptureArg or Arg, I could get 404s for free. Having to write this manually is a bit disappointing. The solution here is to implement match_captures to do for captures what match on action objects already does for args. Having done that, your action class can do pretty much whatever the hell it wants, regexps or db lookups or etc. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From dbix-class at trout.me.uk Sat Sep 27 19:48:01 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sat Sep 27 19:48:03 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <20080925183514.GA2414@xaxax.de> References: <20080925183514.GA2414@xaxax.de> Message-ID: <20080927184801.GJ9470@agaton.scsys.co.uk> On Thu, Sep 25, 2008 at 08:35:14PM +0200, Christian Lackas wrote: > Hi Everybody, > > is it possible for a controller method to directly produce the raw HTTP response? > My application generates a (potentially large)) ZIP file on the fly, > which I don't want to store (on disk or in memory) but rather send it > directly to the client while producing it. > > In a CGI script I use Archive::Zip such as > > print CGI::header(...); > $ZIP->writeToFileHandle(*STDOUT); > for my $f (@files) { > $ZIP->addFile($f, basename($f)); > } > > How can I achieve something similar under Catalyst? Just call $c->write($chunk) with each chunk of data as you get it. Catalyst will automatically send headers before the first chunk for you. Do -not- rely on STDOUT being an appropriate filehandle to print to, that's an accident of the engine design and could easily go away. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From abhishek.netjain at gmail.com Sat Sep 27 19:53:51 2008 From: abhishek.netjain at gmail.com (abhishek jain) Date: Sat Sep 27 19:53:55 2008 Subject: [Catalyst] FormBuilder not working In-Reply-To: <48DC1346.90508@capybara-software.com> References: <7416d8590809192331m3c2ec1ceufe4d166e09ef4070@mail.gmail.com> <7416d8590809200042s2e645759w5644ba42660df036@mail.gmail.com> <7416d8590809200508l221bc6f6l3d805131b7ff59ec@mail.gmail.com> <7416d8590809251210v29f9876ct8d707d229fb992bd@mail.gmail.com> <48DC1346.90508@capybara-software.com> Message-ID: <7416d8590809271153j46772dbal3fb30136e315fd7c@mail.gmail.com> > > >> >> For example I do something like this for a radio button > lang_publish: > label: Publish > options: Y=3DYes, N=3DNo > value: N > required: 1 > > For a select like you want it should be > lang_publish: > label: Publish > options: Y=3DYes,N=3DNo > type: select > required: 1 > > also youcan add the multiple attribute to specify if more than one can be > selected > > Hope this helps > Thanks a lot for the info,What if i have comma (,) as a part of the value, I am not framing questions it is a part of the requirement and i am not finding anything on net. Also someone told me formbuilder is not supported much anymore and one should use FormFu, is it true? Pl. someone reply, -- = Thanks and kind Regards, Abhishek jain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080928/ed026= 217/attachment.htm From chris at vistaeng.homeip.net Sat Sep 27 22:25:51 2008 From: chris at vistaeng.homeip.net (Chris Devine) Date: Sat Sep 27 22:25:57 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <20080927184801.GJ9470@agaton.scsys.co.uk> References: <20080925183514.GA2414@xaxax.de> <20080927184801.GJ9470@agaton.scsys.co.uk> Message-ID: <1ca201c920e7$9e571090$4602000a@chris2> -----Original Message----- From: Matt S Trout [mailto:dbix-class@trout.me.uk] Sent: Saturday, September 27, 2008 13:48 To: The elegant MVC web framework Subject: Re: [Catalyst] How to send raw HTTP response On Thu, Sep 25, 2008 at 08:35:14PM +0200, Christian Lackas wrote: >> Hi Everybody, >> >> is it possible for a controller method to directly produce the raw HTTP response? >> My application generates a (potentially large)) ZIP file on the fly, >> which I don't want to store (on disk or in memory) but rather send it >> directly to the client while producing it. >> >> In a CGI script I use Archive::Zip such as >> >> print CGI::header(...); >> $ZIP->writeToFileHandle(*STDOUT); >> for my $f (@files) { >> $ZIP->addFile($f, basename($f)); >> } >> >> How can I achieve something similar under Catalyst? > >Just call $c->write($chunk) with each chunk of data as you get it. > >Catalyst will automatically send headers before the first chunk for you. > >Do -not- rely on STDOUT being an appropriate filehandle to print to, that's an accident of the engine design >and could easily go away. > >-- All, Using a method like this, how would you set the filename of the downloaded data in the browser? Thanks, Chris -- > Matt S Trout Need help with your Catalyst or DBIx::Class project? > Technical Director http://www.shadowcat.co.uk/catalyst/ > Shadowcat Systems Ltd. Want a managed development or deployment platform? >http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ _ From lee at laylward.com Sat Sep 27 23:13:33 2008 From: lee at laylward.com (Lee Aylward) Date: Sat Sep 27 23:13:42 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <1ca201c920e7$9e571090$4602000a@chris2> References: <20080925183514.GA2414@xaxax.de> <20080927184801.GJ9470@agaton.scsys.co.uk> <1ca201c920e7$9e571090$4602000a@chris2> Message-ID: <20080927221333.GA26171@prettybrd.com> On Sat, Sep 27, 2008 at 04:25:51PM -0500, Chris Devine wrote: > > All, > > Using a method like this, how would you set the filename of the downloaded > data in the browser? > > Thanks, > Chris > You could set a Content-Disposition header, though I don't think that is respected by all clients. http://www.ietf.org/rfc/rfc2183.txt Otherwise it will just use the filename found in the URL. -- Lee Aylward -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080927/4f9d410c/attachment.pgp From darren at darrenduncan.net Sat Sep 27 23:39:03 2008 From: darren at darrenduncan.net (Darren Duncan) Date: Sat Sep 27 23:39:11 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> Message-ID: <48DEB607.90202@darrenduncan.net> Maybe you're already aware of this, but I've found from experience that troubleshooting encoding/Unicode problems in a web/db app can be difficult, especially with multiple conversions at different stages, but I've come up with a short generic algorithm to help test/ensure that things are working and where things need fixing. Note that these details assuming we're using Perl 5.8+. 1. Make sure all your text/code/template/non-binary/etc files are saved as UTF-8 text files (or they are 7-bit ASCII), and you have a Unicode-savvy text editor. 2. Have a "use utf8;" at the top of every Perl file, so Perl treats your source files as being Unicode. 3. Place a text string literal in your program code that you know isn't in ASCII ... for example I like to use the word '????', which is what came out of Google's translation tool when I asked it to translate the word 'sample' to Japanese. Then setup your program to display that text directly in your web page text, without any escaping. 4. Make sure the HTTP response headers for the webpage with that text have a content-type charset value of UTF-8, and make sure that Perl is encoding its output as actual UTF-8; if you were doing it directly using STDOUT for example such as in a CGI, it could be: "binmode *main::STDOUT, ':encoding(UTF-8)';" or such. Make sure your web browser is Unicode savvy. 5. At this point, if the web page displays correctly with the non-ASCII literal (and moreover, if you "view source" in the browser and the literal also displays literally), then you know your program can work/represent internally with Unicode correctly, and it can output Unicode correctly to the browser. It is very important to get this step working first, in isolation, so that you are in a position to judge or troubleshoot other issues such as receiving Unicode input from a browser or using it with a database. 6. Next test that you can receive Unicode from the browser in the various ways, whether by query string / http headers or in an http post. Eg try outputting a value and have the user submit it again, and compare for equality either in the Perl program or by displaying it again next to the original for visual inspection. If any differences come up, then you know any fixes you have to do concern either how you read and interpret the browser request, or perhaps on how you instruct the browser on how to submit a request. Once that's all cleared up, then you know your I/O with the web browser works fine. 7. To test a database, I suggest first using a known-good and Unicode savvy alternate input method for putting some Unicode text in the database, such as using an admin/utility tool that came with the DBMS. Also make sure that the database is itself using UTF-8 character strings in its schema, eg that the schema is declared this way. 8. With a database known to contain some valid Unicode etc text, you first test simply selecting that text from the database and displaying it. If anything doesn't match, it means you probably have to configure your DBMS client connection encoding so it is UTF-8 (often done with a few certain SQL commands), and then separately ensure that Perl is decoding the UTF-8 data into Perl text strings properly. Its important to make sure you can retrieve Unicode from the database properly so that you have a context for judging that you can insert such text in the database. 9. Next try to insert some Unicode text in the database using your program, then select it back to check that it worked. If it didn't, then check DBMS client connection settings, or that Perl is encoding text as UTF-8 properly. 10. Actually, when you have a known-good external tool to help you, you can alternately start the DBMS tests with step 9, where your program inserts text, then you use the known-good tool to ensure it actually was recorded properly. Anyway, that's it in a nutshell. Now I'm sure many of you have already figured this out, but for those who haven't, I hope these tips help you. Adjust as appropriate to account for any abstraction tools or frameworks you are using which means your tests may also involve testing those tools or configuring them. -- Darren Duncan Hugh Hunter wrote: > I've been struggling with this for some time and know there must be an > answer out there. > > I'm using URL arguments to pass parameters to my controller. It's a > site about names, so take the url http://domain.com/name/Jes?s (note the > accented u). The Name.pm controller has an :Args(1) decorator so Jes?s > is stored in $name and then passed to my DBIC model in a ->search({name > => $name}) call. This doesn't manage to find the row that exists in > mysql. When I dump $name I get: > > 'name' => 'Jes\xc3\xbas' > > which I think I understand as being perl's internal escaping of utf-8 > characters. > > I've done everything recommended on > http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode and > the name column in my mysql database uses the utf-8 charset. > > Where am I going wrong? From orasnita at gmail.com Sun Sep 28 08:11:54 2008 From: orasnita at gmail.com (Octavian Rasnita) Date: Sun Sep 28 08:12:15 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> Message-ID: Hi, If it helps somebody, here are the things I did to make my Catalyst-based app to handle well UTF-8. I've installed Perl 5.10.0 and Catalyst 5.7014 a few days ago (under Windows XP) and I've started to use C::C::HTML::FormFu. When I was not using C::C::HTML::FormFu, in order to make the UTF-8 strings show correctly, I just needed to create the TT templates as UTF-8 encoded, to use "use utf8" in the perl modules that were using non-ASCII chars, and to configure Apache to send a Content-Type with the UTF-8 charset. After using C::C::HTML::FormFu, I've seen that the templates that include HTML::FormFu forms don't display the non-ASCII chars correctly, and finally I needed to do the following to make the app work fine: 1. Add to httpd.conf: AddDefaultCharset UTF-8 2. In the perl modules of the application that use non-ascii chars, use: use utf8; 3. In MyApp.pm, add "Unicode" plugin: use Catalyst qw/Unicode/; 4. In the configuration file or MyApp.pm, specify that the TT templates and the HTML::FormFu forms are UTF-8 encoded: __PACKAGE__->config( 'Controller::HTML::FormFu' => { constructor => { tt_args => { ENCODING => 'UTF-8', }, }, }, 'View::TTSite' => { ENCODING => 'UTF-8', }, ); 5. In the class files generated by DBIC::Schema helper, after the line with "# DO NOT MODIFY THIS OR ANYTHING ABOVE", add the following 2 lines, and in the second line, specify the columns that can contain UTF-8 encoded chars: __PACKAGE__->load_components("UTF8Columns"); __PACKAGE__->utf8_columns(qw/username first_name last_name/); I've seen a recommendation to add "UTF8Columns" at the start of the file, as __PACKAGE__->load_components("UTF8Columns", "Core"); but if the module is generated by the helper of Catalyst, it doesn't like to modify what it creates. (It could be helpful if the helper could accept one more parameter that specifies that all columns should be UTF-8 encoded and do these settings.) 6. The TT templates and HTML::FormFu forms should be UTF-8 encoded, without having a BOM. I've seen that the non-ASCII chars are displayed correctly with even fewer settings if the HTML::FormFu forms are UTF-8 encoded and not use a BOM, but the TT templates are UTF-8 encoded and use a BOM, however it is not very nice to need creating 2 types of files and who knows... maybe other problems could appear if doing so, so these settings should be made. I have also created the MySQL tables as UTF-8 encoded, but I am not sure this is really necessary: create table table_name( ... ) engine=InnoDB default charset=utf8; And as a separate note, I just found a simpler way to send a UTF-8 encoded email from a Catalyst app or from a standalone program, using the module Mail::Builder for creating the message and Email::Send for sending it. It allows creating a multipart/alternative message with a text and an html part, allows attaching files easily, it encodes the headers as UTF-8 automaticly... HTH. Octavian ----- Original Message ----- From: "Darren Duncan" To: "The elegant MVC web framework" Sent: Sunday, September 28, 2008 1:39 AM Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) Maybe you're already aware of this, but I've found from experience that troubleshooting encoding/Unicode problems in a web/db app can be difficult, especially with multiple conversions at different stages, but I've come up with a short generic algorithm to help test/ensure that things are working and where things need fixing. Note that these details assuming we're using Perl 5.8+. 1. Make sure all your text/code/template/non-binary/etc files are saved as UTF-8 text files (or they are 7-bit ASCII), and you have a Unicode-savvy text editor. 2. Have a "use utf8;" at the top of every Perl file, so Perl treats your source files as being Unicode. 3. Place a text string literal in your program code that you know isn't in ASCII ... for example I like to use the word '????', which is what came out of Google's translation tool when I asked it to translate the word 'sample' to Japanese. Then setup your program to display that text directly in your web page text, without any escaping. 4. Make sure the HTTP response headers for the webpage with that text have a content-type charset value of UTF-8, and make sure that Perl is encoding its output as actual UTF-8; if you were doing it directly using STDOUT for example such as in a CGI, it could be: "binmode *main::STDOUT, ':encoding(UTF-8)';" or such. Make sure your web browser is Unicode savvy. 5. At this point, if the web page displays correctly with the non-ASCII literal (and moreover, if you "view source" in the browser and the literal also displays literally), then you know your program can work/represent internally with Unicode correctly, and it can output Unicode correctly to the browser. It is very important to get this step working first, in isolation, so that you are in a position to judge or troubleshoot other issues such as receiving Unicode input from a browser or using it with a database. 6. Next test that you can receive Unicode from the browser in the various ways, whether by query string / http headers or in an http post. Eg try outputting a value and have the user submit it again, and compare for equality either in the Perl program or by displaying it again next to the original for visual inspection. If any differences come up, then you know any fixes you have to do concern either how you read and interpret the browser request, or perhaps on how you instruct the browser on how to submit a request. Once that's all cleared up, then you know your I/O with the web browser works fine. 7. To test a database, I suggest first using a known-good and Unicode savvy alternate input method for putting some Unicode text in the database, such as using an admin/utility tool that came with the DBMS. Also make sure that the database is itself using UTF-8 character strings in its schema, eg that the schema is declared this way. 8. With a database known to contain some valid Unicode etc text, you first test simply selecting that text from the database and displaying it. If anything doesn't match, it means you probably have to configure your DBMS client connection encoding so it is UTF-8 (often done with a few certain SQL commands), and then separately ensure that Perl is decoding the UTF-8 data into Perl text strings properly. Its important to make sure you can retrieve Unicode from the database properly so that you have a context for judging that you can insert such text in the database. 9. Next try to insert some Unicode text in the database using your program, then select it back to check that it worked. If it didn't, then check DBMS client connection settings, or that Perl is encoding text as UTF-8 properly. 10. Actually, when you have a known-good external tool to help you, you can alternately start the DBMS tests with step 9, where your program inserts text, then you use the known-good tool to ensure it actually was recorded properly. Anyway, that's it in a nutshell. Now I'm sure many of you have already figured this out, but for those who haven't, I hope these tips help you. Adjust as appropriate to account for any abstraction tools or frameworks you are using which means your tests may also involve testing those tools or configuring them. -- Darren Duncan Hugh Hunter wrote: > I've been struggling with this for some time and know there must be an > answer out there. > > I'm using URL arguments to pass parameters to my controller. It's a site > about names, so take the url http://domain.com/name/Jes?s (note the > accented u). The Name.pm controller has an :Args(1) decorator so Jes?s is > stored in $name and then passed to my DBIC model in a ->search({name => > $name}) call. This doesn't manage to find the row that exists in mysql. > When I dump $name I get: > > 'name' => 'Jes\xc3\xbas' > > which I think I understand as being perl's internal escaping of utf-8 > characters. > > I've done everything recommended on > http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode > and the name column in my mysql database uses the utf-8 charset. > > Where am I going wrong? _______________________________________________ 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/ From gavin.henry at gmail.com Sun Sep 28 09:35:58 2008 From: gavin.henry at gmail.com (Gavin Henry) Date: Sun Sep 28 09:36:01 2008 Subject: [Catalyst] Catalyst in Linux Magazine Message-ID: <13ca621c0809280135t790a60c8x7ed31870adc1220b@mail.gmail.com> Hi, Nice tutorial and article on Catalyst in the current issue: http://www.linux-magazine.com/resources/current_issue (not available online unfortunately). Gavin. From dbix-class at trout.me.uk Sun Sep 28 14:43:24 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Sun Sep 28 14:43:25 2008 Subject: [Catalyst] minor typo in Catalyst::Authentication::Store::DBIx::Class::User In-Reply-To: References: Message-ID: <20080928134324.GT9470@agaton.scsys.co.uk> On Fri, Sep 26, 2008 at 11:17:05AM -0400, John Romkey wrote: > In 0.106, line 89 calls Catalyst::Exeption->throw > > should be Catalyst::Exception->throw I can't find anything remotely like this in svn to apply to - what path and revision did you patch against? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From jshirley at gmail.com Sun Sep 28 15:10:55 2008 From: jshirley at gmail.com (J. Shirley) Date: Sun Sep 28 15:10:57 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <48DEB607.90202@darrenduncan.net> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> Message-ID: <756703690809280710m28238c3by27d164cb2e57380c@mail.gmail.com> On Sat, Sep 27, 2008 at 3:39 PM, Darren Duncan wrote: > Maybe you're already aware of this, but I've found from experience that > troubleshooting encoding/Unicode problems in a web/db app can be difficult, > especially with multiple conversions at different stages, but I've come up > with a short generic algorithm to help test/ensure that things are working > and where things need fixing. Note that these details assuming we're using > Perl 5.8+. > [ snip ] Hey Darren, great post! Can you post it on the wiki, perhaps at: http://dev.catalystframework.org/wiki/faq link to "Unicode Troubleshooting" in the Unicode section there? It would be much appreciated. Thanks, -J From the.leanan.sidhe at gmail.com Sun Sep 28 15:15:25 2008 From: the.leanan.sidhe at gmail.com (Leanan Sidhe) Date: Sun Sep 28 15:15:28 2008 Subject: [Catalyst] DBIx::Class and Catalyst - Trying to make sense of it all. Message-ID: <98b8f6be0809280715t78b8c45cv9ba4ee4256879184@mail.gmail.com> First, I apologize for the completely noob tone of this email. I've read through the perl docs for DBIx::Class, and various Catalyst parts, but I'm having problems understanding how DBIx::Class stuff is slightly different in Catalyst. For example, in the DBI docs, I constantly see the following: $schema->resultset('table_name')->search(....); in Catalyst, this seems to be $c->model('table_model_package')->search(....); I get that and it's not too rough. But then where I get hung up is that I have a few table relationships I want to query. Say I have the following tables / relationships: users: user_id user_name pass cards: card_id card_name card_description set_id sets: set_id set_name user_cards: id user_id card_id A card has a set A set has many cards A card has many user_cards A user_card has a user A user_card has a card Now, say I want to have a page that lists out all the cards a user has. Right now I have one user, so I'm not doing much on the user id. Ok, that's simple, I just do: my $user_cards =3D $c->model('Model::for::UserCards'); my $cards =3D $user_cards->search_related('cards'); Sweet, now I'm getting a list of all cards that my single user has right now. Now I want to be able to add to the results what set that card is from, and here is where I get hung up. I can't figure out the syntax to add to the my $cards to get it to join on the sets table. Is there some documentation somewhere that I'm missing? I've looked at DBIx::Class::Manual::Cookbook for the join/multi join examples, and they seem to be what I want to do, but I can't quite translate the example to my situation. If I should have sent this to a DBIx list, I apologize, since this seems to straddle the two realms. None of the Catalyst docs regarding DBIx seem to be much help in this respect. Thanks for your time, Leanan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080928/3da44= 56f/attachment.htm From romkey at apocalypse.org Sun Sep 28 16:08:53 2008 From: romkey at apocalypse.org (John Romkey) Date: Sun Sep 28 16:08:56 2008 Subject: [Catalyst] minor typo in Catalyst::Authentication::Store::DBIx::Class::User In-Reply-To: <20080928134324.GT9470@agaton.scsys.co.uk> References: <20080928134324.GT9470@agaton.scsys.co.uk> Message-ID: <1E92C29A-6220-471E-A5D9-25D13035C738@apocalypse.org> On Sep 28, 2008, at 9:43 AM, Matt S Trout wrote: > On Fri, Sep 26, 2008 at 11:17:05AM -0400, John Romkey wrote: >> In 0.106, line 89 calls Catalyst::Exeption->throw >> >> should be Catalyst::Exception->throw > > I can't find anything remotely like this in svn to apply to - what > path > and revision did you patch against? Hi Matt - Sorry, that was my first patch... I think I picked the wrong example to model it after. Here's a patch against the trunk: johns-macbook:Catalyst romkey$ diff -u trunk/Catalyst-Authentication- Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/ User.pm.orig trunk/Catalyst-Authentication-Store-DBIx-Class/lib/ Catalyst/Authentication/Store/DBIx/Class/User.pm --- trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/ Authentication/Store/DBIx/Class/User.pm.orig 2008-09-28 10:38:37.000000000 -0400 +++ trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/ Authentication/Store/DBIx/Class/User.pm 2008-09-28 10:38:47.000000000 -0400 @@ -86,7 +86,7 @@ if (keys %{$searchargs}) { $self->_user($self->resultset->search($searchargs)- >first); } else { - Catalyst::Exeption->throw("User retrieval failed: no columns from " . $self->config->{'user_class'} . " were provided"); + Catalyst::Exception->throw("User retrieval failed: no columns from " . $self->config->{'user_class'} . " were provided"); } } - john romkey http://www.romkey.com/ From bobtfish at bobtfish.net Sun Sep 28 17:21:41 2008 From: bobtfish at bobtfish.net (Tomas Doran) Date: Sun Sep 28 17:21:39 2008 Subject: [Catalyst] How to send raw HTTP response In-Reply-To: <20080927184801.GJ9470@agaton.scsys.co.uk> References: <20080925183514.GA2414@xaxax.de> <20080927184801.GJ9470@agaton.scsys.co.uk> Message-ID: On 27 Sep 2008, at 19:48, Matt S Trout wrote: > Just call $c->write($chunk) with each chunk of data as you get it. > > Catalyst will automatically send headers before the first chunk for > you. > > Do -not- rely on STDOUT being an appropriate filehandle to print > to, that's > an accident of the engine design and could easily go away. Unfortunately, if you're using Archive::Zip, you don't get an option to get chunks you can call $c->write with, you _need_ to write to a file handle.. (And this isn't the only module on CPAN that'd behave like this). Therefore, in some cases it would be extremely useful if you could get Catalyst to generate you a file handle you could write to that would write directly into the HTTP response, rather than having to call $c->write. How feasible is that? Alternatively, it would be really useful to have an IO::WriteOnlyClosure module, so you could say something like: my $fh = IO::WriteOnlyClosure->new(sub { $c->write(@_[0]) }); $zip->writeToFileHandle($fh); $zip->addfile($_, basename($_) for (@files); Thoughts / pointing out the module I missed on CPAN? Cheers t0m From ilmari at ilmari.org Sun Sep 28 17:39:33 2008 From: ilmari at ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) Date: Sun Sep 28 17:39:45 2008 Subject: [Catalyst] Re: How to send raw HTTP response In-Reply-To: (Tomas Doran's message of "Sun, 28 Sep 2008 17:21:41 +0100") References: <20080925183514.GA2414@xaxax.de> <20080927184801.GJ9470@agaton.scsys.co.uk> Message-ID: Tomas Doran writes: > On 27 Sep 2008, at 19:48, Matt S Trout wrote: >> Just call $c->write($chunk) with each chunk of data as you get it. >> >> Catalyst will automatically send headers before the first chunk for >> you. >> >> Do -not- rely on STDOUT being an appropriate filehandle to print to, >> that's >> an accident of the engine design and could easily go away. > > Unfortunately, if you're using Archive::Zip, you don't get an option to > get chunks you can call $c->write with, you _need_ to write to a file > handle.. (And this isn't the only module on CPAN that'd behave like > this). (?) > Thoughts / pointing out the module I missed on CPAN? Catalyst::Response in 5.80 trunk implements ->print, just for this puropse (I needed it for Text::CSV_XS' ->print($fh, $fields) method). -- ilmari "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen From darren at darrenduncan.net Mon Sep 29 00:59:10 2008 From: darren at darrenduncan.net (Darren Duncan) Date: Mon Sep 29 00:59:19 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode In-Reply-To: <756703690809280710m28238c3by27d164cb2e57380c@mail.gmail.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> <756703690809280710m28238c3by27d164cb2e57380c@mail.gmail.com> Message-ID: <48E01A4E.1070906@darrenduncan.net> J. Shirley wrote: > Hey Darren, great post! > > Can you post it on the wiki, perhaps at: > > http://dev.catalystframework.org/wiki/faq link to "Unicode > Troubleshooting" in the Unicode section there? It would be much > appreciated. > > Thanks, > -J I have gone and added a section to http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode that has a slightly edited version of my email post. In the process, I discovered that your wiki appears to have a Unicode handling problem, which I black-box debugged and present here. If you go to the above url when you are not logged in and your browser has its cache/cookies/etc flushed beforehand, then my Japanese text sample will display correctly. But if you login to your account and then view the page, then the Japanese text sample will not display properly. Moreover, if you logout after being logged in and refresh the page again, it still doesn't display properly, but if you wipe your cache/cookies/etc (I haven't narrowed it down yet), and then refresh that page, then it displays properly. I see this same behaviour on both Firefox 3.0.3 and Safari 3.1.2, both on Mac OS X 10.5.5 PPC. A telnet to the server on port 80 also displays correctly, though that is only testing the not logged in example. From what I have seen so far, I would guess that the wiki is sometimes encoding its http response as UTF-8 and other times as some single-byte encoding like ISOLATIN1 but it is still declaring that it is UTF-8. I don't have the source code of the wiki or access to the server to test further though. Someone please confirm the behaviour I'm seeing. I hope my diagnosis will help fix it. (On a tangent, I suggest declaring the encoding using uppercase "UTF-8" and not lowercase "utf-8" as the server currently is doing; I don't think this is the cause of the problem but it might be technically incorrect, unless those things are officially case-insensitive.) Thank you. -- Darren Duncan From lee at laylward.com Mon Sep 29 02:41:09 2008 From: lee at laylward.com (Lee Aylward) Date: Mon Sep 29 02:41:14 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <48DEB607.90202@darrenduncan.net> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> Message-ID: <20080929014108.GJ6876@prettybrd.com> On Sat, Sep 27, 2008 at 03:39:03PM -0700, Darren Duncan wrote: > Maybe you're already aware of this, but I've found from experience that > troubleshooting encoding/Unicode problems in a web/db app can be > difficult, especially with multiple conversions at different stages, but > I've come up with a short generic algorithm to help test/ensure that > things are working and where things need fixing. Note that these details > assuming we're using Perl 5.8+. > > ... lots of good tips... Great timing on this as I am currently struggling with some unicode text not displaying correctly in an application I am working on. Per your suggestion I put the Japanese text at the top of my template. All of a sudden the browsers started displaying that and other non-ascii characters correctly. The second I take away the Japanese text it goes back to just showing question marks. I am seeing this behavior in both the test server and Apache. I have looked at the Content-Type header and it is definitely serving it as utf-8, so I am at abit of a loss. There are no databases involved here, but I am displaying information from IMDB::Film. Is there anything in the actual HTML that needs to be set? Thanks for any thoughts on this. -- Lee Aylward -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080928/40f2406c/attachment.pgp From lee at laylward.com Mon Sep 29 02:57:06 2008 From: lee at laylward.com (Lee Aylward) Date: Mon Sep 29 02:57:12 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <20080929014108.GJ6876@prettybrd.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> <20080929014108.GJ6876@prettybrd.com> Message-ID: <20080929015706.GK6876@prettybrd.com> On Sun, Sep 28, 2008 at 08:41:09PM -0500, Lee Aylward wrote: > > Great timing on this as I am currently struggling with some unicode text > not displaying correctly in an application I am working on. Per your > suggestion I put the Japanese text at the top of my template. All of a > sudden the browsers started displaying that and other non-ascii characters > correctly. The second I take away the Japanese text it goes back to just > showing question marks. I am seeing this behavior in both the test > server and Apache. > > I have looked at the Content-Type header and it is definitely serving it > as utf-8, so I am at abit of a loss. There are no databases involved > here, but I am displaying information from IMDB::Film. Is there anything > in the actual HTML that needs to be set? > A little more info. I checked my page on the w3 validator and it returned this: Sorry, I am unable to validate this document because on line 245 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication. The error was: utf8 "\xE9" does not map to Unicode http://validator.w3.org/check?uri=http%3A%2F%2Fprettybrd.com%2Ffilm%2Fperson%2F0001951&charset=%28detect+automatically%29&doctype=Inline&group=0 Perhaps my strings are getting encoded twice? I'll add the suggestion of trying the validator to the wiki page, but it would be nice to have a solution to this specific problem on there as well. -- Lee Aylward -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080928/9fa97394/attachment.pgp From darren at darrenduncan.net Mon Sep 29 03:16:07 2008 From: darren at darrenduncan.net (Darren Duncan) Date: Mon Sep 29 03:16:17 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <20080929014108.GJ6876@prettybrd.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> <20080929014108.GJ6876@prettybrd.com> Message-ID: <48E03A67.9020907@darrenduncan.net> Lee Aylward wrote: > Great timing on this as I am currently struggling with some unicode text > not displaying correctly in an application I am working on. Per your > suggestion I put the Japanese text at the top of my template. All of a > sudden the browsers started displaying that and other non-ascii characters > correctly. The second I take away the Japanese text it goes back to just > showing question marks. I am seeing this behavior in both the test > server and Apache. > > I have looked at the Content-Type header and it is definitely serving it > as utf-8, so I am at abit of a loss. There are no databases involved > here, but I am displaying information from IMDB::Film. Is there anything > in the actual HTML that needs to be set? That seems strange. I wonder if something in your template handler or other part of your app is trying to DWIM for you and is getting it wrong. Are your source files actually UTF-8, both the prior and new versions? Are you explicitly declaring that in one place and not another? I wouldn't expect the addition of Japanese text to suddenly make the other characters look correct by itself unless there's some DWIM going on. I suspect you made some other change between the two versions as well, such as saving the source file in a different encoding. Note that the reason I use a Japanese text example is because the vast majority of my normal program text would fit in the ASCII repertoire, and it would only be user data that might be Unicode, though most user data isn't. And Japanese characters are known to not have a one-byte interpretation and they stand out clearly from latin letters at a glance. So in your own situation, the text you already have that doesn't display right, if it is literal text in your source code, should be a surrogate for my Japanese test example to see if things look right. So see what your text editor says that your older/incorrect file version's encoding is. -- Darren Duncan From lee at laylward.com Mon Sep 29 03:34:27 2008 From: lee at laylward.com (Lee Aylward) Date: Mon Sep 29 03:34:31 2008 Subject: [Catalyst] tips for troubleshooting/QAing Unicode (was Re: Passing UTF-8 arg in URL to DBIC search) In-Reply-To: <48E03A67.9020907@darrenduncan.net> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <48DEB607.90202@darrenduncan.net> <20080929014108.GJ6876@prettybrd.com> <48E03A67.9020907@darrenduncan.net> Message-ID: <20080929023427.GM6876@prettybrd.com> On Sun, Sep 28, 2008 at 07:16:07PM -0700, Darren Duncan wrote: > > That seems strange. I wonder if something in your template handler or > other part of your app is trying to DWIM for you and is getting it wrong. > Are your source files actually UTF-8, both the prior and new versions? > Are you explicitly declaring that in one place and not another? I > wouldn't expect the addition of Japanese text to suddenly make the other > characters look correct by itself unless there's some DWIM going on. I > suspect you made some other change between the two versions as well, such > as saving the source file in a different encoding. > The odd thing is that I can revert back and forth between the two versions. If I remove the Japanese text and resave the templates non-ascii text will no longer work. If I add the Japanese text back it will work again. I have explicitly saved the templates as utf-8 from vim using the ':set enc=utf-8' command on all the templates before saving. I am thinking it may be something with TT, but I have set the ENCODING option in the TT view module. I will keep investingating and let you know what I find. Thanks, -- Lee Aylward -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080928/e32229cd/attachment.pgp From jlee+catalyst at pangeamedia.com Mon Sep 29 14:46:42 2008 From: jlee+catalyst at pangeamedia.com (John Lee) Date: Mon Sep 29 14:46:50 2008 Subject: [Catalyst] fcgid In-Reply-To: <20080927154232.GM9470@agaton.scsys.co.uk> References: <20080927154232.GM9470@agaton.scsys.co.uk> Message-ID: <48E0DC42.6010300@pangeamedia.com> Matt S Trout wrote: > fcgid is designed for shared hosting. it's basically useless for dedicated > setups. > >> I ask this, because it seems that it works better than fastcgi, it is >> maintained and prefered, but I can't see why. > > mod_fastcgi is maintained, just minimally and quietly, and it works > perfectly. > > For dedicated setups it's the only option; I dunno who you think prefers > fcgid but I'm certainly not one of them. > Hmm, now I'm all confused. We'd recently switched to mod_fcgid from handling fastcgi with lighttpd, due to its better process management. However, I'm always akin to trying new things, so this piques my curiosity around mod_fastcgi. What's the general concensus in the catalyst community nowadays? Is mod_fastcgi preferred at large over mod_fcgid these days? I saw a post from Jonathan Rockaway almost two years ago noting that "mod_fastcgi is crufty and slightly broken, while mod_fcgid seems to be more sane", and keep seeing notes that fcgid is better maintained (but no idea how true that is). Two years is a long time, though, so I don't know what the current thought is. From peter at peknet.com Mon Sep 29 15:16:32 2008 From: peter at peknet.com (Peter Karman) Date: Mon Sep 29 15:16:35 2008 Subject: [Catalyst] fcgid In-Reply-To: <48E0DC42.6010300@pangeamedia.com> References: <20080927154232.GM9470@agaton.scsys.co.uk> <48E0DC42.6010300@pangeamedia.com> Message-ID: <48E0E340.9080404@peknet.com> John Lee wrote on 09/29/2008 08:46 AM: > What's the general concensus in the catalyst community nowadays? Is > mod_fastcgi preferred at large over mod_fcgid these days? I saw a post I use mod_fastcgi. It has the external server option, which I like because I can stop/start my app without having to bounce the entire web server. -- Peter Karman . peter@peknet.com . http://peknet.com/ From dbix-class at trout.me.uk Mon Sep 29 17:05:05 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Mon Sep 29 17:05:06 2008 Subject: [Catalyst] DBIx::Class and Catalyst - Trying to make sense of it all. In-Reply-To: <98b8f6be0809280715t78b8c45cv9ba4ee4256879184@mail.gmail.com> References: <98b8f6be0809280715t78b8c45cv9ba4ee4256879184@mail.gmail.com> Message-ID: <20080929160505.GF9470@agaton.scsys.co.uk> On Sun, Sep 28, 2008 at 10:15:25AM -0400, Leanan Sidhe wrote: > First, I apologize for the completely noob tone of this email. I've read > through the perl docs for DBIx::Class, and various Catalyst parts, but I'm > having problems understanding how DBIx::Class stuff is slightly different in > Catalyst. > > For example, in the DBI docs, I constantly see the following: > > $schema->resultset('table_name')->search(....); No you don't. The argument to resultset is the source name, which is by default the last part of the class name. So for My::Schema::Foo, it'd be $schema->resultset('Foo'), the table name could be 'tbl_foobar_baz' or whatever for all DBIx::Class cares so long as you pass that to ->table. > in Catalyst, this seems to be > $c->model('table_model_package')->search(....); No. Basically for each valid argument to $schema->resultset, Catalyst::Model::DBIC::Schema sets it up so that $c->model('NameOfModel::${arg_to_resultset}') is a shortcut to $c->model('NameOfModel')->schema->resultset($arg_to_resultset). > I get that and it's not too rough. > > But then where I get hung up is that I have a few table relationships I want > to query. Say I have the following tables / relationships: > > users: > user_id > user_name > pass > > cards: > card_id > card_name > card_description > set_id > > sets: > set_id > set_name > > user_cards: > id > user_id > card_id > > A card has a set > A set has many cards > A card has many user_cards > A user_card has a user > A user_card has a card > > Now, say I want to have a page that lists out all the cards a user has. > Right now I have one user, so I'm not doing much on the user id. Ok, that's > simple, I just do: > > my $user_cards = $c->model('Model::for::UserCards'); > my $cards = $user_cards->search_related('cards'); That's completely wrong. What you want is: my $user = $c->model('ModelName::User')->find($user_id); my $cards = $user->cards; If you're using Catalyst::Authentication::Store::DBIx::Class you can do my $user = $c->user->obj; to get the DBIC object for the user. If you want more information on using DBIx::Class, please post to the DBIx::Class list - the $c->model shortcut for $schema->resultset is the -only- thing that's different between normal DBIC usage and DBIC under Catalyst, and that's not so much a difference as an extra handy feature :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From jayk at ion0.com Mon Sep 29 17:30:56 2008 From: jayk at ion0.com (Jason Kuri) Date: Mon Sep 29 17:31:01 2008 Subject: [Catalyst] minor typo in Catalyst::Authentication::Store::DBIx::Class::User In-Reply-To: <1E92C29A-6220-471E-A5D9-25D13035C738@apocalypse.org> References: <20080928134324.GT9470@agaton.scsys.co.uk> <1E92C29A-6220-471E-A5D9-25D13035C738@apocalypse.org> Message-ID: <39990512-F194-42B4-B474-2D17C501779E@ion0.com> Hi John, Thanks for catching that. I've incorporated the fix and pushed a new version. It should be on CPAN soon. Thanks again, Jay On Sep 28, 2008, at 9:08 AM, John Romkey wrote: > On Sep 28, 2008, at 9:43 AM, Matt S Trout wrote: >> On Fri, Sep 26, 2008 at 11:17:05AM -0400, John Romkey wrote: >>> In 0.106, line 89 calls Catalyst::Exeption->throw >>> >>> should be Catalyst::Exception->throw >> >> I can't find anything remotely like this in svn to apply to - what >> path >> and revision did you patch against? > > Hi Matt - > > Sorry, that was my first patch... I think I picked the wrong example > to model it after. > > Here's a patch against the trunk: > > johns-macbook:Catalyst romkey$ diff -u trunk/Catalyst-Authentication- > Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/ > User.pm.orig trunk/Catalyst-Authentication-Store-DBIx-Class/lib/ > Catalyst/Authentication/Store/DBIx/Class/User.pm > --- trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/ > Authentication/Store/DBIx/Class/User.pm.orig 2008-09-28 > 10:38:37.000000000 -0400 > +++ trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/ > Authentication/Store/DBIx/Class/User.pm 2008-09-28 > 10:38:47.000000000 -0400 > @@ -86,7 +86,7 @@ > if (keys %{$searchargs}) { > $self->_user($self->resultset->search($searchargs)- > >first); > } else { > - Catalyst::Exeption->throw("User retrieval failed: no > columns from " . $self->config->{'user_class'} . " were provided"); > + Catalyst::Exception->throw("User retrieval failed: no > columns from " . $self->config->{'user_class'} . " were provided"); > } > } > > > > - john romkey > http://www.romkey.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/ From pagaltzis at gmx.de Tue Sep 30 01:14:47 2008 From: pagaltzis at gmx.de (Aristotle Pagaltzis) Date: Tue Sep 30 01:14:27 2008 Subject: [Catalyst] Re: fcgid In-Reply-To: <48E0DC42.6010300@pangeamedia.com> References: <20080927154232.GM9470@agaton.scsys.co.uk> <48E0DC42.6010300@pangeamedia.com> Message-ID: <20080930001447.GE3361@klangraum.plasmasturm.org> * John Lee [2008-09-29 16:05]: > What's the general concensus in the catalyst community > nowadays? Is mod_fastcgi preferred at large over mod_fcgid > these days? Personally? ::Engine::HTTP::Prefork + ::Plugin::Static::Simple. Then I put a reverse proxy in front (it doesn?t really matter, I?ve used Apache mod_proxy and Varnish, pick whatever you like), and teach that to cache the static files for a very, very long time. That way, the Catalyst server a) is completely decoupled from its deployment environment (the two parts don?t even have to be on the same machine), b) can therefore also be debugged standalone in production, c) can be an exact replica of the server that runs on the developer?s machine. (Although the last point is watered down a little by adding a reverse proxy to the mix in production.) Regards, -- Aristotle Pagaltzis // From kaare at jasonic.dk Tue Sep 30 07:02:45 2008 From: kaare at jasonic.dk (Kaare Rasmussen) Date: Tue Sep 30 07:02:48 2008 Subject: [Catalyst] Re: fcgid In-Reply-To: <20080930001447.GE3361@klangraum.plasmasturm.org> References: <20080927154232.GM9470@agaton.scsys.co.uk> <48E0DC42.6010300@pangeamedia.com> <20080930001447.GE3361@klangraum.plasmasturm.org> Message-ID: <20080930060245.CCE802A42AE@kalahari.jasonic.dk> > Personally? ::Engine::HTTP::Prefork + ::Plugin::Static::Simple. > Then I put a reverse proxy in front (it doesn?t really matter, > I?ve used Apache mod_proxy and Varnish, pick whatever you like), > and teach that to cache the static files for a very, very long > time. Do you have any performance data for this, compared to fastcgi and modperl? From pagaltzis at gmx.de Tue Sep 30 10:49:30 2008 From: pagaltzis at gmx.de (Aristotle Pagaltzis) Date: Tue Sep 30 10:49:29 2008 Subject: [Catalyst] Re: fcgid In-Reply-To: <20080930060245.CCE802A42AE@kalahari.jasonic.dk> References: <20080927154232.GM9470@agaton.scsys.co.uk> <48E0DC42.6010300@pangeamedia.com> <20080930001447.GE3361@klangraum.plasmasturm.org> <20080930060245.CCE802A42AE@kalahari.jasonic.dk> Message-ID: <20080930094930.GG3361@klangraum.plasmasturm.org> * Kaare Rasmussen [2008-09-30 08:20]: >> Personally? ::Engine::HTTP::Prefork + >> ::Plugin::Static::Simple. Then I put a reverse proxy in front >> (it doesn?t really matter, I?ve used Apache mod_proxy and >> Varnish, pick whatever you like), and teach that to cache the >> static files for a very, very long time. > > Do you have any performance data for this, compared to fastcgi > and modperl? Nothing scientific. For me the major attraction is that it?s a boatload easier to administrate and debug, since I?m doing the entire devel/QA/sysadmin cycle mostly on my own, and my time is limited. I?d throw a second machine at it much sooner than I?d switch to a more complicated solution. All that said, however, I simply haven?t had to investigate its performance, as it?s proven plenty fast for our modest needs. I can?t imagine off hand any reason for it to be significantly slower than a FastCGI deployment ? conceptually it?s the same setup, with a standard webserver like Apache facing outward and a separate set of Catalyst processes running in the backstage. The main difference (and it makes a world of difference) is the wire protocol used in the connection between those parts. So this is all just anecdotal so far, but it worked perfectly for me. If you think it might work for you, just give it a try ? it takes very little work to do so! I came up with this setup almost by accident, in fact. Regards, -- Aristotle Pagaltzis // From dbix-class at trout.me.uk Tue Sep 30 14:24:49 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Tue Sep 30 14:24:50 2008 Subject: [Catalyst] fcgid In-Reply-To: <48E0DC42.6010300@pangeamedia.com> References: <20080927154232.GM9470@agaton.scsys.co.uk> <48E0DC42.6010300@pangeamedia.com> Message-ID: <20080930132449.GL9470@agaton.scsys.co.uk> On Mon, Sep 29, 2008 at 09:46:42AM -0400, John Lee wrote: > Matt S Trout wrote: > > fcgid is designed for shared hosting. it's basically useless for dedicated > > setups. > > > >> I ask this, because it seems that it works better than fastcgi, it is > >> maintained and prefered, but I can't see why. > > > > mod_fastcgi is maintained, just minimally and quietly, and it works > > perfectly. > > > > For dedicated setups it's the only option; I dunno who you think prefers > > fcgid but I'm certainly not one of them. > > > > Hmm, now I'm all confused. We'd recently switched to mod_fcgid from > handling fastcgi with lighttpd, due to its better process management. > However, I'm always akin to trying new things, so this piques my > curiosity around mod_fastcgi. > > What's the general concensus in the catalyst community nowadays? Is > mod_fastcgi preferred at large over mod_fcgid these days? You shouldn't let your fastcgi module do process management at all, anyway, that's what FCGI::ProcManager is for - and by having the fastcgi stuff external you can, as Peter Karmen points out, bounce the application separately. Not only that but you can do zero-downtime upgrades by starting the new version on the same socket -before- stopping the old version. > I saw a post > from Jonathan Rockaway almost two years ago noting that "mod_fastcgi is > crufty and slightly broken, while mod_fcgid seems to be more sane", *shrug* Jon's an apps dev. I'm ex-operations and design system deployment strategies on a regular basis. His opinion doesn't count in my world, I don't let client developers anywhere near systems stuff if I can help it :) Note though that fcgid -is- more sane for shared hosting and for the web server doing process management. But as noted above, for dedicated production deployments you don't want that anyway, and mod_fastcgi isn't broken at all, it's just picky about its config sometimes :) Also, mod_fastcgi isn't maintained as "actively". But that's because it already works, so they just put out the occasional bugfix release :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From hhunter at gmail.com Tue Sep 30 14:32:03 2008 From: hhunter at gmail.com (Hugh Hunter) Date: Tue Sep 30 14:32:09 2008 Subject: [Catalyst] Passing UTF-8 arg in URL to DBIC search In-Reply-To: <20080927153820.GA32185@hank.org> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <20080927153820.GA32185@hank.org> Message-ID: SSB0aG91Z2h0IGFib3V0IHRoaXMgKHRoYXQgcGFzc2luZyB0aGUgc3RyaW5nIGluIHRoZSBwYXRo IHJhdGhlciB0aGFuIGFzIGEKcGFyYW1ldGVyIHdvdWxkIG1ha2UgYSBkaWZmZXJlbmNlKS4gIEkn dmUgdHJpZWQgdXNpbmcgYSBSZXdyaXRlUnVsZSB0byB0dXJuCnRoZSBwYXRoIGludG8gYSBxdWVy eSBwYXJhbWV0ZXIgYnV0IEkgZ2V0IHRoZSBzYW1lIGJlaGF2aW9yLi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pc3RpbmZvOiBodHRwOi8vbGlz dHMuc2NzeXMuY28udWsvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2NhdGFseXN0Cj4gU2VhcmNo YWJsZSBhcmNoaXZlOgo+IGh0dHA6Ly93d3cubWFpbC1hcmNoaXZlLmNvbS9jYXRhbHlzdEBsaXN0 cy5zY3N5cy5jby51ay8KPiBEZXYgc2l0ZTogaHR0cDovL2Rldi5jYXRhbHlzdC5wZXJsLm9yZy8K PgotLS0tLS0tLS0tLS0tLSBuZXh0IHBhcnQgLS0tLS0tLS0tLS0tLS0KQW4gSFRNTCBhdHRhY2ht ZW50IHdhcyBzY3J1YmJlZC4uLgpVUkw6IGh0dHA6Ly9saXN0cy5zY3N5cy5jby51ay9waXBlcm1h aWwvY2F0YWx5c3QvYXR0YWNobWVudHMvMjAwODA5MzAvYjBlNjcxMmMvYXR0YWNobWVudC5odG0K From dbix-class at trout.me.uk Tue Sep 30 15:39:54 2008 From: dbix-class at trout.me.uk (Matt S Trout) Date: Tue Sep 30 15:39:57 2008 Subject: [Catalyst] Catalyst, DBIx::Class and Moose training in the UK Message-ID: <20080930143954.GS9470@agaton.scsys.co.uk> Shadowcat are looking to start offering training in Catalyst, DBIx::Class and Moose usage, both introductory sessions and more advanced workshop-style classes. The intended format would be two-day classes on site in Lancaster (we'll either arrange accommodation or people can organise their own if they prefer) with a maximum class size of about 10 to ensure there's plenty of space for one on one time during exercises etc. Planned time frame for this is to have the first round of classes in Q12009. If anybody's interested in this, please send mail to mst -at- shadowcat.co.uk (or just reply to this mail with comments) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ From jshirley at gmail.com Tue Sep 30 16:10:13 2008 From: jshirley at gmail.com (J. Shirley) Date: Tue Sep 30 16:10:16 2008 Subject: [Catalyst] Passing UTF-8 arg in URL to DBIC search In-Reply-To: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> Message-ID: <756703690809300810u11c1661eidd93011c96af1cf5@mail.gmail.com> On Sat, Sep 27, 2008 at 6:51 AM, Hugh Hunter wrote: > Hello all, > > I've been struggling with this for some time and know there must be an > answer out there. > > I'm using URL arguments to pass parameters to my controller. It's a site > about names, so take the url http://domain.com/name/Jes?s (note the accented > u). The Name.pm controller has an :Args(1) decorator so Jes?s is stored in > $name and then passed to my DBIC model in a ->search({name => $name}) call. > This doesn't manage to find the row that exists in mysql. When I dump > $name I get: > > 'name' => 'Jes\xc3\xbas' > > which I think I understand as being perl's internal escaping of utf-8 > characters. > > I've done everything recommended on > http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode and > the name column in my mysql database uses the utf-8 charset. > > Where am I going wrong? > > Best regards, > > --Hugh I haven't dug into the Catalyst source to see of any handling for the arguments, but just for testing you may want to try doing a utf8::decode($name) and see if that does the trick for you. (Wild guessing on my part, sorry) -J From dhoworth at mrc-lmb.cam.ac.uk Tue Sep 30 16:23:10 2008 From: dhoworth at mrc-lmb.cam.ac.uk (Dave Howorth) Date: Tue Sep 30 16:23:12 2008 Subject: [Catalyst] CSRF Message-ID: <48E2445E.4020405@mrc-lmb.cam.ac.uk> There's an interesting paper on CSRF mentioned on slashdot today: It mentions Catalyst along with some other frameworks and suggests a way to build in CSRF-protection. Cheers, Dave From carlos.arenas at gmail.com Tue Sep 30 17:37:22 2008 From: carlos.arenas at gmail.com (Carlos Arenas) Date: Tue Sep 30 17:37:23 2008 Subject: [Catalyst] Catalyst, DBIx::Class and Moose training in the UK In-Reply-To: <20080930143954.GS9470@agaton.scsys.co.uk> References: <20080930143954.GS9470@agaton.scsys.co.uk> Message-ID: <9236f5ef0809300937r3f4dcfa4m28cfc4dac42f9517@mail.gmail.com> i am very much interested. do you have pricing info available? and what is the profile for attendees of both types of sessions? ca. On Tue, Sep 30, 2008 at 10:39, Matt S Trout wrote: > Shadowcat are looking to start offering training in Catalyst, DBIx::Class > and Moose usage, both introductory sessions and more advanced workshop-style > classes. The intended format would be two-day classes on site in Lancaster > (we'll either arrange accommodation or people can organise their own if > they prefer) with a maximum class size of about 10 to ensure there's plenty > of space for one on one time during exercises etc. > > Planned time frame for this is to have the first round of classes in Q12009. > > If anybody's interested in this, please send mail to mst -at- shadowcat.co.uk > (or just reply to this mail with comments) > > -- > Matt S Trout Need help with your Catalyst or DBIx::Class project? > Technical Director http://www.shadowcat.co.uk/catalyst/ > Shadowcat Systems Ltd. Want a managed development or deployment platform? > http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/ > > _______________________________________________ > 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/ > From Wade.Stuart at fallon.com Tue Sep 30 17:40:40 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Tue Sep 30 17:40:52 2008 Subject: [Catalyst] CSRF In-Reply-To: <48E2445E.4020405@mrc-lmb.cam.ac.uk> Message-ID: Dave Howorth wrote on 09/30/2008 10:23:10 AM: > There's an interesting paper on CSRF mentioned on slashdot today: > > > It mentions Catalyst along with some other frameworks and suggests a way > to build in CSRF-protection. > > Cheers, Dave > I really don't understand why they even reference Catalyst. CSRF is a generalized issue -- whether you use Catalyst or hand spun assembly for a webapp the same protections are needed. Seems like a cheap way (listing a bunch of frameworks in a security paper) to gain cheap traffic on your paper. -Wade From apv at sedition.com Tue Sep 30 17:58:15 2008 From: apv at sedition.com (Ashley) Date: Tue Sep 30 17:58:22 2008 Subject: [Catalyst] CSRF In-Reply-To: References: Message-ID: <14A02C8B-997F-4018-8A0A-1D610092F437@sedition.com> On Sep 30, 2008, at 9:40 AM, Wade.Stuart@fallon.com wrote: > Seems like a cheap way (listing a bunch of frameworks in a security > paper) to gain cheap traffic on your paper. Isn't that how and why white papers are written. :) I only skimmed the top page but I got the impression that following best practices would circumvent (most of?) the exploits. POSTs being required to manipulate data, specifically. -Ashley From onken at houseofdesign.de Tue Sep 30 18:08:21 2008 From: onken at houseofdesign.de (Moritz Onken) Date: Tue Sep 30 18:08:29 2008 Subject: [Catalyst] CSRF In-Reply-To: <14A02C8B-997F-4018-8A0A-1D610092F437@sedition.com> References: <14A02C8B-997F-4018-8A0A-1D610092F437@sedition.com> Message-ID: <19A05F46-8BDC-4D2E-B0BA-6B5B39D05323@houseofdesign.de> Am 30.09.2008 um 18:58 schrieb Ashley: > On Sep 30, 2008, at 9:40 AM, Wade.Stuart@fallon.com wrote: >> Seems like a cheap way (listing a bunch of frameworks in a security >> paper) to gain cheap traffic on your paper. > > Isn't that how and why white papers are written. :) > > I only skimmed the top page but I got the impression that following > best practices would circumvent (most of?) the exploits. POSTs > being required to manipulate data, specifically. > > -Ashley From the paper: "attackers can use POST" This is possible due to the fact that flash movies can send any request to a server. You can achieve this even with a XMLHTTPRequest. cheers, moritz From apv at sedition.com Tue Sep 30 18:20:11 2008 From: apv at sedition.com (Ashley) Date: Tue Sep 30 18:20:16 2008 Subject: [Catalyst] CSRF In-Reply-To: <19A05F46-8BDC-4D2E-B0BA-6B5B39D05323@houseofdesign.de> References: <14A02C8B-997F-4018-8A0A-1D610092F437@sedition.com> <19A05F46-8BDC-4D2E-B0BA-6B5B39D05323@houseofdesign.de> Message-ID: On Sep 30, 2008, at 10:08 AM, Moritz Onken wrote: > "attackers can use POST" > > This is possible due to the fact that flash movies can send any > request to a server. > You can achieve this even with a XMLHTTPRequest. If scripting is involved that makes it a XSS attack instead, though. No? -Ashley From onken at houseofdesign.de Tue Sep 30 19:08:38 2008 From: onken at houseofdesign.de (Moritz Onken) Date: Tue Sep 30 19:08:46 2008 Subject: [Catalyst] CSRF In-Reply-To: References: <14A02C8B-997F-4018-8A0A-1D610092F437@sedition.com> <19A05F46-8BDC-4D2E-B0BA-6B5B39D05323@houseofdesign.de> Message-ID: Am 30.09.2008 um 19:20 schrieb Ashley: > On Sep 30, 2008, at 10:08 AM, Moritz Onken wrote: >> "attackers can use POST" >> >> This is possible due to the fact that flash movies can send any >> request to a server. >> You can achieve this even with a XMLHTTPRequest. > > If scripting is involved that makes it a XSS attack instead, though. > No? > > -Ashley I was wrong about the XMLHttprequest. Posting to another server is not possible as of the same origin policy. But flash movies can send post request to a different server without user interaction. XSS is more like posting a javascript snippet to a facebook wall which does some javascript actions in the context of the user who opens that wall. cheers, moritz From xt3 at cccmz.de Tue Sep 30 19:58:04 2008 From: xt3 at cccmz.de (Stephan Jennewein) Date: Tue Sep 30 19:57:03 2008 Subject: [Catalyst] mix authentication stores Message-ID: <200809302058.04580.xt3@cccmz.de> Hi, is it possible to use ldap to authenticate and dbic (a database) to handle the user role relation ? So that it works like it resides all in one storage backend. If yes how do I configure that in the $application.conf ? Stephan From Wade.Stuart at fallon.com Tue Sep 30 20:15:50 2008 From: Wade.Stuart at fallon.com (Wade.Stuart@fallon.com) Date: Tue Sep 30 20:16:02 2008 Subject: [Catalyst] CSRF In-Reply-To: Message-ID: Moritz Onken wrote on 09/30/2008 01:08:38 PM: > > Am 30.09.2008 um 19:20 schrieb Ashley: > > > On Sep 30, 2008, at 10:08 AM, Moritz Onken wrote: > >> "attackers can use POST" > >> > >> This is possible due to the fact that flash movies can send any > >> request to a server. > >> You can achieve this even with a XMLHTTPRequest. > > > > If scripting is involved that makes it a XSS attack instead, though. > > No? > > > > -Ashley > > I was wrong about the XMLHttprequest. Posting to another server is not > possible as of the same origin policy. > But flash movies can send post request to a different server without > user interaction. Actually, no. Flash can do GET to another server (hostname) but as of flash 7 (they are at 9 now), you need a crossdomain.xml file on the receiving end to allow POST and data loads. > > XSS is more like posting a javascript snippet to a facebook wall which > does some javascript actions in the context of the user who opens that > wall. > > cheers, > > moritz > > _______________________________________________ > 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/ From jonh at nmgi.com Tue Sep 30 20:26:41 2008 From: jonh at nmgi.com (Jonathan Hall) Date: Tue Sep 30 20:26:55 2008 Subject: [Catalyst] mix authentication stores In-Reply-To: <200809302058.04580.xt3@cccmz.de> References: <200809302058.04580.xt3@cccmz.de> Message-ID: <48E27D71.6020506@nmgi.com> Not directly... it's not even possible in DBIC to have relationships between different databases, which is essentially what you're talking about doing. You can accomplish the same thing client-side if you write your own user store module(s), which is not fundamentally difficult. I have done a similar thing for our Cat application; we authenticate via Unix accounts (/etc/passwd), or DBIC, or LDAP or (insert other yet-to-exist authentication methods). The user roles are all defined in the database. The user store documentation available on CPAN describes how to write modules such that they will interface with Catalyst properly, and it's not very difficult. I did my first one in half a day, having practically zero experience with catalyst internals at the time. (I have since rewritten it a time or two, and each iteration is better and cleaner, as you would expect). -- Jonathan Stephan Jennewein wrote: > Hi, > > is it possible to use ldap to authenticate and dbic (a database) to handle the > user role relation ? So that it works like it resides all in one storage > backend. > If yes how do I configure that in the $application.conf ? > > Stephan > > _______________________________________________ > 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/ > -- Inbound and outbound email scanned for spam and viruses by the DoubleCheck Email Manager: http://www.doublecheckemail.com From moseley at hank.org Tue Sep 30 21:40:57 2008 From: moseley at hank.org (Bill Moseley) Date: Tue Sep 30 21:40:46 2008 Subject: [Catalyst] Passing UTF-8 arg in URL to DBIC search In-Reply-To: <756703690809300810u11c1661eidd93011c96af1cf5@mail.gmail.com> References: <8A4834BB-9BDF-4EB9-B982-A35A084350C7@gmail.com> <756703690809300810u11c1661eidd93011c96af1cf5@mail.gmail.com> Message-ID: <20080930204057.GA9558@hank.org> On Tue, Sep 30, 2008 at 08:10:13AM -0700, J. Shirley wrote: > On Sat, Sep 27, 2008 at 6:51 AM, Hugh Hunter wrote: > > Hello all, > > > > I've been struggling with this for some time and know there must be an > > answer out there. > > > > I'm using URL arguments to pass parameters to my controller. It's a site > > about names, so take the url http://domain.com/name/Jes?s (note the accented > > u). The Name.pm controller has an :Args(1) decorator so Jes?s is stored in > > $name and then passed to my DBIC model in a ->search({name => $name}) call. > > This doesn't manage to find the row that exists in mysql. When I dump > > $name I get: > > > > 'name' => 'Jes\xc3\xbas' > > > > which I think I understand as being perl's internal escaping of utf-8 > > characters. > > > > I've done everything recommended on > > http://dev.catalystframework.org/wiki/gettingstarted/tutorialsandhowtos/using_unicode and > > the name column in my mysql database uses the utf-8 charset. > > > > Where am I going wrong? > > > > Best regards, > > > > --Hugh > > I haven't dug into the Catalyst source to see of any handling for the > arguments, but just for testing you may want to try doing a > utf8::decode($name) and see if that does the trick for you. I think Encode::decode_utf8() the recommended method over using the utf8::decode call. Perhaps something like this early in the request: $c->req->arguments( [ map { Encode::decode_utf8($_) } @{$c->req->arguments} ] ); But, I'd be concerned about doing this. Will all browsers encode into utf8 octets? You could easily make an LWP request with other encodings. -- Bill Moseley moseley@hank.org Sent from my iMutt From onken at houseofdesign.de Tue Sep 30 21:46:23 2008 From: onken at houseofdesign.de (Moritz Onken) Date: Tue Sep 30 21:46:32 2008 Subject: [Catalyst] CSRF In-Reply-To: References: Message-ID: Am 30.09.2008 um 21:15 schrieb Wade.Stuart@fallon.com: > > Moritz Onken wrote on 09/30/2008 01:08:38 PM: > >> >> Am 30.09.2008 um 19:20 schrieb Ashley: >> >>> On Sep 30, 2008, at 10:08 AM, Moritz Onken wrote: >>>> "attackers can use POST" >>>> >>>> This is possible due to the fact that flash movies can send any >>>> request to a server. >>>> You can achieve this even with a XMLHTTPRequest. >>> >>> If scripting is involved that makes it a XSS attack instead, though. >>> No? >>> >>> -Ashley >> >> I was wrong about the XMLHttprequest. Posting to another server is >> not >> possible as of the same origin policy. >> But flash movies can send post request to a different server without >> user interaction. > > Actually, no. Flash can do GET to another server (hostname) but as of > flash 7 (they are at 9 now), you need a crossdomain.xml file on the > receiving end to allow POST and data loads. I'm sorry, didn't know about that. But it's still possible to submit a (invisble) form with the method set to POST without any user interaction (chapter 2.3 from the paper). moritz From xt3 at cccmz.de Tue Sep 30 23:27:50 2008 From: xt3 at cccmz.de (Stephan Jennewein) Date: Tue Sep 30 23:26:51 2008 Subject: [Catalyst] Catalyst::Plugin::UploadProgress Message-ID: <200810010027.51130.xt3@cccmz.de> Hi, I'm trying to use the UploadProgress plugin. At the moment it doesn't update the progressbar during the upload, but the first time it does is when I cancel the upload or it has finished. I think the problem is that I'm using Mason instead of TT . Could that be the problem and if yes is there a solution, because I don't want to switch the templating engine. Stephan From andy at hybridized.org Tue Sep 30 23:39:08 2008 From: andy at hybridized.org (Andy Grundman) Date: Tue Sep 30 23:39:14 2008 Subject: [Catalyst] Catalyst::Plugin::UploadProgress In-Reply-To: <200810010027.51130.xt3@cccmz.de> References: <200810010027.51130.xt3@cccmz.de> Message-ID: <5409090C-B48A-45ED-815C-0B5272AD3B47@hybridized.org> On Sep 30, 2008, at 6:27 PM, Stephan Jennewein wrote: > Hi, > > I'm trying to use the UploadProgress plugin. > At the moment it doesn't update the progressbar during the upload, > but the > first time it does is when I cancel the upload or it has finished. I > think > the problem is that I'm using Mason instead of TT . Could that be > the problem > and if yes is there a solution, because I don't want to switch the > templating > engine. What Catalyst engine are you using? What you described sounds like the behavior with the default HTTP engine. If that's what you're using, try enabling fork mode with -f.