David R. Baird | 1 Aug 2004 16:27
Picon

multiple Maypole applications


Hi, 

Maypole has been on my list of things to investigate for a while. I 
finally got the chance over the weekend, wish I'd made the time 
before. It does exactly what it says on the box - applications up and 
running in minutes. Fantastic! 

So I tried adding a second Maypole application to my site, after 
getting the BeerDB thing up and running, but the config of the second 
application overwrites the first. The patch below fixes that, and 
everything seems to work fine. 

--- /.cpan/build/Maypole-1.7/blib/lib/Maypole.pm	Sat Jul 17 20:15:20 
2004
+++ Maypole.pm	  Sun Aug  1 10:26:21 2004
 <at>  <at>  -22,7 +22,8  <at>  <at> 
       # Naughty.
       *{$calling_class."::handler"} = sub { 
Maypole::handler($calling_class,  <at> _) };
     }
-    my $config = $calling_class->config;
+    my $config = {};
+    $calling_class->config($config);
     $config->{model} ||= "Maypole::Model::CDBI";
     $config->{model}->require;
     die "Couldn't load the model class $config->{model}: $ <at> " if $ <at> ;

--

-- 
Dr. David R. Baird
(Continue reading)

David R. Baird | 1 Aug 2004 18:18
Picon

Announce: MasonX::Maypole


Hello,

It seemed more natural to use Mason as a frontend to Maypole, rather 
than as a view, and preferable to use Mason in its normal mode, 
rather than standalone. This module removes most of the 'view' 
processing from the Maypole request cycle, leaving all that to Mason. 
It makes it trivial to add a Maypole app to an existing Mason site. 
Just add a couple of component roots, a simple autohandler and 
dhandler, and off you go. 

d.

------- Forwarded message follows -------
Date sent:      	Sun, 1 Aug 2004 17:31:46 +0200
Subject:        	CPAN Upload: D/DA/DAVEBAIRD/MasonX-Maypole-
0.01.tar.gz
Send reply to:  	cpan-testers . at . perl.org
To:             	"David R. Baird" <dave . at . riverside-cms.co.uk>
From:           	PAUSE <upload . at . pause.fiz-chemie.de>

The uploaded file

    MasonX-Maypole-0.01.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/D/DA/DAVEBAIRD/MasonX-Maypole-0.01.tar.gz
  size: 7962 bytes
   md5: cff0295d0c6b61b82120498a23df9412
(Continue reading)

Michael Freeman | 1 Aug 2004 18:37
Picon

Re: problems with BeerDB

I am trying to customize the BeerDB application and I added a bunch of fields to
the database like a binary picture column and things like that. How do
I customize the 'view' template to only display a few columns in each
row?

Thanks,
Mike
Jesse Sheidlower | 2 Aug 2004 18:51
Picon
Favicon

Dying a good death


Twice recently I've had experiences were some error in a Maypole
application has caused an improperly large set of results to be
displayed. I was wondering if anyone else might have seen this,
or what a good solution could be.

An example was going to http://mysite.com/myDB/mytable/list ,
when there was an error in a dependency (a required module
hadn't been upgraded properly). I got the error message in my
Apache logs, but Maypole skipped the authentication step,
and skipped the pager, returning the full result set at once.
The navbar also displayed with _all_ tables, not just the
display tables, making my sessions table visible, for example.

Needless to say, if there's an error like this I'd prefer to
display an error page, or at least have the application die
utterly with an Internal Server Error, rather than spewing
out my entire database and all the tables to any unauthenticated
user.

Anyone else see anything like this?

Jesse Sheidlower
Simon Cozens | 5 Aug 2004 11:59
Favicon
Gravatar

Re: Re: problems with BeerDB

Michael Freeman:
> I am trying to customize the BeerDB application and I added a bunch of fields to
> the database like a binary picture column and things like that. How do
> I customize the 'view' template to only display a few columns in each
> row?

Um. You write a view template which says what you want it to say. Which bit
of this are you having problems with?

--

-- 
	"The elder gods went to Suggoth and all I got was this lousy T-shirt."
Daniel R. Allen | 5 Aug 2004 11:52

/beerdb only shows directory listing

Hi all,

I don't have sufficient mod_perl-fu to figure this out on my own.

I followed the cookbook examples from
http://maypole.simon-cozens.org/doc/beerdb.html and
http://wiki.simon-cozens.org/index.cgi?InstallationIssues

however, /beerdb on my server shows a directory listing.

I'm using: maypole 1.7; debian stable apache/mod_perl; and fresh
module installs from CPAN of other required modules.

My apache.conf has:

### maypole test ###

<Perl>
   use lib '/home/user/beerdb/lib';
</Perl>

<Location /beerdb>
    SetHandler perl-script
    PerlHandler BeerDB
</Location>

/home/user/beerdb/lib/BeerDB has:

package BeerDB;
use base 'Apache::MVC';
(Continue reading)

Simon Cozens | 5 Aug 2004 12:01
Favicon
Gravatar

Re: multiple Maypole applications

David R. Baird:
> So I tried adding a second Maypole application to my site, after 
> getting the BeerDB thing up and running, but the config of the second 
> application overwrites the first. The patch below fixes that, and 
> everything seems to work fine. 

Applied, thanks. (Although I'm apt to miss patches on maypole <at> ; maypole-dev <at> 
is the best place for them.)

--

-- 
 * Progress (n.): The process through which Usenet has evolved from
smart people in front of dumb terminals to dumb people in front of
smart terminals.  -- obs <at> burnout.demon.co.uk (obscurity)
Simon Cozens | 5 Aug 2004 12:07
Favicon
Gravatar

Re: /beerdb only shows directory listing

Daniel R. Allen:
> When I try to visit of the scripts such as /beerdb/beer/addnew
> I see the text of the script in the browser, and the error log gets:
> file error - beeraddnew: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68.

This is a good sign, it shows that Maypole is actually being used; I'd next
look at putting a 'sub debug { 1 }' inside your BeerDB.pm and see where it
gets you.

--

-- 
Thermodynamics in a nutshell:
1st Law:  You can't win.  (Energy is conserved)
2nd Law:  You can't break even.  (Entropy)
0th Law:  You can't even quit the game.  (Closed systems) -- Taki Kogoma
Daniel R. Allen | 5 Aug 2004 12:26

Re:/beerdb only shows directory listing

Done.  When I visit beerdb/beer/addnew, the error log now shows:

We don't have that action (addnew) at /usr/local/share/perl/5.6.1/Maypole.pm line 100.
file error - beeraddnew: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68.

--
http://kw.pm.org/ - Kitchener-Waterloo Perl Mongers -         da <at> kw.pm.org
http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da <at> coder.com

Simon Cozens said:
> Daniel R. Allen:
> > When I try to visit of the scripts such as /beerdb/beer/addnew
> > I see the text of the script in the browser, and the error log gets:
> > file error - beeraddnew: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68.
>
> This is a good sign, it shows that Maypole is actually being used; I'd next
> look at putting a 'sub debug { 1 }' inside your BeerDB.pm and see where it
> gets you.
>
> --
> Thermodynamics in a nutshell:
> 1st Law:  You can't win.  (Energy is conserved)
> 2nd Law:  You can't break even.  (Entropy)
> 0th Law:  You can't even quit the game.  (Closed systems) -- Taki Kogoma
Simon Cozens | 5 Aug 2004 12:32
Favicon
Gravatar

Re: Re:/beerdb only shows directory listing

Daniel R. Allen:
> Done.  When I visit beerdb/beer/addnew, the error log now shows:
> 
> We don't have that action (addnew) at /usr/local/share/perl/5.6.1/Maypole.pm line 100.
> file error - beeraddnew: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68.

Well, um, that would be because addnew isn't an action. Try /beerdb/beer/list
instead and see what that gives you.

--

-- 
I want you to know that I create nice things like this because it
pleases the Author of my story.  If this bothers you, then your notion
of Authorship needs some revision.  But you can use perl anyway. :-)
    - Larry Wall

Gmane