From raptor@tvskat.net Tue Jun 1 09:55:53 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Tue, 1 Jun 2004 11:55:53 +0300 Subject: [Maypole] apache2 or cgi? Message-ID: <20040601115553.759d77ec@bugs> hi, I "brusted" over the arhives and see there is some discussion about support for Apache2... what are the steps to make maypole working under apache2, if possible? As worst case scenario how to run it under pure CGI ? tia From dave@dave.org.uk Tue Jun 1 10:17:35 2004 From: dave@dave.org.uk (Dave Cross) Date: Tue, 1 Jun 2004 10:17:35 +0100 Subject: [Maypole] apache2 or cgi? In-Reply-To: <20040601115553.759d77ec@bugs> References: <20040601115553.759d77ec@bugs> Message-ID: <20040601091735.GA10279@mag-sol.com> On Tue, Jun 01, 2004 at 11:55:53AM +0300, raptor@tvskat.net wrote: > hi, > > I "brusted" over the arhives and see there is some discussion about > support for Apache2... what are the steps to make maypole working > under apache2, if possible? I got Maypole working fine under Apache2 by following the directions in http://lists.netthink.co.uk/pipermail/maypole/2004-May/000248.html I also had to install the Apache2 version of Apache::Request which I got from http://search.cpan.org/dist/libapreq2-2.02_02-dev/ Dave... -- New .sigs Running in please parse From raptor@tvskat.net Tue Jun 1 13:41:54 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Tue, 1 Jun 2004 15:41:54 +0300 Subject: [Maypole] apache2 or cgi? In-Reply-To: <20040601091735.GA10279@mag-sol.com> References: <20040601115553.759d77ec@bugs> <20040601091735.GA10279@mag-sol.com> Message-ID: <20040601154154.6b4b02e0@bugs> > http://search.cpan.org/dist/libapreq2-2.02_02-dev/ what about : << Maypole::Authentication::UserSessionCookie doesn't work yet here, (segfaults) but I'm working on it. >> When I try : ./configure --with-apache2-apxs=/usr/sbin/apxs2 >>>>............... checking whether to enable maintainer-specific portions of Makefiles... no build/version_check.pl failed: no version_string found in ''. configure: error: Bad apache2 version --with-apache2-apxs <-- what this mean path to apxs binary or some directory ?! From raptor@tvskat.net Tue Jun 1 14:08:23 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Tue, 1 Jun 2004 16:08:23 +0300 Subject: [Maypole] CGI::Maypole Message-ID: <20040601160823.7e3929e4@bugs> Simultaneously I'm tring CGI variant too : ... client denied by server configuration: /usr/htdocs Premature end of script headers: test.pl file error - frontpage: not found at /usr/lib/perl5/site_perl/5.8.2/Maypole/View/Base.pm line 3077 ...... As stated in the Wiki FAQ I'm tring to put slash at the end, but still get this error , can this be 'cause >>> client denied by server configuration: /usr/htdocs <<< What I've set is a lib directory where I put MyTest.pm : package MyTest; #use base 'Apache::MVC'; use base 'CGI::Maypole'; MyTest->setup("dbi:SQLite:/path/to/db/test.db"); MyTest->config->{uri_base} = "http://localhost/maypole/"; MyTest->config->{rows_per_page} = 10; MyTest->config->{display_tables} = [qw[test]]; 1; then test.pl like this : #!/usr/bin/perl -w use strict; use lib '/path/to/maypole/lib'; use MyTest; MyTest->run(); and fetched like this : wget http://x.x.x.x/maypole/test.pl/ --15:47:12-- http://x.x.x.x/maypole/test.pl/ => `index.html' Connecting to x.x.x.x:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 15:47:13 ERROR 500: Internal Server Error. this doesnt help either : wget http://x.x.x.x/maypole/test.pl/list --16:00:58-- http://x.x.x.x/maypole/test.pl/list => `list' Connecting to x.x.x.x:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 16:00:58 ERROR 500: Internal Server Error. wget http://x.x.x.x/maypole/test.pl/test/list either... the "test" is the name of the Table ... what i'm doing wrong .. tia From raptor@tvskat.net Tue Jun 1 14:23:29 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Tue, 1 Jun 2004 16:23:29 +0300 Subject: [Maypole] CGI::Maypole In-Reply-To: <20040601160823.7e3929e4@bugs> References: <20040601160823.7e3929e4@bugs> Message-ID: <20040601162329.323a3f18@bugs> Hmm :") i had to do it like this so I dont get Internal error :: > then test.pl like this : > > #!/usr/bin/perl -w print "Content-type: text/html \n\n"; > use strict; > use lib '/path/to/maypole/lib'; > use MyTest; > MyTest->run(); but still no success.. it seems I have to copy from somewhere --> somewhere-else templates ... but from where to where ? tia From raptor@tvskat.net Tue Jun 1 16:25:18 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Tue, 1 Jun 2004 18:25:18 +0300 Subject: [Maypole] CGI::Maypole In-Reply-To: <20040601160823.7e3929e4@bugs> References: <20040601160823.7e3929e4@bugs> Message-ID: <20040601182518.751490d0@bugs> I found the problem the following has to be added to MyTest : sub get_template_root { "/path/to/templates/" } where I can find the .css stuff ... it looks very ugly not as shown on perl.com :") On Tue, 1 Jun 2004 16:08:23 +0300 "raptor@tvskat.net" wrote: > Simultaneously I'm tring CGI variant too : > > ... > client denied by server configuration: /usr/htdocs > Premature end of script headers: test.pl > file error - frontpage: not found at /usr/lib/perl5/site_perl/5.8.2/Maypole/View/Base.pm line 3077 ...... > > > As stated in the Wiki FAQ I'm tring to put slash at the end, but still get this error , can this be 'cause > > >>> client denied by server configuration: /usr/htdocs <<< > > What I've set is a lib directory where I put MyTest.pm : > > package MyTest; > #use base 'Apache::MVC'; > use base 'CGI::Maypole'; > > MyTest->setup("dbi:SQLite:/path/to/db/test.db"); > MyTest->config->{uri_base} = "http://localhost/maypole/"; > MyTest->config->{rows_per_page} = 10; > MyTest->config->{display_tables} = [qw[test]]; > 1; > > then test.pl like this : > > #!/usr/bin/perl -w > use strict; > use lib '/path/to/maypole/lib'; > use MyTest; > MyTest->run(); > > > and fetched like this : > > wget http://x.x.x.x/maypole/test.pl/ > --15:47:12-- http://x.x.x.x/maypole/test.pl/ > => `index.html' > Connecting to x.x.x.x:80... connected. > HTTP request sent, awaiting response... 500 Internal Server Error > 15:47:13 ERROR 500: Internal Server Error. > > this doesnt help either : > > wget http://x.x.x.x/maypole/test.pl/list > --16:00:58-- http://x.x.x.x/maypole/test.pl/list > => `list' > Connecting to x.x.x.x:80... connected. > HTTP request sent, awaiting response... 500 Internal Server Error > 16:00:58 ERROR 500: Internal Server Error. > > > wget http://x.x.x.x/maypole/test.pl/test/list > > either... the "test" is the name of the Table ... > > what i'm doing wrong .. > > tia > > _______________________________________________ > maypole mailing list > maypole@lists.netthink.co.uk > http://lists.netthink.co.uk/listinfo/maypole > From marcus@thefeed.no Tue Jun 1 17:09:40 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Tue, 01 Jun 2004 18:09:40 +0200 Subject: [Maypole] apache2 or cgi? In-Reply-To: <20040601154154.6b4b02e0@bugs> References: <20040601115553.759d77ec@bugs> <20040601091735.GA10279@mag-sol.com> <20040601154154.6b4b02e0@bugs> Message-ID: <40BCAA44.3030100@thefeed.no> raptor@tvskat.net wrote: >>http://search.cpan.org/dist/libapreq2-2.02_02-dev/ >> >> > >what about : ><< >Maypole::Authentication::UserSessionCookie doesn't work yet here, >(segfaults) but I'm working on it. > > I have a working version of this, can't remember if I posted the last version of this to the list. Should be part of the next release of this module I guess. Sure wish someone had taken up Simon on the project manager mail. Marcus -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From simon@simon-cozens.org Tue Jun 1 18:04:11 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 1 Jun 2004 18:04:11 +0100 Subject: [Maypole] apache2 or cgi? In-Reply-To: <40BCAA44.3030100@thefeed.no> References: <20040601115553.759d77ec@bugs> <20040601091735.GA10279@mag-sol.com> <20040601154154.6b4b02e0@bugs> <40BCAA44.3030100@thefeed.no> Message-ID: <20040601170411.GB26177@alibi.simon-cozens.org> Marcus Ramberg: > I have a working version of this, can't remember if I posted the last > version of this to the list. Should be part of the next release of this > module I guess. I'd be happy for this module to spun off to you if you want. > Sure wish someone had taken up Simon on the project > manager mail. Oh, plenty of people did. Unfortunately, without a clear list of priorities, taking one of them up on the offer hasn't been a priority yet. :) I should have time to look at another batch of Maypole stuff in about two weeks. In the meantime, I'd sure love it if people told me what they thought I should be doing by sending change requests to bugs-Maypole@rt.cpan.org -- Heh, heh, heh, heh... the NOISE of a bursar CHEWING Proctors' Memoranda. - Henry Braun is Oxford Zippy From marcus@thefeed.no Tue Jun 1 21:02:20 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Tue, 01 Jun 2004 22:02:20 +0200 Subject: [Maypole] Patch to allow different ok_tables and display_tables Message-ID: <40BCE0CC.6020202@thefeed.no> Hi. Some of the tables I want only accessible through links from other tables, others I want to display, so I've made this patch which allows you to specify ok_tables as well as display_tables . It also allows ok_tables to use the same format as display_tables. Marcus RCS file: /var/cvs/modules/Apache-MVC/lib/Maypole.pm,v retrieving revision 1.18 diff -u -r1.18 Maypole.pm @@ -89,7 +90,10 @@ sub is_applicable { my $self = shift; my $config = $self->config; - $config->{ok_tables} = {map {$_ => 1} @{$config->{display_tables}}}; + $config->{ok_tables} ||= @{$config->{display_tables}}; + $config->{ok_tables} = {map {$_=>1} @{$config->{ok_tables}}} + if ref $config->{ok_tables} eq "ARRAY"; warn "We don't have that table ($self->{table})" if $self->debug and not $config->{ok_tables}{$self->{table}}; return DECLINED() unless exists $config->{ok_tables}{$self->{table}}; -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From s.willert@media-net.de Wed Jun 2 02:27:12 2004 From: s.willert@media-net.de (Sebastian Willert) Date: Wed, 02 Jun 2004 03:27:12 +0200 Subject: [Maypole] Using Maypole with existing Class::DBI classes Message-ID: <1086139632.3760.11.camel@localhost> Hi all, I am very impressed by Maypole and want to use it with a set of classes I've written using Class::DBI before I stubled on this framework. I could not use Maypole::Model::CDBI because the classes have names that are slightly different from those produced by Class::DBI::Loader. I have included my attempt to extend Maypole::Model::CDBI [1] to use this classes instead of autoloading some from Class::DBI::Loader, but I failed. The sources listed below do neither interact with the database (mysql logging is enabled but empty) nor produce any error messages: it's just like operating on empty datasets. I've tried to dig through the sources of Maypole (version 1.4) but lost my way after all this indirection and multiple inheritance and stuff, so I'd like to ask if anyone here can spot what I am doing wrong or even provide me with an example of a working model class for preexisting Class::DBI classes. Regards, Sebastian P.S. Have mercy if I've done something completly braindead, I am fairly new to the wonderful world of Class::DBI and friends. --- [1] My attempt at Driver and Model classes for use with preexisting Class::DBI classes package Bar::A; use Class::DBI::FromCGI; use Class::DBI::mysql; use base 'Class::DBI::mysql'; __PACKAGE__->set_db( 'Main', 'dbi:mysql:bar' ); __PACKAGE__->set_up_table( 'tbl_a' ); __PACKAGE__->has_many( addresses => 'Bar::A::B' ); package Bar::A::B; use Class::DBI::FromCGI; use Class::DBI::mysql; use base 'Class::DBI::mysql'; __PACKAGE__->set_db( 'Main', 'dbi:mysql:bar' ); __PACKAGE__->set_up_table( 'tbl_a_b' ); package Bar; use base 'Apache::MVC'; Bar->setup("dbi:mysql:bar"); Bar->config->{uri_base} = "http://bar.loc/"; Bar->config->{rows_per_page} = 10; Bar->config->{model} = 'Bar::Model'; Bar->config->{display_tables} = [qw[tbl_a tbl_b]]; Bar::A->untaint_columns( printable => [qw/foo1 foo2/] ); Bar::A::B->untaint_columns( email => [qw/email/] ); package Bar::Model; use Maypole::Model::CDBI; use base 'Maypole::Model::CDBI'; my %_classlist = ( tbl_a => 'Bar::A', tbl_a_b => 'Bar::A::B' ); sub setup_database { my ($self, $config, $namespace, $dsn, $u, $p) = @_; $config->{dsn} = $dsn; $config->{classes} = [ sort values %_classlist ]; $config->{tables} = [ sort keys %_classlist ]; $self->adopt($_) for @{$config->{classes}}; } sub class_of { my ($self, $r, $table) = @_; return $_classlist{ $table } || $self->SUPER::class_of( $r, $table ); } From raptor@tvskat.net Wed Jun 2 07:49:37 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Wed, 2 Jun 2004 09:49:37 +0300 Subject: [Maypole] from where to dload beerdb resurses ? Message-ID: <20040602094937.5cdd1a2c@bugs> hi, >From where I can get isellit and or beerdb CSS-sheets and templates and pictures.. tia From marcus@thefeed.no Wed Jun 2 08:23:33 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Wed, 02 Jun 2004 09:23:33 +0200 Subject: [Maypole] Using Maypole with existing Class::DBI classes In-Reply-To: <1086139632.3760.11.camel@localhost> References: <1086139632.3760.11.camel@localhost> Message-ID: <40BD8075.8060009@thefeed.no> Sebastian Willert wrote: >Hi all, > >I am very impressed by Maypole and want to use it with a set of classes >I've written using Class::DBI before I stubled on this framework. I >could not use Maypole::Model::CDBI because the classes have names that >are slightly different from those produced by Class::DBI::Loader. I have >included my attempt to extend Maypole::Model::CDBI [1] to use this >classes instead of autoloading some from Class::DBI::Loader, but I >failed. The sources listed below do neither interact with the database >(mysql logging is enabled but empty) nor produce any error messages: >it's just like operating on empty datasets. > > Hi Sebastian. Maypole::Model::CDBI does not require Class::DBI::Loader. You can write normal CDBI classes and inherit from Maypole::Model::CDBI , see the Flox example in http://cvs.simon-cozens.org/viewcvs.cgi/flox/ for an example of an application that does this. Marcus -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From simon@simon-cozens.org Wed Jun 2 09:44:26 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 2 Jun 2004 09:44:26 +0100 Subject: [Maypole] Using Maypole with existing Class::DBI classes In-Reply-To: <40BD8075.8060009@thefeed.no> References: <1086139632.3760.11.camel@localhost> <40BD8075.8060009@thefeed.no> Message-ID: <20040602084426.GA3828@alibi.simon-cozens.org> Marcus Ramberg: > >I am very impressed by Maypole and want to use it with a set of classes > >I've written using Class::DBI before I stubled on this framework. I > >could not use Maypole::Model::CDBI because the classes have names that > >are slightly different from those produced by Class::DBI::Loader. > > Hi Sebastian. Maypole::Model::CDBI does not require Class::DBI::Loader. Yes, it does. > You can write normal CDBI classes and inherit from Maypole::Model::CDBI > , see the Flox example in http://cvs.simon-cozens.org/viewcvs.cgi/flox/ > for an example of an application that does this. This doesn't solve the problem of the CDBI::Loader class names being different from the ones you choose yourself. I'm about to need to write Maypole::Model::CDBI::Plain, which overrides the setup_database and class_of methods to take a DSN, username, password and list of classes. It's sufficiently trivial that I could do it today, but I want to wait until Email::Store is done (by the end of this week) so I can get it heavily tested. -- Oh dear. I've just realised that my fvwm config lasted longer than my marriage, in that case. - Anonymous From raptor@tvskat.net Wed Jun 2 09:49:50 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Wed, 2 Jun 2004 11:49:50 +0300 Subject: [Maypole] edit & add ? Message-ID: <20040602114950.49b81eb5@bugs> Any idea why I'm getting this when I try to update a record :: Premature end of script headers: test.pl, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 Use of uninitialized value in subroutine entry at /usr/lib/perl5/vendor_perl/5.8.2/DBIx/ContextualFetch.pm line 51, line 3077., referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 Can't update 2: DBD::SQLite::st execute failed: [for Statement "UPDATE test, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 SET blah = ?, x = ?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 WHERE id=?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 "] at /usr/lib/perl5/vendor_perl/5.8.2/DBIx/ContextualFetch.pm line 51, line 3077., referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 at /usr/lib/perl5/vendor_perl/5.8.2/Class/DBI/FromCGI.pm line 233, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 MyTest::Test MyTest::Test=HASH(0x87ca9b8) destroyed without saving changes to blah, x at /arh/sites/maypole/webroot/test.pl line 0, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 Similar things happens when I try to add new record.. tia From simon@simon-cozens.org Wed Jun 2 09:52:36 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 2 Jun 2004 09:52:36 +0100 Subject: [Maypole] edit & add ? In-Reply-To: <20040602114950.49b81eb5@bugs> References: <20040602114950.49b81eb5@bugs> Message-ID: <20040602085236.GA4961@alibi.simon-cozens.org> raptor@tvskat.net: > Any idea why I'm getting this when I try to update a record :: > > Can't update 2: DBD::SQLite::st execute failed: [for Statement "UPDATE test, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > SET blah = ?, x = ?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > WHERE id=?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > "] at /usr/lib/perl5/vendor_perl/5.8.2/DBIx/ContextualFetch.pm line 51, line 3077., referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 I think this probably means your web server user doesn't have permission to write to the database. It's pretty hard to tell from the limited information you've given. -- He is no fool who gives what he cannot keep to gain what he cannot lose. From raptor@tvskat.net Wed Jun 2 10:38:23 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Wed, 2 Jun 2004 12:38:23 +0300 Subject: [Maypole] edit & add ? In-Reply-To: <20040602085236.GA4961@alibi.simon-cozens.org> References: <20040602114950.49b81eb5@bugs> <20040602085236.GA4961@alibi.simon-cozens.org> Message-ID: <20040602123823.157ab34d@bugs> yep that was the problem thanx alot ... > raptor@tvskat.net: > > Any idea why I'm getting this when I try to update a record :: > > > > Can't update 2: DBD::SQLite::st execute failed: [for Statement "UPDATE test, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > > SET blah = ?, x = ?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > > WHERE id=?, referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > > "] at /usr/lib/perl5/vendor_perl/5.8.2/DBIx/ContextualFetch.pm line 51, line 3077., referer: http://x.x.x.x:81/maypole/test.pl/test/edit/2 > > I think this probably means your web server user doesn't have permission to > write to the database. It's pretty hard to tell from the limited information > you've given. From marcus@thefeed.no Wed Jun 2 11:27:38 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Wed, 02 Jun 2004 12:27:38 +0200 Subject: [Maypole] Using Maypole with existing Class::DBI classes In-Reply-To: <20040602084426.GA3828@alibi.simon-cozens.org> References: <1086139632.3760.11.camel@localhost> <40BD8075.8060009@thefeed.no> <20040602084426.GA3828@alibi.simon-cozens.org> Message-ID: <40BDAB9A.4010603@thefeed.no> Simon Cozens wrote: >Marcus Ramberg: > > >>>I am very impressed by Maypole and want to use it with a set of classes >>>I've written using Class::DBI before I stubled on this framework. I >>>could not use Maypole::Model::CDBI because the classes have names that >>>are slightly different from those produced by Class::DBI::Loader. >>> >>> >>Hi Sebastian. Maypole::Model::CDBI does not require Class::DBI::Loader. >> >> > >Yes, it does. > > > Heh, sorry, you are right. My mind is going, please ignore me ;) Marcus From raptor@tvskat.net Wed Jun 2 12:57:55 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Wed, 2 Jun 2004 14:57:55 +0300 Subject: [Maypole] CGI::Mypole trailing slash Message-ID: <20040602145755.6c640faa@bugs> hi, I have the following problem that I have to modify all templates to add trailing slash "/" when the link is build. (then when I move to apache2 have to revert all modifications :"() Is there some more general way of doing this.. If I put trailing slash on uri_base then in some places double-slash appears "//", which again breaks the things...(Then probably in this case somewhere where path is parsed multiply slashes have to be stripped..) tia From raptor@tvskat.net Wed Jun 2 13:20:58 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Wed, 2 Jun 2004 15:20:58 +0300 Subject: [Maypole] some questions ? Message-ID: <20040602152058.30b96d0e@bugs> hi, I'm already running mypole and 'm experimenting.. and have some questions : How do u make more complex list/views/edits/deletes, what I mean f.e. what if I want to display "list" that combines info from several tables also to show up like real data instead as ID's. Then what when I click on detailed "edit" some info to be shown only as info other to be editable and later placing the every datum back into its table. Later what about morphed view/edit so that it behaves different for different users.. and so on, and so on.. I'm basicly figuring out (not in details) how this will be done, i'm asking here so that u can redirect me to some examples or write how u do it... and it will be good if there is some shortcuts about such functionality..(this is the main idea of maypole isnt it :"), more declarative approach rather procedural). One more thing it is better to hide off data during the Controller (MVC) part rather than pulling the data to template and then template to decide what to show isnt it... but then do u code these restrictions or u rely on things like "untaint" (i.e. what other modules i should look at for these stuff). Visualy for "view" this : if ($user eq 'blah') { $hash{fieldX} = $dbihash{fieldX} it preffered than this (when it comes down to sensitive information): [% IF hash.user == 'blah' %] [% hash.fieldX %] [%ELSE%]   [%END%] tia From simon@simon-cozens.org Wed Jun 2 13:37:41 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 2 Jun 2004 13:37:41 +0100 Subject: [Maypole] some questions ? In-Reply-To: <20040602152058.30b96d0e@bugs> References: <20040602152058.30b96d0e@bugs> Message-ID: <20040602123741.GB17509@alibi.simon-cozens.org> raptor@tvskat.net: > I'm already running mypole and 'm experimenting.. and have some questions : I notice that http://www.catb.org/~esr/faqs/smart-questions.html doesn't mention about not bombarding a mailing list with questions as if its only purpose was to get your code working, but you might wish to treat it as if it did. -- 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 tony-maypole@kasei.com Wed Jun 2 23:22:50 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Wed, 2 Jun 2004 23:22:50 +0100 Subject: [Maypole] some questions ? In-Reply-To: <20040602123741.GB17509@alibi.simon-cozens.org> References: <20040602152058.30b96d0e@bugs> <20040602123741.GB17509@alibi.simon-cozens.org> Message-ID: <20040602222249.GA5274@soto.kasei.com> On Wed, Jun 02, 2004 at 01:37:41PM +0100, Simon Cozens wrote: > raptor@tvskat.net: > > I'm already running mypole and 'm experimenting.. and have some questions : > I notice that http://www.catb.org/~esr/faqs/smart-questions.html doesn't > mention about not bombarding a mailing list with questions as if its only > purpose was to get your code working, but you might wish to treat it as if it > did. Or alternatively, Welcome to the list. We're glad you like maypole, and we hope we'll be able to help point you in the right direction... Tony From alex@owal.co.uk Thu Jun 3 10:18:05 2004 From: alex@owal.co.uk (Alex McLintock) Date: Thu, 03 Jun 2004 10:18:05 +0100 Subject: [Maypole] Absolute Beginners List? Message-ID: <40BEECCD.1090807@owal.co.uk> I think Simon wants this Maypole list to be run in the same way as most other technical lists (and rightly so). eg Before posting you better have : 1) read the FAQ, and the documentation first 2) done all the things mentioned here : http://www.catb.org/~esr/faqs/smart-questions.html#before 3) made sure your question is actually about Maypole and not one of the modules that it uses. (and a whole bunch of other things too) However I am wondering how to discuss the "big picture". For instance, I am not sure about how and when to over-ride Class:DBI::Loader. I want to treat maypole as a framework - which includes all the modules it (optionally) uses so that I can ask questions about anything related to building a Maypole application. Does such a list exist? Or to put it another way... is there an absolute beginners maypole list where we can ask dumb questions and get away with it? Since there isn't a book about Maypole yet I guess the best thing to do is to look at lots and lots of examples (and there are quite a few. Thanks!) Alex From alex@vivien.franken.de Thu Jun 3 11:03:46 2004 From: alex@vivien.franken.de (Alex Goller) Date: Thu, 3 Jun 2004 12:03:46 +0200 Subject: [Maypole] Absolute Beginners List? In-Reply-To: <40BEECCD.1090807@owal.co.uk> References: <40BEECCD.1090807@owal.co.uk> Message-ID: <20040603100346.GQ52479@vivien.franken.de> Hi, On Thu, Jun 03, 2004 at 10:18:05AM +0100, Alex McLintock wrote: > I think Simon wants this Maypole list to be run in the same way as most > other technical lists (and rightly so). I don't want to speak for Simon or the list, but here's what i thought about the last few mails with all those questions :) > eg Before posting you better have : > 1) read the FAQ, and the documentation first I think much of the documentation and a lot of stuff in the wiki need to be fixed in order to work for Random J. Newbie. Following the list in the last days i thought of some fixes: * either put beerdb together with all stylesheets in the distribution or create a separate archive distributed via the website * package up ISellit so that it is usable/installable * expand the InstallationIssues (database permissions, missing modules, etc.) > 2) done all the things mentioned here : > http://www.catb.org/~esr/faqs/smart-questions.html#before ack :) > 3) made sure your question is actually about Maypole and not one of the > modules that it uses. > (and a whole bunch of other things too) Which is in some sense hard to discover for newbies thinking that maypole might be 'cool'. Maybe i should just hack my fixes into the wiki (installation issues) and somebody else fix up the links for ISellIt and the BeerDB css templates. So, no, i don't know if there's an absolute beginners list. just my 2 cents, alex -- alexander goller alex@vivien.franken.de From alex@vivien.franken.de Thu Jun 3 11:07:12 2004 From: alex@vivien.franken.de (Alex Goller) Date: Thu, 3 Jun 2004 12:07:12 +0200 Subject: [Maypole] Absolute Beginners List? In-Reply-To: <20040603100346.GQ52479@vivien.franken.de> References: <40BEECCD.1090807@owal.co.uk> <20040603100346.GQ52479@vivien.franken.de> Message-ID: <20040603100712.GR52479@vivien.franken.de> On Thu, Jun 03, 2004 at 12:03:46PM +0200, Alex Goller wrote: > Which is in some sense hard to discover for newbies thinking that > maypole might be 'cool'. Maybe i should just hack my fixes into the > wiki (installation issues) and somebody else fix up the links for > ISellIt and the BeerDB css templates. Seems Ian Langworth already did just that, thanks ;) -- alexander goller alex@vivien.franken.de From m.jouanne@apr-job.com Wed Jun 2 18:23:43 2004 From: m.jouanne@apr-job.com (JOUANNE Mickael) Date: Wed, 2 Jun 2004 19:23:43 +0200 Subject: [Maypole] little patch for working with Postgres and Autocommit => 1 Message-ID: <20040602172343.GA11651@apr-job.com> --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello. Today i begin to test Maypole. It's a very good working module. But after trying Beer, i discover that some DBI options i usually give to connect don't pass in Model::CDBI. I explain : BeerDB->setup("dbi:Pg:dbname=beer;host=localhost;", "user", "passord", { AutoCommit => 1, RaiseError => 1, PrintError => 0 }, ); After password, "Autocommit" and others DBI options are ignored. And sometimes you don't want to do transaction, so i want my Autocommit to 1. I included my patch attached piece. Congratulations. Bye. -- APR-JOB 9, rue de Lens 92000 Nanterre Mickaël JOUANNE Tel: 0146526820 Fax : 0146526811 WEBMASTER m.jouanne@apr-job.com ICQ : 42799256 * If Linux doesn't have the solution, you have the wrong problem * --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="CDBI.pm.patch" --- /tmp/CDBI.pm Wed Jun 2 18:37:26 2004 +++ Model/CDBI.pm Wed Jun 2 18:53:29 2004 @@ -127,13 +127,14 @@ } sub setup_database { - my ($self, $config, $namespace, $dsn, $u, $p) = @_; + my ($self, $config, $namespace, $dsn, $u, $p, $opts) = @_; $config->{dsn} = $dsn; $config->{loader} = Class::DBI::Loader->new( namespace => $namespace, dsn => $dsn, user => $u, password => $p, + options => $opts # for postgresql autocommit ); $config->{classes} = [ $config->{loader}->classes ]; $config->{tables} = [ $config->{loader}->tables ]; --6c2NcOVqGQ03X4Wi-- From matt.adams@morcor.com Wed Jun 2 20:51:01 2004 From: matt.adams@morcor.com (Matt Adams) Date: Wed, 02 Jun 2004 15:51:01 -0400 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL Message-ID: <40BE2FA5.9000900@morcor.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi: I've setup the Maypole after upgrading to Perl 5.8.4 (and all the module upgrades that go along with this) I discovered that the http://localhost/beerdb/beer/list/ no longer seems to work. All I end up with is an error in Apache's error log that says: File does not exist: /usr/local/www/data/beerdb/beer/list Am I missing something here? Shouldn't this be working? Thanks, Matt - -- Matt Adams Development Specialist Morcor Solutions Inc. (613) 354-2912 x228 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAvi+kmgqg+8k3WXURAmrFAKCZV98Qv0ih8WCMQUN47RfkTkFbIwCfedTf rXJUZct8jozZCpPTWDE8Neo= =fIwR -----END PGP SIGNATURE----- From philip.stadermann@iterationx.de Wed Jun 2 22:54:20 2004 From: philip.stadermann@iterationx.de (Philip Stadermann) Date: Wed, 02 Jun 2004 23:54:20 +0200 Subject: [Maypole] Maypole Debian package Message-ID: <40BE4C8C.6000106@iterationx.de> Hi everyone, is there a Debian package for Maypole or is someone working on it? If not I want to build one. I just wanted to ask first to prevent duplicate work. Greets, Philip From jgilles@glmultimedia.com Thu Jun 3 12:44:31 2004 From: jgilles@glmultimedia.com (Julien Gilles) Date: Thu, 03 Jun 2004 13:44:31 +0200 Subject: [Maypole] Maypole Debian package In-Reply-To: <40BE4C8C.6000106@iterationx.de> (Philip Stadermann's message of "Wed, 02 Jun 2004 23:54:20 +0200") References: <40BE4C8C.6000106@iterationx.de> Message-ID: <87smdcvpb4.fsf@jgilles.internal.glmultimedia.com> Philip Stadermann writes: > Hi everyone, > > is there a Debian package for Maypole or is someone working on it? If > not I want to build one. I just wanted to ask first to prevent > duplicate work. > I did it with dh-make-perl, and it works fine. I think the main problem is to list all dependancies... I end up with the following deb packages, (always build with dh-make-perl using CPAN) : libclass-dbi-asform-perl_2.2-1_all.deb libclass-dbi-loader-perl_0.02-1_all.deb libclass-dbi-loader-relationship-perl_1.2-1_all.deb libclass-dbi-mysql-perl_0.23-1_all.deb libclass-dbi-pager-perl_0.05-1_all.deb libclass-dbi-plugin-retrieveall-perl_1-1_all.deb libclass-dbi-plugin-type-perl_0.02-1_all.deb libdata-page-perl_1.01-1_all.deb liblingua-en-inflect-number-perl_1.1-1_all.deb liblingua-en-inflect-perl_1.88-1_all.deb libmaypole-authentication-usersessioncookie-perl_1.1-1_all.deb libmaypole-perl_1.4-1_all.deb Good luck ! -- Julien Gilles. From simon@simon-cozens.org Thu Jun 3 14:21:34 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 14:21:34 +0100 Subject: [Maypole] Absolute Beginners List? In-Reply-To: <40BEECCD.1090807@owal.co.uk> References: <40BEECCD.1090807@owal.co.uk> Message-ID: <20040603132134.GA13290@alibi.simon-cozens.org> Alex McLintock: > I think Simon wants this Maypole list to be run in the same way as most > other technical lists (and rightly so). A bit of history. Maypole came out of two projects that I was in the midst of writing - one to put a front-end onto an SQL database, and one which needed a nice way of going from a URL to a method on an object. I abstracted them out and Maypole was the bit where they met in the middle. Then people like Jesse started reading my blog and playing with it, and soon I had an open source project to maintain. I'm not very good at doing that. I debated whether or not to start two mailing lists, one for developers and one for users, but at the time there were only three or four of us and we were both developers and users, so I thought I could punt for the time being. I think we've probably now got to the point where we can split development from support, so I've created the maypole-dev list. (http://lists.netthink.co.uk/listinfo/maypole-dev) Some of you may now be on the wrong list. :) > Since there isn't a book about Maypole yet My hope was that when the manual gets finished, it could be considered one. I'm sorry I haven't had the time to finish it off yet. -- All the good ones are taken. From matt.adams@morcor.com Thu Jun 3 14:28:59 2004 From: matt.adams@morcor.com (Matt Adams) Date: Thu, 03 Jun 2004 09:28:59 -0400 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL Message-ID: <40BF279B.2070801@morcor.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi: I've setup the Maypole after upgrading to Perl 5.8.4 (and all the module upgrades that go along with this) I discovered that the http://localhost/beerdb/beer/list/ no longer seems to work. All I end up with is an error in Apache's error log that says: File does not exist: /usr/local/www/data/beerdb/beer/list Am I missing something here? Shouldn't this be working? Thanks, Matt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAvyeHmgqg+8k3WXURArQRAKCLbGejnWBfgaKVgqNNh3kF9TBahQCguE8I FCHOPjYT8YfQl+74j2td1Ho= =b2VA -----END PGP SIGNATURE----- From mmims@bigfoot.com Thu Jun 3 14:27:03 2004 From: mmims@bigfoot.com (Marc Mims) Date: Thu, 3 Jun 2004 06:27:03 -0700 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL In-Reply-To: <40BE2FA5.9000900@morcor.com> References: <40BE2FA5.9000900@morcor.com> Message-ID: <20040603132703.GA12221@questright.com> * Matt Adams [040603 04:23]: > File does not exist: /usr/local/www/data/beerdb/beer/list > > Am I missing something here? Shouldn't this be working? You need to install Template::Plugin::Class. I had the same problem and found the answer via a Google search at http://laughingmeme.org/archives/001898.html#001898. -Marc From simon@simon-cozens.org Thu Jun 3 14:34:30 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 14:34:30 +0100 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL In-Reply-To: <20040603132703.GA12221@questright.com> References: <40BE2FA5.9000900@morcor.com> <20040603132703.GA12221@questright.com> Message-ID: <20040603133430.GA14584@alibi.simon-cozens.org> Marc Mims: > I had the same problem and found the answer via a Google search at > http://laughingmeme.org/archives/001898.html#001898. Can I also recommend the newly re-ordered Installation Issues page at http://wiki.simon-cozens.org/index.cgi?InstallationIssues Thanks to Leo for that. -- "When in doubt, print 'em out." -- Karl's Programming Proverb 0x7 From simon@simon-cozens.org Thu Jun 3 14:35:53 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 14:35:53 +0100 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL In-Reply-To: <20040603133430.GA14584@alibi.simon-cozens.org> References: <40BE2FA5.9000900@morcor.com> <20040603132703.GA12221@questright.com> <20040603133430.GA14584@alibi.simon-cozens.org> Message-ID: <20040603133553.GB14584@alibi.simon-cozens.org> Simon Cozens: > Thanks to Leo for that. Leo? Ian. -- Wouldn't you love to fill out that report? "Company asset #423423 was lost while fighting the forces of evil." -- Chris Adams in the scary.devil.monastery From raptor@tvskat.net Thu Jun 3 15:29:09 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Thu, 3 Jun 2004 17:29:09 +0300 Subject: [Maypole] relationships ? Message-ID: <20040603172909.07983c6e@bugs> i cant figure out how to set these relationships i.e. if i have : create table users ( id pkey, name char(40) ); create table address ( id pkey, uid integer, blah char(40) ); uid is the user ID. I have tired different variants w/o success i.e. : a users has address on uid a users has address a users has uid on address a address has user how to make it... can I use Class::DBI directly instead of this : use Class::DBI::Loader::Relationship; MaypoleICS->config->{loader}->relationship($_) for ( 'a address has user on uid'); .. something like this : DB::Addr->has_a(uid => 'DB::User'); tia From raptor@tvskat.net Thu Jun 3 15:45:36 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Thu, 3 Jun 2004 17:45:36 +0300 Subject: [Maypole] Absolute Beginners List? In-Reply-To: <40BEECCD.1090807@owal.co.uk> References: <40BEECCD.1090807@owal.co.uk> Message-ID: <20040603174536.0eeb9744@bugs> yep, :") i got it wrong too, 'cause as i seen on perl.com it seemed like piece of cake, "emerge maypole" and then everything goes ok.. What I found was a maze of dependable modules with which i've not worked until now..(I'm not complaining about that).. So now I'm reading all docs of these modules to get the idea.. and hope to not ask stupid questions. otherwise I very like the idea and the way it is implementated tia From alex@owal.co.uk Thu Jun 3 15:50:14 2004 From: alex@owal.co.uk (Alex McLintock) Date: Thu, 03 Jun 2004 15:50:14 +0100 Subject: [Maypole] search_form template? or elsewhere? Message-ID: <40BF3AA6.9060003@owal.co.uk> Thanks Simon for creating the maypole-dev list, thus leaving this one for users and developers alike. -------- And now my question to the list. If I want to have a subset of fields searchable do I simply do it in templates specific to that table, or is there a programatic way? I'm trying to customise my BeerDB application (which is actually now SFBooksSB) I don't want all the fields to be searchable. eg surname and firstname is usually enough to find an author. The others are unecessary. I see that the search form is created in a template called "search_form". Presumably there isn't anything like the "untaint" methods to say that particular columns are searchable. If I want fewer search fields to appear then I create the appropriate template for this and "specialise" the list template for that table to actually use this new search form. Are there any tools to help me develop better "search forms"? Feel free to point me at docs or examples I have missed. (I am reading them - honest!) Alex McLintock From simon@simon-cozens.org Thu Jun 3 15:58:53 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 15:58:53 +0100 Subject: [Maypole] search_form template? or elsewhere? In-Reply-To: <40BF3AA6.9060003@owal.co.uk> References: <40BF3AA6.9060003@owal.co.uk> Message-ID: <20040603145853.GB22685@alibi.simon-cozens.org> Alex McLintock: > If I want to have a subset of fields searchable do I simply do it in > templates specific to that table, or is there a programatic way? I think it's *best* to customize templates. I think Maypole works on the understanding that there are templates there for you to get stuff up and running quickly, but the minute you start doing something outside the defaults, you should write your own templates. Unfortunately, I made the default templates too useful, which means that people end up thinking they can always bend them to do what they want. The assumption is that you will hardly touch the default templates. -- ``Perl is the successfull attempt to make a braindump directly executable.'' - Lutz Donnerhacke in de.org.ccc From alex@owal.co.uk Thu Jun 3 16:32:46 2004 From: alex@owal.co.uk (Alex McLintock) Date: Thu, 03 Jun 2004 16:32:46 +0100 Subject: [Maypole] relationships ? In-Reply-To: <20040603172909.07983c6e@bugs> References: <20040603172909.07983c6e@bugs> Message-ID: <40BF449E.8030401@owal.co.uk> raptor tvXXXXXt.net wrote: >a users has address on uid >a users has address >a users has uid on address >a address has user > > > Yeah, I was confused by this. Part of the problem lies in the fact that we seem to have tables with plurals as names ie table "users" instead of "user". Have you specified that uid is the primary key? >how to make it... can I use Class::DBI directly instead of this : > > The docs have an example of how you might create a package specifically for this... I think it is here http://maypole.simon-cozens.org/doc/Request.html >DB::Addr->has_a(uid => 'DB::User'); > > I think that if you want to do it that way then you can. There is no *need* to use Class::DBI::Loader:: Relationship AFAIK I think you might want to create a trivial package like this... package DB::Addr; DB::Addr->has_a(uid => 'DB::User'); sub foo :Exported {} Ok I am not too clear I understand either. From simon@simon-cozens.org Thu Jun 3 16:42:49 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 16:42:49 +0100 Subject: [Maypole] relationships ? In-Reply-To: <40BF449E.8030401@owal.co.uk> References: <20040603172909.07983c6e@bugs> <40BF449E.8030401@owal.co.uk> Message-ID: <20040603154249.GC25418@alibi.simon-cozens.org> Alex McLintock: > I think that if you want to do it that way then you can. There is no > *need* to use Class::DBI::Loader:: Relationship > AFAIK It's probably best *not* to use it. Like default templates. Use it if it does what you want. Don't use it if it doesn't do what you want. This ought to be easy to understand. :) -- Look, there are only a few billion people in the world, right? And they can only possibly know a few thousand bits of information not known by someone else, right? So the human race will never have a real need for more than a few terabits of storage, except possibly as cache. - Geraint Jones From alex@owal.co.uk Thu Jun 3 17:05:56 2004 From: alex@owal.co.uk (Alex McLintock) Date: Thu, 03 Jun 2004 17:05:56 +0100 Subject: [Maypole] relationships ? In-Reply-To: <20040603154249.GC25418@alibi.simon-cozens.org> References: <20040603172909.07983c6e@bugs> <40BF449E.8030401@owal.co.uk> <20040603154249.GC25418@alibi.simon-cozens.org> Message-ID: <40BF4C64.9080809@owal.co.uk> Simon Cozens wrote: >Alex McLintock: > > >>I think that if you want to do it that way then you can. There is no >>*need* to use Class::DBI::Loader:: Relationship >>AFAIK >> >> > >It's probably best *not* to use it. Like default templates. > >Use it if it does what you want. Don't use it if it doesn't do what you want. >This ought to be easy to understand. :) > > > The big problem for beginners like myself is that we can't yet make that judgement call. For example, I don't always know whether Class::DBI::Loader::Relationship doesn't do what we want it to do because a) it can't or b) we don't know how to use it properly. ===================== As a practical suggestion I think we could do with more examples along the line of.... "So you have the basic beerDB up and running... and now you want to do X. In order to do that you could try Y" I'll try to write some as I learn. Alex From alex@owal.co.uk Thu Jun 3 17:56:54 2004 From: alex@owal.co.uk (Alex McLintock) Date: Thu, 03 Jun 2004 17:56:54 +0100 Subject: [Maypole] has_a display name Message-ID: <40BF5856.9060408@owal.co.uk> When I have a "has_a" relationship between two tables, using an id field, how does "Maypole" figure out what field to use as the "pretty" name for that field? Is it just any field with "name" in the name? Here is my example in case you are interested... I have a relationship "title has_a author" SFBooksDB::Title->has_a(authornumber => "SFBooksDB::Author"); I can view and list titles of books, and the authornumber column comes up with the authors "firstname" as a hyperlink instead of the integer authornumber. This is great - and a step in the right direction. It does something similar in the edit screen where there is a huge drop down list of *all* the author firstnames. But an author's firstname doesn't uniquely identify an author, and I can't see where I said it did. I would actually like it to be the concatenation of "firstname", "secondname", and "surname". I see that this hyperlink is built up in the template using HTML::Element, but something needs to present the right data to that code. I am not using the C:D:L:R stuff but have created the relationship between title and author as follows. SFBooksDB::Author->untaint_columns( printable => [qw/AuthorNumber Surname Firstname Secondname / ], integer => [qw/sf fantasy mystery/] ); SFBooksDB::Title->untaint_columns( printable => [qw/ TitleNumber Title / ] ); And I also added this in for luck SFBooksDB::Author->columns(Primary => qw/AuthorNumber/); SFBooksDB::Author->columns(Helpful => qw/Firstname Secondname Surname Birth QuikSearch/); ( http://www.diversebooks.com/maypole/title/list/ ) From jester@panix.com Thu Jun 3 18:34:12 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 3 Jun 2004 13:34:12 -0400 Subject: [Maypole] has_a display name In-Reply-To: <40BF5856.9060408@owal.co.uk> References: <40BF5856.9060408@owal.co.uk> Message-ID: <20040603173411.GA14164@panix.com> On Thu, Jun 03, 2004 at 05:56:54PM +0100, Alex McLintock wrote: > When I have a "has_a" relationship between two tables, using an id > field, how does "Maypole" figure out what field to use as the "pretty" > name for that field? > Is it just any field with "name" in the name? If there is such a field, Maypole will take that by default if you don't specify anything else. > Here is my example in case you are interested... > > I have a relationship "title has_a author" > SFBooksDB::Title->has_a(authornumber => "SFBooksDB::Author"); > > I can view and list titles of books, and the authornumber column comes > up with the authors "firstname" as a hyperlink instead of the integer > authornumber. > This is great - and a step in the right direction. It does something > similar in the edit screen where there is a huge drop down list of *all* > the author firstnames. > > But an author's firstname doesn't uniquely identify an author, and I > can't see where I said it did. I would actually like it to be the > concatenation of "firstname", "secondname", and "surname". You want to take a look at the Class::DBI docs, under "Overloaded Operators," and see what it says about stringification. For your setup I expect you'll want something like package SFBooksDB::Author; #other stuff... sub stringify_self { my $self = shift; return join " ", $self->firstname, $self->secondname, $self->surname; } 1; HTH. Jesse Sheidlower From raptor@tvskat.net Fri Jun 4 00:33:26 2004 From: raptor@tvskat.net (raptor) Date: Fri, 4 Jun 2004 02:33:26 +0300 Subject: [Maypole] Problem with http://localhost/beerdb/style/list/ URL In-Reply-To: <40BF279B.2070801@morcor.com> References: <40BF279B.2070801@morcor.com> Message-ID: <20040604023326.723b878b@vr> u probably has to set the template path like this : BeerDB->config->{tamplate_root} = '/your/real/tmpl/directory'; just guesing. hth |Hi: | |I've setup the Maypole after upgrading to Perl 5.8.4 (and all the module |upgrades that go along with this) I discovered that the |http://localhost/beerdb/beer/list/ no longer seems to work. All I end up with |is an error in Apache's error log that says: | |File does not exist: /usr/local/www/data/beerdb/beer/list | |Am I missing something here? Shouldn't this be working? | | |Thanks, | |Matt From jester@panix.com Thu Jun 3 21:57:24 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 3 Jun 2004 16:57:24 -0400 Subject: [Maypole] "Can't locate...db_Main" errors Message-ID: <20040603205724.GA16566@panix.com> This is a little odd. When trying to hit a particular table, BookDB::Image, which has_a BookDB::Image_Category, I'm dying with a "Can't locate object method "db_Main" via package "BookDB::Image_Category" at...Ima/DBI.pm line 386" error. This used to work; I recently upgraded my Perl from 5.8.2 to 5.8.4, but rebuilt all the dependencies, so I don't think this could be it. Also, all the other tables are working just fine. I've reduced Image_Category.pm, which was small to begin with, to the bare-bones package BookDB::Image_Category; use base 'BookDB::Model'; 1; But it still dies with the same error. I see there have been other reports of this, with no explanation though. Any ideas? Jesse Sheidlower From simon@simon-cozens.org Thu Jun 3 22:55:49 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 22:55:49 +0100 Subject: [Maypole] relationships ? In-Reply-To: <40BF4C64.9080809@owal.co.uk> References: <20040603172909.07983c6e@bugs> <40BF449E.8030401@owal.co.uk> <20040603154249.GC25418@alibi.simon-cozens.org> <40BF4C64.9080809@owal.co.uk> Message-ID: <20040603215549.GC23188@alibi.simon-cozens.org> Alex McLintock: > For example, I don't always know whether > Class::DBI::Loader::Relationship doesn't do what we want it to do because > a) it can't > or > b) we don't know how to use it properly. Fair enough. Assume it can't, though. :) > As a practical suggestion I think we could do with more examples along > the line of.... > "So you have the basic beerDB up and running... and now you want to do > X. In order to do that you could try Y" > I'll try to write some as I learn. This is what http://maypole.simon-cozens.org/doc/Beer.html is meant to become. -- It's all fun and games until someone loses an eye. Then it's a sport! From simon@simon-cozens.org Thu Jun 3 23:00:38 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 23:00:38 +0100 Subject: [Maypole] has_a display name In-Reply-To: <40BF5856.9060408@owal.co.uk> References: <40BF5856.9060408@owal.co.uk> Message-ID: <20040603220038.GD23188@alibi.simon-cozens.org> Alex McLintock: > When I have a "has_a" relationship between two tables, using an id > field, how does "Maypole" figure out what field to use as the "pretty" > name for that field? Displaying is a template problem. It's probably best *not* to use the default templates. Use them if they do what you want. Don't use them if they don't do what you want. This ought to be easy to understand. :) I think it's *best* to customize templates. I think Maypole works on the understanding that there are templates there for you to get stuff up and running quickly, but the minute you start doing something outside the defaults, you should write your own templates. Unfortunately, I made the default templates too useful, which means that people end up thinking they can always bend them to do what they want. The assumption is that you will hardly touch the default templates. I could set up a cron job to post this to the list every twelve hours if it would help. :) -- Remember, any design flaw you're sufficiently snide about becomes a feature - Dan Sugalski From simon@simon-cozens.org Thu Jun 3 23:08:33 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Thu, 3 Jun 2004 23:08:33 +0100 Subject: [Maypole] has_a display name In-Reply-To: <20040603173411.GA14164@panix.com> References: <40BF5856.9060408@owal.co.uk> <20040603173411.GA14164@panix.com> Message-ID: <20040603220833.GE23188@alibi.simon-cozens.org> Jesse Sheidlower: > package SFBooksDB::Author; > #other stuff... > > sub stringify_self { > my $self = shift; > return join " ", $self->firstname, $self->secondname, $self->surname; > } This is correct; however, if it's just a simple column, you can use Class::DBI's ordinary columns( Stringify => ... ) mechanism. Maypole::Model::CDBI will look for columns called name, title or any primary column not called "id" in the absence of another stringify column. -- Term, holidays, term, holidays, till we leave school, and then work, work, work till we die. -- C.S. Lewis From jester@panix.com Fri Jun 4 02:33:05 2004 From: jester@panix.com (Jesse Sheidlower) Date: Thu, 3 Jun 2004 21:33:05 -0400 Subject: [Maypole] "Can't locate...db_Main" errors In-Reply-To: <20040603205724.GA16566@panix.com> References: <20040603205724.GA16566@panix.com> Message-ID: <20040604013305.GA16313@panix.com> On Thu, Jun 03, 2004 at 04:57:24PM -0400, Jesse Sheidlower wrote: > > This is a little odd. When trying to hit a particular table, > BookDB::Image, which has_a BookDB::Image_Category, I'm dying > with a "Can't locate object method "db_Main" via package > "BookDB::Image_Category" at...Ima/DBI.pm line 386" error. Aargh. Of course, like all problems, it was intensely stupid: I had renamed what had originally been "Category" to "Image_Category", on the grounds like I might have other groups of categories, but then neglected to change the database table name. Oops. Jesse Sheidlower From raptor@tvskat.net Fri Jun 4 09:53:17 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Fri, 4 Jun 2004 11:53:17 +0300 Subject: [Maypole] ala VIEW's ? Message-ID: <20040604115317.76083f1f@bugs> hi, At the moment when I point in the config->{display_tables} the db-table names maypole builds automaticly class for every table, what I want to make is a virtual table (like sql VIEW), so that after i set such a virtual table and put it in display_table it to behave like other tables i.e. view/edit/list records and then accordingly on edit every piece of data goes to its correct place. I can do SQL-VIEW's but not all DB support writing to view. is there a recipie or I have to do it from scratch. tia From raptor@tvskat.net Fri Jun 4 14:56:06 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Fri, 4 Jun 2004 16:56:06 +0300 Subject: [Maypole] search next page Message-ID: <20040604165606.1353e854@bugs> hi, when doing search and the result is more than one page and I click on the next-page i'm directed to list-next-page instead to search-next-page. any idea how to correct this.. tia From jester@panix.com Fri Jun 4 15:09:20 2004 From: jester@panix.com (Jesse Sheidlower) Date: Fri, 4 Jun 2004 10:09:20 -0400 Subject: [Maypole] search next page In-Reply-To: <20040604165606.1353e854@bugs> References: <20040604165606.1353e854@bugs> Message-ID: <20040604140920.GA20363@panix.com> On Fri, Jun 04, 2004 at 04:56:06PM +0300, raptor@tvskat.net wrote: > hi, > > when doing search and the result is more than one page and I click > on the next-page i'm directed to list-next-page instead to > search-next-page. > > any idea how to correct this.. Right now it can't be done, but it is a Known Problem, has been discussed here before, and is filed on the RT list on CPAN. Which hopefully means Simon will get around to it RSN ;-). Jesse Sheidlower From mk@calcentral.com Fri Jun 4 19:56:46 2004 From: mk@calcentral.com (Matthew Kalastro) Date: Fri, 4 Jun 2004 11:56:46 -0700 Subject: [Maypole] table confusion w/multiple apps in same vhost? In-Reply-To: <20040603215549.GC23188@alibi.simon-cozens.org> Message-ID: Hello, My database tables are getting confused when running two basic Maypole apps on the same virtual host, from two different 's. The tables from the 1st app below appear in the views from the 2nd app, and visa versa, depending on which app is loaded first after server restart. I'd like to be able to do this. Putting the apps in separate virtual hosts solved the problem if I don't preload the main app configuration module (" use SOE::DoorAccess; "). Is this expected behavior? Could I "superclass" Apache::MVC to avoid this confusion? Any ideas appreciated. Here's what I'm using: 1st app: SOE/DoorAccess.pm: package SOE::DoorAccess; =20 use base 'Apache::MVC'; use Class::DBI::Loader::Relationship; =20 SOE::DoorAccess -> setup ( "dbi:mysql:host=3Dlocalhost;database=3DDoorAccess", "dbuser", "dbpass" ); =20 SOE::DoorAccess -> config -> {uri_base} =3D "http://apps.soe.ucsc.edu:82/door_access/"; =20 ...database setup... Apache config: # Door Access application # includes SOE/DoorAccess.pm use lib '/home/local/httpdocs/content/htdocs/door_access/lib'; SetHandler perl-script PerlHandler SOE::DoorAccess 2nd app: SOE/CEPortfolio/WebApp.pm package SOE::CEPortfolio::WebApp; =20 use base 'Apache::MVC'; use Class::DBI::Loader::Relationship; =20 SOE::CEPortfolio::WebApp -> setup ( "dbi:mysql:host=3Dlocalhost;database=3DCEPortfolio" . "dbuser", "dbpass" ); =20 SOE::CEPortfolio::WebApp -> config -> {uri_base} =3D "http://apps.soe.ucsc.edu:82/ce_portfolio/"; =20 ...database setup... Apache config: # CE Portfolio # includes SOE/CEPortfolio.pm use lib '/home/local/httpdocs/content/htdocs/ce_portfolio/lib'; SetHandler perl-script PerlHandler SOE::CEPortfolio::WebApp Maypole is really cool, and could save me tons of development time. Thanks Simon! Thanks a lot, Matt From roland@moriz.de Sat Jun 5 13:12:15 2004 From: roland@moriz.de (Roland Moriz) Date: Sat, 05 Jun 2004 14:12:15 +0200 Subject: [Maypole] Advanced Example? Message-ID: <1086437534.2665.3.camel@localhost> Hi, is there an advanced example of an Maypole based Web-Application including Authentication and Session functionality available? thank you with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From mgarcia@mentesvirtuais.com Sat Jun 5 22:16:13 2004 From: mgarcia@mentesvirtuais.com (Marcos Garcia) Date: Sat, 5 Jun 2004 22:16:13 +0100 Subject: [Maypole] =?iso-8859-1?Q?Can=B4t_locate__Model_Classes?= Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C44B4A.BD5B31F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, =20 I can=92t run my first sample of Maypole. I=92ve a RetHat 9 server with httpd-2.0.40-21.11 and mod_perl-1.99_07-5. The content of my Model class=20 (-rwxr-xr-x 1 root root 637 Jun 5 21:03 /var/www/html/maypole/Ola.pm) =20 is: -------------------------------------------------------------------------= --- ---------------------------------- package Ola; use strict; use base 'Apache::MVC'; Ola->setup("dbi:Pg:vmind", "nobody", ""); Ola->config->{uri_base} =3D "http://1127.0.0.1/maypole/"; Ola->config->{rows_per_page} =3D 10; Ola->config->{display_tables} =3D [qw[users groups actions ]]; Ola::Users->untaint_columns( printable =3D> [qw/login name/] ); Ola::Groups->untaint_columns( printable =3D> [qw/grpname active/] ); Ola::Actions->untaint_columns( printable =3D> [qw/actionid compname accao active/], integer =3D> [qw/actionid/], ); Ola->groups->{loader}->relationship($_) for ( "a groups has users", "a group has actions"); =20 1; -------------------------------------------------------------------------= --- -------------------------- In the Apache configuration I put these lines: SetHandler perl-script PerlHandler Ola =20 When I invoke the URL http://127.0.0.1/maypole/ I get this error from = Apache -------------------------------------------------------------------------= --- -------------------------- [Sat Jun 05 21:54:56 2004] [error] Can't locate Ola.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi = /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at (eval 2) line 3.! [Sat Jun 05 21:54:56 2004] [error] failed to resolve handler `Ola' [Sat Jun 05 21:54:56 2004] [error] [client 172.30.0.214] Can't locate = Ola.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 = /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at (eval 2) line 3.! -------------------------------------------------------------------------= --- --------------------------- =20 I can=92t figure out the solution for this problem. Can anyone help me = solving this problem?? =20 Thanks in advance, =20 M.P.Garcia =20 ________________________________________________ =20 Mentes Virtuais, Lda Consultoria Inform=E1tica e Solu=E7=F5es Multim=E9dia e-mail: mgarcia@mentesvirtuais.com http://www.mentesvirtuais.com =20 =20 Inova=E7=E3o e Profissionalismo =E9 o que nos = distingue... =20 ------=_NextPart_000_0006_01C44B4A.BD5B31F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,

 

