Re: [Catalyst] component's new() call browser dependent

2008-01-13 Thread Juan Camacho
On Jan 13, 2008 7:17 PM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
>
>
> On Sun, 2008-01-13 at 19:11 -0500, Juan Camacho wrote:
> > I found something quite strange. When I use Firefox the model's new
> > method is called for each request, but if I use IE it doesn't.  This
> > is under mod_perl. Is this behavior by design?  Have I missed some
> > documentation on this?
>
> Can you provide a test case (just some code I can run to try to
> reproduce this)?  It would be best if this works against the dev server
> instead of mod_perl.
>

I've been simply printing to STDERR in my model new method, e.g.

use strict;
use warnings;
use base qw|Catalyst::Component::ACCEPT_CONTEXT Catalyst::Model
Class::Accessor::Fast|;
use NEXT;

package MyApp::Model::Foo;

sub new {
my $self = shift->NEXT::new(@_);
print STDERR __PACKAGE__ . "::new called";
return $self;
}

sub something_else { print STDERR "something_else called\n" }

Do you still need some code? Should new be called for every request or
is there some intentional session caching going on?

Juan

___
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] component's new() call browser dependent

2008-01-13 Thread Juan Camacho
I found something quite strange. When I use Firefox the model's new
method is called for each request, but if I use IE it doesn't.  This
is under mod_perl. Is this behavior by design?  Have I missed some
documentation on this?

Thanks, Juan

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Comprehensive Tutorials Needed

2007-12-16 Thread Juan Camacho
On Dec 16, 2007 3:41 AM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
>
> On Sun, 2007-12-16 at 15:40 +0800, Tony Winslow wrote:
> > Hi, all!
> >
> > I'm new to Catalyst. I'm eager to learn it.
> > Yet I cannot find a systematic book or
> > tutorial about it. Can anyone here help
> > me find one or even write one for the world?
>
> Good timing.  My Catalyst book is now shipping:
>

What no free chapters to entice buyers? :)

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] expand CGI::FormBuilder

2007-11-24 Thread Juan Camacho
On Nov 23, 2007 4:04 AM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

> So what you need to do is do something like:
>
>package MyApp::FormBuilder::Action;
>use base 'Catalyst::Controller::FormBuilder::Action::TT'; # or Mason etc.
>sub _create_formbuilder { shift; return MyApp::FormBuilder->new(@_) }
>1;
>
> Then configure Catalyst::Controller::FormBuilder to use it:
>
>$config->{Controller::FormBuilder}{action} = 'MyApp::FormBuilder::Action';
>
> That should do it.  This is totally untested though, so good luck.
>

Yep, that should do it although _create_formbuilder is private and
undocumented :) Also, I haven't documented the C::C::F::Action class
or the 'action' config parameter mostly because I'm not sure I am
going to keep the Action implementation around. I use C::C::F::Action
subclasses in my own applications, so I *probably* will.

Matt's suggestion is good and makes the above unnecessary for this
case. Simply add support for
$config->{Controller::FormBuilder}{formbuilder_class} =
'My::Own::FormBuilder'.  This will help with the simple cases where
you just want to swap CGI::FormBuilder with a subclass or an adapter
pattern class instead.

Juan

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/