From ggorman@equal-time.com Sat May 1 21:41:12 2004 From: ggorman@equal-time.com (Gary Gorman) Date: Sat, 1 May 2004 15:41:12 -0500 Subject: [Maypole] FW: Apache::Request Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_003B_01C42F92.BB1B0F60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit -----Original Message----- From: Gary Gorman [mailto:ggorman@kc.rr.com] Sent: Saturday, May 01, 2004 3:37 PM To: Gary Gorman Subject: FW: Apache::Request -----Original Message----- From: Gary Gorman [mailto:ggorman@kc.rr.com] Sent: Friday, April 30, 2004 7:07 PM To: maypole@lists.netthink.co.uk Subject: Apache::Request I'm trying to get Maypole to work on my Apache web server but it seems it's not compatible with Apache2. It seems like the problem is in the version of mod_perl I'm using - mod_perl-1.99. libapreq requires I install a version < 1.99. The problem is these lessor versions are not compatible with Apache2. Is there a work-around for this? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 ------=_NextPart_000_003B_01C42F92.BB1B0F60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
-----Original Message-----
From: Gary Gorman=20 [mailto:ggorman@kc.rr.com]
Sent: Saturday, May 01, 2004 3:37=20 PM
To: Gary Gorman
Subject: FW:=20 Apache::Request

 
-----Original Message-----
From: Gary Gorman=20 [mailto:ggorman@kc.rr.com]
Sent: Friday, April 30, 2004 7:07=20 PM
To: maypole@lists.netthink.co.uk
Subject:=20 Apache::Request

I'm = trying to get=20 Maypole to work on my Apache web server but it seems it's not compatible = with=20 Apache2. It seems like the problem is in the version of mod_perl I'm = using -=20 mod_perl-1.99. libapreq requires I install a version < 1.99. The = problem is=20 these lessor versions are not compatible with Apache2. Is there a = work-around=20 for this?

Gary = Gorman 

Owner -=20 Equal-time.com
9045 Grand=20 Ave.
Kansas = City, MO=20 64114
816-523-0486  

 

 
------=_NextPart_000_003B_01C42F92.BB1B0F60-- From simon@simon-cozens.org Sat May 1 21:47:37 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sat, 1 May 2004 21:47:37 +0100 Subject: [Maypole] FW: Apache::Request In-Reply-To: References: Message-ID: <20040501204737.GA11388@alibi.simon-cozens.org> Gary Gorman: > I'm trying to get Maypole to work on my Apache web server but it seems it's > not compatible with Apache2. It seems like the problem is in the version of > mod_perl I'm using - mod_perl-1.99. libapreq requires I install a version < > 1.99. The problem is these lessor versions are not compatible with Apache2. > Is there a work-around for this? Yep, and it's called CGI::Maypole; it comes with Maypole. See its documentation. To be honest, I don't know how to get it to work as an Apache2 handler, (I have no knowledge of Apache2 and how it differs from mod_perl) whether there's anything special you can do rather than just running it as a (persistent?) CGI script. Has anyone got Maypole working under Apache2? -- "I think i'll take my girlfriend to vegas for a win'98 burn/upgrade...." -- Megahal (trained on asr), 1998-11-06 From michael@diaspora.gen.nz Sat May 1 23:30:54 2004 From: michael@diaspora.gen.nz (michael@diaspora.gen.nz) Date: Sun, 02 May 2004 10:30:54 +1200 Subject: [Maypole] FW: Apache::Request In-Reply-To: Your message of "Sat, 01 May 2004 21:47:37 +0100." <20040501204737.GA11388@alibi.simon-cozens.org> Message-ID: Simon Cozens writes: >Yep, and it's called CGI::Maypole; it comes with Maypole. See its >documentation. To be honest, I don't know how to get it to work as an Apache2 >handler, (I have no knowledge of Apache2 and how it differs from mod_perl) >whether there's anything special you can do rather than just running it as a >(persistent?) CGI script. Has anyone got Maypole working under Apache2? I had a go at it. Something like the following diff got me most of the way, but it's not a "proper" port according to the mod_perl 2.0 documentation, and ISTR that I then had input handling problems, so I eventually just installed Apache 1.3 and mod_perl 1.0 instead. It's on my list to investigate, but there are a few things ahead of it. -- michael. --- MVC.pm.old 2004-05-02 10:27:36.000000000 +1200 +++ MVC.pm 2004-05-02 10:27:43.000000000 +1200 @@ -1,6 +1,7 @@ package Apache::MVC; use base 'Maypole'; -use Apache; +use Apache2; +use Apache::compat; use Apache::Request; use strict; use warnings; From ggorman@kc.rr.com Sat May 1 01:07:15 2004 From: ggorman@kc.rr.com (Gary Gorman) Date: Fri, 30 Apr 2004 19:07:15 -0500 Subject: [Maypole] Apache::Request Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C42EE6.59B7A5A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I'm trying to get Maypole to work on my Apache web server but it seems it's not compatible with Apache2. It seems like the problem is in the version of mod_perl I'm using - mod_perl-1.99. libapreq requires I install a version < 1.99. The problem is these lessor versions are not compatible with Apache2. Is there a work-around for this? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 ------=_NextPart_000_0000_01C42EE6.59B7A5A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm = trying to get=20 Maypole to work on my Apache web server but it seems it's not compatible = with=20 Apache2. It seems like the problem is in the version of mod_perl I'm = using -=20 mod_perl-1.99. libapreq requires I install a version < 1.99. The = problem is=20 these lessor versions are not compatible with Apache2. Is there a = work-around=20 for this?

Gary Gorman 

