Re: [Catalyst] Catalyst::Manual::Tutorial::CatalystBasics [error] Couldn't render template undef error - status_msg is undefined
On Mar 14, 2007, at 12:51 AM, David Christensen wrote: I'm now on tutorial 2 of 9, and have run the various scripts, entered modules and templates, etc., as directed for the books database example. When I fire up the development server and browse to: http://p3800.holgerdanske.com:3000/books/list The server says: [error] Couldn't render template undef error - status_msg is undefined It looks like you've turned on debugging in Template, either DEBUG_UNDEF or DEBUG_ALL (which gets you all the debugging options, including UNDEF.) DEBUG_UNDEF is helpful if you want to make sure you don't have any undefined variable values in your templates, but the way most people use templates is to just leave anything they don't need filled in empty. One option if you want to keep DEBUG_UNDEF enabled, but not have it throw an error for things like status_msg and error_msg that might reasonably be blank is to do something like this in your view... my @dont_leave_blank = qw( status_msg error_msg ); sub template_vars { my ( $self, $c ) = @_; my %vars = $self-NEXT::template_vars( $c ); foreach my $x ( @dont_leave_blank ) { if ( ! defined $vars{ $x } ) { $vars{ $x } = q{} } } return %vars; } -- Jason Kohles [EMAIL PROTECTED] http://www.jasonkohles.com/ A witty saying proves nothing. -- Voltaire ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [BULK] - Re: [Catalyst] Template Engine
On 3/13/07, Mesdaq, Ali [EMAIL PROTECTED] wrote: I like the idea of OO based modules and systems. Is that the main difference between TT and Mason? That is that Mason is OO based and TT is not? No. The main difference is that TT is usually used with it's own templating language (it supports in-line perl but is very rarely used that way), and Mason is always used with in-line perl. In terms of templating, they really have very similar feature sets. Mason is much more than a templating system, and provides a full web development environment, but you won't get to use most of that from Catalyst. - Perrin ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] [Announce] Catalyst-Runtime 5.7007
Hi Gang. There's been some time since our last release, as we're busy working on the next major release of Catalyst. Meanwhile, here is a release new release to address minor issues that has come up in the past months. All in all though, the development team is quite happy with the stability of our current stable releases. Marcus -- catch and release monkey Changelog Entry: 5.7007 2007-03-13 14:18:00 - Performance and stability improvements to the built-in HTTP server. - Don't ignore file uploads if form contains a text field with the same name. (Carl Franks) - Support restart_delay of 0 (for use in the POE engine). - Skip body processing if we don't have a Content-Length header. Results in about a 9% performance increase when handling GET/HEAD requests. - Add a default body to redirect responses. - MyApp-model/view now looks at MyApp-config-{default_view/model} (Bogdan Lucaciu) -- With regards Marcus Ramberg ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [Announce] Catalyst-Runtime 5.7007
- Original Message From: Marcus Ramberg [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Wednesday, March 14, 2007 10:22:35 AM Subject: [Catalyst] [Announce] Catalyst-Runtime 5.7007 Hi Gang. There's been some time since our last release, as we're busy working on the next major release of Catalyst. Meanwhile, here is a release new release to address minor issues that has come up in the past months. All in all though, the development team is quite happy with the stability of our current stable releases. Marcus -- catch and release monkey Changelog Entry: 5.7007 2007-03-13 14:18:00 - Performance and stability improvements to the built-in HTTP server. - Don't ignore file uploads if form contains a text field with the same name. (Carl Franks) - Support restart_delay of 0 (for use in the POE engine). - Skip body processing if we don't have a Content-Length header. Results in about a 9% performance increase when handling GET/HEAD requests. - Add a default body to redirect responses. - MyApp-model/view now looks at MyApp-config-{default_view/model} (Bogdan Lucaciu) -- With regards Marcus Ramberg I'll be installing this right away so that I can drop my content length hack to fix the long pause on redirects for Firefox. The default view model thing will reduce boilerplate code in my base controllers for sure. Thanks! Would anyone care to comment about some of the potentially new things upcoming? Peeking in the Catalyst repository branches area shows a lot of tantalizing and interesting things. I know people are super busy but I can't help to wonder. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Calling a private sub - best practice
Hi folks, Using Cat::Controller::Formbuilder. The background is I have 2 methods that essentially do the same thing to start with, ie my $form = $self-formbuilder, which populates the fields from the information in an .fb file. But I need to override some of the field definitions, so I list them separately as a series of $form-field( name = 'name', option = [EMAIL PROTECTED] ). Because this is repeated in both of the methods I thought I could/should factor out the common code to a private sub like this: $self-_override_field_defs($form); but it doesn't work. The only way so far to do it is to put $form in the stash and use $c-forward('_override_field_defs'), then retrieve $form from the stash in _override_field_defs(). Is this the correct way to call sub-routines, via $c-forward and $c-stash? I know about TIMTOWTDI but I want to start off with 'best practice'. -- Richard Jones Leeds, UK mailto:[EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Calling a private sub - best practice
On Mar 14, 2007, at 9:23 AM, RA Jones wrote: Hi folks, Using Cat::Controller::Formbuilder. The background is I have 2 methods that essentially do the same thing to start with, ie my $form = $self-formbuilder, which populates the fields from the information in an .fb file. But I need to override some of the field definitions, so I list them separately as a series of $form- field( name = 'name', option = [EMAIL PROTECTED] ). Because this is repeated in both of the methods I thought I could/ should factor out the common code to a private sub like this: $self-_override_field_defs($form); but it doesn't work. The only way so far to do it is to put $form in the stash and use $c-forward('_override_field_defs'), then retrieve $form from the stash in _override_field_defs(). Is this the correct way to call sub-routines, via $c-forward and $c-stash? I know about TIMTOWTDI but I want to start off with 'best practice'. You can forward $c, which will let you call the form object directly. Adam ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Calling a private sub - best practice
Adam Jacob wrote: On Mar 14, 2007, at 9:23 AM, RA Jones wrote: Is this the correct way to call sub-routines, via $c-forward and $c-stash? I know about TIMTOWTDI but I want to start off with 'best practice'. You can forward $c, which will let you call the form object directly. Adam Doesn't $c get forwarded automatically? All Catalyst methods seem to begin with my ($self, $c) = @_; I tried this: my $form = $c-forward('build_form'); which forwards to the build_form() method which (of course) builds and returns the form. It does work - is that what you had in mind? -- Richard Jones Leeds, UK mailto:[EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] PAR Deployment
Hi all, I am quite new to the framework and was trying to deploy my application as a PAR archive. I have tried to follow all the different ways from the Advent Calendars and also as per PAR::Tutorial and I can't seem to get this to work. I'm sure there have been successful deployments using this method. So, can someone please point me in the right direction for deploying a Catalyst application as a PAR. The servers I'm trying this on are: 1. Mac OS X 10.4.8 (Tiger) 2. Linux i686 GNU/Linux Thanks, Adeola. -- Creative Developer - Digital Craftsmen Ltd Exmouth House, 3 Pine Street London, EC1R 0JH t: +44 20 7183 1410 f: +44 20 7099 5140 m: +44 79 3952 0786 w: http://www.digitalcraftsmen.net/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Calling a private sub - best practice
On Mar 14, 2007, at 9:50 AM, RA Jones wrote: Adam Jacob wrote: On Mar 14, 2007, at 9:23 AM, RA Jones wrote: Is this the correct way to call sub-routines, via $c-forward and $c-stash? I know about TIMTOWTDI but I want to start off with 'best practice'. You can forward $c, which will let you call the form object directly. Adam Doesn't $c get forwarded automatically? All Catalyst methods seem to begin with my ($self, $c) = @_; I tried this: my $form = $c-forward('build_form'); which forwards to the build_form() method which (of course) builds and returns the form. It does work - is that what you had in mind? You don't have to use forward; but if you don't, you have to pass $c directly: sub foo :Local :Form { my ($self, $c) = @_; $self-_call_me($c, ..your args...); } sub _call_me { my ($self, $c) = @_; ... do things to $c ... } There is nothing particularly magical about $c-forward, and in many cases, you are probably better off with a straight method call. (Rather than going through forward) Adam ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] PAR Deployment
On Mar 14, 2007, at 10:21 AM, Adeola Awoyemi wrote: Hi all, I am quite new to the framework and was trying to deploy my application as a PAR archive. I have tried to follow all the different ways from the Advent Calendars and also as per PAR::Tutorial and I can't seem to get this to work. I'm sure there have been successful deployments using this method. So, can someone please point me in the right direction for deploying a Catalyst application as a PAR. The servers I'm trying this on are: 1. Mac OS X 10.4.8 (Tiger) 2. Linux i686 GNU/Linux Hi, Adeola. We'll need some more specifics about what's going wrong for you before we can help. Adam ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [BULK] - [Catalyst] Template Engine
To partially answer my own question here is a great resource for comparing the template systems without having to try each one out. http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html I found it to be a great comparison of the systems. -- Ali Mesdaq Security Researcher Websense Security Labs http://www.WebsenseSecurityLabs.com -- -Original Message- From: Mesdaq, Ali [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 13, 2007 12:00 PM To: The elegant MVC web framework Subject: [BULK] - [Catalyst] Template Engine I just wanted to get everyone's feedback on what they prefer as their templating engine. I know there are a bunch of choices but wanted to see what people think of certain ones. I am looking for something that supports and promotes good practices and cutting edge techniques. -- Ali Mesdaq Security Researcher Websense Security Labs http://www.WebsenseSecurityLabs.com -- ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: logout and go back to previous session?
* hubert depesz lubaczewski [EMAIL PROTECTED] [2007-03-14 06:40]: can you point me to a direction (manual/webpage/example) where i can read about setting session object from 2 different cookies? i.e. with some logic about which session_id to choose. The default modules don’t provide this, from what I can tell. However, C::Session::State::Cookie consists of 100 lines of pretty simple code; just read the source. A patch to support multiple different cookie names would be quite easy to implement. (Or a subclass, failing that.) Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/