Re: [cgiapp] Good practices: how many run modes in an app

2005-12-18 Thread Ron Savage
On Sun, 18 Dec 2005 09:19:18 -0500, Cees Hek wrote: Hi Cees > That is the rule I follow as well. The only time the CGI::App Same here. > object sees a DBI handle is when it needs to pass one to a plugin > (like the session plugin). It never ever uses it directly. Right. -- Cheers Ron Savage

[cgiapp] CAP::Config::Simple

2005-12-18 Thread Andrew Brosnan
Hi, While trying to install CAP::Config::Simple (on Mac OS X 10.3.9) I get the following errors from make test: # Failed test 'un readable file' # in t/main.t at line 75. # '' # doesn't match '(?i-xsm:Permission denied)' t/mainNOK 19

Re: [cgiapp] location of instance and application files

2005-12-18 Thread Ron Savage
On Sun, 18 Dec 2005 18:16:20 -0500, Jeff MacDonald wrote: Hi Jeff, > /usr/www/www.mysite.com/www - this dir holds my cgi's my images, my > html /usr/www/www.mysite.com/etc/ - this holds my templates, my > modules etc. Exactly, even though there are so many ways of doing this. Brad, The rules I

Re: [cgiapp] location of instance and application files

2005-12-18 Thread Jeff MacDonald
Hi Brad, I would recommend you make a directory that is outside your webspace to house your modules. If only to keep people from digging around in there. I usually do something like /usr/www/www.mysite.com/www - this dir holds my cgi's my images, my html /usr/www/www.mysite.com/etc/ - this holds

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Jeff MacDonald
yes , sorry about that. On 12/18/05, RA Jones <[EMAIL PROTECTED]> wrote: > On Sun, 18 Dec 2005, Jeff MacDonald <[EMAIL PROTECTED]> wrote: > >I'm at about the same stage of "figuring things out" as you are, I'd > >recommend looking into > > > >C::A::P::Dispatch, it can basically parse your query s

[cgiapp] location of instance and application files

2005-12-18 Thread bradford
Where's the best the place for instance and application files? I thought, originally, that instance scripts would go in my web directory, as in index.cgi, so it would fire automatically. But maybe, if I go with the multi-instance scenario that Jesse just suggested, they should go in my /cgi-bin.

RE: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread bradford
Jesse, Thanks for reeling us back in. You pose a great paradigm. I'm liking it. This approach seems to mirror my pre C::A days where I called a different Perl scripts for each function: or So, your newly suggest approach might look like: or Right? Brad > Hi Richard -- > >> Reading the th

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread RA Jones
Hi Jesse, On Sun, 18 Dec 2005, Jesse Erlbaum <[EMAIL PROTECTED]> wrote: [lots of useful remarks] HTH, Yes it does - but only to muddy the already murky waters ;-) It is a counter argument to the one that suggests the fewer the better. Actually I've no real preference as yet, other than to a

RE: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Jesse Erlbaum
Hi Richard -- > Reading the thread on 'Good practices: how many run modes in > an app' it > is obvious my current application under development is going way over > the 'recommended' upper limit of rm's. I know I need to break it into > smaller units based around functionality, but how? A be

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread RA Jones
On Sun, 18 Dec 2005, Rhesa Rozendaal <[EMAIL PROTECTED]> wrote: Here's a sketch of my app structure as it is now. I show two parts, the main, formerly monolithic CgiApp, and one package with a set of run modes. package My::MainApp; use base qw/My::BaseApp/; # I already have this one; it hand

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread RA Jones
On Sun, 18 Dec 2005, Jeff MacDonald <[EMAIL PROTECTED]> wrote: I'm at about the same stage of "figuring things out" as you are, I'd recommend looking into C::A::P::Dispatch, it can basically parse your query string, to know which module handles which runmode, combine that with AutoRunmodes and y

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Rhesa Rozendaal
[EMAIL PROTECTED] wrote: I'm liking this thread. But I have some elementary questions: package My::MainApp; use base qw/My::BaseApp/; # I already have this one; it handles sessions etc use My::MainApp::Admin; # contains the run modes dealing with admin functions use My::MainApp::News; # anot

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread bradford
I'm liking this thread. But I have some elementary questions: > package My::MainApp; > > use base qw/My::BaseApp/; # I already have this one; it handles sessions > etc > use My::MainApp::Admin; # contains the run modes dealing with admin > functions > use My::MainApp::News; # another example pack