I can’t run my = first sample of Maypole.

I’ve a RetHat 9 server with httpd-2.0.40-21.11 and = mod_perl-1.99_07-5.

The content of my = Model class

(-rwxr-xr-x=A0=A0=A0 1 root=A0=A0=A0=A0 root=A0=A0=A0=A0=A0=A0=A0=A0=A0 637 Jun=A0 = 5 21:03 /var/www/html/maypole/Ola.pm)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =

is:

-----------------------= -------------------------------------------------------------------------= --------------

pack= age Ola;

use<= /span> strict;

use<= /span> base 'Apache::MVC';

Ola<= /span>->setup("dbi:Pg:vmind", "nobody", = "");

Ola<= /span>->config->{uri_base} =3D = "http://1127.0.0.1/maypole/";

Ola<= /span>->config->{rows_per_page} =3D = 10;

Ola<= /span>->config->{display_tables} = =3D [qw[users groups actions = ]];

Ola:= :Users->untaint_columns( printable =3D> [qw/login name/] );

Ola:= :Groups->untaint_columns( printable =3D> [qw/grpname active/] );

Ola:= :Actions->untaint_columns(

=A0=A0=A0=A0=A0=A0=A0 printable =3D> [qw/actionid compname accao active/],

=A0=A0=A0=A0=A0=A0=A0 integer =3D> [qw/actionid/],

);

