Re: [Catalyst] Catalyst::View::JSON sends a file
2010/1/12 Tomas Doran bobtf...@bobtfish.net: Your browser will do whatever it normally does with the mime type you're sending. By changing settings or mime types you'll probably be able to convince it to display the JSON. Or just install the FireFox addon 'JSONView' which will show you the JSON in the browser window in the same way that you see XML (with pretty colours and stuff). This is best as it puts the smarts where you want them (in your browser) rather than in the app where the unintended consequences kick in. Cheers, Edmund. PS: as a side note you're being asked to download a file because the mime-type for JSON is 'application/json' so the browser assumes that it is not human readable. There is a chirpy little holy war about all the mime-types that are 'text/*' that should actually be 'application/*' - like 'text/xml' for example. But I digress... ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] InstancePerContext doesn't work in schema
Steve Kleiman wrote: Having trouble with InstancePerContext in a schema. This won't work. Ever. InstancePerContext only works on Catalyst components, the schema isn't a component, the MyApp::Model::DB class is the component.. You'll want to add InstancePerContext to the model class and get that to pass stuff down into the schema.. I'd like to be able to get at $c from within a schema definition. The $callsheet-context call does not throw an error and returns an undef value. So in the case below, I would expect console output to be 'good test' but instead I get Can't call method log on an undefined value. This is a spectacularly bad idea. Why? (It's a much better idea to build some closures around $c which you can call to do things for you, and those pass those into the schema - then the schema has a coderef it can call to 'generate me a URI', but it still has no knowledge of Catalyst or $c so seperation of concerns is maintained). 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/
[Catalyst] C:E:HTTP:Restarter problem after upgrading
Hi There, i was using Catalyst version 5.80007 without any problems. Yesterday i updated through the cpan-programm zu version 5.80018. My old Catalyst-Applications (created with catalyst.pl under version 5.80007) now struggle to start in auto-restart-mode with the error: = % SNIP % = Can't locate Catalyst/Engine/HTTP/Restarter.pm in @INC (@INC contains: /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .). at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 113 Class::MOP::load_first_existing_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 118 Class::MOP::load_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 2437 Catalyst::setup_engine('gpstracks', 'undef') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 1050 Catalyst::setup('gpstracks') called at /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib/gpstracks.pm line 34 require gpstracks.pm called at ./gpstracks_server.pl line 55 Compilation failed in require at ./gpstracks_server.pl line 55. = % SNIP % = While the standalone server without auto-restarting works just fine. Also when creating a quick testapp whith catalyst.pl testapp an starting testapp_server.pl -r just works fine too. So has the been Restarter-codule changed/abadoned? And how can i easily update my old applications then? Thanks in advance, Sven ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C:E:HTTP:Restarter problem after upgrading
Hmm, no, that doesn't seem to be the real reason. When looking at C::E::H::Restarter it was last included into Catalyst::Runtime in Version 5.8000_07. I found a thread on the archive about the changed restarter http://lists.scsys.co.uk/pipermail/catalyst/2009-May/022260.html An i also got this Catalyst::Restarter module. But how can i now easily and savely update my *_server.pl scripts? Just change manually the $ENV{CATALYST_ENGINE} variable from HTTP::Restarter to Catalyst::Restarter? Am Donnerstag, den 14.01.2010, 15:28 +0100 schrieb Christoph Friedrich: Looks like you just didn't install Catalyst::Engine::HTTP::Restarter with the update. Try to install it via the command cpan Catalyst::Engine::HTTP::Restarter Greets Christoph Sven Eppler schrieb: Hi There, i was using Catalyst version 5.80007 without any problems. Yesterday i updated through the cpan-programm zu version 5.80018. My old Catalyst-Applications (created with catalyst.pl under version 5.80007) now struggle to start in auto-restart-mode with the error: = % SNIP % = Can't locate Catalyst/Engine/HTTP/Restarter.pm in @INC (@INC contains: /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .). at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 113 Class::MOP::load_first_existing_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 118 Class::MOP::load_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 2437 Catalyst::setup_engine('gpstracks', 'undef') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 1050 Catalyst::setup('gpstracks') called at /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib/gpstracks.pm line 34 require gpstracks.pm called at ./gpstracks_server.pl line 55 Compilation failed in require at ./gpstracks_server.pl line 55. = % SNIP % = While the standalone server without auto-restarting works just fine. Also when creating a quick testapp whith catalyst.pl testapp an starting testapp_server.pl -r just works fine too. So has the been Restarter-codule changed/abadoned? And how can i easily update my old applications then? Thanks in advance, Sven ___ 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/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C:E:HTTP:Restarter problem after upgrading
Has you tried to install/update it via CPAN? Sven Eppler schrieb: Hmm, no, that doesn't seem to be the real reason. When looking at C::E::H::Restarter it was last included into Catalyst::Runtime in Version 5.8000_07. I found a thread on the archive about the changed restarter http://lists.scsys.co.uk/pipermail/catalyst/2009-May/022260.html An i also got this Catalyst::Restarter module. But how can i now easily and savely update my *_server.pl scripts? Just change manually the $ENV{CATALYST_ENGINE} variable from HTTP::Restarter to Catalyst::Restarter? Am Donnerstag, den 14.01.2010, 15:28 +0100 schrieb Christoph Friedrich: Looks like you just didn't install Catalyst::Engine::HTTP::Restarter with the update. Try to install it via the command cpan Catalyst::Engine::HTTP::Restarter Greets Christoph Sven Eppler schrieb: Hi There, i was using Catalyst version 5.80007 without any problems. Yesterday i updated through the cpan-programm zu version 5.80018. My old Catalyst-Applications (created with catalyst.pl under version 5.80007) now struggle to start in auto-restart-mode with the error: = % SNIP % = Can't locate Catalyst/Engine/HTTP/Restarter.pm in @INC (@INC contains: /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .). at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 113 Class::MOP::load_first_existing_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 118 Class::MOP::load_class('Catalyst::Engine::HTTP::Restarter') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 2437 Catalyst::setup_engine('gpstracks', 'undef') called at /usr/local/share/perl/5.8.8/Catalyst.pm line 1050 Catalyst::setup('gpstracks') called at /var/www/vhosts/sveneppler.de/catalyst/gpstracks/script/../lib/gpstracks.pm line 34 require gpstracks.pm called at ./gpstracks_server.pl line 55 Compilation failed in require at ./gpstracks_server.pl line 55. = % SNIP % = While the standalone server without auto-restarting works just fine. Also when creating a quick testapp whith catalyst.pl testapp an starting testapp_server.pl -r just works fine too. So has the been Restarter-codule changed/abadoned? And how can i easily update my old applications then? Thanks in advance, Sven ___ 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/ ___ 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/ attachment: christoph.vcf___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C:E:HTTP:Restarter problem after upgrading
Sven Eppler wrote: Hmm, no, that doesn't seem to be the real reason. When looking at C::E::H::Restarter it was last included into Catalyst::Runtime in Version 5.8000_07. I found a thread on the archive about the changed restarter http://lists.scsys.co.uk/pipermail/catalyst/2009-May/022260.html An i also got this Catalyst::Restarter module. But how can i now easily and savely update my *_server.pl scripts? Just change manually the $ENV{CATALYST_ENGINE} variable from HTTP::Restarter to Catalyst::Restarter? No, don't do that. Update your Catalyst::Devel, and then when you run myapp_server.pl (without the -r option) it'll tell you how to upgrade your scripts. 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/
Re: [Catalyst] C:E:HTTP:Restarter problem after upgrading
Ahh, thanks, this little info just scrolled through the screen since there where a lot Controllers, Views, etc. Works fine now. :) Am Donnerstag, den 14.01.2010, 14:50 + schrieb Tomas Doran: Sven Eppler wrote: Hmm, no, that doesn't seem to be the real reason. When looking at C::E::H::Restarter it was last included into Catalyst::Runtime in Version 5.8000_07. I found a thread on the archive about the changed restarter http://lists.scsys.co.uk/pipermail/catalyst/2009-May/022260.html An i also got this Catalyst::Restarter module. But how can i now easily and savely update my *_server.pl scripts? Just change manually the $ENV{CATALYST_ENGINE} variable from HTTP::Restarter to Catalyst::Restarter? No, don't do that. Update your Catalyst::Devel, and then when you run myapp_server.pl (without the -r option) it'll tell you how to upgrade your scripts. 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/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] modules for conditional GET ?
Hi Catalysters, For some actions of a Catalyst app, I would like to implement conditional GET (using If-Modified-Since HTTP header), where the timestamp of one config file decides whether the page should be refreshed or not --- this is because that page is quite expensive to compute. This scenario sounds like a common thing to do, so I expected to find some Catalyst plugins/extensions in CPAN to do that, but didn't find any. Did I just miss some CPAN modules, or should I really start from scratch ? Thanks in advance for any hints, 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/
[Catalyst] Password Encrypting Authentication
Hello, I'm using Catalyst for 5.80015, and having a bit of trouble syncing my password authentication with my encrypting. I'm using Catalyst::Plugin::Authentication in order to authenticate users, and I'm using DBIx::Class::EncodedColumn in order to encrypt passwords as they are inserted (when a user registers). I'm not too partial to any encryption algorithm, but I'm having trouble finding a method that works with both of these. DBIx::Class::EncodedColumn does exactly what I want it to as far as encrypting the password column prior to inserting (or updating) it. Has someone used these in conjunction in the past, or how is this commonly implemented? Ideally I would like EncodedColumn to use the basic unix encryption that C::P::Authentication uses when password_type='crypted'. Thanks! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Login authentication using C::HTML::FormBuilder ...
I'm using C::HTML::FormBuilder for a simple login form and would like to use the standard $c-authenticate() for validation. This means that I either have to pass ctx = $c to $form-process(), more tightly coupling the controller to the form, or do all of the $c-authenticate() stuff after $form-validated(), making my controller fatter. Is there another way of accomplishing this more elegantly, or is one of these options acceptable? Just curious is all. -- Kiffin Gish kiffin.g...@planet.nl Gouda, The Netherlands ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] modules for conditional GET ?
There's a good example using the 'Cache-Control' header in the new Catalyst book, Chapter 11, section 'Deploy with a Cache'. On Thu, 2010-01-14 at 16:05 +0100, Dami Laurent (PJ) wrote: Hi Catalysters, For some actions of a Catalyst app, I would like to implement conditional GET (using If-Modified-Since HTTP header), where the timestamp of one config file decides whether the page should be refreshed or not --- this is because that page is quite expensive to compute. This scenario sounds like a common thing to do, so I expected to find some Catalyst plugins/extensions in CPAN to do that, but didn't find any. Did I just miss some CPAN modules, or should I really start from scratch ? Thanks in advance for any hints, 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/ -- Kiffin Gish kiffin.g...@planet.nl Gouda, The Netherlands ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] modules for conditional GET ?
From: Dami Laurent (PJ) laurent.d...@justice.ge.ch Hi Catalysters, For some actions of a Catalyst app, I would like to implement conditional GET (using If-Modified-Since HTTP header), where the timestamp of one config file decides whether the page should be refreshed or not --- this is because that page is quite expensive to compute. This scenario sounds like a common thing to do, so I expected to find some Catalyst plugins/extensions in CPAN to do that, but didn't find any. Did I just miss some CPAN modules, or should I really start from scratch ? Thanks in advance for any hints, Laurent Dami Try Catalyst::Plugin::Cache::HTTP. 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/
Re: [Catalyst] InstancePerContext doesn't work in schema
Hey Tomas. Thank you very much for responding. The challenge I've got is that sometimes I want a schema object to act on a date or time. However to do that properly, it needs access to the current user's time zone and locale. I gather you're suggesting I just pass in the time zone and locale to the object every time. Cool. I can refactor that. How about handling something as straightforward as getting debug text within a Schema to the console, e.g., $c-log-debug(hello) What's the recommended procedure for debugging outside the Controller? Thanks again. -steve On Jan 14, 2010, at 6:10 AM, Tomas Doran wrote: Steve Kleiman wrote: Having trouble with InstancePerContext in a schema. This won't work. Ever. InstancePerContext only works on Catalyst components, the schema isn't a component, the MyApp::Model::DB class is the component.. You'll want to add InstancePerContext to the model class and get that to pass stuff down into the schema.. I'd like to be able to get at $c from within a schema definition. The $callsheet-context call does not throw an error and returns an undef value. So in the case below, I would expect console output to be 'good test' but instead I get Can't call method log on an undefined value. This is a spectacularly bad idea. Why? (It's a much better idea to build some closures around $c which you can call to do things for you, and those pass those into the schema - then the schema has a coderef it can call to 'generate me a URI', but it still has no knowledge of Catalyst or $c so seperation of concerns is maintained). 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/
Re: [Catalyst] Password Encrypting Authentication
Jon wrote: Ideally I would like EncodedColumn to use the basic unix encryption that C::P::Authentication uses when password_type='crypted'. You're meant to be using password_type = 'self_check' with EncodedColumn, then the user row is responsible for both encrypting the password and checking the encrypted password, rather than having two different things trying to do opposite halves of the same thing.. 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/
Re: [Catalyst] Password Encrypting Authentication
Ideally I would like EncodedColumn to use the basic unix encryption that C::P::Authentication uses when password_type='crypted'. You're meant to be using password_type = 'self_check' with EncodedColumn, then the user row is responsible for both encrypting the password and checking the encrypted password, rather than having two different things trying to do opposite halves of the same thing.. That works perfect. Thanks! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Catalyst-View-Email question
Forgive me if there's another mailing list I should've posted this at. It didn't seem to squarely fit the Catalyst list because it may be a mailer issue. Not sure. I'm trying to use Catalyst::View::Email and Catalyst::View::Email::Template. The error I get is: [debug] C::V::Email::Template uses default view Prodhub::View::TT=HASH(0x1047840e8) for rendering. [debug] C::V::Email uses default content_type text/plain. [debug] Rendering template _email/invitation_to_project-HTML.tt2 [debug] Passing page through as text: _email/invitation_to_project-HTML.tt2 [debug] C::V::Email uses specified content_type text/plain. [error] Caught exception in Prodhub::View::Email::Template-process Couldn't connect to localhost at /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Action.pm line 65 [error] Caught exception in engine Can't use string (a6868e20c5ff9800b88e1a6ac7eef75e) as a HASH ref while strict refs in use at /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Engine.pm line 117. The configuration I'm using in .conf is below. I get this error regardless of whether I try Sendmail or SMTP. If it makes any difference, I'm on Mac linux. Thanks in advance for any insight. Steve Kleiman Configuration: View::Email stash_key email default content_typetext/plain charset utf-8 /default sender mailer Sendmail # mailerSMTP # mailer_args is passed directly into Email::Send mailer_args Hostmail.prodhub.com # defaults to localhost usernamem...@prodhub.com passwordxxx /mailer_args /sender /View::Email View::Email::Template template_prefix _email default # Defines the default view used to render the templates. viewTT /default /View::Email::Template ___ 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/