[cgiapp] [ANNOUNCE] Module-Starter-Plugin-CGIApp 0.21

2010-03-03 Thread Jaldhar H. Vyas
I've finally fixed the Windows issues and uploaded version 0.21 to CPAN.

-- 
Jaldhar H. Vyas jald...@braincells.com

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




[cgiapp] C::A::P::Routes

2010-03-03 Thread P Kishor
A while back I attempted working with CAPRoutes, but failed. Today I
decided to revisit it, and failed again. In fact, I am failing at
getting the simplest possible application running with it, and I am
wondering -- either I am completely clueless about how this is
supposed to work, or this module is just not what it claims to be. I
will go with the former assumption, and ask for the list's help here.

My app script is a simple

use App;

my $w = App-new(
TMPL_PATH = /Sites/app/_tmpl,
PARAMS= {
   ..
},
);
$w-run();

in my App.pm package, I have

sub setup {
my $self = shift;

$self-routes_root('/app');
$self-routes([
'foo/:page?' = 'foo',
'/:page?'  = 'foo',
''= 'foo',
'bar/:page'   = 'bar',
'baz/:page'  = 'baz',
]);

$self-start_mode('foo');
$self-tmpl_path( '/Sites/app/_tmpl' );
}

Ok. Here is all that goes wrong --

1. Why do I need to provide $self-tmpl_path( '/Sites/app/_tmpl' ); in
my App.pm even though I have TMPL_PATH = /Sites/app/_tmpl, in my
app.cgi? (this is not a CAPRoutes specific question). If I comment out
$self-tmpl_path, the script errors out. If that is what is needed,
then why even give me the option of declaring TMPL_PATH in my app.cgi?

2. I have CAPRoutes 1.02. If I do a simple 'my $debug =
$self-routes_dbg;' in a run mode in my App.pm, the script dies with
the error that Undefined subroutine
CGI::Application::Plugin::Routes::Dumper called at
/usr/local/lib/perl5/site_perl/5.10.1/CGI/Application/Plugin/Routes.pm
line 49. Line 48, 49 happen to be

require Data::Dumper;
return Dumper($self-{'Application::Plugin::Routes::__r_params'});

If I replace 'require Data::Dumper' with 'use Data::Dumper' the error
goes away, but nothing is dumped out. The
$self-{'Application::Plugin::Routes::__r_params'} var is completely
empty.

3. Finally, CAPRoutes doesn't seem to match any routes at all. No
matter what my path_info, it always defaults to the start mode 'foo'.

So, please, please let me be the clueless one here and set me right,
otherwise, it will be baffling how a module that doesn't work at all
got onto CPAN.

Many thanks,


-- 
Puneet Kishor

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] C::A::P::Routes

2010-03-03 Thread Ron Savage
Hi

On Wed, 2010-03-03 at 15:56 -0600, P Kishor wrote:
 A while back I attempted working with CAPRoutes, but failed. Today I
 decided to revisit it, and failed again. In fact, I am failing at

I've never used it. CGI::Application::Dispatch is superb, so that's what
I'm sticking with.

Not only that, but with the availability of
CGI::Application::Dispatch::PSGI, we can move effortlessly to Plack. I
already have.

Then, when you want to embrace more and more of Plack, you might try
Plack::App::URLMap, etc.
-- 
Ron Savage
r...@savage.net.au
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] C::A::P::Routes

2010-03-03 Thread P Kishor
On Wed, Mar 3, 2010 at 4:33 PM, Ron Savage r...@savage.net.au wrote:
 Hi

 On Wed, 2010-03-03 at 15:56 -0600, P Kishor wrote:
 A while back I attempted working with CAPRoutes, but failed. Today I
 decided to revisit it, and failed again. In fact, I am failing at

 I've never used it. CGI::Application::Dispatch is superb, so that's what
 I'm sticking with.


I do use CAD in another application, and yes, that works rather well.
For a number of reasons, I want to explore CAPRoute. In fact, one
thing I don't like about CAD is that it breaks the (to me) established
formula of extending a CA application's functionality via a plugin. I
don't want all that routing table stuff in my instance script. I want
it in my App.pm, along with all the run modes.

In any case, this post is an attempt to make CAPRoutes work for me,
not to discount it in favor of CAD.

Thanks,

 Not only that, but with the availability of
 CGI::Application::Dispatch::PSGI, we can move effortlessly to Plack. I
 already have.

 Then, when you want to embrace more and more of Plack, you might try
 Plack::App::URLMap, etc.






-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] C::A::P::Routes

2010-03-03 Thread Michael Peters
On 03/03/2010 05:58 PM, P Kishor wrote:

 I do use CAD in another application, and yes, that works rather well.
 For a number of reasons, I want to explore CAPRoute. In fact, one
 thing I don't like about CAD is that it breaks the (to me) established
 formula of extending a CA application's functionality via a plugin.

In fact, there are lots of C::A related modules that aren't plugins:

CGI::Application::FastCGI
CGI::Application::PSGI
CGI::Application::Server

And you'll note that they're all concerned about what happens before 
your application module begins to do it's thing. Dispatch has to happen 
outside of your application module because it in fact picks which 
application module to run based on the URI.

 I
 don't want all that routing table stuff in my instance script. I want
 it in my App.pm, along with all the run modes.

This will only work in very simple situations where you only have a 
single application module. I try to not have more than a dozen run modes 
in any application file, and all but the simplest of applications will 
have more than that.

-- 
Michael Peters
Plus Three, LP

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




[cgiapp] [ANNOUNCE] Module-Starter-Plugin-CGIApp 0.22

2010-03-03 Thread Jaldhar H. Vyas
This is probably it for now.  It came to my attention that I was not 
following best practices for the signature test (t/00-signature.t)  so 
this has been fixed in this release.

Also some unneeded dependencies have been removed from the generated 
dists' build scripts and in M-S-P-CGIApp itself.

-- 
Jaldhar H. Vyas jald...@braincells.com

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####