Ola<= /span>->groups->{loader}->relationship($_) for (

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = "a groups has users",

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = "a group has actions");

 

1;

-----------------------= -------------------------------------------------------------------------= ------

In the Apache = configuration I put these lines:

<Location = /maypole>

=A0=A0=A0=A0=A0=A0=A0 SetHandler perl-script

=A0=A0=A0=A0=A0=A0=A0 PerlHandler Ola

</Location><= /o:p>

 

When I invoke the URL = http://127.0.0.1/maypole/ I get = this error from Apache

-----------------------= -------------------------------------------------------------------------= ------

[Sat Jun 05 21:54:56 = 2004] [error] Can't locate Ola.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 = /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl = /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at (eval 2) line = 3.!

[Sat Jun 05 21:54:56 = 2004] [error] failed to resolve handler `Ola'

[Sat Jun 05 21:54:56 = 2004] [error] [client = 172.30.0.214] Can't locate Ola.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi = /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at (eval 2) line = 3.!

-----------------------= -------------------------------------------------------------------------= -------

 

I can’t figure = out the solution for this problem. Can anyone help me solving this = problem??

 

Thanks in = advance,

 

M.P.= Garcia

 

______= __________________________________________

&= nbsp;

Mentes= Virtuais, Lda

Consul= toria Inform=E1tica e Solu=E7=F5es Multim=E9dia

e-mail= : mgarcia@mentesvirtuais.com=

http://www.mentesvirtuais.com=

&= nbsp;

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = Inova=E7=E3o e Profissionalismo =E9 o que nos distingue...

 

------=_NextPart_000_0006_01C44B4A.BD5B31F0-- From roland@moriz.de Sat Jun 5 22:22:19 2004 From: roland@moriz.de (Roland Moriz) Date: Sat, 05 Jun 2004 23:22:19 +0200 Subject: [Maypole] =?ISO-8859-1?Q?Can=B4t?= locate Model Classes In-Reply-To: References: Message-ID: <1086470539.2665.13.camel@localhost> Hi Marcos, Am Sa, den 05.06.2004 schrieb Marcos Garcia um 23:16: > I can=FFt run my first sample of Maypole. [...] > When I invoke the URL http://127.0.0.1/maypole/ I get this error from > Apache >=20 > -----------------------------------------------------------------------= ------------------------------- >=20 > [Sat Jun 05 21:54:56 2004] [error] Can't locate Ola.pm in @INC (@INC > contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/5.8.0 > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl > /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl > /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) > at (eval 2) line 3.! >=20 > [Sat Jun 05 21:54:56 2004] [error] failed to resolve handler `Ola' >=20 > [Sat Jun 05 21:54:56 2004] [error] [client 172.30.0.214] Can't locate > Ola.pm in @INC (@INC contains: > /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl > /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl > /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) > at (eval 2) line 3.! >=20 try to set the PERL5LIB to your module directory: httpd.conf: =09 PerlSetEnv PERL5LIB /var/www/html/maypole [...] hth, with kind regards, Mit freundlichen Gruessen, Roland Moriz --=20 Muenchen/Germany - http://www.roland-moriz.de/ From roland@moriz.de Sat Jun 5 22:31:24 2004 From: roland@moriz.de (Roland Moriz) Date: Sat, 05 Jun 2004 23:31:24 +0200 Subject: [Maypole] =?ISO-8859-1?Q?Can=B4t?= locate Model Classes In-Reply-To: References: Message-ID: <1086471083.2665.16.camel@localhost> Hi Marcos, sorry. with mod_perl2 you'll have to adjust @INC as described at http://theory.uwinnipeg.ca/modperl/docs/2.0/user/config/config.html#Adjusting_C__INC_ The old way with PERL5LIB might not work anymore. regards, with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From mgarcia@mentesvirtuais.com Sat Jun 5 23:40:29 2004 From: mgarcia@mentesvirtuais.com (Marcos Garcia) Date: Sat, 5 Jun 2004 23:40:29 +0100 Subject: [Maypole] =?iso-8859-1?Q?RE:_=5BMaypole=5D_Can=B4t_locate__Model_Classes?= In-Reply-To: <1086471083.2665.16.camel@localhost> Message-ID: That solution solves the @INC problem, but now I have other one. Now it complains about Apache.pm and it seems to me that installing the Apache.pm module isn't the solution. -------------------------------------------------------------------------= --- [Sat Jun 05 23:30:44 2004] [error] Can't locate Apache.pm in @INC (@INC contains: /var/www/html/maypole = /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 = /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/site_perl/5.8.0/Apache/MVC.pm line 3.!BEGIN failed--compilation aborted at = /usr/lib/perl5/site_perl/5.8.0/Apache/MVC.pm line 3.!Compilation failed in require at (eval 2) line 3.!!...propagated = at /usr/lib/perl5/5.8.0/base.pm line 64.!BEGIN failed--compilation aborted = at /var/www/html/maypole/Ola.pm line 7.!Compilation failed in require at = (eval 1) line 3.! [Sat Jun 05 23:30:44 2004] [error] failed to resolve handler `Ola' [Sat Jun 05 23:30:44 2004] [error] [client 172.30.0.214] Can't locate Apache.pm in @INC (@INC contains: /var/www/html/maypole /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/site_perl/5.8.0/Apache/MVC.pm line 3.!BEGIN failed--compilation aborted at = /usr/lib/perl5/site_perl/5.8.0/Apache/MVC.pm line 3.!Compilation failed in require at (eval 2) line 3.!!...propagated = at /usr/lib/perl5/5.8.0/base.pm line 64.!BEGIN failed--compilation aborted = at /var/www/html/maypole/Ola.pm line 7.!Compilation failed in require at = (eval 1) line 3.! -------------------------------------------------------------------------= -- Thanks in advance, M.P.Garcia -----Original Message----- From: Roland Moriz [mailto:roland@moriz.de]=20 Sent: s=E1bado, 5 de Junho de 2004 22:31 To: mgarcia@mentesvirtuais.com Cc: maypole@lists.netthink.co.uk Subject: Re: [Maypole] Can=B4t locate Model Classes Hi Marcos, sorry. with mod_perl2 you'll have to adjust @INC as described at http://theory.uwinnipeg.ca/modperl/docs/2.0/user/config/config.html#Adjus= tin g_C__INC_ The old way with PERL5LIB might not work anymore. regards, with kind regards, Mit freundlichen Gruessen, Roland Moriz --=20 Muenchen/Germany - http://www.roland-moriz.de/ From roland@moriz.de Sat Jun 5 23:55:22 2004 From: roland@moriz.de (Roland Moriz) Date: Sun, 06 Jun 2004 00:55:22 +0200 Subject: [Maypole] =?ISO-8859-1?Q?Can=B4t?= locate Model Classes In-Reply-To: <200406052237.i55MbPpb005124@s2.moriz.net> References: <200406052237.i55MbPpb005124@s2.moriz.net> Message-ID: <1086476121.2665.39.camel@localhost> Hi, Am So, den 06.06.2004 schrieb Marcos Garcia um 0:40: > That solution solves the @INC problem, but now I have other one. > Now it complains about Apache.pm and it seems to me that installing the > Apache.pm module isn't the solution. [...] at the moment Apache::MVC works only with mod_perl 1.xx / apache 1.3.xx out of the box. But maybe http://lists.netthink.co.uk/pipermail/maypole/2004-May/000248.html and http://lists.netthink.co.uk/pipermail/maypole/2004-May/000261.html help you to get maypole running. (new Apache2::MVC + a patched Maypole.pm). Another solution is to call maypole as standard CGI script (with lower performance of course): http://search.cpan.org/~simon/Maypole-1.4/lib/CGI/Maypole.pm Please check the mailinglist archive for more information. http://lists.netthink.co.uk/pipermail/maypole/ regards, with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From karen.cravens@gmail.com Sun Jun 6 19:48:58 2004 From: karen.cravens@gmail.com (Karen Cravens) Date: Sun, 6 Jun 2004 13:48:58 -0500 Subject: [Maypole] Converting an existing app to Maypole Message-ID: <7cc7c1ce04060611486663626a@mail.gmail.com> In between other projects, I've been trying to get my head wrapped around Maypole. There's something I haven't seen addressed in the examples, and I haven't played at all with Class::DBI, so I'm not sure if it's even doable. The church has got an app that runs under PHP and MySQL - InfoCentral. It's the only thing that runs PHP, and we'd really like to eliminate it so that we can retire that server. The website server runs mod_perl Apache, and (after trashing a test server) we've come to the conclusion that everyone who says you shouldn't have mod_perl and PHP on the same install is quite correct. So the alternatives become compiling a second instance of Apache or, and this is of course my preference, turning it into a Perl app. The more so because it's fairly bare-bones as is and we'd like to extend it. That's a long way of saying "I didn't name the fields and I'd rather not rename them if I can help it." So. The table "person_per" holds all the persons, as you might guess, primary key of per_ID, and (among other fields), per_fam_ID, which correspondes to the primary key in "family_fam" which is named fam_ID. Far as I can tell, all of the examples show corresponding field names. Is that required? I'm guessing I can do something with inflate/deflate to link person.per_fam_ID and family.fam_ID, but I haven't pursued it thoroughly yet, and I'd like to know if there's an easier way, or if I'm missing something braindead obvious. From tony-maypole@kasei.com Mon Jun 7 08:44:11 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Mon, 7 Jun 2004 08:44:11 +0100 Subject: [Maypole] Converting an existing app to Maypole In-Reply-To: <7cc7c1ce04060611486663626a@mail.gmail.com> References: <7cc7c1ce04060611486663626a@mail.gmail.com> Message-ID: <20040607074411.GA18809@soto.kasei.com> On Sun, Jun 06, 2004 at 01:48:58PM -0500, Karen Cravens wrote: > So. The table "person_per" holds all the persons, as you might guess, > primary key of per_ID, and (among other fields), per_fam_ID, which > correspondes to the primary key in "family_fam" which is named fam_ID. > Far as I can tell, all of the examples show corresponding field names. In Class::DBI, as long as you define the has_a relationships correctly first, the has_many will do the right thing by examining the has_a declaration. I'm not entirely sure yet what Maypole does here, but I would suggest setting up that has_a by hand and seeing what happens... Tony From raptor@tvskat.net Mon Jun 7 11:37:51 2004 From: raptor@tvskat.net (raptor@tvskat.net) Date: Mon, 7 Jun 2004 13:37:51 +0300 Subject: [Maypole] ala VIEW continued ? Message-ID: <20040607133751.09a36fc8@bugs> hi, I seem to have some success with it, but will post here so that u can check 'm I doing something stupid.. and how to continue after these first steps.. ok below is the code (only interesting lines): package MaypoleICS; #use base 'Apache::MVC'; use base 'CGI::Maypole'; use MaypoleICS::Stuff; <---------here is it MaypoleICS->setup("dbi:SQLite:/path/to/db"); MaypoleICS->config->{uri_base} = "http://x.x.x.x/index.pl"; MaypoleICS->config->{rows_per_page} = 25; MaypoleICS->config->{display_tables} = [qw(users addr stuff)]; ...... etc..... 1; then MaypoleICS::Stuff : package MaypoleICS::Stuff; use base qw(Maypole::Model::CDBI); use Class::DBI::View qw(SubQuery); MaypoleICS->setup("dbi:SQLite:/path/to/db"); MaypoleICS::Stuff->table('stuff'); MaypoleICS::Stuff->columns(All => qw(id name phone cx)); MaypoleICS::Stuff->setup_view(<setup("dbi:SQLite:/path/to/db"); otherwise I have this : Premature end of script headers: index.pl, referer: http://x.x.x.x/index.pl/stuff/list Can't locate object method "db_Main" via package "MaypoleICS::Stuff" at /usr/lib/perl5/vendor_perl/5.8.2/Ima/DBI.pm line 386, line 3077., referer: http://x.x.x.x/index.pl/stuff/list Is there a way to overcome this... tia From com@navicon.dk Mon Jun 7 13:19:18 2004 From: com@navicon.dk (=?ISO-8859-1?Q?Carsten_=D8land_Madsen?=) Date: Mon, 07 Jun 2004 14:19:18 +0200 Subject: [Maypole] many to many relationships Message-ID: <40C45D46.3020408@navicon.dk> In Beer.pm I did ... sub related { "pubs" } as suggested. This does not change anything, i.e., no pubs can be seen when viewing a beer. I noticed a previous mail about handpump being ignored. Any hints/workarounds on how to get many-to-many relationships working in maypole? rgds /carsten From com@navicon.dk Mon Jun 7 13:35:49 2004 From: com@navicon.dk (=?ISO-8859-1?Q?Carsten_=D8land_Madsen?=) Date: Mon, 07 Jun 2004 14:35:49 +0200 Subject: [Maypole] many to many relationships In-Reply-To: <40C45D46.3020408@navicon.dk> References: <40C45D46.3020408@navicon.dk> Message-ID: <40C46125.7010204@navicon.dk> Sorry, I was to fast on the trigger Doing package BeerDB::Pub; sub related { "beers" } return 1; and package BeerDB::Beer; sub related { "pubs" } return 1; Does work, i.e., pubs are listed when a beer is viewed etc. Now how do I add beers to pubs? /carsten Carsten =D8land Madsen wrote: > In Beer.pm I did > > ... > sub related { "pubs" } > > as suggested. This does not change anything, i.e., no pubs can be seen=20 > when viewing a beer. I noticed a previous mail about handpump being=20 > ignored. > > Any hints/workarounds on how to get many-to-many relationships working=20 > in maypole? > > rgds > /carsten > > _______________________________________________ > maypole mailing list > maypole@lists.netthink.co.uk > http://lists.netthink.co.uk/listinfo/maypole > From marcus@thefeed.no Mon Jun 7 14:03:35 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Mon, 07 Jun 2004 15:03:35 +0200 Subject: [Maypole] many to many relationships In-Reply-To: <40C46125.7010204@navicon.dk> References: <40C45D46.3020408@navicon.dk> <40C46125.7010204@navicon.dk> Message-ID: <40C467A7.9040508@thefeed.no> The relationship bit of cdbi has changed in 0.60 of Class::DBI . Search the list for 'proper related function' to find a patch. Marcus Carsten Øland Madsen wrote: > Sorry, I was to fast on the trigger > > Doing > > package BeerDB::Pub; > > sub related { "beers" } > > return 1; > > and > > > package BeerDB::Beer; > sub related { "pubs" } > return 1; > > Does work, i.e., pubs are listed when a beer is viewed etc. > > Now how do I add beers to pubs? > -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From drew@drewtaylor.com Mon Jun 7 15:31:52 2004 From: drew@drewtaylor.com (Drew Taylor) Date: Mon, 07 Jun 2004 10:31:52 -0400 Subject: [Maypole] many to many relationships In-Reply-To: <40C467A7.9040508@thefeed.no> References: <40C45D46.3020408@navicon.dk> <40C46125.7010204@navicon.dk> <40C467A7.9040508@thefeed.no> Message-ID: <40C47C58.2090609@drewtaylor.com> Make sure you use the latest CPAN release (currently 0.96), which has tons of important (and good and useful!) changes since 0.60. Drew Marcus Ramberg wrote: > The relationship bit of cdbi has changed in 0.60 of Class::DBI . Search > the list for 'proper related function' to find a patch. > > Marcus > > Carsten Øland Madsen wrote: > >> Sorry, I was to fast on the trigger >> >> Doing >> >> package BeerDB::Pub; >> >> sub related { "beers" } >> >> return 1; >> >> and >> >> >> package BeerDB::Beer; >> sub related { "pubs" } >> return 1; >> >> Does work, i.e., pubs are listed when a beer is viewed etc. >> >> Now how do I add beers to pubs? -- ---------------------------------------------------------------- Drew Taylor * Web development & consulting Email: drew@drewtaylor.com * Site implementation & hosting Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres ---------------------------------------------------------------- From marcus@thefeed.no Mon Jun 7 16:14:47 2004 From: marcus@thefeed.no (Marcus Ramberg) Date: Mon, 07 Jun 2004 17:14:47 +0200 Subject: [Maypole] many to many relationships In-Reply-To: <40C47C58.2090609@drewtaylor.com> References: <40C45D46.3020408@navicon.dk> <40C46125.7010204@navicon.dk> <40C467A7.9040508@thefeed.no> <40C47C58.2090609@drewtaylor.com> Message-ID: <40C48667.2010001@thefeed.no> Sorry, the below should of course be "has changed in 0.96", the Maypole patch takes advantage of the new CDBI::Relationship::* structure to get a proper list of has_manys Drew Taylor wrote: > Make sure you use the latest CPAN release (currently 0.96), which has > tons of important (and good and useful!) changes since 0.60. > >> The relationship bit of cdbi has changed in 0.60 of Class::DBI . >> Search the list for 'proper related function' to find a patch. >> >> Marcus >> >> Carsten Øland Madsen wrote: >> >>> Sorry, I was to fast on the trigger >>> >>> Doing >>> >>> package BeerDB::Pub; >>> >>> sub related { "beers" } >>> >>> return 1; >>> >>> and >>> >>> >>> package BeerDB::Beer; >>> sub related { "pubs" } >>> return 1; >>> >>> Does work, i.e., pubs are listed when a beer is viewed etc. >>> >>> Now how do I add beers to pubs? >> > -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no From philip.stadermann@iterationx.de Mon Jun 7 17:00:37 2004 From: philip.stadermann@iterationx.de (Philip Stadermann) Date: Mon, 07 Jun 2004 18:00:37 +0200 Subject: [Maypole] Maypole Debian package Message-ID: <40C49125.7050801@iterationx.de> Hi everyone, is there a Debian package for Maypole or is someone working on it? If not I want to build one. I just wanted to ask first to prevent duplicate work. Greets, Philip From com@navicon.dk Tue Jun 8 11:18:44 2004 From: com@navicon.dk (=?ISO-8859-1?Q?Carsten_=D8land_Madsen?=) Date: Tue, 08 Jun 2004 12:18:44 +0200 Subject: [Maypole] extending edit template for beerdb? Message-ID: <40C59284.7030508@navicon.dk> Hi I'm trying to extend the edit template for the BeerDB demo so that when editing beers a list of pubs will be availabe and it will be possible to add and remove pubs. Currently I'm struggling with getting a list with all the pubs from within the edit template. My template code looks like this FOR accessor = classmetadata.related_accessors.list; "