Owner -=20 Equal-time.com
9045 Grand=20 Ave.
Kansas = City, MO=20 64114
816-523-0486  

 

 
------=_NextPart_000_0000_01C42EE6.59B7A5A0-- From rlucas@tercent.net Sat May 1 23:35:09 2004 From: rlucas@tercent.net (Randall Lucas) Date: Sat, 1 May 2004 15:35:09 -0700 Subject: [Maypole] FW: Apache::Request In-Reply-To: <20040501204737.GA11388@alibi.simon-cozens.org> Message-ID: I haven't used Maypole with Apache2, but folks should be aware that CGI support in Apache 2 is really not production-quality. For example, CGIs writing modest quantities to STDERR will hang the server; see http://blogs.law.harvard.edu/rlucas/2004/04/01#a32 Randall On Saturday, May 1, 2004, at 01:47 PM, Simon Cozens wrote: > Gary Gorman: >> I'm trying to get Maypole to work on my Apache web server but it >> seems it's >> not compatible with Apache2. It seems like the problem is in the >> version of >> mod_perl I'm using - mod_perl-1.99. libapreq requires I install a >> version < >> 1.99. The problem is these lessor versions are not compatible with >> Apache2. >> Is there a work-around for this? > > Yep, and it's called CGI::Maypole; it comes with Maypole. See its > documentation. To be honest, I don't know how to get it to work as an > Apache2 > handler, (I have no knowledge of Apache2 and how it differs from > mod_perl) > whether there's anything special you can do rather than just running > it as a > (persistent?) CGI script. Has anyone got Maypole working under Apache2? > > -- > "I think i'll take my girlfriend to vegas for a win'98 > burn/upgrade...." > -- Megahal (trained on asr), 1998-11-06 > > _______________________________________________ > maypole mailing list > maypole@lists.netthink.co.uk > http://lists.netthink.co.uk/listinfo/maypole > From ggorman@equal-time.com Sun May 2 00:12:17 2004 From: ggorman@equal-time.com (Gary Gorman) Date: Sat, 1 May 2004 18:12:17 -0500 Subject: [Maypole] Running the BeerDB Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C42FA7.D68E2420 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I think I have gotten past the Apache::Requester issue, but now I'm encountering another issue. My error log is reporting the following: "Base class package "Apache::MVC" is empty. (Perhaps you need to 'use' the module which defines that package first.)" It goes on to say: "/usr/local/apache2/lib/perl/BeerDB.pm line 2\nBEGIN failed--compilation aborted at /usr/local/apache2/lib/perl/BeerDB.pm line 2.\nCompilation failed in require at (eval 4) line 3." The given path is where I put BeerDB.pm, MVC.pm, and Request.pm so they could be found by @INC, but they are owned by root. Does this matter? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 ------=_NextPart_000_0000_01C42FA7.D68E2420 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="winmail.dat" eJ8+IhEXAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEGgAMADgAAANQHBQABABIADAAAAAYABQEB A5AGACgHAAAiAAAACwACAAEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAADADYAAAAAAB4AcAAB AAAAEwAAAFJ1bm5pbmcgdGhlIEJlZXJEQgAAAgFxAAEAAAAWAAAAAcQv0bjTk9Z3bINuSEOBn9fC DL8UYAAAAgEdDAEAAAAcAAAAU01UUDpHR09STUFOQEVRVUFMLVRJTUUuQ09NAAsAAQ4AAAAAQAAG DgBgurTRL8QBAgEKDgEAAAAYAAAAAAAAADQiQZfSVjZNi3XZtWcYXR/CgAAACwAfDgEAAAACAQkQ AQAAACcDAAAjAwAAbQQAAExaRnVLEkJUAwAKAHJjcGcxMjUWMgD4C2BuDhAwMzNPAfcCpAPjAgBj aArAc/BldDAgBxMCgwBQBOUxAgBwcnEOUBDYUGHgcHlydXMCgxLxEHVbEs0ReDMDRRT/QwnwdG0I cHkGABVwbwbwBuBvKmsCgH0KgXYIkHdr6QuAZDQMYGMAUAsDC7WgIEkgdGgLgGsbUcEVgHZlIGdv AkAJ8LogCrBzBUAbgBwwQQqwgRVwZTo6UmVxClAbHOAEkCAEAQpQLCBiEnUFQG5vB+BJJ212IAnw BaB1AjAGcQ8gIG8AcBxgHSAeVS4KogqATX8YkASQA2AFwAkAIFAEACC9CXBwCREgMh0SAhBsCQCb A/APIDohVCFUIkIc0B0cMGMLYAQRHWFrYWeFHDAiHVZNVkMiInIEZW0FMHkuIChQ6wSQFYBwBCB5 CGAfEAngimQbcG8DMGIgJxQAPGUnCiARUB0DBGF1bO0cMHcbkBVwIAEBC4AHkT0bgGEFQCW2KwAR EHQu9CkiJDpJBUAcUAeRAiChKMJzYXk6JiAvFADUci8JAGMHQC8TwB1ywjIu8GliL3AEkC9AgkIJ 4HJEQi5wH4ALL+AogCAOUFxuQkU4R0lOI4ALcCpQZC3eLQWgJ1ADECuAaS3xAaD/CREooSuBLr8v zzDYIUAxgP8IUDKoMgQeYAOgCXAd8CxAIxwwK4EoZXYHQCA0UikxBDMuLKtUHSFn/mkcIByiG4Ai ciqABJAcMP0bYHAe8TB3HsAmwT0TAHD3KLAd1TDScyjgHREYkB/BemwosGIjch/gP5EYkED9MdBD HsQ/AwrAHDAfMCiA70AjA2AcYCeQRC2yG4EEIHMAwBxxcj8kOgr0HyFpMGRjdGwKsRH0MjjsIEcK wBiQRwWwFvMUcrwyNCmwJDUWkhsiT0GxsQXALSBFHfAHQC0jAH0HgC4ygRRRRzExEhaBIFA5MDQ1 RfByPeJBdxwgIUBJu0sAcRzQGCBpAydwPUFPIDY0MTFDGjBJuzgxNi0OQDPyLUqQODYDMUnCRvIk Or9HRlBvRFULtiFjGXEAU8AACwABgAggBgAAAAAAwAAAAAAAAEYAAAAAA4UAAAAAAAADAA+ACCAG AAAAAADAAAAAAAAARgAAAAAQhQAAAAAAAAMAFIAIIAYAAAAAAMAAAAAAAABGAAAAAAGFAAAAAAAA AwBIgAggBgAAAAAAwAAAAAAAAEYAAAAAUoUAAHN5AQALAFWACCAGAAAAAADAAAAAAAAARgAAAAAO hQAAAAAAAAMAV4AIIAYAAAAAAMAAAAAAAABGAAAAABGFAAAAAAAAAwBYgAggBgAAAAAAwAAAAAAA AEYAAAAAGIUAAAAAAAAeAG2ACCAGAAAAAADAAAAAAAAARgAAAABUhQAAAQAAAAQAAAA5LjAACwB5 gAggBgAAAAAAwAAAAAAAAEYAAAAABoUAAAAAAAALAJKACCAGAAAAAADAAAAAAAAARgAAAACChQAA AQAAAAIB+A8BAAAAEAAAADQiQZfSVjZNi3XZtWcYXR8CAfoPAQAAABAAAAA0IkGX0lY2TYt12bVn GF0fAgH7DwEAAACmAAAAAAAAADihuxAF5RAaobsIACsqVsIAAFBTVFBSWC5ETEwAAAAAAAAAAE5J VEH5v7gBAKoAN9luAAAAQzpcRG9jdW1lbnRzIGFuZCBTZXR0aW5nc1xnZ29ybWFuMVxMb2NhbCBT ZXR0aW5nc1xBcHBsaWNhdGlvbiBEYXRhXE1pY3Jvc29mdFxPdXRsb29rXFBlcnNvbmFsIEZvbGRl cnMoMSkucHN0AAAAAwD+DwUAAAADAA00/TcAAAIBfwABAAAANgAAADxER0VOSUxIRk9OSkhDR0lQ SVBFSkNFR0JDTkFBLmdnb3JtYW5AZXF1YWwtdGltZS5jb20+AAAAAwAGELM3K5wDAAcQNAIAAAMA EBAAAAAAAwAREAAAAAAeAAgQAQAAAGUAAABJVEhJTktJSEFWRUdPVFRFTlBBU1RUSEVBUEFDSEU6 OlJFUVVFU1RFUklTU1VFLEJVVE5PV0lNRU5DT1VOVEVSSU5HQU5PVEhFUklTU1VFTVlFUlJPUkxP R0lTUkVQT1JUSU5HAAAAAE+y ------=_NextPart_000_0000_01C42FA7.D68E2420-- From simon@simon-cozens.org Sun May 2 00:23:38 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sun, 2 May 2004 00:23:38 +0100 Subject: [Maypole] FW: Apache::Request In-Reply-To: References: <20040501204737.GA11388@alibi.simon-cozens.org> Message-ID: <20040501232338.GB16924@alibi.simon-cozens.org> According to Chia-liang Kao, the right thing is: 1) use CGI::Maypole instead of Apache::MVC. 2) Put something like this in your httpd.conf: PerlModule Apache2 PerlModule Apache::compat PerlModule CGI #PerlInitHandler Apache::StatINC PerlModule Apache::Reload PerlInitHandler Apache::Reload SetHandler perl-script PerlHandler BeerDB -- "He was a modest, good-humored boy. It was Oxford that made him insufferable." From simon@simon-cozens.org Sun May 2 00:27:07 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sun, 2 May 2004 00:27:07 +0100 Subject: [Maypole] Running the BeerDB In-Reply-To: References: Message-ID: <20040501232707.GA19961@alibi.simon-cozens.org> Gary Gorman: > "Base class package "Apache::MVC" is empty. (Perhaps you need to 'use' the > module which defines that package first.)" This usually means you haven't installed Maypole properly. > The given path is where I put BeerDB.pm, MVC.pm, and Request.pm so they > could be found by @INC, but they are owned by root. Does this matter? Um. Yes, in all kinds of ways. Try perl -MCPAN -e 'install Apache::MVC' or better perl -MCPAN -e 'install CPANPLUS' perl -MCPANPLUS -e 'install Apache::MVC' Repeat the above commands until 'perl -MApache::MVC -e1' doesn't give an error. -- TorgoX: you're rapidly learning, I see, that XML is a fucking piece of festering shit which has no more justification for walking God's clean earth than a dung beetle with diarrhoea. From rlucas@tercent.net Sun May 2 00:26:22 2004 From: rlucas@tercent.net (Randall Lucas) Date: Sat, 1 May 2004 16:26:22 -0700 Subject: [Maypole] Running the BeerDB In-Reply-To: Message-ID: Gary, If I understand that you put MVC.pm in that directory, you'll have problems. MVC.pm -- which you should probably install via CPAN or make install, rather than to a temporary lib -- is the file containing package Apache::MVC. As such, it needs to be in subdir Apache/ from a path in your lib. If you use lib ~/mybeerdb; ~/mybeerdb/BeerDB.pm Package BeerDB ~/mybeerdb/Apache/MVC.pm Pacakge Apache::MVC ~/mybeerdb/Apache/Request.pm Package Apache::Request But you should probably be installing Apache::MVC and Apache::Request via their make install methods to your standard perl library location, anyhow. Apologies if you knew this. As far as permissions, the webserver needs read perms to all the modules. Randall On Saturday, May 1, 2004, at 04:12 PM, Gary Gorman wrote: > I think I have gotten past the Apache::Requester issue, but now I'm > encountering another issue. > My error log is reporting the following: > > "Base class package "Apache::MVC" is empty. (Perhaps you need to 'use' > the > module which defines that package first.)" > > It goes on to say: "/usr/local/apache2/lib/perl/BeerDB.pm line 2\nBEGIN > failed--compilation aborted at /usr/local/apache2/lib/perl/BeerDB.pm > line > 2.\nCompilation failed in require at (eval 4) line 3." > > The given path is where I put BeerDB.pm, MVC.pm, and Request.pm so they > could be found by @INC, but they are owned by root. Does this matter? > > Gary Gorman > Owner - Equal-time.com > 9045 Grand Ave. > Kansas City, MO 64114 > 816-523-0486 > > > > > > > From simon@simon-cozens.org Sun May 2 01:06:49 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sun, 2 May 2004 01:06:49 +0100 Subject: [Maypole] Running the BeerDB In-Reply-To: References: Message-ID: <20040502000649.GB21441@alibi.simon-cozens.org> Randall Lucas: > If I understand that you put MVC.pm in that directory, you'll have > problems. MVC.pm -- which you should probably install via CPAN or make > install, rather than to a temporary lib To amplify that: Maypole requires about twenty modules directly, which between them require between fifty to a hundred packages. At least. Trying to install them all manually and keep track of the dependencies *will* drive you mad. Automate it with CPAN or CPANPLUS, or the ports system for *BSD. Or else we'll see you in 2005, because you might have satisfied all the dependencies by hand by then. -- Sendmail may be safely run set-user-id to root. -- Eric Allman, "Sendmail Installation Guide" From forehead@4red.org Sun May 2 08:43:57 2004 From: forehead@4red.org (forehead) Date: Sun, 2 May 2004 15:43:57 +0800 Subject: [Maypole] create with sql-function values Message-ID: hi, maypole here are two questions. 1. when I create the Class::DBI object , like this: user->create({ username => $username, password => $password, create_on => 'now()' }); here the create_on column is a 'datetime' one , the the value 'now()' will not give the object right stuff what I expected. I browser the Class::DBI source code and find that the value here given will pass as $sth->execute(@values). so we can not use the database's method for more convient use. so here must give the real date like '2004-05-04'. any idea to give the convient solution when meet such situation£¿ 2. the table data will map to perl class-object. sometimes i need the objects orgnized as a tree( the data struct), which has parents and children, and when delete one, it will delete the children. or other any data struct , any idea to implement that for more convient , write a abstract tree class or a Class::DBI:Plugin ? any good idea? may the question more about the Class::DBI, but since maypole is almost use that modules features and give the magic solution for web-based application, so I want more ideas about how to meet the more complex situations. thanks for any comments. ---------------------- forehead (Chun Sheng) forehead@4red.org 2004-04-27 From tony-maypole@kasei.com Sun May 2 09:27:03 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Sun, 2 May 2004 09:27:03 +0100 Subject: [Maypole] create with sql-function values In-Reply-To: References: Message-ID: <20040502082703.GA14715@soto.kasei.com> On Sun, May 02, 2004 at 03:43:57PM +0800, forehead wrote: > user->create({ > username => $username, > password => $password, > create_on => 'now()' > }); This is setting the create_on to the literal value 'now()', which, as you say, isn't waht you want. There's a discussion to how to do something like this on the CLass::DBI wiki: http://www.class-dbi.com/cgi-bin/wiki/index.cgi?SettingDefaultValues Tony From simon@simon-cozens.org Sun May 2 09:32:41 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sun, 2 May 2004 09:32:41 +0100 Subject: [Maypole] create with sql-function values In-Reply-To: References: Message-ID: <20040502083241.GA14015@alibi.simon-cozens.org> forehead: > 1. when I create the Class::DBI object , like this: > user->create({ > username => $username, > password => $password, > create_on => 'now()' > }); > > here the create_on column is a 'datetime' one , the the value 'now()' > will not give the object right stuff what I expected. Class::DBI problem. > 2. the table data will map to perl class-object. sometimes i need the objects > orgnized as a tree( the data struct), which has parents and children, and when > delete one, it will delete the children. or other any data struct , any idea to > implement that for more convient , write a abstract tree class or a Class::DBI:Plugin ? > any good idea? Class::DBI problem. However, if you've set up the relationships properly: MyThing::Node->has_a(parent => "MyThing::Node"); MyThing::Node->has_a(child => "MyThing::Node"); MyThing::Node->has_a(sibling => "MyThing::Node"); you should be able to set up triggers to give you the appropriate cascading delete: MyThing::Node->add_trigger(before_delete => sub { my $self = shift; $self->child && $self->child->delete; $self->sibling && $self->sibling->delete; }); > may the question more about the Class::DBI, but since maypole is > almost use that modules features Maypole uses Perl, but that doesn't mean this is the best place to ask generic Perl questions... :) -- I've looked at the listing, and it's right! -- Joel Halpern From marcus@thefeed.no Sun May 2 18:29:06 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Sun, 2 May 2004 19:29:06 +0200 Subject: [Maypole] (no subject) Message-ID: <36C19D12-9C5E-11D8-906B-000A956D773E@thefeed.no> Hi. I Had testing problems on the latest CVS, turned out my CDBI::AsForm was too old. Attached a patch to Makefile.PL. Is this the wanted format for patches? Marcus Index: Makefile.PL =================================================================== RCS file: /var/cvs/modules/Apache-MVC/Makefile.PL,v retrieving revision 1.16 diff -r1.16 Makefile.PL 13,14c13,14 < Class::DBI::AsForm => 0, < Class::DBI::FromCGI => 0, --- > Class::DBI::AsForm => 2.2, > Class::DBI::FromCGI => 0.94, From bg271828@yahoo.com Sun May 2 19:51:50 2004 From: bg271828@yahoo.com (Your Name) Date: Sun, 2 May 2004 11:51:50 -0700 (PDT) Subject: [Maypole] Searching in Maypole Message-ID: <20040502185150.53021.qmail@web50006.mail.yahoo.com> I'm just learning about Maypole - neat article on perl.com - and I wonder how do you search? The built in search routine just does LIKE '$foo%' searches. What if you want to do = searches, or searches with '$foo < $bar AND $foo > $baz', or searches with '$foo IN $x, $y, $z"? And what about stripping bad characters from a form-field search string, in case someone tries to search for '%something' and you don't want that? Maypole looks nice, but it's function would be better if you could do complicated things instead of just simple stuff. Jen __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover From simon@simon-cozens.org Sun May 2 21:24:50 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sun, 2 May 2004 21:24:50 +0100 Subject: [Maypole] Searching in Maypole In-Reply-To: <20040502185150.53021.qmail@web50006.mail.yahoo.com> References: <20040502185150.53021.qmail@web50006.mail.yahoo.com> Message-ID: <20040502202450.GA8267@alibi.simon-cozens.org> Your Name: > I'm just learning about Maypole - neat article on > perl.com - and I wonder how do you search? Currently, you write a routine that does the kind of searching you want. In the near future, I'll be revamping the built-in search support a little. > Maypole looks nice, but it's function would be better > if you could do complicated things instead of just > simple stuff. You can do complicated things with it, but not for free. You can do anything you want with it. I wrote a social network site. I wrote an e-commerce site. I wrote a portal. None of these are like the default Maypole actions - did you take a look at the second article where I explained how to extend Maypole? I think Maypole is too powerful. Because you can write a reasonably good application with very few lines of code, people get the feeling that you ought be able to write any application you want with no additional lines of code. If Maypole did less, people would be happier with extending it to do what they want. If Maypole provided no searching support at all, people wouldn't be surprised that the searching didn't do what they wanted. Ah well, it's done now. -- This is exactly how the World Wide Web works: the HTML files are the pithy description on the paper tape, and your Web browser is Ronald Reagan. - Neal Stephenson From allen@hutchison.org Mon May 3 04:51:58 2004 From: allen@hutchison.org (Allen Hutchison) Date: Sun, 2 May 2004 20:51:58 -0700 Subject: [Maypole] CGI install problem... Message-ID: <39DDAA6B-9CB5-11D8-8BE1-000A9599D542@hutchison.org> I'm trying to get the BeerDB working with Maypole::CGI. I'm getting the following error: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.0/CGI/Maypole.pm line 39, line 3077. file error - beer.cgi: not found at /usr/lib/perl5/site_perl/5.8.0/Maypole/View/Base.pm line 66, line 3077. Can anyone give me some suggestions about what might be causing the error? I've modified the BeerDB.pm to point to my host, and am using the beer.cgi from the man page. I've copied all of the templates to the cgi-bin/beerdb/ directory. Thanks, Allen -- mail: allen@hutchison.org blog: www.hutchison.org/allen feed: www.hutchison.org/allen/rss.xml From ggorman@equal-time.com Mon May 3 05:14:00 2004 From: ggorman@equal-time.com (Gary Gorman) Date: Sun, 2 May 2004 23:14:00 -0500 Subject: [Maypole] Style Sheets Message-ID: I finally got everything installed properly - I think - but I have one additional question. In the installation notes there was mention of two files: beer.css and header.css. I can't seem to find them anywhere. Where are they? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 From simon@simon-cozens.org Mon May 3 08:16:58 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Mon, 3 May 2004 08:16:58 +0100 Subject: [Maypole] Style Sheets In-Reply-To: References: Message-ID: <20040503071658.GA17088@alibi.simon-cozens.org> Gary Gorman: > I finally got everything installed properly - I think - but I have one > additional question. In the installation notes there was mention of two > files: beer.css and header.css. I can't seem to find them anywhere. Where > are they? Oops; beerdb.css you can get from, uh, http://neo.trinity-house.org.uk/beerdb.css I'll remember to add it to the MANIFEST for the next release. Where did you see the reference to header.css? -- luckily, my toes have no trailing newline characters From perrin@elem.com Mon May 3 21:15:30 2004 From: perrin@elem.com (Perrin Harkins) Date: Mon, 03 May 2004 16:15:30 -0400 Subject: [Maypole] module naming Message-ID: <1083615330.24366.175.camel@localhost.localdomain> Is there any plan to move Apache::MVC to fit in better with the naming conventions of the rest of Maypole? I was thinking Apache::Maypole, and then there could also be Apache2::Maypole. (CGI::Maypole under ModPerl::Registry is not the best approach to mod_perl 2 support.) - Perrin From marius@kjeldahl.net Mon May 3 22:35:18 2004 From: marius@kjeldahl.net (Marius Kjeldahl) Date: Mon, 3 May 2004 23:35:18 +0200 Subject: [Maypole] ISellIt example - subcategory trouble Message-ID: <200405032335.18970.marius@kjeldahl.net> I've read the articles and set it up (the part from the first article) to run locally. After some struggling figuring out that I needed to mirror the Location directive with an actual directory entry in the server root and populate them with templates (which I had to access CVS to get), I managed to get it working. Looks great. But it seems "subcategory" adding/editing does not work. The category drop down does not get stored. Not when I add it "directly" in the subcategories list or even when I "edit" a subcategory. Am I the only one? Thanks, Marius K. From jester@panix.com Tue May 4 21:09:42 2004 From: jester@panix.com (Jesse Sheidlower) Date: Tue, 4 May 2004 16:09:42 -0400 Subject: [Maypole] URL reconstruction Message-ID: <20040504200942.GA23958@panix.com> The authentication doc page discusses how to reconstruct the URL in a template, like so: [% SET args = request.args.join("/"); %] ...
So that one can, for example, take a detour to a login page and go back to where you came from. I'm finding that this isn't working for me--the "args" is the problem. If I am on a page with links in the form http://localhost/mydatabase/mytable/list/?page=10 and I click on such a link after a login has expired, the ACTION line will be constructed as http://localhost/mydatabase/mytable/list i.e. the ?page=10 is not correctly picked up. What should I be doing to get this to work? Thanks. Jesse Sheidlower From jester@panix.com Wed May 5 03:48:18 2004 From: jester@panix.com (Jesse Sheidlower) Date: Tue, 4 May 2004 22:48:18 -0400 Subject: [Maypole] Searching and paged results Message-ID: <20040505024818.GA14003@panix.com> This is another one for the category of I-don't-know-how-to-process-args, I think. In the current default setup, a search will be paged if there is a value for rows-per-page set. However, the actual search parameters are not passed to the pager for construction of a new URL. Thus, for example, if you have a database with 1,000 beers, of which 400 are IPAs, and you execute a search for "IPA", the first screen will have 10 (or whatever rows-per-page is) IPAs. But when you click on "[2]", you won't get the second page of 400 IPAs, but rather the second page of 1,000 beers. This should probably go into the category of Wrong, as opposed to Could-Be-Done-Differently. It's also probably more broadly applicable than just the pager--various links to or from search results might need to take this into account. I guess the solution will involve always appending form params back onto the query? But will that complicate things if one is expecting form params instead of URL params? Jesse Sheidlower, beta-ing away From simon@simon-cozens.org Wed May 5 06:10:34 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 5 May 2004 06:10:34 +0100 Subject: [Maypole] URL reconstruction In-Reply-To: <20040504200942.GA23958@panix.com> References: <20040504200942.GA23958@panix.com> Message-ID: <20040505051034.GA10307@alibi.simon-cozens.org> Jesse Sheidlower: > The authentication doc page discusses how to reconstruct the URL > in a template, like so: > > [% SET args = request.args.join("/"); %] > ... > > > So that one can, for example, take a detour to a login page and go > back to where you came from. [% request.path %] is the new way of doing things. It's in the manual somewhere, but should probably be made explicit in a Request chapter recipe. -- The Blit is a nice terminal, but it runs emacs. From simon@simon-cozens.org Wed May 5 06:14:22 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 5 May 2004 06:14:22 +0100 Subject: [Maypole] Searching and paged results In-Reply-To: <20040505024818.GA14003@panix.com> References: <20040505024818.GA14003@panix.com> Message-ID: <20040505051422.GB10307@alibi.simon-cozens.org> Jesse Sheidlower: > In the current default setup, a search will be paged if there > is a value for rows-per-page set. However, the actual search > parameters are not passed to the pager for construction of a > new URL. Oops. > I guess the solution will involve always appending form params > back onto the query? Yes. > But will that complicate things if one is > expecting form params instead of URL params? Ow, yes, this is going to get complicated. I'll revamp the search method as promised to take more interesting search operators, and will fix this then - probably by allowing the search terms to come on the URL or as form parameters. The current implementation is little more than a proof of concept. -- "Everything's working, try again in half an hour."-chorus.net tech support From andrew.findlay@skills-1st.co.uk Wed May 5 12:14:25 2004 From: andrew.findlay@skills-1st.co.uk (Andrew Findlay) Date: Wed, 5 May 2004 12:14:25 +0100 Subject: [Maypole] BeerDB ignores handpumps Message-ID: <20040505111425.GA15844@brick.skills-1st.co.uk> I am having trouble with the BeerDB demo. I think it should displaya list of beers when viewing a pub, and a list of pubs when viewing a beer but it does not. In fact, it seems to completely ignore the line "a pub has beers on handpumps" in the setup. Any suggestions? The previous problem I had was solved by installing Template::Plugin::Class which had not been brought in by the prereqs, so I wonder whether this is a similar case. Could someone who has it working please post a list of *all* the Perl modules you have installed for comparison? I append a script to do that and the output that I get on my test system. Thanks Andrew -- ----------------------------------------------------------------------- | From Andrew Findlay, Skills 1st Ltd | | Consultant in large-scale systems, networks, and directory services | | http://www.skills-1st.co.uk/ +44 1628 782565 | ----------------------------------------------------------------------- #!/usr/bin/perl # # list-perl-modules use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } ----------------------------------------------------------------------- Apache::Test -- 1.10 AppConfig -- 1.56 CGI::Simple -- 0.071 CGI::Untaint -- 1.00 Class::Accessor -- 0.19 Class::DBI -- 0.95 Class::DBI::AbstractSearch -- 0.05 Class::DBI::AsForm -- 2.2 Class::DBI::FromCGI -- 0.94 Class::DBI::Loader -- 0.02 Class::DBI::Loader::Relationship -- 1.2 Class::DBI::Pager -- 0.05 Class::DBI::Plugin::RetrieveAll -- 1 Class::DBI::Plugin::Type -- 0.02 Class::DBI::SQLite -- 0.04 Class::DBI::mysql -- 0.23 Class::Data::Inheritable -- 0.02 Class::Trigger -- 0.08 Class::WhiteHole -- 0.04 Convert::ASN1 -- 0.18 DBD::CSV -- 0.2002 DBD::SQLite -- 0.31 DBI -- 1.32 DBIx::ContextualFetch -- 1.01 Data-Page -- ??? Data::ShowTable -- undef Exporter::Lite -- 0.01 HTML-Tree -- ??? HTML::Parser -- 3.26 HTML::Tagset -- 3.03 IO-stringy -- ??? Ima::DBI -- 0.33 Lingua::EN::Inflect -- 1.88 Lingua::EN::Inflect::Number -- 1.1 Locale::gettext -- 1.01 Maypole -- 1.4 Msql-Mysql-modules -- ??? Net::SSLeay -- 1.21 PDA::Pilot -- undef Perl -- 5.8.0 SQL::Abstract -- 1.15 SQL::Statement -- 1.004 Template -- 2.13 Term::ReadLine::Gnu -- 1.13 Test::Simple -- 0.47 Text::CSV_XS -- 0.23 Tie::IxHash -- 1.21 Tk -- 800.024 UNIVERSAL::exports -- 0.03 UNIVERSAL::moniker -- 0.07 URI -- 1.22 libapreq -- ??? libwww-perl -- ??? perl-ldap -- ??? ----------------------------------------------------------------------- From jester@panix.com Wed May 5 15:13:48 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 5 May 2004 10:13:48 -0400 Subject: [Maypole] Searching and paged results In-Reply-To: <20040505051422.GB10307@alibi.simon-cozens.org> References: <20040505024818.GA14003@panix.com> <20040505051422.GB10307@alibi.simon-cozens.org> Message-ID: <20040505141348.GA11434@panix.com> On Wed, May 05, 2004 at 06:14:22AM +0100, Simon Cozens wrote: Jesse Sheidlower wrote: > > > I guess the solution will involve always appending form params > > back onto the query? > > Yes. > > > But will that complicate things if one is > > expecting form params instead of URL params? > > Ow, yes, this is going to get complicated. I'll revamp the search method as > promised to take more interesting search operators, and will fix this then - > probably by allowing the search terms to come on the URL or as form > parameters. The current implementation is little more than a proof of concept. Thank you. I'd ask that when you do this, could you write the relevant actions--to construct the search params and to get them back--as separate methods, instead of as an integral part of the search? That way, if one wants to pass search parameters in a different way (I had in mind sticking them into the same session that's already holding login info), one can do this by overriding only the relevant methods, instead of having to override the entire search mechanism (esp. as this is likely to be growing in complexity). Jesse Sheidlower From jester@panix.com Wed May 5 16:59:31 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 5 May 2004 11:59:31 -0400 Subject: [Maypole] URL reconstruction In-Reply-To: <20040505051034.GA10307@alibi.simon-cozens.org> References: <20040504200942.GA23958@panix.com> <20040505051034.GA10307@alibi.simon-cozens.org> Message-ID: <20040505155931.GA6015@panix.com> On Wed, May 05, 2004 at 06:10:34AM +0100, Simon Cozens wrote: > Jesse Sheidlower: > > The authentication doc page discusses how to reconstruct the URL > > in a template, like so: > > > > [% SET args = request.args.join("/"); %] > > ... > > > > > > So that one can, for example, take a detour to a login page and go > > back to where you came from. > > [% request.path %] is the new way of doing things. It's in the manual > somewhere, but should probably be made explicit in a Request chapter recipe. Ah, that is a nice way of doing things. And I see it is in the Request chapter on exactly what I'm asking about, the pass-through login feature. (See, that's what you get for having a whole bunch of different docs! Some will be out of date; I was looking at the Authentication how-to.) However, there seems to be a problem, which is that request.path only contains the URL, without the parameters. And looking at the code, that seems to be what it is meant to contain--isn't this, in A::MVC's parse_location, meant to strip the params out of the $r->{path} entirely? $self->{path} =~ s/^($loc)?\///; Thus [% request.path %] won't actually contain the full path, and this suggestion in the pass-through login thing won't work. Jesse Sheidlower From simon@simon-cozens.org Wed May 5 18:08:32 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 5 May 2004 18:08:32 +0100 Subject: [Maypole] BeerDB ignores handpumps In-Reply-To: <20040505111425.GA15844@brick.skills-1st.co.uk> References: <20040505111425.GA15844@brick.skills-1st.co.uk> Message-ID: <20040505170832.GA3841@alibi.simon-cozens.org> Andrew Findlay: > I am having trouble with the BeerDB demo. I think it should displaya > list of beers when viewing a pub, and a list of pubs when viewing a > beer but it does not. In fact, it seems to completely ignore the line > "a pub has beers on handpumps" in the setup. > > Any suggestions? Damn. Someone noticed. I haven't quite got to understanding how to do many-to-many relationships properly yet. I need to play with the new version of Class::DBI. -- BITTERNESS: Never be Afraid to Share Your Dreams with the World, Because there's Nothing the World Loves More Than The Taste of Really Sweet Dreams http://www.despair.com From gaal@forum2.org Wed May 5 20:16:24 2004 From: gaal@forum2.org (Gaal Yahas) Date: Wed, 5 May 2004 22:16:24 +0300 Subject: [Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI Message-ID: <20040505191624.GG1115@sike.forum2.org> When using Maypole to create an object that has non-ASCII characters in one of its fields, the browser encodes the form submission, e.g. ׊א and so on, and the database receives this data undecoded. This is obviously wrong for most applications; I want my database to store information in UTF-8. This is another one of those general questions about a problem that isn't Maypole's fault. I realize this, but it's not clear what module does handle this, so just a pointer would be appreciated: is either of the modules mentioned in the subject responsible? What should be done to fix this? -- Gaal Yahas http://gaal.livejournal.com/ From tony-maypole@kasei.com Wed May 5 20:46:35 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Wed, 5 May 2004 20:46:35 +0100 Subject: [Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI In-Reply-To: <20040505191624.GG1115@sike.forum2.org> References: <20040505191624.GG1115@sike.forum2.org> Message-ID: <20040505194635.GA1239@soto.kasei.com> On Wed, May 05, 2004 at 10:16:24PM +0300, Gaal Yahas wrote: > This is another one of those general questions about a problem that > isn't Maypole's fault. I realize this, but it's not clear what module > does handle this, so just a pointer would be appreciated: is either of > the modules mentioned in the subject responsible? What should be done > to fix this? If I'm understanding the problem (and of course it's quite possible that I'm not), I would say that it's something that should be handled closer to the Maypole end of the flow. I'm open to persuasion that it's something that Class::DBI::FromCGI should take care of, but I'm hesitant to move it into CGI::Untaint. I have no strong arguments to back any of this up at this point, however, so I'll certainly consider all opinions! Tony From gaal@forum2.org Wed May 5 21:03:53 2004 From: gaal@forum2.org (Gaal Yahas) Date: Wed, 5 May 2004 23:03:53 +0300 Subject: [Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI In-Reply-To: <20040505194635.GA1239@soto.kasei.com> References: <20040505191624.GG1115@sike.forum2.org> <20040505194635.GA1239@soto.kasei.com> Message-ID: <20040505200353.GI1115@sike.forum2.org> On Wed, May 05, 2004 at 08:46:35PM +0100, Tony Bowden wrote: > On Wed, May 05, 2004 at 10:16:24PM +0300, Gaal Yahas wrote: > > This is another one of those general questions about a problem that > > isn't Maypole's fault. I realize this, but it's not clear what module > > does handle this, so just a pointer would be appreciated: is either of > > the modules mentioned in the subject responsible? What should be done > > to fix this? > > If I'm understanding the problem (and of course it's quite possible that > I'm not), I would say that it's something that should be handled > closer to the Maypole end of the flow. I'm open to persuasion that it's > something that Class::DBI::FromCGI should take care of, but I'm hesitant > to move it into CGI::Untaint. > > I have no strong arguments to back any of this up at this point, > however, so I'll certainly consider all opinions! Okay, it was indeed "closer to the Maypole end of the flow": it turned out that my browser was treating the page as ISO-8859-1 (Latin-1); *despite* the http-equiv directive in custom/header that specifies utf-8. I traced this to Apache's "AddDefaultCharset On" directive, enabled by default and defualting to latin-1[1]. Perversely, my HTTP responses contained *two* Content-Type lines and evidently my browser was honoring the wrong one. So: 1. I changed AddDefaultCharset from "On" to "utf-8"; this fixed the symptom. 2. It's not clear to me why the http-equiv doesn't override Apache's defualt (which by rights should only be added to pages that don't specify their encoding explicitly). Perhaps this is some mod_perl misconfiguration on my part? Or a bug in mod_perl or apache? I'm using a non-DSO mod_perl with a recent apache. [1] due to security reasons; see http://www.apache.org/info/css-security/ -- Gaal Yahas http://gaal.livejournal.com/ From rlucas@tercent.com Thu May 6 08:10:08 2004 From: rlucas@tercent.com (Randall Lucas) Date: Thu, 6 May 2004 00:10:08 -0700 Subject: [Maypole] Where to work on adding boolean checkboxes? Message-ID: <687A67EA-9F2C-11D8-BF55-000A957653D6@tercent.com> Hi folks, I'd like to extend Maypole magically to give checkboxes when an edited field is boolean. Where is the logical spot for me to begin working on this? As I see it, I could start hacking up the template with a special case, but might it be better to go upstream into Class::DBI::AsForm? Please let me know where such changes would be appropriate and welcome. Best, Randall From tony-maypole@kasei.com Thu May 6 08:18:56 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Thu, 6 May 2004 08:18:56 +0100 Subject: [Maypole] Where to work on adding boolean checkboxes? In-Reply-To: <687A67EA-9F2C-11D8-BF55-000A957653D6@tercent.com> References: <687A67EA-9F2C-11D8-BF55-000A957653D6@tercent.com> Message-ID: <20040506071856.GA9432@soto.kasei.com> On Thu, May 06, 2004 at 12:10:08AM -0700, Randall Lucas wrote: > I'd like to extend Maypole magically to give checkboxes when an edited > field is boolean. Where is the logical spot for me to begin working on > this? As I see it, I could start hacking up the template with a > special case, but might it be better to go upstream into > Class::DBI::AsForm? Please let me know where such changes would be > appropriate and welcome. I'd suggest AsForm, as then people not using Maypole can still get the benefit of it... Tony From andrew.findlay@skills-1st.co.uk Thu May 6 10:45:00 2004 From: andrew.findlay@skills-1st.co.uk (Andrew Findlay) Date: Thu, 6 May 2004 10:45:00 +0100 Subject: [Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI In-Reply-To: <20040505200353.GI1115@sike.forum2.org> References: <20040505191624.GG1115@sike.forum2.org> <20040505194635.GA1239@soto.kasei.com> <20040505200353.GI1115@sike.forum2.org> Message-ID: <20040506094500.GC15844@brick.skills-1st.co.uk> On Wed, May 05, 2004 at 11:03:53PM +0300, Gaal Yahas wrote: > 1. I changed AddDefaultCharset from "On" to "utf-8"; this fixed the > symptom. > > 2. It's not clear to me why the http-equiv doesn't override Apache's > defualt (which by rights should only be added to pages that don't > specify their encoding explicitly). >From the Apache manual: # AddDefaultCharset directive # Syntax: AddDefaultCharset On|Off|charset # Context: all # Status: core # Default: AddDefaultCharset Off # Compatibility: AddDefaultCharset is only available in Apache 1.3.12 and later # # This directive specifies the name of the character set that will be # added to any response that does not have any parameter on the content # type in the HTTP headers. This will override any character set # specified in the body of the document via a META tag. A setting of # AddDefaultCharset Off disables this functionality. AddDefaultCharset # On enables Apache's internal default charset of iso-8859-1 as required # by the directive. You can also specify an alternate charset to be # used. The key here is that the default will be added if no charset is defined *in the HTTP headers*. The presence of a META tag in the document has no effect. It would be wise to make sure that a charset is specified either in the headers or in the page template for all pages. Maypole does this in the factory/header template. Andrew -- ----------------------------------------------------------------------- | From Andrew Findlay, Skills 1st Ltd | | Consultant in large-scale systems, networks, and directory services | | http://www.skills-1st.co.uk/ +44 1628 782565 | ----------------------------------------------------------------------- From simon@simon-cozens.org Thu May 6 12:21:29 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 6 May 2004 12:21:29 +0100 Subject: [Maypole] TPF Wrap-up Message-ID: <20040506112129.GA16474@alibi.simon-cozens.org> As the observant of you will have noticed, it is now no longer April. I received $1000 funding from the Perl Foundation which paid my expenses for the month of April while I hacked on a bunch of Maypole things. Despite having my work cut short by the dreaded RSI, I feel I managed to achieve enough to justify the grant: * Over 20,000 words of a user manual * Five articles on Maypole case studies (2 perl.com, one in last month's TPJ, one to go out to TPJ this month, and one for IBM DeveloperWorks.) * An e-commerce application, and one portal application ported from ASP.NET In addition, the code enhancements I've been able to make by working on Maypole full time have led to much increased stability and brought Maypole to enterprise-readiness, as evidenced by the first Maypole-related job being posted on jobs.perl.org a few days ago. Although my current funding has run out and Maypole is now going to return to being a free-time project for me, there's a small possibility that I'm going to receive some funding from a computer consultancy to continue Maypole's development. With that in mind, I'd like to think about some longer-term directions for Maypole. There are short and medium term goals in the todo list, but I want to set out my vision for how Maypole is going to develop from here. First, I want to produce some more examples of model classes that aren't based on databases at all; I will be writing an NNTP interface for perl.org and this may end up being Maypole based. There needs to be a way of inheriting from Maypole applications, and of packaging Maypole "components"; requiring a login and authentication, or adding a shopping cart to an application, should be a simple matter of 'use'ing the component and configuring appropriately. This in turn requires Maypole to sort out where it puts factory components, and how Maypole itself gets packaged for install. Finally, I'm slightly unhappy about the namespace clash between actions and a model class's methods; witness the ugliness in Maypole::Model::CDBI::delete. Decoupling this with a has-a relationship is a long-term goal, possibly looking ahead several major stable revisions. It only remains for me to thank the Perl Foundation once again for allowing me time to work on Maypole. I hope that their contribution has translated into your benefit. Simon -- IDIOCY: Never Underestimate The Power Of Stupid People In Large Groups http://www.despair.com From gaal@forum2.org Thu May 6 11:57:20 2004 From: gaal@forum2.org (Gaal Yahas) Date: Thu, 6 May 2004 13:57:20 +0300 Subject: [Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI In-Reply-To: <20040506094500.GC15844@brick.skills-1st.co.uk> References: <20040505191624.GG1115@sike.forum2.org> <20040505194635.GA1239@soto.kasei.com> <20040505200353.GI1115@sike.forum2.org> <20040506094500.GC15844@brick.skills-1st.co.uk> Message-ID: <20040506105720.GB26096@sike.forum2.org> On Thu, May 06, 2004 at 10:45:00AM +0100, Andrew Findlay wrote: > # This directive specifies the name of the character set that will be > # added to any response that does not have any parameter on the content > # type in the HTTP headers. This will override any character set > # specified in the body of the document via a META tag. A setting of > # AddDefaultCharset Off disables this functionality. AddDefaultCharset > # On enables Apache's internal default charset of iso-8859-1 as required > # by the directive. You can also specify an alternate charset to be > # used. > > The key here is that the default will be added if no charset is > defined *in the HTTP headers*. The presence of a META tag in the > document has no effect. > > It would be wise to make sure that a charset is specified either in > the headers or in the page template for all pages. Maypole does this > in the factory/header template. I am aware of custom/header (factory/header does not provide this), but Maypole *only* provides a META tag, which (contrary to the Apache documentation you quote) *does* make its way to the HTTP response header! In other words, Maypole does not fully control the HTTP headers (this is no surprise). But if this is a *default* charset directive, why should it override the META tag? Are authors now supposed to set the response headers outside their documents? The whole point of META tags is to save them from doing that, hence my surprise. You know what, if this is the way it's supposed to work, then Maypole is as good a place as any to centrally configure this; perhaps we need an HTTP header template page as well. -- Gaal Yahas http://gaal.livejournal.com/ From perrin@elem.com Thu May 6 21:48:00 2004 From: perrin@elem.com (Perrin Harkins) Date: Thu, 06 May 2004 16:48:00 -0400 Subject: [Maypole] TPF Wrap-up In-Reply-To: <20040506112129.GA16474@alibi.simon-cozens.org> References: <20040506112129.GA16474@alibi.simon-cozens.org> Message-ID: <1083876479.24366.389.camel@localhost.localdomain> On Thu, 2004-05-06 at 07:21, Simon Cozens wrote: > * An e-commerce application, and one portal application ported from > ASP.NET I've seen the articles for these in the manual. Is the code available for download somewhere? - Perrin From jester@panix.com Thu May 6 21:55:57 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 6 May 2004 16:55:57 -0400 Subject: [Maypole] TPF Wrap-up In-Reply-To: <1083876479.24366.389.camel@localhost.localdomain> References: <20040506112129.GA16474@alibi.simon-cozens.org> <1083876479.24366.389.camel@localhost.localdomain> Message-ID: <20040506205557.GA16856@panix.com> On Thu, May 06, 2004 at 04:48:00PM -0400, Perrin Harkins wrote: > On Thu, 2004-05-06 at 07:21, Simon Cozens wrote: > > * An e-commerce application, and one portal application ported from > > ASP.NET > > I've seen the articles for these in the manual. Is the code available > for download somewhere? http://cvs.simon-cozens.org/viewcvs.cgi/ibsportal/ Jesse Sheidlower From perrin@elem.com Thu May 6 23:30:21 2004 From: perrin@elem.com (Perrin Harkins) Date: Thu, 06 May 2004 18:30:21 -0400 Subject: [Maypole] TPF Wrap-up In-Reply-To: <20040506205557.GA16856@panix.com> References: <20040506112129.GA16474@alibi.simon-cozens.org> <1083876479.24366.389.camel@localhost.localdomain> <20040506205557.GA16856@panix.com> Message-ID: <1083882621.6816.5.camel@localhost.localdomain> On Thu, 2004-05-06 at 16:55, Jesse Sheidlower wrote: > http://cvs.simon-cozens.org/viewcvs.cgi/ibsportal/ Thanks Jesse. I don't see the iSellIt code in there. Is that around somewhere too? - Perrin From simon@simon-cozens.org Thu May 6 23:40:42 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 6 May 2004 23:40:42 +0100 Subject: [Maypole] TPF Wrap-up In-Reply-To: <1083882621.6816.5.camel@localhost.localdomain> References: <20040506112129.GA16474@alibi.simon-cozens.org> <1083876479.24366.389.camel@localhost.localdomain> <20040506205557.GA16856@panix.com> <1083882621.6816.5.camel@localhost.localdomain> Message-ID: <20040506224042.GA22021@alibi.simon-cozens.org> Perrin Harkins: > Thanks Jesse. I don't see the iSellIt code in there. Is that around > somewhere too? Nope, that's just in the perl.com articles. I'll put it up somewhere. -- There's no cinnamon and no lemon or orange involved. If there were, it was a heretic who mixed it up and the mixer should be impaled on a stake and buggered by the Shrike for two hours, then taken down and forced to rub the wounds with the mix until death sets in. - Ingvar Mattsson *cares* about cocktails. From jester@panix.com Fri May 7 02:43:00 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 6 May 2004 21:43:00 -0400 Subject: [Maypole] TPF Wrap-up In-Reply-To: <1083882621.6816.5.camel@localhost.localdomain> References: <20040506112129.GA16474@alibi.simon-cozens.org> <1083876479.24366.389.camel@localhost.localdomain> <20040506205557.GA16856@panix.com> <1083882621.6816.5.camel@localhost.localdomain> Message-ID: <20040507014259.GA12797@panix.com> On Thu, May 06, 2004 at 06:30:21PM -0400, Perrin Harkins wrote: > On Thu, 2004-05-06 at 16:55, Jesse Sheidlower wrote: > > http://cvs.simon-cozens.org/viewcvs.cgi/ibsportal/ > > Thanks Jesse. I don't see the iSellIt code in there. Is that around > somewhere too? Oops, sorry, I thought you were talking about the I Buy Spy. JTS From andrew.findlay@skills-1st.co.uk Fri May 7 10:33:37 2004 From: andrew.findlay@skills-1st.co.uk (Andrew Findlay) Date: Fri, 7 May 2004 10:33:37 +0100 Subject: [Maypole] Trying to build new model class Message-ID: <20040507093337.GA20845@brick.skills-1st.co.uk> I am trying to build a new Model class so that I can work on LDAP data with Maypole. This is turning out to be very frustrating! I started by copying Maypole/Model/CDBI.pm and removing everything that looked specific to DBI. This became Dir/Model.pm I also copied Class/DBI/Loader/Generic.pm to Dir/Loader/Generic.pm The only change to that so far is the module name. Class/DBI/Loader/mysql.pm was copied to Dir/Loader/LDAP.pm and modified. So far, this just removes the DBI stuff, but it should end containing the LDAP connection code (calls to Net::LDAP). It currently has a couple of 'table' names wired in for testing. I override some parts of the config hash in the main application class, to force Maypole to use Dir::Model rather than Maypole::Model::CDBI. I found that I had to specify view => "Maypole::View::TT" here too, which seems wrong. Anyway, having done all that I have run up against a problem that I am having great trouble with. Running the main class under Maypole::CLI for tests, I get this error: Can't call method "_table2class" on an undefined value at Dir/Model.pm line 129, line 225. Dir::Model::class_of('Dir::Model','Dir=HASH(0x8934eec)','dir') called at /usr/lib/perl5/site_perl/5.8.0/Maypole.pm line 65 Maypole::handler_guts('Dir=HASH(0x8934eec)') called at /usr/lib/perl5/site_perl/5.8.0/Maypole.pm line 57 Maypole::handler('Dir','Dir') called at /usr/lib/perl5/site_perl/5.8.0/Maypole.pm line 23 Maypole::__ANON__[/usr/lib/perl5/site_perl/5.8.0/Maypole.pm:23]('Dir') called at t3 line 9 The offending line is in class_of: sub class_of { my ($self, $r, $table) = @_; return $r->config->{loader}->_table2class($table); } Obviously the loader stuff should have been filled in during the setup phase, but I cannot see where. I append copies of the relevant files: can anyone suggest what I might have done wrong? Thanks Andrew -- ----------------------------------------------------------------------- | From Andrew Findlay, Skills 1st Ltd | | Consultant in large-scale systems, networks, and directory services | | http://www.skills-1st.co.uk/ +44 1628 782565 | ----------------------------------------------------------------------- Dir.pm: ======= package Dir; use base 'Apache::MVC'; # Override the model class to avoid getting Maypole::Model::CDBI sub config { my $h = { model => "Dir::Model", tables => ["people", "groups"], view => "Maypole::View::TT", ## Should be the default! }; return $h; } Dir->setup("XXsomeLDAPstuffXX", "YYuserYY", "ZZpasswdZZ"); Dir->config->{uri_base} = "http://brick-172-16-91-128/dir/"; Dir->config->{rows_per_page} = 10; Dir->config->{display_tables} = [qw[people]]; 1; package Dir::People; sub column_names { (shift->SUPER::column_names(), cn => "Name") } sub display_columns { ("cn", "sn", "uid"); } 1; ----------------------------------------------------------------------- Dir/Model.pm: ============= package Dir::Model; use base qw(Maypole::Model::Base Dir::Loader::LDAP); use Lingua::EN::Inflect::Number qw(to_PL); use CGI::Untaint; use Dir::Loader; use Dir::Loader::LDAP; use strict; =head1 NAME Dir::Model - Model class based on Class::DBI =head1 DESCRIPTION This is a master model class which uses C to do all the hard work of fetching rows and representing them as objects. =cut sub related { my ($self, $r) = @_; # Has-many methods; XXX this is a hack map {to_PL($_)} grep { exists $r->{config}{ok_tables}{$_} } map {$_->table} keys %{shift->__hasa_list || {}} } sub do_edit :Exported { my ($self, $r) = @_; my $h = CGI::Untaint->new(%{$r->{params}}); my ($obj) = @{$r->objects || []}; if ($obj) { # We have something to edit $obj->update_from_cgi($h); } else { $obj = $self->create_from_cgi($h); } if (my %errors = $obj->cgi_update_errors) { # Set it up as it was: $r->{template_args}{cgi_params} = $r->{params}; $r->{template_args}{errors} = \%errors; $r->{template} = "edit"; } else { $r->{template} = "view"; } $r->objects([ $obj ]); } sub delete :Exported { return shift->SUPER::delete(@_) if caller ne "Maypole::Model::Base"; my ($self, $r) = @_; $_->SUPER::delete for @{ $r->objects || [] }; $r->objects([ $self->retrieve_all ]); $r->{template} = "list"; $self->list($r); } sub adopt { my ($self, $child) = @_; # Null so far... } sub search :Exported { return shift->SUPER::search(@_) if caller ne "Maypole::Model::Base"; # A real CDBI search. my ($self, $r) = @_; my %fields = map {$_ => 1 } $self->columns; my $oper = "like"; # For now my %params = %{$r->{params}}; my %values = map { $_ => {$oper, $params{$_} } } grep { $params{$_} and $fields{$_} } keys %params; $r->template("list"); if (!%values) { return $self->list($r) } my $order = $self->order($r); $self = $self->do_pager($r); $r->objects([ $self->search_where(\%values), ($order ? { order => $order } : ()) ]); $r->{template_args}{search} = 1; } sub do_pager { my ($self, $r) = @_; if ( my $rows = $r->config->{rows_per_page}) { return $r->{template_args}{pager} = $self->pager($rows, $r->query->{page}); } else { return $self } } sub order { my ($self, $r) = @_; my $order; my %ok_columns = map {$_ => 1} $self->columns; if ($order = $r->query->{order} and $ok_columns{$order}) { $order .= ($r->query->{o2} eq "desc" && " DESC") } $order; } sub list :Exported { my ($self, $r) = @_; my $order = $self->order($r); $self = $self->do_pager($r); if ($order) { $r->objects([ $self->retrieve_all_sorted_by( $order )]); } else { $r->objects([ $self->retrieve_all ]); } } sub setup_database { my ($self, $config, $namespace, $dsn, $u, $p) = @_; $config->{dsn} = $dsn; $config->{loader} = Dir::Loader->new( namespace => $namespace, dsn => $dsn, user => $u, password => $p, ); $config->{classes} = [ $config->{loader}->classes ]; $config->{tables} = [ $config->{loader}->tables ]; } sub class_of { my ($self, $r, $table) = @_; return $r->config->{loader}->_table2class($table); } sub view :Exported { } 1; ----------------------------------------------------------------------- Dir/Loader.pm: ============== package Dir::Loader; use strict; use vars qw($VERSION); $VERSION = '0.01'; sub new { my($class, %args) = @_; my $impl = "Dir::Loader::LDAP"; eval qq/use $impl/; return $impl->new(%args); } 1; ----------------------------------------------------------------------- Dir/Loader/Generic.pm: ====================== package Dir::Loader::Generic; # Derived from Class::DBI::Loader::Generic use strict; use vars qw($VERSION); $VERSION = '0.01'; use Carp (); require Class::Accessor; use base qw(Class::Accessor); __PACKAGE__->mk_accessors(qw(_datasource _namespace)); sub _croak { require Carp; Carp::croak(@_); } sub new { my($class, %args) = @_; my $self = bless { _datasource => [ $args{dsn}, $args{user}, $args{password}, $args{options}], _namespace => $args{namespace}, CLASSES => {}, }, $class; $self->_load_classes; $self; } sub _load_classes { _croak('ABSTRACT METHOD'); } sub find_class { my($self,$table) = @_; return $self->{CLASSES}->{$table}; } sub classes { my $self = shift; return sort values %{$self->{CLASSES}}; } sub tables { my $self = shift; return sort keys %{$self->{CLASSES}}; } sub _table2class { my($self, $table) = @_; my $namespace = $self->{_namespace} || ""; $namespace =~ s/(.*)::$/$1/; my $subclass = $table; $subclass =~ s/_(\w)/ucfirst($1)/eg; my $class = $namespace ? "$namespace\::". ucfirst($subclass) : ucfirst($subclass); } 1; __END__ =head1 NAME Dir::Loader::Generic - generic Class Loader implementation. =head1 SYNOPSIS ABSTRACT CLASS =head1 DESCRIPTION Derived from Class::DBI::Loader::Generic - generic Class::DBI::Loader implementation. please see L =head1 AUTHOR Class::DBI::Loader::Generic by IKEBE Tomohiro Eikebe@edge.co.jpE This derivation by Andrew Findlay Eandrew.findlay@skills-1st.co.ukE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L =cut ----------------------------------------------------------------------- Dir/Loader/LDAP.pm: =================== package Dir::Loader::LDAP; # Derived from Class::DBI::Loader::mysql; use strict; use Carp (); require Net::LDAP; require Dir::Loader::Generic; use base qw(Dir::Loader::Generic); use vars qw($VERSION); $VERSION = '0.01'; sub _croak { require Carp; Carp::croak(@_); } sub _load_classes { my $self = shift; my @tables = ("people", "groups"); foreach my $table(@tables) { my $class = $self->_table2class($table); no strict 'refs'; @{"$class\::ISA"} = qw(Net::LDAP); $self->{CLASSES}->{$table} = $class; } } 1; __END__ =head1 NAME Dir::Loader::LDAP - Class Loader for LDAP data source =head1 SYNOPSIS use Dir::Loader; # $loader is a Dir::Loader::LDAP my $loader = Dir::Loader::LDAP->new( dsn => "dbi:mysql:dbname", user => "root", password => "", namespace => "Data", ); my $class = $loader->find_class('film'); # $class => Data::Film my $obj = $class->retrieve(1); =head1 DESCRIPTION Derived from Class::DBI::Loader::mysql - Class::DBI::Loader mysql implementation. please see L =head1 AUTHOR Class::DBI::Loader::mysql by IKEBE Tomohiro Eikebe@edge.co.jpE This derivation by Andrew Findlay Eandrew.findlay@skills-1st.co.ukE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L =cut ----------------------------------------------------------------------- From i.carruthers@inpharmatica.co.uk Fri May 7 11:11:43 2004 From: i.carruthers@inpharmatica.co.uk (Ian Carruthers,(4702)) Date: Fri, 07 May 2004 11:11:43 +0100 Subject: [Maypole] Newbie Problem with Beer Message-ID: <409B60DF.1070409@inpharmatica.co.uk> Hi all , Hope someone can help me with this., I cant seem to get CGI::Maypole working at all Here are the scrips. I have a cgi script like this: Beer.pl ### #!/usr/bin/perl -w use strict; use BeerDB; BeerDB->run(); ### And a module BeerDB.pm ### package BeerDB; use base 'CGI::Maypole'; ### And thats it! It fails with: Can't use an undefined value as an ARRAY reference at /home/victoria/ianc/lib/local/share/perl/5.6.1//Maypole.pm line 44. Any Sugestions? Many thanks , Ian Carruthers From simon@simon-cozens.org Fri May 7 15:51:25 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Fri, 7 May 2004 15:51:25 +0100 Subject: [Maypole] Trying to build new model class In-Reply-To: <20040507093337.GA20845@brick.skills-1st.co.uk> References: <20040507093337.GA20845@brick.skills-1st.co.uk> Message-ID: <20040507145125.GA23085@alibi.simon-cozens.org> Andrew Findlay: > I started by copying Maypole/Model/CDBI.pm and removing everything > that looked specific to DBI. This became Dir/Model.pm > > I also copied Class/DBI/Loader/Generic.pm to Dir/Loader/Generic.pm > The only change to that so far is the module name. I'm not sure that's a useful starting point. > Class/DBI/Loader/mysql.pm was copied to Dir/Loader/LDAP.pm and > modified. Or that. > I override some parts of the config hash in the main application > class, to force Maypole to use Dir::Model rather than > Maypole::Model::CDBI. I found that I had to specify > view => "Maypole::View::TT" here too, which seems wrong. That does seem wrong. > sub class_of { > my ($self, $r, $table) = @_; > return $r->config->{loader}->_table2class($table); > } > > Obviously the loader stuff should have been filled in during the setup > phase, but I cannot see where. It should only be filled in if you're starting from Class::DBI::Loader. But since your model is not Class::DBI-based in the slightest, I wouldn't do that. Basically, if you want to get there, I wouldn't be starting from here. -- Testing can show the presence of bugs, but not their absence. -- Dijkstra From andrew.findlay@skills-1st.co.uk Fri May 7 16:29:07 2004 From: andrew.findlay@skills-1st.co.uk (Andrew Findlay) Date: Fri, 7 May 2004 16:29:07 +0100 Subject: [Maypole] Trying to build new model class In-Reply-To: <20040507145125.GA23085@alibi.simon-cozens.org> References: <20040507093337.GA20845@brick.skills-1st.co.uk> <20040507145125.GA23085@alibi.simon-cozens.org> Message-ID: <20040507152907.GI15844@brick.skills-1st.co.uk> On Fri, May 07, 2004 at 03:51:25PM +0100, Simon Cozens wrote: > > I also copied Class/DBI/Loader/Generic.pm to Dir/Loader/Generic.pm > > The only change to that so far is the module name. > > I'm not sure that's a useful starting point. I chose that because the documentation said: This is a master model class which uses "Class::DBI" to do all the hard work of fetching rows and representing them as objects. It is a good model to copy if you're replacing it with other database abstraction modules. What would be a better place to start? Thanks Andrew -- ----------------------------------------------------------------------- | From Andrew Findlay, Skills 1st Ltd | | Consultant in large-scale systems, networks, and directory services | | http://www.skills-1st.co.uk/ +44 1628 782565 | ----------------------------------------------------------------------- From simon@simon-cozens.org Fri May 7 16:34:18 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Fri, 7 May 2004 16:34:18 +0100 Subject: [Maypole] Trying to build new model class In-Reply-To: <20040507152907.GI15844@brick.skills-1st.co.uk> References: <20040507093337.GA20845@brick.skills-1st.co.uk> <20040507145125.GA23085@alibi.simon-cozens.org> <20040507152907.GI15844@brick.skills-1st.co.uk> Message-ID: <20040507153418.GA9090@alibi.simon-cozens.org> Andrew Findlay: > > > I also copied Class/DBI/Loader/Generic.pm to Dir/Loader/Generic.pm > > I'm not sure that's a useful starting point. > > I chose that because the documentation said: > This is a master model class which uses "Class::DBI" to do You're talking about Maypole::Model::CDBI. I'm talking about Class::DBI::Loader::Generic. It's CDBI specific. You don't want to be playing with it. -- It's much better to have people flaming in the flesh. -Al Aho From zero@perplexity.org Sat May 8 05:46:25 2004 From: zero@perplexity.org (dan sinclair) Date: Sat, 08 May 2004 00:46:25 -0400 Subject: [Maypole] file errors Message-ID: <1083991585.886.63.camel@oberon.perplexity.org> Hello, I've installed Maypole and it seems to be working, the issue I'm currently having is as follows. I have my apache set up with: Alias /im/ /home/zero/dev/foo/im/ SetHandler perl-script PerlHandler Foo Where Foo is my Maypole app. In my header I have some images /im/foo.gif etc. I can load the page, and all the images appear, but in the log file I see: file error - imfoo.gif: not found at /usr/lib/perl5/site_perl/5.8.0/Maypole/View/Base.pm line 66. Which I'm guessing is a config issue? Whats the proper way to configure Maypole to work off of / and not get errors when accessing other things below that directory? Thanks, dan From marcus@thefeed.no Sat May 8 08:46:15 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Sat, 08 May 2004 09:46:15 +0200 Subject: [Maypole] file errors In-Reply-To: <1083991585.886.63.camel@oberon.perplexity.org> References: <1083991585.886.63.camel@oberon.perplexity.org> Message-ID: <409C9047.2010804@thefeed.no> dan sinclair wrote: >I have my apache set up with: > >Alias /im/ /home/zero/dev/foo/im/ > > > SetHandler perl-script > PerlHandler Foo > > >Where Foo is my Maypole app. In my header I have some images /im/foo.gif etc. I can load the page, >and all the images appear, but in the log file I see: > > Hey. Now, I`m no Template Toolkit expert, but I would image it`s a much better idea to keep your static images outside of the maypole template directory. With Regards Marcus Ramberg -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From marcus@thefeed.no Sat May 8 09:00:44 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Sat, 08 May 2004 10:00:44 +0200 Subject: [Maypole] Footer missing Message-ID: <409C93AC.3090409@thefeed.no> This is a multi-part message in MIME format. --------------050202030603070505030008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Seems to me there is no footer in the Maypole templates, even though Simon refers to it in the perl.com articles. here's a basic footer, and a patch against CVS to use it in the factory and custom templates. Marcus Index: custom/frontpage =================================================================== RCS file: /var/cvs/modules/Apache-MVC/templates/custom/frontpage,v retrieving revision 1.3 diff -r1.3 frontpage 15a16 > [% INCLUDE footer %] cvs server: Diffing factory Index: factory/edit =================================================================== RCS file: /var/cvs/modules/Apache-MVC/templates/factory/edit,v retrieving revision 1.4 diff -r1.4 edit 30a31,32 > > [% INCLUDE footer %] Index: factory/frontpage =================================================================== RCS file: /var/cvs/modules/Apache-MVC/templates/factory/frontpage,v retrieving revision 1.3 diff -r1.3 frontpage 15a16 > [% INCLUDE footer %] Index: factory/list =================================================================== RCS file: /var/cvs/modules/Apache-MVC/templates/factory/list,v retrieving revision 1.8 diff -r1.8 list 42a43,44 > > [% INCLUDE footer %] -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no --------------050202030603070505030008 Content-Type: text/plain; name="footer" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="footer" --------------050202030603070505030008-- From ggorman@equal-time.com Sat May 8 19:20:53 2004 From: ggorman@equal-time.com (Gary Gorman) Date: Sat, 8 May 2004 13:20:53 -0500 Subject: [Maypole] BeerDB errors Message-ID: In trying to get Maypole up and running I continue to get the following error: "Can't locate object method "set_db" via package "BeerDB::Beer" at ...." What does this mean?? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 From simon@simon-cozens.org Sat May 8 20:00:36 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sat, 8 May 2004 20:00:36 +0100 Subject: [Maypole] BeerDB errors In-Reply-To: References: Message-ID: <20040508190036.GA29312@alibi.simon-cozens.org> Gary Gorman: > "Can't locate object method "set_db" via package "BeerDB::Beer" at ...." > What does this mean?? See: http://wiki.simon-cozens.org/index.cgi?InstallationIssues -- 10. The Earth quakes and the heavens rattle; the beasts of nature flock together and the nations of men flock apart; volcanoes usher up heat while elsewhere water becomes ice and melts; and then on other days it just rains. - Prin. Dis. From ggorman@equal-time.com Sun May 9 09:37:00 2004 From: ggorman@equal-time.com (Gary Gorman) Date: Sun, 9 May 2004 03:37:00 -0500 Subject: [Maypole] Missing Modules? Message-ID: I can finally open the page that list the tables. Each link goes to another page, but the fields are blank. I read through the Maypole Makefile.PL and at the bottom of this file there were "Insert.." commands as if they populated the beerdb, but as I said, those fields are blank in the web page. I'm running a RedHat 8.0 server, kernel 2.4.20-28-8smp, apache-1.3.29 on an i386. Here's a list of the modules I have installed on my server: Apache::DBI -- 0.94 Apache::Template -- 0.09 Apache::Test -- 1.10 AppConfig -- 1.56 Archive::Tar -- 1.08 Archive::Zip -- 1.10 Bit::Vector -- 6.3 CGI -- 3.05 CGI::Untaint -- 1.00 CPANPLUS -- 0.049 Class::Accessor -- 0.19 Class::DBI -- 0.96 Class::DBI::AbstractSearch -- 0.05 Class::DBI::AsForm -- 2.2 Class::DBI::AutoLoader -- 0.12 Class::DBI::FromCGI -- 0.94 Class::DBI::Loader -- 0.02 Class::DBI::Loader::Relationship -- 1.2 Class::DBI::Pager -- 0.05 Class::DBI::Plugin::RetrieveAll -- 1 Class::DBI::Plugin::Type -- 0.02 Class::DBI::mysql -- 0.23 Class::Data::Inheritable -- 0.02 Class::Trigger -- 0.08 Class::WhiteHole -- 0.04 Compress::Zlib -- 1.33 DBD::Multiplex -- 0.9 DBD::SQLite -- 0.31 DBD::mysql -- 2.9003 DBI -- 1.42 DBI::Shell -- 11.93 DBIx::ContextualFetch -- 1.01 Date::Calc -- 5.3 Date::Manip -- 5.42 Exporter::Lite -- 0.01 ExtUtils::MakeMaker -- 6.21 File::RsyncP -- 0.50 GD -- 2.12 GD::Graph -- 1.43 GD::Graph3d -- 0.63 GD::Text -- 0.86 HTML-Tree -- ??? HTML::Parser -- 3.36 HTML::Tagset -- 3.03 IO-stringy -- ??? IO::Tee -- 0.64 IO::Zlib -- 1.01 IPC::Run -- 0.78 Ima::DBI -- 0.33 Image::Info -- 1.16 Image::Size -- 2.992 Lingua::EN::Inflect -- 1.88 Lingua::EN::Inflect::Number -- 1.1 Locale::Maketext::Lexicon -- 0.38 Maypole -- 1.4 Net::Daemon -- 0.38 Parse::Yapp -- undef Perl -- 5.8.4 Pod::Escapes -- 1.04 Pod::POM -- 0.15 Pod::Simple -- 2.06 RPC::PlServer -- 0.2017 SQL::Abstract -- 1.15 Template -- 2.13 Template::Plugin::Class Term::ReadLine -- 1.01 Term::Size -- 0.2 Test -- 1.25 Test::Builder::Tester -- 0.09 Test::Manifest -- 0.93 Test::Reporter -- 1.20 Text::Autoformat -- 1.12 Text::Reform -- 1.11 Thread::Serialize -- 0.09 Thread::Tie -- 0.12 Tie::DBI -- 0.93 Time::Piece -- 1.08 Time::Piece::MySQL -- 0.03 UNIVERSAL::exports -- 0.03 UNIVERSAL::moniker -- 0.07 URI -- 1.30 XML-DOM -- ??? XML::LibXML::Common -- 0.13 XML::NamespaceSupport -- 1.08 XML::Parser -- 2.34 XML::RSS -- 1.03 XML::RegExp -- 0.02 XML::SAX -- 0.12 XML::XPath -- 1.13 YAML -- 0.35 libapreq -- ??? libwww-perl -- ??? libxml-perl -- ??? load -- 0.16 mod_perl -- 1.29 ---------------------------------------------------------------------------- ------ What modules are missing? Gary Gorman Owner - Equal-time.com 9045 Grand Ave. Kansas City, MO 64114 816-523-0486 From jean-francois.im@myrealbox.com Mon May 10 09:27:59 2004 From: jean-francois.im@myrealbox.com (Jean-Francois Im) Date: Mon, 10 May 2004 04:27:59 -0400 Subject: [Maypole] Problems with user authentication and a little question. Message-ID: <409F3D0F.8000301@myrealbox.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have been trying to build my own version of the iSellIt demo application featured on perl.com. So far, it mostly works(ie. I can list items, categories, etc.). However, I cannot seem to be able to make users work properly. This is the authentication function, in the driver module(the entire driver module source code is at http://phv.lns.kicks-ass.net/css/CStore.pm.txt). sub authenticate { ~ my ($self, $r) = @_; ~ unless ($r->{table} eq "itemschariot" or $r->{action} eq "achat") { ~ return OK; ~ } ~ $r->get_user; ~ if (!$r->{user}) { ~ $r->template("login"); ~ } ~ return OK; } If I try to login manually by going to http://phv.lns.kicks-ass.net/login and entering my login details(user list : http://phv.lns.kicks-ass.net/user/list), it does not return an error but I do not get a cookie nor do I get authentified. If I register a user, it appears that I am logged onto the frontpage but the authentication does not persists, nor do I get a cookie(which is probably why the authentication does not persist). Additionally, I obtain this error message in the Apache log files(two times). Use of uninitialized value in subroutine entry at /usr/local/share/perl/5.6.1/Maypole/Authentication/UserSessionCookie.pm line 175. Use of uninitialized value in subroutine entry at /usr/local/share/perl/5.6.1/Maypole/Authentication/UserSessionCookie.pm line 175. However, if I try to enforce authentication by changing the authenticate function to : sub authenticate { ~ my ($self, $r) = @_; # unless ($r->{table} eq "itemschariot" or $r->{action} eq "achat") { # return OK; # } ~ if($r->{action} eq "login") { ~ return OK; ~ } ~ $r->get_user; ~ if (!$r->{user}) { ~ $r->template("login"); ~ } ~ return OK; } I get a different error message in the Apache error log file : Couldn't load user class CStore::User at /usr/local/share/perl/5.6.1/Maypole/Authentication/UserSessionCookie.pm line 130. I tried looking in the flox source code in CVS, reading the Authentication in Maypole document, searching Google as well as this mailing list's archives, without results. I'm probably missing something small but I can't put my finger on it. Any ideas? Also, I have a little question. From within a template, how would I get the classmetadata for another table. What I am trying to do is to have a subview of all products for a particular category(see http://phv.lns.kicks-ass.net/categorie/view/3). However, how would I find the names of the columns for the other table(produit). This is the relevant part of the template : [% SET columnlist = [ 'name', 'description', 'manufacturier', 'prix' ]; FOR col = columnlist; ~ NEXT IF col == "id"; ~ ""; ~ col; ~ ""; END %] Obviously, it leaves the column names from the database, not the pretty formatted ones. I know that item.produits is a list of all the products for that particular category, but how would I find the column names from there? Thank you in advance, Jean-Francois Im -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1-nr1 (Windows 2000) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAnz0M51r72W5ULgYRArI4AJ4zxOWxtBtYV1HgYH0neaQz7qwn6wCeM1gJ p3l4GvzTllb7MJbRLnn5DzM= =x+QH -----END PGP SIGNATURE----- From Daniel.Brunkhorst@dataport.de Wed May 12 07:52:59 2004 From: Daniel.Brunkhorst@dataport.de (Daniel.Brunkhorst@dataport.de) Date: Wed, 12 May 2004 08:52:59 +0200 Subject: [Maypole] error trying to get the beerdb example up and running Message-ID: <159DDC6F191E5B45B2422E68EECAD13D0A5B22@wscxpr06.fhhnet.stadt.hamburg.de> Hi list, I would like to play around with Maypole a bit and wanted to use the BeerDB example for first steps with this framework. I copied the templates to "/beerdb" directory, made the BeerDB accessible to Apache and changed BeerDB.pm so that it contains the correct path to the beerdb.db file. I also added the Location directive to httpd.conf, so that BeerDB.pm gets called as a handler whenever the /beerdb uri is accessed, which is what I do telling firefox to open "http://localhost/beerdb/". This results in the error message "Can't use an undefined value as an ARRAY reference at bla/Maypole.pm line 44" in the Apache error log. I copied the corresponding subroutine and marked the line in question. Does anyone see something obvious that I am missing or doing wrong, then please let me know before I spend hours debugging ... sub init { my $class =3D shift; my $config =3D $class->config; $config->{view} ||=3D "Maypole::View::TT"; $config->{view}->require; die "Couldn't load the view class $config->{view}: $@" if $@; ############# next line is line 44 $config->{display_tables} ||=3D [ @{$class->config->{tables}} ]; ############# $class->view_object($class->config->{view}->new); $class->init_done(1); } Thank you, Daniel Brunkhorst. ________________________________=20 Dataport=20 Altenholzer Str 10 - 14, 24161 Altenholz=20 Internet:www.dataport.de=20 E-Mail: daniel.brunkhorst@dataport.de=20 Telefon: 0431 - 32 95 6318=20 Telefax: 0431 - 32 95 410=20 =20 From jcabraham@genpathpharma.com Wed May 12 16:18:30 2004 From: jcabraham@genpathpharma.com (Jim Abraham) Date: Wed, 12 May 2004 11:18:30 -0400 Subject: [Maypole] Problem with Cookbook Method Message-ID: <40A24046.3050302@genpathpharma.com> This is from the "Maypole Request Hacking Cookbook" at http://maypole.simon-cozens.org/doc/Request.html # clip Template Switcheroo An action doesn't have any data of its own to display, but needs to display something. Solution: This is an extremely common hack. You've just issued an action like beer/do_edit, which updates the database. You don't want to display a page that says "Record updated" or similar. Lesser application servers would issue a redirect to have the browser request /beer/view/id instead, but we can actually modify the Maypole request on the fly and, after doing the update, pretend that we were going to /beer/view/id all along. We do this by setting the objects in the objects slot and changing the template to the one we wanted to go to. This hack is so common that it's expected that there'll be a neater way of doing this in the future. # end clip The problem with updating the database and then internally switching to another display page, rather than sending a redirect to a display page is that, if the user then, for whatever, idiotic reason, clicks Reload on that page, he will at the very least get an annoying "POST data" message from the browser, or, at worst, repost the edit page and do a redundant database write. What surprises me is that this behavior (the dreaded "Reload" effect) is "so common" that most developers have already been burned by the internal page switch "bug". This "solution" should probably be rethought. Jim Abraham From simon@simon-cozens.org Wed May 12 16:34:24 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 12 May 2004 16:34:24 +0100 Subject: [Maypole] Problem with Cookbook Method In-Reply-To: <40A24046.3050302@genpathpharma.com> References: <40A24046.3050302@genpathpharma.com> Message-ID: <20040512153424.GA19223@alibi.simon-cozens.org> Jim Abraham: > What surprises me is that this behavior (the dreaded "Reload" effect) is > "so common" that most developers have already been burned by the > internal page switch "bug". This "solution" should probably be rethought. Thoughts welcome! -- Apr 13 11:05:20 apollo13 fsck[3927]: root, we have a problem. - Jeff Gostin From perrin@elem.com Wed May 12 17:24:02 2004 From: perrin@elem.com (Perrin Harkins) Date: Wed, 12 May 2004 12:24:02 -0400 Subject: [Maypole] Problem with Cookbook Method In-Reply-To: <40A24046.3050302@genpathpharma.com> References: <40A24046.3050302@genpathpharma.com> Message-ID: <1084379042.31841.29.camel@localhost.localdomain> On Wed, 2004-05-12 at 11:18, Jim Abraham wrote: > The problem with updating the database and then internally switching to > another display page, rather than sending a redirect to a display page > is that, if the user then, for whatever, idiotic reason, clicks Reload > on that page, he will at the very least get an annoying "POST data" > message from the browser, or, at worst, repost the edit page and do a > redundant database write. And if you redirect the user, you will break the back button. If a redundant write is a serious problem, it's easy to insert a unique ID in the form to make sure it doesn't get sent to the database twice. I think this will come down to a question of what is best for your particular application. - Perrin From jester@panix.com Wed May 12 17:36:32 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 12 May 2004 12:36:32 -0400 Subject: [Maypole] Problem with Cookbook Method Message-ID: <20040512163631.GA23870@panix.com> Perrin wrote: > And if you redirect the user, you will break the back button. If a > redundant write is a serious problem, it's easy to insert a unique ID in > the form to make sure it doesn't get sent to the database twice. Perrin, would you mind giving a quick sketch of how one would implement this in Maypole? I'm sure lots of people would be interested in this--one for the Wiki's cookbook if not the docs proper. Best Jesse From perrin@elem.com Wed May 12 17:47:33 2004 From: perrin@elem.com (Perrin Harkins) Date: Wed, 12 May 2004 12:47:33 -0400 Subject: [Maypole] Problem with Cookbook Method In-Reply-To: <20040512163631.GA23870@panix.com> References: <20040512163631.GA23870@panix.com> Message-ID: <1084380453.31841.56.camel@localhost.localdomain> On Wed, 2004-05-12 at 12:36, Jesse Sheidlower wrote: > Perrin, would you mind giving a quick sketch of how one would implement > this in Maypole? This column of Randal's explains it: http://www.stonehenge.com/merlyn/WebTechniques/col64.html He is using File::Cache for his sessions, but you can just stick it in whatever session-tracking system you have. - Perrin From perrin@elem.com Wed May 12 17:58:20 2004 From: perrin@elem.com (Perrin Harkins) Date: Wed, 12 May 2004 12:58:20 -0400 Subject: [Maypole] Problem with Cookbook Method In-Reply-To: <40A253AD.4040608@genpathpharma.com> References: <40A24046.3050302@genpathpharma.com> <1084379042.31841.29.camel@localhost.localdomain> <40A253AD.4040608@genpathpharma.com> Message-ID: <1084381100.31841.75.camel@localhost.localdomain> [ CC'ing the list ] On Wed, 2004-05-12 at 12:41, Jim Abraham wrote: > Actually, a redirect will not break the back button. You're right, I was thinking of fake redirects with META tags or JavaScript. > As you > say transaction ids are a good idea in general, but it still leaves the > application logic undefined (where should the user be sent in this > event?), not to mention the fact the it still confonts the user with the > annoying "POST data..." message box. I'm not sure there's a truly generic answer to this. Simon's explanation in that section of the docs is a bit flippant, and it wouldn't hurt to add more discussion of the pros and cons of different approaches, if you are up for it. In general, I don't mind the user getting that "POST data" message because, well, that's what you get for doing something stupid, and it doesn't actually break anything. - Perrin From petersm@venzia.com Wed May 12 13:37:27 2004 From: petersm@venzia.com (petersm) Date: Wed, 12 May 2004 07:37:27 -0500 Subject: [Maypole] Problem with Cookbook Method In-Reply-To: <1084379042.31841.29.camel@localhost.localdomain> References: <40A24046.3050302@genpathpharma.com> <1084379042.31841.29.camel@localhost.localdomain> Message-ID: <20040512123415.M47835@petersfamily.org> Perrin Harkins > On Wed, 2004-05-12 at 11:18, Jim Abraham wrote: > > The problem with updating the database and then internally switching to > > another display page, rather than sending a redirect to a display page > > is that, if the user then, for whatever, idiotic reason, clicks Reload > > on that page, he will at the very least get an annoying "POST data" > > message from the browser, or, at worst, repost the edit page and do a > > redundant database write. > > And if you redirect the user, you will break the back button. If a > redundant write is a serious problem, it's easy to insert a unique ID in > the form to make sure it doesn't get sent to the database twice. I > think this will come down to a question of what is best for your > particular application. I agree with Perrin here. The 'POST data' message is usually enough to not have the user resubmit the data (at least in my limited experience). I think the existing solution is simple and will work in most cases. If you feel like it's not adequate maybe you could write another example showing how to do it by a redirect (since that's really the only way to avoid this right?). Michael Peters Venzia From marcus@thefeed.no Wed May 12 19:05:42 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Wed, 12 May 2004 20:05:42 +0200 Subject: [Maypole] Apache2 support for maypole. Message-ID: <40A26776.9010301@thefeed.no> This is a multi-part message in MIME format. --------------050300000507030609080601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I've been hacking a little on maypole, and I now have a working Apache2 driver for Maypole. It requires a small patch to the base maypole class as included below, because modperl2 doesn't like the global Apache->request method. This shouldn't hurt the other driver classes though. Maypole::Authentication::UserSessionCookie doesn't work yet here, (segfaults) but I'm working on it. Marcus Index: lib/Maypole.pm =================================================================== RCS file: /var/cvs/modules/Apache-MVC/lib/Maypole.pm,v retrieving revision 1.18 diff -p -0 -r1.18 Maypole.pm *** lib/Maypole.pm 16 Apr 2004 17:17:13 -0000 1.18 --- lib/Maypole.pm 12 May 2004 17:54:32 -0000 *************** sub handler { *** 55 **** ! $r->get_request(); --- 55 ---- ! $r->get_request(@_); -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no --------------050300000507030609080601 Content-Type: text/plain; name="MVC.pm" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="MVC.pm" package Apache2::MVC; use base 'Maypole'; use Apache2; use Apache::RequestRec; use Apache::RequestUtil; use Apache::Request; use APR::URI; use strict; use warnings; our $VERSION = "0.1"; sub get_request { my ($self,$r)=@_; $self->{ar} = Apache::Request->new($r); } sub parse_location { my $self = shift; $self->{path} = $self->{ar}->uri; my $loc = $self->{ar}->location; no warnings 'uninitialized'; $self->{path} =~ s/^($loc)?\///; $self->parse_path; $self->{params} = { $self->_mod_perl_args($self->{ar})}; $self->{query} = { $self->_mod_perl_args($self->{ar})}; } sub send_output { my $r = shift; $r->{ar}->content_type($r->{content_type}); $r->{ar}->headers_out->set("Content-Length" => length $r->{output}); print ($r->{output}); } sub get_template_root { my $r = shift; $r->{ar}->document_root . "/". $r->{ar}->location; } sub _mod_perl_args { my ($self, $apr) = @_; my %args; foreach my $key ( $apr->param ) { my @values = $apr->param($key); $args{$key} = @values == 1 ? $values[0] : \@values; } return %args; } 1; =head1 NAME Apache2::MVC - Apache2 front-end to Maypole =head1 SYNOPSIS package BeerDB; use base 'Apache2::MVC'; BeerDB->setup("dbi:mysql:beerdb"); BeerDB->config->{uri_base} = "http://your.site/"; BeerDB->config->{display_tables} = [qw[beer brewery pub style]]; # Now set up your database: # has-a relationships # untaint columns 1; =head1 DESCRIPTION Maypole is a Perl web application framework to Java's struts. It is essentially completely abstracted, and so doesn't know anything about how to talk to the outside world. C is a mod_perl2 based subclass of Maypole for. To use it, you need to create a package which represents your entire application. In our example above, this is the C package. This needs to first inherit from C, and then call setup. This will give your package an Apache2-compatible C subroutine, and then pass any parameters onto the C method of the model class. The default model class for Maypole uses L to map a database to classes, but this can be changed by messing with the configuration. (B calling setup.) Next, you should configure your application through the C method. Configuration parameters at present are: =over =item uri_base You B specify this; it is the base URI of the application, which will be used to construct links. =item display_tables If you do not want all of the tables in the database to be accessible, then set this to a list of only the ones you want to display =item rows_per_page List output is paged if you set this to a positive number of rows. =back You should also set up relationships between your classes, such that, for instance, calling C on a C object returns an object representing its associated brewery. For a full example, see the included "beer database" application. =head1 INSTALLATION Create a driver module like the one above. Put the following in your Apache config: SetHandler perl-script PerlHandler BeerDB Copy the templates found in F into the F directory off the web root. When the designers get back to you with custom templates, they are to go in F. If you need to do override templates on a database-table-by-table basis, put the new template in F>. This will automatically give you C, C, C, C and C commands; for instance, a list of breweries, go to http://your.site/beer/brewery/list For more information about how the system works and how to extend it, see L. =head1 AUTHOR Simon Cozens, C Ported to Apache2 by Marcus Ramberg C =head1 LICENSE You may distribute this code under the same terms as Perl itself. --------------050300000507030609080601-- From jester@panix.com Wed May 12 19:14:28 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 12 May 2004 14:14:28 -0400 Subject: [Maypole] Apache2 support for maypole. In-Reply-To: <40A26776.9010301@thefeed.no> References: <40A26776.9010301@thefeed.no> Message-ID: <20040512181427.GA509@panix.com> On Wed, May 12, 2004 at 08:05:42PM +0200, Marcus Ramberg wrote: > I've been hacking a little on maypole, and I now have a working Apache2 > driver for Maypole. It requires a small patch to the base maypole class > as included below, because modperl2 doesn't like the global > Apache->request method. This shouldn't hurt the other driver classes though. Well, even though I'm not running Apache2 yet and have no intentions of switching in the near future, I'll still say "Thank you!" for this work. Jesse Sheidlower From indy@galeb.etf.bg.ac.yu Wed May 12 19:41:08 2004 From: indy@galeb.etf.bg.ac.yu (Nikola Knezevic) Date: Wed, 12 May 2004 20:41:08 +0200 (CEST) Subject: [Maypole] Problem with authentication Message-ID: Hi, I can't take this anymore. I've spent last day and a half modifying this code, failing to find error, which exists. The problem is Auth. I have 3 kinds of users: guests (not logged), users and admin. So I decided to add a link to login page, where gusets can log in, instead of following the some other link and then loging if credentials are wrong. And it fails in one this. It works, but because the form references localhost/gtm/login, even if they log in, they arent redirected. Bumer. I wrote $r->{template}="frontpage", but it isn't followed. Any help? Also, how can I initialy set no_cache(1)? GTM->{ar}->no_cache(1) fails if put after GTM->setup(...) Thanks. This is relevant part: ----8<---- package GTM; use strict; use base qw(Maypole::Authentication::UserSessionCookie Apache::MVC); use Class::DBI::Loader::Relationship; use Digest::MD5; use Apache::Constants qw(:common); use Apache::Cookie; #XXX: to use the benefits of Apache::Reload, I even tried: # BEGIN {GTM->setup(...)} # use GTM::Korisnik; # but it fails to reload with error: Invalid CODE attribute: Exported # double bumer GTM->setup("dbi:mysql:gtm_db;host=localhost",'gtm_test','gtm'); GTM::Korisnik->require; GTM->config->{uri_base} = "http://localhost/gtm"; .... # konfiguracija - autentifikacija GTM->config->{auth}{user_class} = 'GTM::Korisnik'; GTM->config->{auth}{user_field} = 'user_name'; GTM->config->{auth}{password_field} = 'password'; GTM->config->{auth}{cookie_name} = "gtm_login"; GTM->config->{auth}{session_args} = { LockDirectory => "/tmp/locks/", Directory => "/tmp/sessions/" }; .... sub authenticate { my ($self, $r) = @_; $r->{ar}->no_cache(1); $r->get_user; if ($r->{user}) { return $r->model_class->sub_authenticate($r) if $r->model_class->can("sub_authenticate"); $r->{template}="frontpage" if $r->{path} eq "login"; return OK; }; # samo ako nije ulogovan $r->{template}="login"; return OK; } 1; ----->8----------- custom/login [% WRAPPER sablon title="login page" %]