[cgiapp] Re: CGI::Uploader -> making it not generate thumbs, for non images.

2005-12-18 Thread Mark Stosberg
On 2005-12-18, Jeff MacDonald <[EMAIL PROTECTED]> wrote: >'img_1_thmb_1' => { > if_mimetype => '/^image\/.+/', > transform_method => \&gen_thumb, > params => [ w => 100, h => 100 ], > } First, let's rewrite this in the new 2.0 syntax:

RE: [cgiapp] Good practices: how many run modes in an app

2005-12-18 Thread Jesse Erlbaum
Hi Jeff -- > Af few weeks ago, I asked a question about a snazzy way to do a fill > in form in one line > > return > $self->fill_form($self->tt_process({}),$self->dbh->selectrow_h > ashref("SELECT > * from menus WHERE id = ?",{},$id)); > > Since this uses dbh directly, in Krang to do something

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Cees Hek
On 12/18/05, Rhesa Rozendaal <[EMAIL PROTECTED]> wrote: >use base qw/MyApp::Base/; > or >our @ISA = qw/MyApp::Base/; > > is functionally equivalent. I personally prefer the former, since it reads > better. Although they are very similar, there is a minor difference that can be important i

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Rhesa Rozendaal
RA Jones wrote: Reading the thread on 'Good practices: how many run modes in an app' it is obvious my current application under development is going way over the 'recommended' upper limit of rm's. I know I need to break it into smaller units based around functionality, but how? I had an app l

Re: [cgiapp] Simple Implementation of Ajax.pm

2005-12-18 Thread Bruce McKenzie
Here is a simple implementation of a form created with CGI::Appication, Template-Toolkit, and CGI::Ajax that will process changed fields without submitting and re-drawing the form. Thanks to all for your help. Cheers, Bruce webapp pl ## #!/usr/bin/perl use WebApp; my $

Re: [cgiapp] Number of rm's best practice (more)

2005-12-18 Thread Jeff MacDonald
I'm at about the same stage of "figuring things out" as you are, I'd recommend looking into C::A::P::Dispatch, it can basically parse your query string, to know which module handles which runmode, combine that with AutoRunmodes and you get a pretty cool setup. Jeff. On 12/18/05, RA Jones <[EMAIL

[cgiapp] Number of rm's best practice (more)

2005-12-18 Thread RA Jones
Reading the thread on 'Good practices: how many run modes in an app' it is obvious my current application under development is going way over the 'recommended' upper limit of rm's. I know I need to break it into smaller units based around functionality, but how? At the moment my main applicati

[cgiapp] CGI::Uploader -> making it not generate thumbs, for non images.

2005-12-18 Thread Jeff MacDonald
I was thinking of doing something like this my $u = CGI::Uploader->new( spec => { file => { gen_files => { 'img_1_thmb_1' => { if_mimetype => '/^image\/.+/', transform_method => \&gen_thumb, params => [ w => 100, h => 100

Re: [cgiapp] Good practices: how many run modes in an app

2005-12-18 Thread Jeff MacDonald
Jesse, Af few weeks ago, I asked a question about a snazzy way to do a fill in form in one line return $self->fill_form($self->tt_process({}),$self->dbh->selectrow_hashref("SELECT * from menus WHERE id = ?",{},$id)); Since this uses dbh directly, in Krang to do something similar does that mean

Re: [cgiapp] Good practices: how many run modes in an app

2005-12-18 Thread Cees Hek
On 12/18/05, Jesse Erlbaum <[EMAIL PROTECTED]> wrote: > Just regarding the last part, "business objects" -- [snip] > CGI::Application modules are prohibited from having or using DBI > database handles. That is the rule I follow as well. The only time the CGI::App object sees a DBI handle is whe

RE: [cgiapp] Good practices: how many run modes in an app

2005-12-18 Thread Jesse Erlbaum
Hi Rob -- > I would break each of them up into functional areas. My rule of thumb > is never more than 12, rarely more than 6, preferably 4 or less. > Anything more and I'm trying to do too much in the controller and > should be offloading into business objects. Just regarding the last part, "b