"; END; Why does the config.loader.find_class('pub').retrieve_all(); call not return a list with all the pubs? The find_class returns 'BeerDB::Pub'. rgds /carsten From karen.cravens@gmail.com Wed Jun 9 01:11:33 2004 From: karen.cravens@gmail.com (Karen Cravens) Date: Tue, 8 Jun 2004 19:11:33 -0500 Subject: [Maypole] Converting an existing app to Maypole In-Reply-To: <20040607074411.GA18809@soto.kasei.com> References: <7cc7c1ce04060611486663626a@mail.gmail.com> <20040607074411.GA18809@soto.kasei.com> Message-ID: <7cc7c1ce04060817115dc4ccd7@mail.gmail.com> On Mon, 7 Jun 2004 08:44:11 +0100, Tony Bowden wrote: > In Class::DBI, as long as you define the has_a relationships correctly > first, the has_many will do the right thing by examining the has_a > declaration. Okay. So now I just need to learn how to set up the has_a's... as I said, I'm not (yet) familiar with Class::DBI. > I'm not entirely sure yet what Maypole does here, but I would suggest > setting up that has_a by hand and seeing what happens... Seems reasonable. Thanks. From michael@petersfamily.org Wed Jun 9 21:46:47 2004 From: michael@petersfamily.org (michael) Date: Wed, 9 Jun 2004 15:46:47 -0500 Subject: [Maypole] getting started woes.. Message-ID: <20040609204141.M640@petersfamily.org> I'm trying to get a simple Maypole app up and running and could use some help. I get this in the error log... Can't locate object method "set_db" via package "AHRPetition::Petition" at /usr/lib/perl5/site_perl/5.8.3/Class/DBI/Loader/mysql.pm line 23 now I read the wiki and it said it could be cause I don't have the appropriate Class::DBI::* modules installed. but an ls -R on the lib directory for class DBI shows all of these... ls -R Class/DBI Class/DBI: AbstractSearch.pm ColumnGrouper.pm FromCGI.pm Loader Pager.pm Query.pm Relationship.pm AsForm.pm Column.pm Iterator.pm Loader.pm Plugin Relationship Class/DBI/Loader: Generic.pm mysql.pm Pg.pm Relationship.pm SQLite.pm Class/DBI/Plugin: RetrieveAll.pm Type.pm Class/DBI/Relationship: HasA.pm HasMany.pm MightHave.pm so it appears to me that they are all there. what might be the problem??? Here's my handler code... [code] package AHRPetition; use Apache::Reload; use base 'Apache::MVC'; AHRPetition->setup("dbi:mysql:AHR", 'root', 'whatever'); AHRPetition->config->{uri_base} = "http://localhost:8080/Petition/"; AHRPetition->config->{display_tables} = [qw[Petition User Sector Signature]]; AHRPetition::Petition->untaint_columns( printable => [qw/title text/], integer => [qw/User Sector active/], ); use Class::DBI::Loader::Relationship; AHRPetition->config->{loader}->relationship($_) for ( "a petition has a user", "a petition has a sector", "a user has a petition", "a signature has a petition", ); [/code] thanks for looking at this. Michael Peters From roland@moriz.de Wed Jun 9 21:54:37 2004 From: roland@moriz.de (Roland Moriz) Date: Wed, 09 Jun 2004 22:54:37 +0200 Subject: [Maypole] getting started woes.. In-Reply-To: <20040609204141.M640@petersfamily.org> References: <20040609204141.M640@petersfamily.org> Message-ID: <1086814477.2320.1.camel@pc-101.muc.de.moriz.net.> Hello Michael, Am Mi, den 09.06.2004 schrieb michael um 22:46: > I'm trying to get a simple Maypole app up and running and could use some help. > > I get this in the error log... > > Can't locate object method "set_db" via package "AHRPetition::Petition" at > /usr/lib/perl5/site_perl/5.8.3/Class/DBI/Loader/mysql.pm line 23 > http://wiki.simon-cozens.org/index.cgi?InstallationIssues "Ensure that you're using... Class::DBI::mysql if you're using a MySQL database, or Class::DBI::SQLite if you're using SQLite, or so on.." with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From gaal@forum2.org Wed Jun 9 22:03:00 2004 From: gaal@forum2.org (Gaal Yahas) Date: Thu, 10 Jun 2004 00:03:00 +0300 Subject: [Maypole] Passing dbh attributes on setup Message-ID: <20040609210300.GD17923@sike.forum2.org> I need to pass initialization information to my database handle[1]. But I couldn't figure out how! This doesn't work: __PACKAGE__->setup($dsn, $user, $password, { mysql_enable_utf8=>1 }); Naive, perhaps, to assume that it should, but the flow in Maypole::setup as a little too confusing for me :-( I'd settle for a hackish way to steal the dbh from CDBI after the connect, since I don't need this attribute to be correct at connection time, but that didn't seem any easier. [1] If you're using mysql and need to convince perl your data is utf8, check out this patch to DBD::mysql: http://lists.mysql.com/perl/3006 -- Gaal Yahas http://gaal.livejournal.com/ From jester@panix.com Wed Jun 9 22:05:22 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 9 Jun 2004 17:05:22 -0400 Subject: [Maypole] getting started woes.. In-Reply-To: <20040609204141.M640@petersfamily.org> References: <20040609204141.M640@petersfamily.org> Message-ID: <20040609210522.GA15954@panix.com> On Wed, Jun 09, 2004 at 03:46:47PM -0500, michael wrote: > I'm trying to get a simple Maypole app up and running and could use some help. > > I get this in the error log... > > Can't locate object method "set_db" via package "AHRPetition::Petition" at > /usr/lib/perl5/site_perl/5.8.3/Class/DBI/Loader/mysql.pm line 23 > > now I read the wiki and it said it could be cause I don't have the appropriate > Class::DBI::* modules installed. > > but an ls -R on the lib directory for class DBI shows all of these... > > ls -R Class/DBI > Class/DBI: > AbstractSearch.pm ColumnGrouper.pm FromCGI.pm Loader Pager.pm > Query.pm Relationship.pm > AsForm.pm Column.pm Iterator.pm Loader.pm Plugin > Relationship You do _not_ seem to have Class::DBI::mysql installed (you have Class::DBI::Loader::mysql, which is different). Install Class::DBI::mysql and you should be good to go, or at least you should be past _this_ error ;-) Best, Jesse Sheidlower From roland@moriz.de Wed Jun 9 22:30:26 2004 From: roland@moriz.de (Roland Moriz) Date: Wed, 09 Jun 2004 23:30:26 +0200 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <20040609210300.GD17923@sike.forum2.org> References: <20040609210300.GD17923@sike.forum2.org> Message-ID: <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> Hello Gaal, Am Mi, den 09.06.2004 schrieb Gaal Yahas um 23:03: > I need to pass initialization information to my database handle[1]. > > But I couldn't figure out how! This doesn't work: > > __PACKAGE__->setup($dsn, $user, $password, { mysql_enable_utf8=>1 }); > > Naive, perhaps, to assume that it should, but the flow in Maypole::setup > as a little too confusing for me :-( not sure if this works but have you tried to set the attribut within $dsn as described in the DBI pod? http://search.cpan.org/~timb/DBI-1.42/DBI.pm ------- "The \%attr parameter can be used to alter the default settings of PrintError, RaiseError, AutoCommit, and other attributes. For example: $dbh = DBI->connect($data_source, $user, $pass, { PrintError => 0, AutoCommit => 0 }); The username and password can also be specified using the attributes Username and Password, in which case they take precedence over the $username and $password parameters. You can also define connection attribute values within the $data_source parameter. For example: dbi:DriverName(PrintWarn=>1,PrintError=>0,Taint=>1):... Individual attributes values specified in this way take precedence over any conflicting values specified via the \%attr parameter to connect." ------- Also, Simon maybe wants to extend Maypole::Model::CDBI::setup_database() to allow extra arguments (as far as i can see Class::DBI::Loader supports that) in a future release of Maypole... hth, with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From tony-maypole@kasei.com Wed Jun 9 23:05:45 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Wed, 9 Jun 2004 23:05:45 +0100 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <20040609210300.GD17923@sike.forum2.org> References: <20040609210300.GD17923@sike.forum2.org> Message-ID: <20040609220545.GA17591@soto.kasei.com> On Thu, Jun 10, 2004 at 12:03:00AM +0300, Gaal Yahas wrote: > I'd settle for a hackish way to steal the dbh from CDBI after the connect, > since I don't need this attribute to be correct at connection time, but > that didn't seem any easier. my $dbh = $class->db_Main; Tony From roland@moriz.de Wed Jun 9 23:21:33 2004 From: roland@moriz.de (Roland Moriz) Date: Thu, 10 Jun 2004 00:21:33 +0200 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> References: <20040609210300.GD17923@sike.forum2.org> <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> Message-ID: <1086819693.2320.20.camel@pc-101.muc.de.moriz.net.> Hello again, Am Mi, den 09.06.2004 schrieb Roland Moriz um 23:30: > Also, Simon maybe wants to extend Maypole::Model::CDBI::setup_database() > to allow extra arguments (as far as i can see Class::DBI::Loader > supports that) in a future release of Maypole... Marcus Ramberg was so friendly to inform me about the patch written by Mickael Jouanne at: http://lists.netthink.co.uk/pipermail/maypole/2004-June/000355.html Does someone still have an overview about current available patches? with kind regards, Roland Moriz (rmoriz) -- rmoriz@cpan.org From jester@panix.com Wed Jun 9 23:31:47 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 9 Jun 2004 18:31:47 -0400 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <1086819693.2320.20.camel@pc-101.muc.de.moriz.net.> References: <20040609210300.GD17923@sike.forum2.org> <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> <1086819693.2320.20.camel@pc-101.muc.de.moriz.net.> Message-ID: <20040609223147.GA8099@panix.com> On Thu, Jun 10, 2004 at 12:21:33AM +0200, Roland Moriz wrote: > Hello again, > > Am Mi, den 09.06.2004 schrieb Roland Moriz um 23:30: > > > Also, Simon maybe wants to extend Maypole::Model::CDBI::setup_database() > > to allow extra arguments (as far as i can see Class::DBI::Loader > > supports that) in a future release of Maypole... > > Marcus Ramberg was so friendly to inform me about the patch written by > Mickael Jouanne at: > > http://lists.netthink.co.uk/pipermail/maypole/2004-June/000355.html > > Does someone still have an overview about current available patches? I've placed this patch into the RT queue on CPAN at: https://rt.cpan.org/NoAuth/Bugs.html?Dist=Maypole There are some other patches there, and Simon has asked that patches, feature requests, etc. be sent there for ease of tracking. Jesse Sheidlower From michael@petersfamily.org Wed Jun 9 23:45:47 2004 From: michael@petersfamily.org (michael) Date: Wed, 9 Jun 2004 17:45:47 -0500 Subject: [Maypole] another PB with :Exported Message-ID: <20040609224219.M79414@petersfamily.org> Ok, I'm having a problem adding a new action. I found this post http://lists.netthink.co.uk/pipermail/maypole/2004-May/000256.html where he seemed to have the same problem and then simon 'kindly' pointed him toward the first recipe which deals with separating the model classes. I'm not doing that, but I still get the same 'Invalid CODE attribute: Exported' error. here's my module... [code] package Petition::Handle; use Apache::Reload; use base 'Apache::MVC'; Petition::Handle->setup("dbi:mysql:AHR", 'root', 'whatever'); Petition::Handle->config->{template_root} = "/home/ahr/www/Petition/templates"; Petition::Handle->config->{uri_base} = "http://localhost:8080/Petition/"; Petition::Handle->config->{display_tables} = [qw[Petition User Sector Signature]]; Petition::User->has_a(Petition => 'Petition::Petition'); Petition::User->untaint_columns( printable => [qw(name password)], integer => [qw(Petition)], ); sub add :Exported {} 1; [/code] all in one file/module and it still gives that error. thanks for any help. Michael Peters From roland@moriz.de Thu Jun 10 00:04:09 2004 From: roland@moriz.de (Roland Moriz) Date: Thu, 10 Jun 2004 01:04:09 +0200 Subject: [Maypole] Patchlist Message-ID: <1086822249.2320.23.camel@pc-101.muc.de.moriz.net.> Hi, that's the list of patches i know about: http://wiki.simon-cozens.org/index.cgi?MaypolePatches Feel free to alter/comment/add! with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/ From jester@panix.com Thu Jun 10 03:35:59 2004 From: jester@panix.com (Jesse Sheidlower) Date: Wed, 9 Jun 2004 22:35:59 -0400 Subject: [Maypole] Patchlist In-Reply-To: <1086822249.2320.23.camel@pc-101.muc.de.moriz.net.> References: <1086822249.2320.23.camel@pc-101.muc.de.moriz.net.> Message-ID: <20040610023559.GA27920@panix.com> On Thu, Jun 10, 2004 at 01:04:09AM +0200, Roland Moriz wrote: > Hi, > > that's the list of patches i know about: > http://wiki.simon-cozens.org/index.cgi?MaypolePatches > > Feel free to alter/comment/add! Roland, thanks for the list! I've added all relevant info (some were already in CVS, some related to other modules), properly credited, to the appropriate RT queue, which should be used to track all of these. Let's make it easy for Simon to get all of it done! Jesse Sheidlower From carloschoenberg@yahoo.com Thu Jun 10 04:08:06 2004 From: carloschoenberg@yahoo.com (Carlos Schoenberg) Date: Wed, 9 Jun 2004 20:08:06 -0700 (PDT) Subject: [Maypole] no primary key says Class::DBI::Loader::Pg Message-ID: <20040610030806.72720.qmail@web50008.mail.yahoo.com> If I do this: Package Foo; use base 'CGI::Maypole'; Foo->setup... I get this error: pg_catalog.pg_aggregate has no primary key at /usr/lib/perl5/site_perl/5.8.0/Class/DBI/Loader/Pg.pm line 22 Is there a way to make this work without creating a primary key on every random table in my database? __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ From michael@diaspora.gen.nz Thu Jun 10 05:56:39 2004 From: michael@diaspora.gen.nz (michael@diaspora.gen.nz) Date: Thu, 10 Jun 2004 16:56:39 +1200 Subject: [Maypole] no primary key says Class::DBI::Loader::Pg In-Reply-To: Your message of "Wed, 09 Jun 2004 20:08:06 MST." <20040610030806.72720.qmail@web50008.mail.yahoo.com> Message-ID: >pg_catalog.pg_aggregate has no primary key at >/usr/lib/perl5/site_perl/5.8.0/Class/DBI/Loader/Pg.pm >line 22 See http://lists.netthink.co.uk/pipermail/maypole/2004-May/000287.html for a patch to Class::DBI::Loader::Pg which fixes that problem with Pg 7.4. -- michael. From mwangu@hotmail.com Thu Jun 10 09:07:08 2004 From: mwangu@hotmail.com (Mike Wangu) Date: Thu, 10 Jun 2004 08:07:08 +0000 Subject: [Maypole] CDBIL::Relationship query Message-ID: Thank you, Perrin. I concur. Apologies for the delay in responding. >From: Perrin Harkins >To: Mike Wangu >CC: Maypole List >Subject: Re: [Maypole] CDBIL::Relationship query >Date: Fri, 28 May 2004 13:19:17 -0400 > >On Fri, 2004-05-28 at 03:57, Mike Wangu wrote: > > I have setup my table classes manually using Class::DBI and I am happy >with > > that. I came across Class::DBI::Loader::Relationship in the Maypole >examples > > and that looks a more maintainable way of setting up the underlying >classes > > for an application. > >Okay, I see what you're after now. Given that neither you nor I can >figure out how to express this simple relationship with C::D::L::R, I'd >say it's probably not going to be more maintainable. I would stick with >standard Class::DBI semantics. > >- Perrin > _________________________________________________________________ Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/ From gaal@forum2.org Thu Jun 10 09:11:26 2004 From: gaal@forum2.org (Gaal Yahas) Date: Thu, 10 Jun 2004 11:11:26 +0300 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <20040609220545.GA17591@soto.kasei.com> References: <20040609210300.GD17923@sike.forum2.org> <20040609220545.GA17591@soto.kasei.com> Message-ID: <20040610081126.GH17923@sike.forum2.org> On Wed, Jun 09, 2004 at 11:05:45PM +0100, Tony Bowden wrote: > On Thu, Jun 10, 2004 at 12:03:00AM +0300, Gaal Yahas wrote: > > I'd settle for a hackish way to steal the dbh from CDBI after the connect, > > since I don't need this attribute to be correct at connection time, but > > that didn't seem any easier. > > my $dbh = $class->db_Main; Hmm, perhaps my timing was wrong, but this didn't work: BYM->db_Main()->{mysql_enable_utf8} = 1; # after BYM->setup and stuff [...] Couldn't require BYM - Can't locate object method "db_Main" via package "BYM" at lib/BYM.pm line 30. -- Gaal Yahas http://gaal.livejournal.com/ From gaal@forum2.org Thu Jun 10 09:12:22 2004 From: gaal@forum2.org (Gaal Yahas) Date: Thu, 10 Jun 2004 11:12:22 +0300 Subject: [Maypole] Passing dbh attributes on setup In-Reply-To: <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> References: <20040609210300.GD17923@sike.forum2.org> <1086816625.2320.8.camel@pc-101.muc.de.moriz.net.> Message-ID: <20040610081222.GI17923@sike.forum2.org> On Wed, Jun 09, 2004 at 11:30:26PM +0200, Roland Moriz wrote: > not sure if this works but have you tried to set the attribut within > $dsn as described in the DBI pod? > > http://search.cpan.org/~timb/DBI-1.42/DBI.pm [...] > You can also define connection attribute values within the $data_source > parameter. For example: > > dbi:DriverName(PrintWarn=>1,PrintError=>0,Taint=>1):... This does the trick for me, thank you very much! -- Gaal Yahas http://gaal.livejournal.com/ From Steve@cat-and-mouse.demon.co.uk Sun Jun 6 14:55:50 2004 From: Steve@cat-and-mouse.demon.co.uk (Steve@cat-and-mouse.demon.co.uk) Date: Sun, 06 Jun 2004 14:55:50 +0100 Subject: [Maypole] Update/Insert ignored in beerdb on Postgres 7.4/apache 2 Message-ID: <40C33076.12613.257208C@localhost> Hi, I'm trying to get BeerDB working with Apache2, and Postgres 7.4, in a user area, and am not having much luck. I'm using the latest modules of everything, as far as I can tell, other than Class::DBI::AsForm, which I had to use 2.1, as in 2.2 the tests fail: 1..4 ok 1 - use Class::DBI::AsForm; Can't locate object method "db_Main" via package "Foo" at ....... perl5/site_perl/5.8.2/Ima/DBI.pm line 386. # Looks like you planned 4 tests but only ran 1. # Looks like your test died just after 1. make: *** [test_dynamic] Error 255 I've used Marcus Ramberg's patches, excluding the UserSessionCookie mods to get Maypole up and running, and have used the tips described here: http://lists.netthink.co.uk/pipermail/maypole/2004-May/000287.html To get a partially usable BeerDB installation. Unfortuantly I cannot create records however - if I add a record to brewery, it looks like it has worked, and gets displayed on the page, but does not alter the database. I've tried adding a record using psql, and interestingly the id it picks is '7', however, if I edit this record using the maypole front end, then once again, Maypole shows it has changed, but this is not reflected in the database. No errors are output to the error log, before I get my wellies on an start wading through code, I was wondering if I have overlooked something incredibly obvious that half a dozen people have overcome already? Cheers, Steve From Steve@cat-and-mouse.demon.co.uk Sun Jun 6 15:11:15 2004 From: Steve@cat-and-mouse.demon.co.uk (Steve@cat-and-mouse.demon.co.uk) Date: Sun, 06 Jun 2004 15:11:15 +0100 Subject: [Maypole] Re: Update/Insert ignored in beerdb on Postgres 7.4/apache 2 Message-ID: <40C33413.12651.2653DF7@localhost> On 6 Jun 2004 at 14:55, maypole@lists.netthink.co.uk wrote: > Hi, > > I'm trying to get BeerDB working with Apache2, and Postgres 7.4, in a user area, and > am not having much luck. ... > > To get a partially usable BeerDB installation. Unfortuantly I cannot create records > however - if I add a record to brewery, it looks like it has worked, and gets > displayed on the page, but does not alter the database. > I've now added the mod described in: http://lists.netthink.co.uk/pipermail/maypole/2004-June/000355.html And the problem has gone away. Sorry for the waste of bandwidth - posting it obviously swept away a few cobwebs. Steve From lenjaffe@mail.com Fri Jun 11 17:18:25 2004 From: lenjaffe@mail.com (Leonard Jaffe) Date: Fri, 11 Jun 2004 11:18:25 -0500 Subject: [Maypole] please explain this error log message Message-ID: <20040611161825.336BD16402D@ws1-4.us4.outblaze.com> I'm getting an error message in my apache log when I click thruogh my frontpage to this URL: http://myhost/cond/RAATCONDITION/list This is the message: Argument "OK" isn't numeric in numeric eq (==) at /revo/perl/lib/perl5/site_perl/5.8.0/////////////////////Maypole.pm line 73. Can anybody explain: 1) Why OK isn't defined. Shouldn't that come from Maypole's juju? 2) What gives with the parade of slashes? Thanks. Len. -- Len Jaffe Columbus, OH, USA -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From Steve@cat-and-mouse.demon.co.uk Sat Jun 12 23:38:20 2004 From: Steve@cat-and-mouse.demon.co.uk (Steve@cat-and-mouse.demon.co.uk) Date: Sat, 12 Jun 2004 23:38:20 +0100 Subject: [Maypole] Leakage of model? data on same apache, different location Message-ID: Hello, This has already been mentioned once: http://lists.netthink.co.uk/pipermail/maypole/2004-June/000382.html But as yet I haven't seen an answer. I've installed both ISellIt and BeerDB on the same server, and one of the applications tens to polute the either from a data standpoint - the frontpage for ISellIt could list beers, brewery, pubs etc as the table types on the frontpage - this will go as far as the links refusing to work, implying that large portions of data are being overwritten - perhaps in the apache request object or at class level somewhere? I'm currently using postgres, and apache 2, and am unfortuantely unable to test it on apache 1 at the moment, I was wondering if this behavour was universal? I'll obviously try to figure it out myself, just wondered if someone else had already found/fixed the issue and can save me some time? Cheers, Steve From simon@thegest