This is login page

[% SET args = request.args.join("/"); %]

You need to log in

[% IF login_error %]
[% login_error %]
[% END %] Username:
Password:
[% END %] ------8<--------- custom/login_part # this is a component, which provides a link to login page [% IF request.user %] Pozdrav, [% request.user.login_name %]. [ logout ] [% ELSE %] [% SET args = request.args.join("/"); %] subscribe login [% END %] From petersm@venzia.com Wed May 12 23:48:55 2004 From: petersm@venzia.com (petersm) Date: Wed, 12 May 2004 17:48:55 -0500 Subject: [Maypole] Maypole Competitor Message-ID: <20040512224135.M14975@petersfamily.org> I don't how useful/informative this will be but I recently discovered Maypole (from the Perl.com article) but I was (still am for a limited amount of time) part of the CheesePizza (cheesepizza.venzia.com) project which is an MVC application framework base on CGI::Application, HTML::Template, and CGI::Session. It has a lot of the same goals and ideas. Design decisions were made (mostly not by me) that I think make it a little clunky but I used it on several dozen projects very happily. Just thought you might like to know so you can add it to your list of competitors (simon). I think I will personally be switching to Maypole for a couple of reasons... I think there will be far more support... I'm really warming up to the idea of Class::DBI... Template::Toolkit makes working with classes and function easy (although I still like HTML::Template for simplicity: maybe we can have an HTML::Template::Extended that let's you use classes and add functions to be used there are well.... just rambling). Anyway, just thought I'd give you the heads up and maybe you can glean some ideas from reading the CheesePizza documentation. Michael Peters Venzia From simon@simon-cozens.org Thu May 13 00:02:20 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 13 May 2004 00:02:20 +0100 Subject: [Maypole] Maypole Competitor In-Reply-To: <20040512224135.M14975@petersfamily.org> References: <20040512224135.M14975@petersfamily.org> Message-ID: <20040512230220.GA13070@alibi.simon-cozens.org> petersm: > I don't how useful/informative this will be but I recently discovered Maypole > (from the Perl.com article) but I was (still am for a limited amount of time) > part of the CheesePizza (cheesepizza.venzia.com) project which is an MVC > application framework base on CGI::Application, HTML::Template, and > CGI::Session. It has a lot of the same goals and ideas. Design decisions were > made (mostly not by me) that I think make it a little clunky but I used it on > several dozen projects very happily. Just thought you might like to know so > you can add it to your list of competitors (simon). Someone emailed me recently to tell me about their new MVC framework project. Oh, I thought. That's nice. Now what? If I seriously maintained the list of competitors, my wiki would be running way over its disk quota. Implementing an MVC framework has become the new templating module: everyone has their own not-invented-here solution, and that's not counting the bazillions of company-internal ones we'll never get to see. What we need is a really flexible, extensible, simple and well-designed solution that encompasses all of the usual ideas and provides scope for implementing even more. Thankfully... -- DYSFUNCTION: The Only Consistent Feature of All of Your Dissatisfying Relationships is You. http://www.despair.com From indy@galeb.etf.bg.ac.yu Thu May 13 00:46:31 2004 From: indy@galeb.etf.bg.ac.yu (Nikola Knezevic) Date: Thu, 13 May 2004 01:46:31 +0200 (CEST) Subject: [Maypole] transforming columns Message-ID: Hi, I'm storing password column as md5 hash. OK, that's easy:) The thig that is not so easy is doing it using CDBI (for me, at least) So I had to copy check_credentials from M:A:USC just to changeone line to: $pw_field => Digest::MD5::md5_hex($r->{params}{$pw_field}), I'm fiddling with CDBI now, but using inflate and deflate doesn't give me any results. Any thoughts? Thanks. From tony-maypole@kasei.com Thu May 13 09:06:13 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Thu, 13 May 2004 09:06:13 +0100 Subject: [Maypole] transforming columns In-Reply-To: References: Message-ID: <20040513080613.GA11407@soto.kasei.com> On Thu, May 13, 2004 at 01:46:31AM +0200, Nikola Knezevic wrote: > Hi, I'm storing password column as md5 hash. OK, that's easy:) > The thig that is not so easy is doing it using CDBI (for me, at least) > I'm fiddling with CDBI now, but using inflate and deflate doesn't give me > any results. Any thoughts? Is this something you're doing at the application level or at the database itself? If you can do it through a database function you could possibly override the placeholder for that column to include the function. If it's at the application you probably have to override the password() method in that table's CDBI subclass to DTRT. Tony From jgilles@glmultimedia.com Thu May 13 12:47:25 2004 From: jgilles@glmultimedia.com (Julien Gilles) Date: Thu, 13 May 2004 13:47:25 +0200 Subject: [Maypole] Pb with :Exported Message-ID: <87ad0cv99u.fsf@jgilles.internal.glmultimedia.com> I have the folowing problem with the ":Exported" : I have a simple Maypole Application, Tv.pm (in /usr/local/lib/site_perl/) package Tv; use base 'Apache::MVC'; use Tv::Seq; Tv->setup(...); Tv->config->{uri_base} = ...; 1; In /usr/local/lib/site_perl/Tv/Seq.pm, I just put : package Tv::Seq; sub create :Exported { } 1; In error.log from Apache : [error] Invalid CODE attribute: Exported at /usr/local/lib/site_perl/Tv/Seq.pm (...) If I remove the "use Tv::Seq;", it's ok. Do I need to add a "use something" to Tv/Seq.pm ? -- Julien Gilles. From simon@simon-cozens.org Thu May 13 13:05:24 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 13 May 2004 13:05:24 +0100 Subject: [Maypole] Pb with :Exported In-Reply-To: <87ad0cv99u.fsf@jgilles.internal.glmultimedia.com> References: <87ad0cv99u.fsf@jgilles.internal.glmultimedia.com> Message-ID: <20040513120524.GA28516@alibi.simon-cozens.org> Julien Gilles: > [error] Invalid CODE attribute: Exported at /usr/local/lib/site_perl/Tv/Seq.pm (...) Did you try reading the manual? :) http://maypole.simon-cozens.org/doc/Request.html , first recipe. -- "(Because if life's not shit, then you're not doing it right.)" - Rebecca Luckraft From petter.egesund@kunnskapsforlaget.no Thu May 13 13:09:49 2004 From: petter.egesund@kunnskapsforlaget.no (Petter Egesund) Date: Thu, 13 May 2004 14:09:49 +0200 Subject: [Maypole] Many to many Message-ID: <9C4158A14701F94491A40E54FED9ACD4856E61@kf-nt.kf.local> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C438E3.30489010 Content-Type: text/plain Is there any progression on the many to many problem with Maypole (I think I will wait until this problem is solved)? Cheers, Petter ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ ------_=_NextPart_001_01C438E3.30489010 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Many to many

Is there any progression on the many = to many problem with Maypole (I think I will wait until this problem is = solved)?

Cheers,

Petter
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft = Exchange.
For more information, connect to http://www.F-Secure.com/

------_=_NextPart_001_01C438E3.30489010-- From jgilles@glmultimedia.com Thu May 13 13:32:11 2004 From: jgilles@glmultimedia.com (Julien Gilles) Date: Thu, 13 May 2004 14:32:11 +0200 Subject: [Maypole] Pb with :Exported In-Reply-To: <20040513120524.GA28516@alibi.simon-cozens.org> (Simon Cozens's message of "Thu, 13 May 2004 13:05:24 +0100") References: <87ad0cv99u.fsf@jgilles.internal.glmultimedia.com> <20040513120524.GA28516@alibi.simon-cozens.org> Message-ID: <8765b0v778.fsf@jgilles.internal.glmultimedia.com> Simon Cozens writes: > Julien Gilles: >> [error] Invalid CODE attribute: Exported at /usr/local/lib/site_perl/Tv/Seq.pm (...) > > Did you try reading the manual? :) > http://maypole.simon-cozens.org/doc/Request.html , first recipe. Oops. Now I've changed my eyes, It's much better. Thanks. -- Julien Gilles. From marius@kjeldahl.net Thu May 13 20:02:41 2004 From: marius@kjeldahl.net (Marius Kjeldahl) Date: Thu, 13 May 2004 21:02:41 +0200 Subject: Fwd: [Maypole] ISellIt example - subcategory trouble Message-ID: <200405132102.41777.marius@kjeldahl.net> A couple of weeks ago, I sent a question as described below. I got no replies, so I'm asking again. To simplify matters a bit; does anybody know if there is a problem with pulldown boxes not working properly? When I tested with the ISellIt example from the article series (see complete message below), it did not register any of the pulldown selections. Alternatively, what would you suggest as a "better" example application for starting development with Maypole? Thanks, Marius K. ---------- Forwarded Message ---------- Subject: [Maypole] ISellIt example - subcategory trouble Date: Monday 03 May 2004 23:35 From: Marius Kjeldahl To: maypole@lists.netthink.co.uk I've read the articles and set it up (the part from the first article) to run locally. After some struggling figuring out that I needed to mirror the Location directive with an actual directory entry in the server root and populate them with templates (which I had to access CVS to get), I managed to get it working. Looks great. But it seems "subcategory" adding/editing does not work. The category drop down does not get stored. Not when I add it "directly" in the subcategories list or even when I "edit" a subcategory. Am I the only one? Thanks, Marius K. _______________________________________________ maypole mailing list maypole@lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole ------------------------------------------------------- From jester@panix.com Thu May 13 20:50:09 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 13 May 2004 15:50:09 -0400 Subject: [Maypole] Patches to fix multiple form-submission issues Message-ID: <20040513195009.GA9228@panix.com> --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This is a followup to the thread "Problem with Cookbook Method," the problem being the multiple form submissions, either by hitting "reload" and ignoring the browser's warning on resending a POST request, or by hitting "back" and then whatever the "create" or "submit" button is. Perrin was kind enough to point me to an article of Randal's on this exact problem, and I have adopted his general technique. Using this functionality will require that you have some kind of session management already running, as discussed in Maypole::Authentication::UserSessionCookie, but it will not break anything where no sessions are available. The basic idea is that when a form is sent to the browser, it will include a random form_id variable, which should be placed in a hidden field; this variable is stored server-side in the session. When the form is submitted, the do_edit method will check to see if the form_id sent with the form matches the form_id held in the session; if it does, the session's copy is deleted (thus preventing a match if the form is resent) and life goes on. If it does not match, a message is generated, and the user is sent back to the "list" template. (Perhaps this isn't the best place to go.) I haven't included any doc patches, but: to use it, just add this line to any form sent to the do_edit method (i.e. any add or edit form, factory (Simon: I haven't patched the factory forms) or custom: That's it. My only real issue is that the get_form_id method has to be placed in Apache::MVC so it can be called by the request method; this, if you're using another front-end, you have to copy the get_form_id method there. I'd rather put it in CBDI.pm, but I don't then know how to call it from a template. Hope this helps anyone. Best, Jesse Sheidlower --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=CDBI-patch *** CDBI.pm-orig Thu May 13 15:32:39 2004 --- CDBI.pm Thu May 13 15:37:59 2004 *************** *** 36,41 **** --- 36,52 ---- sub do_edit :Exported { my ($self, $r) = @_; + if (defined $r->{session}) { + if ($r->{session}{form_id} ne $r->{params}{form_id}) { + push @{$r->{template_args}{messages}}, + "There was a problem with your form; you may have accidentally tried to resubmit it"; + $self->list($r); + $r->{template} = "list"; + return; + } else { # we're OK; clear form_id so it can't be reused + delete $r->{session}{form_id}; + } + } my $h = CGI::Untaint->new(%{$r->{params}}); my ($obj) = @{$r->objects || []}; if ($obj) { --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=MVC-patch *** MVC.pm-orig Thu May 13 14:59:26 2004 --- MVC.pm Thu May 13 14:59:31 2004 *************** *** 10,15 **** --- 10,23 ---- shift->{ar} = Apache::Request->new(Apache->request); } + sub get_form_id { + my $self = shift; + use Apache::Session::Generate::MD5; + my $form_id = Apache::Session::Generate::MD5::generate(); + $self->{session}{form_id} = $form_id; + return $form_id; + } + sub parse_location { my $self = shift; $self->{path} = $self->{ar}->uri; --GvXjxJ+pjyke8COw-- From marcus@thefeed.no Thu May 13 21:35:57 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Thu, 13 May 2004 22:35:57 +0200 Subject: [Maypole] Maypole-Authentication-UserSessionCookie Apache2 Patch Message-ID: <40A3DC2D.9010605@thefeed.no> This is a multi-part message in MIME format. --------------050508070101030403010901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Below is a patch for Maypole-Authentication-UserSessionCookie to allow it to work with Apache2. This also required some changes to Apache2::MVC, so I'm including a updated version of that too. Marcus diff -p -0 -r1.5 UserSessionCookie.pm *** UserSessionCookie.pm 29 Apr 2004 15:16:00 -0000 1.5 --- UserSessionCookie.pm 13 May 2004 20:34:29 -0000 *************** use Apache::Cookie; *** 5 **** --- 6,10 ---- + my ($ModPerl2) = ($mod_perl::VERSION >= 1.99); + if($ModPerl2) { + eval "use Apache::RequestRec;use Apache::RequestUtil;"; + } + *************** sub get_user { *** 53 **** ! my %jar = Apache::Cookie->new($ar)->parse; --- 58,64 ---- ! my %jar; ! if ($ModPerl2) { ! %jar = Apache::Cookie->fetch($ar); ! } else { ! %jar = Apache::Cookie->parse; ! } ! *************** L *** 244 **** --- 256,257 ---- + + 1; -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no --------------050508070101030403010901 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="MVC.pm" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="MVC.pm" package Apache2::MVC; use base 'Maypole'; use Apache2; use Apache::RequestRec; use Apache::RequestUtil; use Apache::Request; use APR::URI; use strict; use warnings; our $VERSION = "0.1"; sub get_request { my ($self,$r)=@_; $self->{ar} = $r; } sub parse_location { my $self = shift; $self->{path} = $self->{ar}->uri; my $loc = $self->{ar}->location; no warnings 'uninitialized'; $self->{path} =~ s/^($loc)?\///; $self->parse_path; $self->{params} = { $self->_mod_perl_args($self->{ar})}; $self->{query} = { $self->_mod_perl_args($self->{ar})}; } sub send_output { my $r = shift; $r->{ar}->content_type($r->{content_type}); $r->{ar}->headers_out->set("Content-Length" => length $r->{output}); print ($r->{output}); } sub get_template_root { my $r = shift; $r->{ar}->document_root . "/". $r->{ar}->location; } sub _mod_perl_args { my ($self, $apr) = @_; my %args; $apr=Apache::Request->new($apr); foreach my $key ( $apr->param ) { my @values = $apr->param($key); $args{$key} = @values == 1 ? $values[0] : \@values; } return %args; } 1; =head1 NAME Apache2::MVC - Apache2 front-end to Maypole =head1 SYNOPSIS package BeerDB; use base 'Apache2::MVC'; BeerDB->setup("dbi:mysql:beerdb"); BeerDB->config->{uri_base} = "http://your.site/"; BeerDB->config->{display_tables} = [qw[beer brewery pub style]]; # Now set up your database: # has-a relationships # untaint columns 1; =head1 DESCRIPTION Maypole is a Perl web application framework to Java's struts. It is essentially completely abstracted, and so doesn't know anything about how to talk to the outside world. C is a mod_perl2 based subclass of Maypole for. To use it, you need to create a package which represents your entire application. In our example above, this is the C package. This needs to first inherit from C, and then call setup. This will give your package an Apache2-compatible C subroutine, and then pass any parameters onto the C method of the model class. The default model class for Maypole uses L to map a database to classes, but this can be changed by messing with the configuration. (B calling setup.) Next, you should configure your application through the C method. Configuration parameters at present are: =over =item uri_base You B specify this; it is the base URI of the application, which will be used to construct links. =item display_tables If you do not want all of the tables in the database to be accessible, then set this to a list of only the ones you want to display =item rows_per_page List output is paged if you set this to a positive number of rows. =back You should also set up relationships between your classes, such that, for instance, calling C on a C object returns an object representing its associated brewery. For a full example, see the included "beer database" application. =head1 INSTALLATION Create a driver module like the one above. Put the following in your Apache config: SetHandler perl-script PerlHandler BeerDB Copy the templates found in F into the F directory off the web root. When the designers get back to you with custom templates, they are to go in F. If you need to do override templates on a database-table-by-table basis, put the new template in F>. This will automatically give you C, C, C, C and C commands; for instance, a list of breweries, go to http://your.site/beer/brewery/list For more information about how the system works and how to extend it, see L. =head1 AUTHOR Simon Cozens, C Ported to Apache2 by Marcus Ramberg C =head1 LICENSE You may distribute this code under the same terms as Perl itself. --------------050508070101030403010901-- From marcus@thefeed.no Thu May 13 21:54:47 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Thu, 13 May 2004 22:54:47 +0200 Subject: [Maypole] Maypole-Authentication-UserSessionCookie Apache2 Patch In-Reply-To: <40A3DC2D.9010605@thefeed.no> References: <40A3DC2D.9010605@thefeed.no> Message-ID: <40A3E097.6020807@thefeed.no> Somehow the latest phoenix seems to be eating the body of messages with patches to this list, but I guess you figured out what the last message was from the subject, anyhow, it requires a small update to Apache2::MVC, which is why a updated version of that one is attached. Enjoy. Marcus -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From lists-maypole@pimb.org Fri May 14 12:56:10 2004 From: lists-maypole@pimb.org (Jody Belka) Date: Fri, 14 May 2004 11:56:10 +0000 Subject: [Maypole] Couple of small patches Message-ID: <20040514115610.GA3925@faith.gentoo.org> Below are a couple of patches to solve a couple of problems i tripped across in playing with BeerDB. First, a patch for Class::DBI::AsForm Reasoning: small typo which results in textareas always appearing blank --- AsForm.pm 2004-03-20 18:35:54.000000000 +0100 +++ /usr/local/share/perl/5.8.3/Class/DBI/AsForm.pm 2004-05-14 11:57:20.000000000 +0200 @@ -92,7 +92,7 @@ # Right, have some of this! eval "package $class; Class::DBI::Plugin::Type->import()"; my $type = $class->column_type($field); - return $class->_to_textarea($field) + return $self->_to_textarea($field) if $type and $type =~ /^(TEXT|BLOB)$/i; return $self->_to_textfield($field); } Second, a patch for Apache::MVC Reasoning: CGI.pm returns an empty string for a parameter without a value in the query string (eg, "name1=&name2=" or "name1&name2") Apache::Request returns undef instead. Class::DBI::FromCGI then ignores that field because of this. --- MVC.pm 2004-04-02 14:26:42.000000000 +0200 +++ /usr/local/share/perl/5.8.3/Apache/MVC.pm 2004-05-14 12:55:55.000000000 +0200 @@ -19,6 +19,9 @@ $self->parse_path; $self->{params} = { $self->{ar}->content }; + while (my ($key, $value) = each %{$self->{params}}) { + $self->{params}{$key} = '' unless defined $value; + } $self->{query} = { $self->{ar}->args }; } -- Jody Belka knew (at) pimb (dot) org From perrin@elem.com Fri May 14 20:47:32 2004 From: perrin@elem.com (Perrin Harkins) Date: Fri, 14 May 2004 15:47:32 -0400 Subject: [Maypole] Patches to fix multiple form-submission issues In-Reply-To: <20040513195009.GA9228@panix.com> References: <20040513195009.GA9228@panix.com> Message-ID: <1084564052.31841.377.camel@localhost.localdomain> On Thu, 2004-05-13 at 15:50, Jesse Sheidlower wrote: > The basic idea is that when a form is sent to the browser, it > will include a random form_id variable, which should be placed > in a hidden field; this variable is stored server-side in the > session. When the form is submitted, the do_edit method will > check to see if the form_id sent with the form matches the form_id > held in the session; if it does, the session's copy is deleted > (thus preventing a match if the form is resent) and life goes > on. If it does not match, a message is generated, and the user > is sent back to the "list" template. (Perhaps this isn't the > best place to go.) Interestingly, although that does appear to be what Randal was doing, this is not how I would do it. I think that just goes to show that you can only generalize the expected behavior of web apps so far. What I would do is put the unique ID of a form into the session AFTER processing it, and whenever a new update request comes in I would check to see that it wasn't a form submission I already handled. With the method you implemented, I would be concerned about multiple windows being open. I don't want to stop users from opening multiple windows with forms in them; I just want to only process each form submission once. My approach (storing the already processed form ids) doesn't have a problem with multiple windows. - Perrin From simon@simon-cozens.org Fri May 14 21:20:56 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Fri, 14 May 2004 21:20:56 +0100 Subject: [Maypole] Patches to fix multiple form-submission issues In-Reply-To: <1084564052.31841.377.camel@localhost.localdomain> References: <20040513195009.GA9228@panix.com> <1084564052.31841.377.camel@localhost.localdomain> Message-ID: <20040514202056.GA9432@alibi.simon-cozens.org> Perrin Harkins: > Interestingly, although that does appear to be what Randal was doing, > this is not how I would do it. I think that just goes to show that you > can only generalize the expected behavior of web apps so far. Or that when you've finished generalizing it, you have to specify it again if you want to code it. :) Incidentally, I'm not sure I like the idea of requiring there to be a session. Goes against the whole "keeping it simple" thing, and costs generality. -- 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 From m.spring@gmx.de Sat May 15 10:16:20 2004 From: m.spring@gmx.de (Markus Spring) Date: Sat, 15 May 2004 11:16:20 +0200 Subject: [Maypole] Installation Woes Message-ID: <40A5DFE4.7000500@gemini.local> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi list, as Simons article on www.perl.com was *really* mouth watering, I try to install Maypole myself, but: I cautiously installed all prerequisites under Perl 5.8.4, with * DBI 1.41 (otherwise DBD::Pg does not test ok) * Class:DBI::AsForm 2.1 (as 2.2 does not test ok) * All other modules in their most up-to-date versions The error message of Class:DBI::AsForm 2.2 is ok 1 - use Class::DBI::AsForm; Can't locate object method "db_Main" via package "Foo" at /root/.cpan/build/Ima-DBI-0.33/blib/lib/Ima/DBI.pm line 386. Now Maypole 1.4 compiles ok but complains when testing: t/1....ok 3/5Can't call method "fetchrow_hashref" on an undefined value at /usr/local/lib/perl5/site_perl/5.8.4/Class/DBI/AsForm.pm line 106. Same does Apache::MVC from CVS. So I am really stuck no, as the failing test gives me no hint what to do. Any help will be greatly appreciated Kind regards Markus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail