From chromatic@wgz.org Tue Jul 6 02:12:33 2004 From: chromatic@wgz.org (chromatic) Date: Mon, 05 Jul 2004 18:12:33 -0700 Subject: [Maypole] Jellybean::Container::Maypole Message-ID: <1089076353.2430.2.camel@localhost> Hi all, I've just released Jellybean::Container::Maypole, a Jellybean plugin that can run Maypole applications. It works really well with SQLite databases. It's not on the CPAN yet because Jellybean still needs a bit of work, but if you download the snapshot from http://wgz.org/chromatic/jellybean/ and the wrapper from http://wgz.org/chromatic/perl/, it'll probably work for you. Surprisingly, I didn't have to modify Maypole at all, though I did need one small hack to make it load without mod_perl installed. -- c From email@jasonkohles.com Tue Jul 6 05:27:50 2004 From: email@jasonkohles.com (Jason Kohles) Date: Tue, 6 Jul 2004 00:27:50 -0400 Subject: [Maypole] Using additional_data on a page not related to a table Message-ID: <20040706042750.GA18978@mail.jasonkohles.com> Greetings, I'm in the process of developing my first real application with Maypole, and have run into a problem. I'm not sure if this is my misunderstanding the way it should work, or if the way it is working is as screwy as I think it is :), so any suggestions would be appreciated. It all started with wanting to display some an overview of several tables as they relate to the person who is currently logged in. I started by trying to use additional_data to put some information into the template_args. My additional_data sub looks like this: sub additional_data { my $r = shift; $r->{template_args}{my} = $r->{user}; $r->{template_args}{login} = $ENV{REMOTE_USER}; } I then added to my frontpage template:

Login: [% login %]

However, the login is always blank. I tracked down where it was getting lost and found this: * Maypole::handler contains this snippet: my $status = $r->handler_guts(); return $status unless $status == OK; * Maypole::handler_guts calls is_applicable() and then bases its decision on what to do next based on the return from is_applicable. Only one of the two possible branches based on this return calls additional_data, however, if is_applicable does not return OK, then it runs some code that is commented with "it's just a plain template" * is_applicable sets up some defaults in the event that ok_tables is not populated, and then has this line of code: return DECLINED() unless exists $config->{ok_tables}{$self->{table}}; When is_applicable gets called during the processing of the frontpage template, $self->{table} is set to 'frontpage', therefore is_applicable returns false, and additional_data() is never run. So the question is, is there a reason that additional_data() doesn't run for plain templates? Or is there some other way to accomplish what I'm trying here? This is the patch I applied to get it working, so far I haven't seen any strange side effects from this, but should I expect to find any? *** Maypole.pm.orig Tue Jul 6 00:29:28 2004 --- Maypole.pm Tue Jul 6 00:29:45 2004 *************** *** 79,84 **** --- 79,85 ---- delete $r->{model_class}; $r->{path} =~ s{/}{}; # De-absolutify $r->template($r->{path}); + $r->additional_data(); } if (!$r->{output}) { # You might want to do it yourself return $r->view_object->process($r); -- Jason Kohles A witty saying proves nothing. email@jasonkohles.com -- Voltaire (1694 - 1778) http://www.jasonkohles.com/ From email@jasonkohles.com Tue Jul 6 05:54:31 2004 From: email@jasonkohles.com (Jason Kohles) Date: Tue, 6 Jul 2004 00:54:31 -0400 Subject: [Maypole] authentication for plain templates Message-ID: <20040706045431.GB18978@mail.jasonkohles.com> Following up to my earlier message, it seems that a simple template (such as the example 'frontpage') can not be authenticated for similar reasons, your authenticate() sub will never be called if you are calling a template which is not associated with a table. I've patched my version of Maypole with this patch, which solves the problem for me, and hopefully for others... *** Maypole.pm Tue Jul 6 00:29:28 2004 --- /usr/lib/perl5/site_perl/5.6.1/Maypole.pm Tue Jul 6 00:57:19 2004 *************** *** 63,78 **** sub handler_guts { my $r = shift; $r->model_class($r->config->{model}->class_of($r, $r->{table})); ! my $status = $r->is_applicable; if ($status == OK) { - $status = $r->call_authenticate; - if ($r->debug and $status != OK and $status != DECLINED) { - $r->view_object->error($r, - "Got unexpected status $status from calling authentication"); - } - return $status unless $status == OK; - $r->additional_data(); - $r->model_class->process($r); } else { # Otherwise, it's just a plain template. --- 63,78 ---- sub handler_guts { my $r = shift; $r->model_class($r->config->{model}->class_of($r, $r->{table})); ! ! my $status = $r->call_authenticate; ! if ($r->debug and $status != OK and $status != DECLINED) { ! $r->view_object->error($r, ! "Got unexpected status $status from calling authentication"); ! } ! return $status unless $status == OK; ! $r->additional_data(); ! $status = $r->is_applicable; if ($status == OK) { $r->model_class->process($r); } else { # Otherwise, it's just a plain template. -- Jason Kohles A witty saying proves nothing. email@jasonkohles.com -- Voltaire (1694 - 1778) http://www.jasonkohles.com/ From jester@panix.com Tue Jul 6 07:07:07 2004 From: jester@panix.com (Jesse Sheidlower) Date: Tue, 6 Jul 2004 02:07:07 -0400 Subject: [Maypole] Paged search results: first steps Message-ID: <20040706060707.GA3167@panix.com> I apologize for the extremely nonspecific nature of this post, but it's late at night and just want to get some thoughts down. One of the problems I've had with Maypole up to now is the lack of paged search results: When you run a search while using a pager, the pager template takes no notice of the fact that you're doing a search, so the links that are generated are to the full result set, not to the searched results. We've discussed this before on the list. Thanks to some helpful off-list suggestions from another hacker, I've cobbled together a system to get this to work, which I will now describe, if not patch. First, the search method in CDBI.pm. I generate a list of the search params (as opposed to the entire parameter list, which can have assorted other stuff depending on where you're coming from), and pass this to the template: my %search_params = map {$_ => $params{$_} } grep { $params{$_} and $fields{$_} } keys %params; $r->{template_args}{search_params} = \%search_params; (I note in passing that the search_where line in this method has errors, in the generation of the order_by clause: the correct syntax should be: $r->objects([ $self->search_where(\%values, ($order ? { order_by => $order } : {})) ]); I've submitted this to the RT queue). Then, I created a separate search_pager template, which I call from the list template like: [% IF search %] [% INCLUDE search_pager %] [% ELSE %] [% INCLUDE pager %] [% END %] The search_pager template, instead of using the "link" macro, generates the URL's in this general way: [% USE url("$base/$table/search", search_params) %] and then for the link itself: [% "[" _ '' _ num _ "" _ "]" %] This isn't fully working; the base URL tends to have lots of extra //'s, and the link generation is ugly and should be macroified and is screwed up much of the time. And it should account for order parameters, and perhaps others, but I haven't gotten there yet. Still, it's probably the general idea, so if someone is still reading and has the time to make it work right, please let me know! Jesse Sheidlower From simon@simon-cozens.org Tue Jul 6 14:22:15 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 14:22:15 +0100 Subject: [Maypole] authentication for plain templates In-Reply-To: <20040706045431.GB18978@mail.jasonkohles.com> References: <20040706045431.GB18978@mail.jasonkohles.com> Message-ID: <20040706132215.GA16707@alibi.simon-cozens.org> Jason Kohles: > Following up to my earlier message, it seems that a simple template > (such as the example 'frontpage') can not be authenticated for similar > reasons, your authenticate() sub will never be called if you are calling > a template which is not associated with a table. I've patched my > version of Maypole with this patch, which solves the problem for me, and > hopefully for others... Firstly, this should be in maypole-dev. Secondly I remember deliberately taken this out because plain templates don't have model classes. -- Ah the joys of festival + Gutenburg project. I can now have Moby Dick read to me by Stephen Hawking. From simon@simon-cozens.org Tue Jul 6 14:24:32 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 14:24:32 +0100 Subject: [Maypole] Jellybean::Container::Maypole In-Reply-To: <1089076353.2430.2.camel@localhost> References: <1089076353.2430.2.camel@localhost> Message-ID: <20040706132432.GB16707@alibi.simon-cozens.org> chromatic: > Surprisingly, I didn't have to modify Maypole at all, You call it surprising, I call it good design. *shrug*. :) -- Life is perfectly fair, by the way; just to other people. From simon@simon-cozens.org Tue Jul 6 14:25:57 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 14:25:57 +0100 Subject: [Maypole] Paged search results: first steps In-Reply-To: <20040706060707.GA3167@panix.com> References: <20040706060707.GA3167@panix.com> Message-ID: <20040706132557.GC16707@alibi.simon-cozens.org> Jesse Sheidlower: > haven't gotten there yet. Still, it's probably the general > idea, so if someone is still reading and has the time to make > it work right, please let me know! I'm currently trying to solve a more general problem, where occasionally you want some_object.accessor to be paged, not the object itself. I'll let you know how I get on with it. Right now I'm trying to get to work on Maypole::Cache. -- Relf Test Passed. - plan9 has a bad day From simon@simon-cozens.org Tue Jul 6 17:37:42 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 17:37:42 +0100 Subject: [Maypole] Maypole::Cache Message-ID: <20040706163742.GA29814@alibi.simon-cozens.org> I've just uploaded this to CPAN. You'll like it. Executive summary: package BeerDB; use base 'Apache::MVC'; use Maypole::Cache; # Things go faster now ... -- Will your long-winded speeches never end? What ails you that you keep on arguing? -- Job 16:3 From perrin@elem.com Tue Jul 6 21:57:19 2004 From: perrin@elem.com (Perrin Harkins) Date: Tue, 06 Jul 2004 16:57:19 -0400 Subject: [Maypole] Maypole::Cache In-Reply-To: <20040706163742.GA29814@alibi.simon-cozens.org> References: <20040706163742.GA29814@alibi.simon-cozens.org> Message-ID: <1089147439.2882.186.camel@localhost.localdomain> On Tue, 2004-07-06 at 12:37, Simon Cozens wrote: > I've just uploaded this to CPAN. You'll like it. > > Executive summary: > > package BeerDB; > use base 'Apache::MVC'; > use Maypole::Cache; # Things go faster now FYI, Cache::SharedMemoryCache is very slow. Cache::FileCache is typically more than twice as fast. A fast caching module like Cache::FastMmap, or something built on BerkeleyDB is typically about a hundred times faster. - Perrin From simon@simon-cozens.org Tue Jul 6 22:04:00 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 22:04:00 +0100 Subject: [Maypole] Maypole::Cache In-Reply-To: <1089147439.2882.186.camel@localhost.localdomain> References: <20040706163742.GA29814@alibi.simon-cozens.org> <1089147439.2882.186.camel@localhost.localdomain> Message-ID: <20040706210400.GB13898@alibi.simon-cozens.org> Perrin Harkins: > FYI, Cache::SharedMemoryCache is very slow. Cache::FileCache is > typically more than twice as fast. A fast caching module like > Cache::FastMmap, or something built on BerkeleyDB is typically about a > hundred times faster. I only went with SharedMemoryCache because it advertised going across multiple Apache processes; do the other caches do this too? -- Jenkinson's Law: It won't work. From perrin@elem.com Tue Jul 6 22:23:19 2004 From: perrin@elem.com (Perrin Harkins) Date: Tue, 06 Jul 2004 17:23:19 -0400 Subject: [Maypole] Maypole::Cache In-Reply-To: <20040706210400.GB13898@alibi.simon-cozens.org> References: <20040706163742.GA29814@alibi.simon-cozens.org> <1089147439.2882.186.camel@localhost.localdomain> <20040706210400.GB13898@alibi.simon-cozens.org> Message-ID: <1089148999.2882.191.camel@localhost.localdomain> On Tue, 2004-07-06 at 17:04, Simon Cozens wrote: > I only went with SharedMemoryCache because it advertised going across multiple > Apache processes; do the other caches do this too? Yes, all of them do. I recommend Cache::FastMmap as a starting point. Fairly similar to what you have, but much faster. - Perrin From simon@simon-cozens.org Tue Jul 6 22:37:28 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 22:37:28 +0100 Subject: [Maypole] Maypole::Cache In-Reply-To: <1089148999.2882.191.camel@localhost.localdomain> References: <20040706163742.GA29814@alibi.simon-cozens.org> <1089147439.2882.186.camel@localhost.localdomain> <20040706210400.GB13898@alibi.simon-cozens.org> <1089148999.2882.191.camel@localhost.localdomain> Message-ID: <20040706213728.GA15754@alibi.simon-cozens.org> Perrin Harkins: > Yes, all of them do. I recommend Cache::FastMmap as a starting point. Nice idea, but Cache::FastMmap doesn't conform to the Cache::Cache API. For instance, I can't set a namespace, and, most annoyingly, ->new takes a hash not a hash reference. The whole point of having {cache_opts}{class} in the Maypole::Cache config is so that people can set their own caching class out of mutually compatible cache implementations - of which Cache::FastMmap is sadly not one. -- 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 perrin@elem.com Tue Jul 6 22:46:26 2004 From: perrin@elem.com (Perrin Harkins) Date: Tue, 06 Jul 2004 17:46:26 -0400 Subject: [Maypole] Maypole::Cache In-Reply-To: <20040706213728.GA15754@alibi.simon-cozens.org> References: <20040706163742.GA29814@alibi.simon-cozens.org> <1089147439.2882.186.camel@localhost.localdomain> <20040706210400.GB13898@alibi.simon-cozens.org> <1089148999.2882.191.camel@localhost.localdomain> <20040706213728.GA15754@alibi.simon-cozens.org> Message-ID: <1089150386.2882.199.camel@localhost.localdomain> On Tue, 2004-07-06 at 17:37, Simon Cozens wrote: > Nice idea, but Cache::FastMmap doesn't conform to the Cache::Cache API. Yes, but neither does any other cache module worth using. The sad fact is that all of the Cache::Cache modules are considerably slower than a simple MySQL query. They have a clean API, but no one else has adopted it, so it's not very useful. You can use the share_file parameter with Cache::FastMmap to get different namespaces. IPC::MM and BerkeleyDB also have acceptable performance for shared data, but don't have an API designed specifically for caching, so expiration would be an additional thing to implement on top of them. - Perrin From simon@simon-cozens.org Tue Jul 6 22:57:39 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 6 Jul 2004 22:57:39 +0100 Subject: [Maypole] Maypole::Cache In-Reply-To: <1089150386.2882.199.camel@localhost.localdomain> References: <20040706163742.GA29814@alibi.simon-cozens.org> <1089147439.2882.186.camel@localhost.localdomain> <20040706210400.GB13898@alibi.simon-cozens.org> <1089148999.2882.191.camel@localhost.localdomain> <20040706213728.GA15754@alibi.simon-cozens.org> <1089150386.2882.199.camel@localhost.localdomain> Message-ID: <20040706215739.GA17177@alibi.simon-cozens.org> Perrin Harkins: > simple MySQL query. They have a clean API, but no one else has adopted > it, so it's not very useful. You see it as not useful, I see it as room for improvement. > IPC::MM and BerkeleyDB also have acceptable performance for shared data, I'm sorry, but I believe in two principles as far as Maypole goes: 1) Making things as easy as possible, and 2) Giving the user the choice. Maypole::Cache is designed to do these things. It gives the user the choice by allowing them to easily switch between backend cache implementations; it makes things as easy as possible by using a caching framework which means that switching implementations is not going to cause a problem. As such, it fulfils its goals perfectly. So you are not going to sway me on that score. If you feel that the Cache::Cache modules do not have acceptable performance for you, then 1) Cache::Cache is the problem, whereas Maypole::Cache is doing precisely what it was designed to do, and 2) I look forward to seeing your faster implementations on CPAN. In the meantime, questions about why such-and-such a Cache::Cache module is not as fast as something else are as related to Maypole as "How do I do this in Class::DBI" and "how do I do this in Template Toolkit". -- Asynchronous inputs are at the root of our race problems. -- D. Winker and F. Prosser From kevin@allpoetry.com Wed Jul 7 02:00:52 2004 From: kevin@allpoetry.com (Kevin) Date: Tue, 06 Jul 2004 18:00:52 -0700 Subject: [Maypole] could 5.6 prevent modules from accessing parent for some reason? (answer) In-Reply-To: References: <20040624062858.GC8497@usc.edu> Message-ID: Just answering my own question for the sake of the archives. Turned out I had an error in the has_a statement in my sub-module, and when loading it via: Limitbreak::User->require; Errors are not shown as they are with use(). Since require is so perl-4-ish, I hadn't been familiar with that. A better suggestion would be to use (working from memory here): Limitbreak::User->require or warn "Unable to load User.pm: $!, $@"; Further complications were also added by Apache::StatINC, since the has_a methods die() if their functions are already created. I hope to get around this by wrapping the setup call in an eval to catch errors and continue re(compilation). I've always found StatINC extremely handy for testing while developing. Ciao, Kevin On Thu, 24 Jun 2004 12:36:02 -0700, Kevin wrote: > I had tried that as well, and sorry for leaving out the lines at the top > of Limitbreak/User.pm > > #Limitbreka/User.pm# > package Limitbreak::User; > use base 'Apache::MVC'; > Limitbreak::User->has_a(user => "Limitbreak::Identity"); > > Couldn't require Limitbreak - Can't locate object method "has_a" via > package "Limitbreak::User" (perhaps you forgot to load > "Limitbreak::User"?) at Limitbreak/User.pm line 4. > > > If concat Limitbreak/User.pm to Limitbreak.pm and take out the 'use' > part, it loads fine, but this is less than ideal obviously :) > > A additional confusion is when I try to add my own method > package Limitbreak::User; > use base 'Apache::MVC'; > sub mytest :Exported { > my ($self, $r) = @_; > warn "testing, world"; > $r->{template} = "view"; > } > > And test it with: > perl -MMaypole::CLI=Limitbreak -e1 http://localhost/user/test/ > > I get this error: > file error - usertest/: not found at > /usr/lib/perl5/site_perl/5.6.1/Maypole/View/Base.pm line 66. > > Seems like maybe its passing through the name (sans /'s) to try and find > a custom template, even though I set the template back to 'view'? I am > very confused :) > > Thanks, > Kevin > > On Wed, 23 Jun 2004 23:28:58 -0700, Carl Hayter wrote: > >> On Wed, Jun 23, 2004 at 11:05:47PM -0700, Kevin wrote: >>> I'm getting the error: >>> >>> Couldn't require Limitbreak - Can't locate object method "columns" via >>> package "Limitbreak::User" (perhaps you forgot to load >>> "Limitbreak::User"?) at Limitbreak/User.pm line 5. >>> >>> I've tried to follow the first recipe here: >>> http://maypole.simon-cozens.org/doc/Request.html >>> >>> #Limitbreak.pm >>> package Limitbreak; >>> use base 'Apache::MVC'; >>> use Class::DBI::Loader::Relationship; >>> Limitbreak->setup("..."); >>> >>> Limitbreak::User->require; >>> >>> >>> #Limitbreak::User# >>> Limitbreak::User::untaint_columns ( printable => [qw/username email >> >> Limitbreak::User::untaint_columns ( %args ) >> and >> Limitbreak::User->untaint_columns ( %args ) >> >> may act differently, try the second way. >> >> ---- >> Carl > > > -- Ciao, Kevin Allpoetry.com Community Manager "Say the word before the rain comes" From dfr1@wm.ru Mon Jul 12 12:02:16 2004 From: dfr1@wm.ru (dfr1@wm.ru) Date: Mon, 12 Jul 2004 15:02:16 +0400 Subject: [Maypole] DBD::Pg Maypole and morning bug Message-ID: <9212275796.20040712150216@wm.ru> Hello, When i trying to profile Maypole app with Devel::DProf, resulting profile file looks like apache children doesnt exit and run till i kill httpd. Also i experiencing that morning bug every morning, i mean that strange DBI errors: [Mon Jul 12 12:08:50 2004] [error] DBD::Pg::st fetchrow_array failed: no statemtement executing [for Statement "SELECT field4, field2, field3, field7, field1 FROM p_board WHERE bid=? "] at /usr/local/lib/perl5/site_perl/5.8.2/DBIx/ContextualFetch.pm line 87, .. I tried to use Apahce::DBI, but: [Mon Jul 12 11:52:27 2004] [error] PBoard::PBoard can't SELECT bid FROM p_board WHERE bid = ? : bind_columns called with 1 refs when 22 needed. at /usr/local/lib/perl5.. How it an be cured ? Thanks -- Best regards, dfr1 mailto:dfr1@wm.ru From jester@panix.com Tue Jul 13 03:33:37 2004 From: jester@panix.com (Jesse Sheidlower) Date: Mon, 12 Jul 2004 22:33:37 -0400 Subject: [Maypole] Turning off CDBI::Loader in Maypole? Message-ID: <20040713023337.GA8343@panix.com> I have a database with about a dozen tables in it; of these, about five are self-contained for a single app. (They all relate to each other in a broader way, but for this one app I can ignore the rest.) I set up Maypole for dealing with this app, and set up the classes myself, without using CDBI::Loader::Relationship. I'm only looking at the five tables for this. However, when I run it, I get the following warning in my Apache log: Column 'first' in MyDB::Uslib clashes with built-in method at /usr/local/lib/perl5/site_perl/5.8.4/Class/DBI/Loader/mysql.pm line 24 The "uslib" table has nothing to do with my application, and I don't declare it anywhere, and I don't mention Loader in any of my setup things. Is there any way I can shut Loader down entirely so it doesn't try to set up all of these other tables? Or prevent it from looking at the tables it has no business in seeing? And, when I do get around to using this table, will I have a problem because one of my columns is called "first"? Thanks. Jesse Sheidlower From simon@simon-cozens.org Tue Jul 13 09:34:35 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 13 Jul 2004 09:34:35 +0100 Subject: [Maypole] Turning off CDBI::Loader in Maypole? In-Reply-To: <20040713023337.GA8343@panix.com> References: <20040713023337.GA8343@panix.com> Message-ID: <20040713083435.GB13686@alibi.simon-cozens.org> Jesse Sheidlower: > of my setup things. Is there any way I can shut Loader down > entirely so it doesn't try to set up all of these other > tables? Yes, use the Maypole::Model::CDBI::Plain model class instead. -- I think of AI as the study of programming situations where either don't know what you want, or don't know how to get it. - Sean Burke From jester@panix.com Tue Jul 13 14:31:55 2004 From: jester@panix.com (Jesse Sheidlower) Date: Tue, 13 Jul 2004 09:31:55 -0400 Subject: [Maypole] Turning off CDBI::Loader in Maypole? In-Reply-To: <20040713083435.GB13686@alibi.simon-cozens.org> References: <20040713023337.GA8343@panix.com> <20040713083435.GB13686@alibi.simon-cozens.org> Message-ID: <20040713133155.GA17862@panix.com> On Tue, Jul 13, 2004 at 09:34:35AM +0100, Simon Cozens wrote: > Jesse Sheidlower: > > of my setup things. Is there any way I can shut Loader down > > entirely so it doesn't try to set up all of these other > > tables? > > Yes, use the Maypole::Model::CDBI::Plain model class instead. Oh, so _that's_ what it's for! That makes sense, yes. Thanks. JTS From jester@panix.com Sat Jul 17 13:58:43 2004 From: jester@panix.com (Jesse Sheidlower) Date: Sat, 17 Jul 2004 08:58:43 -0400 Subject: [Maypole] Help with Maypole::Model::CDBI::Plain Message-ID: <20040717125843.GA9506@panix.com> I've been torturing Simon off-list about this, so I thought I'd give him a break and let someone else give it a shot. Has anyone managed to get this working? I have set up a group of CDBI classes that I am now trying to use with Maypole, and have already done the setup on the CDBI side so I don't need to use Loader. After a variety of missteps, and following the explanations, I have the following situation: my database is "sfDB"; my CDBI base class, which for now just establishes the connection, is "sfDB::DBI", and my tables of interest are "sfDB::Citation", "::CitationSubject", and "::Subject". The only thing that the sfDB.pm base does is set up the Maypole-related stuff, as discussed in the ::Plain docs. Here's the basic code: --- package sfDB::DBI; use base 'Class::DBI::mysql'; __PACKAGE__->set_db('Main', "dbi:mysql:sf","user","password"); package sfDB; use strict; use base qw(sfDB::DBI Apache::MVC); use sfDB::Citation; use sfDB::Subject; use sfDB::CitationSubject; sfDB->config->{model} = "Maypole::Model::CDBI::Plain"; sfDB->setup([qw/sfDB::Citation sfDB::CitationSubject sfDB::Subject/]); sfDB->config->{uri_base} = "http://localhost/sf/"; package sfDB::Citation; use strict; use base 'sfDB::DBI'; __PACKAGE__->has_many(subject => [ CitationSubject => 'subject_id' ]); sub list :Exported { } # not shown here, but a special list method --- When I try to run this by going to http://localhost/sf/citation/list, I get the following error: [Sat Jul 17 08:54:00 2004] [error] Invalid CODE attribute: Exported at /usr/local/www/modules/sfDB/Citation.pm line 18 Typically, or originally, this error was associated with issues of setting up separate model-class modules, and is discussed in the docs, but the solutions proposed there--either wrapping the "setup" call in a BEGIN block, or moving the module loading to runtime by using "sfDB::Citation->require" instead of "use sfDB::Citation", don't work in this setup. Anyone have a suggestion for how I'm supposed to be doing this? I'd like to get around the Loader requirement. And Simon will be grateful too! Thanks! Jesse Sheidlower From simon@simon-cozens.org Sat Jul 17 14:14:53 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Sat, 17 Jul 2004 14:14:53 +0100 Subject: [Maypole] Help with Maypole::Model::CDBI::Plain In-Reply-To: <20040717125843.GA9506@panix.com> References: <20040717125843.GA9506@panix.com> Message-ID: <20040717131453.GA14031@alibi.simon-cozens.org> Jesse Sheidlower: > I've been torturing Simon off-list about this, so I thought > I'd give him a break and let someone else give it a shot. > Has anyone managed to get this working? For what it's worth, the code to Buscador is available at http://cvs.simon-cozens.org/viewcvs.cgi/buscador/?cvsroot=Email and shows this working. > When I try to run this by going to http://localhost/sf/citation/list, > I get the following error: > > [Sat Jul 17 08:54:00 2004] [error] Invalid CODE attribute: > Exported at /usr/local/www/modules/sfDB/Citation.pm line 18 What this means is that your sfDB::Citation model doesn't correctly inherit from one of the Maypole model classes. There are two ways to ensure that it does. The first, which definitely works but is somewhat unclean, is to explicitly make it to do: package sfDB::Citation; use base qw(sfDB::DBI Maypole::Model::CDBI::Plain); The reason I don't like that is because you're repeating information about the model class not just here in each of the table classes that you use, but also in your driver class. So there is the better way to do it, which is the one that Maypole usually uses; this is to ensure that you set up your model class and call "setup" *before* loading the individual table class. As part of "setup" Maypole ensures that your table classes inherit from the correct model class. So instead of use sfDB::Citation; sfDB->config->{model} = "..."; sfDB->setup(...) you have something like BEGIN { sfDB->config->{model} = "..."; sfDB->setup(...) } use sfDB::Citation Then sfDB::Citation will have inherited (somewhere down the chain) from Maypole::Model::Base, by means of the "setup" call, and this means that it will know about the attributes that Maypole uses. I'm afraid I'm a bit tired of trying to make this particular example work after several rounds of email about it :) so I just suggest you play with the order of loading until it works. And don't forget that circular dependencies in the code *can* screw up the way Perl loads things. (which is why I mentioned it previously, I wasn't just bringing it up randomly. ;) -- "Irrigation of the land with seawater desalinated by fusion power is ancient. It's called 'rain'." -- Michael McClary, in alt.fusion From simon@neininger.net Sat Jul 17 20:45:19 2004 From: simon@neininger.net (Simon Neininger) Date: Sat, 17 Jul 2004 21:45:19 +0200 Subject: [Maypole] mysql-type "time" can be displayed, but not edited Message-ID: <20040717194519.GB8452@aromat.neininger.net> Hi! I have a Maypole-Webapplication which uses the type "time" in the MySQL-Database. If I add/edit objects, the time is ignored. In the logfile of the MySQL-Server I've seen that the fileds of type time aren't includet in the INSERT/UPDATE-Statements. However, if I enter the time with a mysql-client, its displayed correctly in the webapplication. I tried some "autoinflate"-stuff, like on http://search.cpan.org/~tmtm/Class-DBI-mysql-0.23/lib/Class/DBI/mysql.pm but I think I've got it wrong. package seeueberquerung; use base 'Apache::MVC'; use Class::DBI::mysql; use Class::DBI::Loader::Relationship; use Time::Piece; use Time::Piece::MySQL; Class::DBI::mysql->autoinflate(column_type => 'Inflation::Class'); Class::DBI::mysql->autoinflate(time => 'Time::Piece'); Class::DBI::mysql->autoinflate(dates => 'Time::Piece'); Class::DBI::mysql->autoinflate(date => 'Time::Piece'); Class::DBI::mysql->autoinflate(datetime => 'Time::Piece'); Class::DBI::mysql->autoinflate(timestamp => 'Time::Piece'); seeueberquerung->setup("dbi:mysql:database=seeueberquerung;host=aromat;user=simon"); seeueberquerung->config->{template_root} = "/var/www/templates/factory"; seeueberquerung->config->{uri_base} = "http://neininger.net/seeueberquerung/"; seeueberquerung->config->{rows_per_page} = 5; seeueberquerung->config->{loader}->relationship($_) for ("a kategorie has teilnehmer"); 1; Gruss Simon N. From jester@panix.com Sat Jul 17 20:54:25 2004 From: jester@panix.com (Jesse Sheidlower) Date: Sat, 17 Jul 2004 15:54:25 -0400 Subject: [Maypole] Help with M::M::CDBI::Plain (finish is in sight!) In-Reply-To: <20040717131453.GA14031@alibi.simon-cozens.org> References: <20040717125843.GA9506@panix.com> <20040717131453.GA14031@alibi.simon-cozens.org> Message-ID: <20040717195424.GA10443@panix.com> On Sat, Jul 17, 2004 at 02:14:53PM +0100, Simon Cozens wrote: > Jesse Sheidlower: > > > [Sat Jul 17 08:54:00 2004] [error] Invalid CODE attribute: > > Exported at /usr/local/www/modules/sfDB/Citation.pm line 18 > > What this means is that your sfDB::Citation model doesn't correctly > inherit from one of the Maypole model classes. [...] > So there is the better way to do it, which is the one that Maypole > usually uses; this is to ensure that you set up your model class and call > "setup" *before* loading the individual table class. As part of "setup" > Maypole ensures that your table classes inherit from the correct model class. The problem I get with wrapping the setup stuff in a BEGIN block is: [error] Can't locate object method "table" via package "sfDB::Citation" (perhaps you forgot to load "sfDB::Citation"?) at /usr/local/lib/perl5/site_perl/5.8.4/Maypole/Model/CDBI/Plain.pm line 6 Perhaps the problem with the order of loading can be solved simply by moving the "use sfDB::Citation" etc. statements _after_ the sfDB->config->{model} = "Maypole::Model::CDBI::Plain"; sfDB->setup([qw/sfDB::Citation sfDB::CitationSubject sfDB::Subject/]); lines (but _without_ wrapping these in a BEGIN block)? I also fixed a problem that caused another error (I, er, forget the set_up_table call in my derived classes). This seems to fix order-of-loading issues. There is one remaining error, though, that I have no idea the source of: [Sat Jul 17 15:31:54 2004] [error] No such column: model_class That's the entire error. Needless to say, I have no model_class column in any of my tables, and nothing _I_ am doing is trying to look at such a column, so I fear it must be coming from somewhere in Maypole. > I'm afraid I'm a bit tired of trying to make this particular example work > after several rounds of email about it :) so I just suggest you play with the > order of loading until it works. Yes, that's why I took this one to the list, where it remains, in the hopes that someone other than you might have had luck with it ;-). I do think that this is not quite as simple as you think it is, though. Best, Jesse Sheidlower From jester@panix.com Sun Jul 18 01:25:20 2004 From: jester@panix.com (Jesse Sheidlower) Date: Sat, 17 Jul 2004 20:25:20 -0400 Subject: [Maypole] Help with M::M::CDBI::Plain (finish is in sight!) In-Reply-To: <20040717195424.GA10443@panix.com> References: <20040717125843.GA9506@panix.com> <20040717131453.GA14031@alibi.simon-cozens.org> <20040717195424.GA10443@panix.com> Message-ID: <20040718002519.GA27906@panix.com> On Sat, Jul 17, 2004 at 03:54:25PM -0400, Jesse Sheidlower wrote: > On Sat, Jul 17, 2004 at 02:14:53PM +0100, Simon Cozens wrote: > > The problem I get with wrapping the setup stuff in a BEGIN > block is: > > [error] Can't locate object method "table" via package > "sfDB::Citation" (perhaps you forgot to load > "sfDB::Citation"?) at > /usr/local/lib/perl5/site_perl/5.8.4/Maypole/Model/CDBI/Plain.pm > line 6 > > Perhaps the problem with the order of loading can be solved > simply by moving the "use sfDB::Citation" etc. statements > _after_ the > > sfDB->config->{model} = "Maypole::Model::CDBI::Plain"; > sfDB->setup([qw/sfDB::Citation sfDB::CitationSubject sfDB::Subject/]); > > lines (but _without_ wrapping these in a BEGIN block)? I also fixed a > problem that caused another error (I, er, forget the set_up_table > call in my derived classes). > > This seems to fix order-of-loading issues. There is one > remaining error, though, that I have no idea the source of: > > [Sat Jul 17 15:31:54 2004] [error] No such column: model_class > > That's the entire error. I correct myself, I've been confusing a variety of errors. This error--the "No such column: model_class"--comes _only_ from adding M::M::CDBI::Plain to the "use base" list for the derived modules, the first of the two suggested solutions Simon offered. Now, any version _without_ M::M::CDBI::Plain in the derived modules, or a BEGIN block in the base module, throws the "Invalid CODE attribute: Exported" error, whether the "use sfDB::Citation" lines precede or follow the "setup" call. When there is a BEGIN block wrapping the setup call in the base module, I get the "Invalid CODE attribute" error if the "use sfDB::Citation" etc. lines _precede_ the BEGIN block, but if these lines _follow_ the BEGIN block--the other of the two solutions Simon suggested in his previous message-- I get a [error] Can't locate object method "table" via package "sfDB::Citation" (perhaps you forgot to load "sfDB::Citation"?) at /usr/local/lib/perl5/site_perl/5.8.4/Maypole/Model/CDBI/Plain.pm line 6 error. I have tried to look over the Buscador example, and it is a little different from either the ::Plain docs, or what Simon had been suggesting. It also looked pretty cool, and I was especially blown away by the $r->objects([ $self->plucene_search( $r->{query}{terms} )]); search method--wow! But, in any event, following this pattern also leads to the "can't locate..."table"...perhaps you forgot to load sfDB::Citation" error as above. C'mon, no one else using this yet? I'm tearing my hair out here! Jesse Sheidlower From ben@btucker.net Mon Jul 19 19:12:28 2004 From: ben@btucker.net (Benjamin Tucker) Date: Mon, 19 Jul 2004 14:12:28 -0400 Subject: [Maypole] link macro Message-ID: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> Hello, I apologize if this has been brought up before, I couldn't find it in the archive. The link macro as it ships with Maypole does not add a slash between the $base and $table variables. It seems to me it should, since trailing slashes are stripped from the uri_base. Ben P.S. I got a permission error when I tried to grab the latest source from cvs: > failed to create lock directory for > `/var/cvs/modules/Apache-MVC/lib/Maypole/Model/CDBI' > (/var/cvs/modules/Apache-MVC/lib/Maypole/Model/CDBI/#cvs.lock): > Permission denied >>> proposed patch: --- macros Mon Jul 19 13:34:49 2004 +++ macros Fri Apr 2 13:16:56 2004 @@ -13,7 +13,7 @@ #%] [% MACRO link(table, command, additional, label) BLOCK; - ''; + ''; label; ""; END; From simon@simon-cozens.org Mon Jul 19 19:27:00 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Mon, 19 Jul 2004 19:27:00 +0100 Subject: [Maypole] link macro In-Reply-To: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> Message-ID: <20040719182700.GA19446@alibi.simon-cozens.org> Benjamin Tucker: > I apologize if this has been brought up before, I couldn't find it in > the archive. The link macro as it ships with Maypole does not add a > slash between the $base and $table variables. It seems to me it > should, since trailing slashes are stripped from the uri_base. Thanks; I added the slash-trimming recently because I was getting double-slashes from URLs, and then never added it back on the factory templates. (Because I never use the factory templates) > P.S. I got a permission error when I tried to grab the latest source > from cvs: Fixed that, too. -- Life is perfectly fair, by the way; just to other people. From jester@panix.com Mon Jul 19 19:29:44 2004 From: jester@panix.com (Jesse Sheidlower) Date: Mon, 19 Jul 2004 14:29:44 -0400 Subject: [Maypole] link macro In-Reply-To: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> Message-ID: <20040719182944.GA20731@panix.com> On Mon, Jul 19, 2004 at 02:12:28PM -0400, Benjamin Tucker wrote: > Hello, > > I apologize if this has been brought up before, I couldn't find it in > the archive. The link macro as it ships with Maypole does not add a > slash between the $base and $table variables. It seems to me it > should, since trailing slashes are stripped from the uri_base. Where does this stripping happen? The base URI that you declare in MyDB->config->{uri_base} = "http://my.site/MyDB_home/" should have a closing slash in the declaration, so it's correct not to add it with the link macro. I think this is something that got worked out in some of the earliest releases. Jesse Sheidlower From jester@panix.com Mon Jul 19 19:33:50 2004 From: jester@panix.com (Jesse Sheidlower) Date: Mon, 19 Jul 2004 14:33:50 -0400 Subject: [Maypole] link macro In-Reply-To: <20040719182944.GA20731@panix.com> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> <20040719182944.GA20731@panix.com> Message-ID: <20040719183350.GC20731@panix.com> On Mon, Jul 19, 2004 at 02:29:44PM -0400, Jesse Sheidlower wrote: > > Where does this stripping happen? Oops, please ignore this. Simon changed Maypole out from under me ;-). Jesse Sheidlower From simon@simon-cozens.org Mon Jul 19 19:34:35 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Mon, 19 Jul 2004 19:34:35 +0100 Subject: [Maypole] link macro In-Reply-To: <20040719182944.GA20731@panix.com> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> <20040719182944.GA20731@panix.com> Message-ID: <20040719183435.GD19446@alibi.simon-cozens.org> Jesse Sheidlower: > Where does this stripping happen? Later. :) Just as "base" is passed to the template. So the Apache::MVC stuff that relies on the trailing slash being there still works. -- Momomoto, Famous Japanese, can swallow his nose. From ben@btucker.net Mon Jul 19 20:06:48 2004 From: ben@btucker.net (Benjamin Tucker) Date: Mon, 19 Jul 2004 15:06:48 -0400 Subject: [Maypole] link macro In-Reply-To: <20040719182700.GA19446@alibi.simon-cozens.org> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> <20040719182700.GA19446@alibi.simon-cozens.org> Message-ID: On Jul 19, 2004, at 2:27 PM, Simon Cozens wrote: > Benjamin Tucker: >> I apologize if this has been brought up before, I couldn't find it in >> the archive. The link macro as it ships with Maypole does not add a >> slash between the $base and $table variables. It seems to me it >> should, since trailing slashes are stripped from the uri_base. > > Thanks; I added the slash-trimming recently because I was getting > double-slashes from URLs, and then never added it back on the factory > templates. Cool, that's what I figured. >> P.S. I got a permission error when I tried to grab the latest source >> from cvs: > > Fixed that, too. Sweet! By the way, Maypole rocks! :-) Thanks! Ben From ben@btucker.net Tue Jul 20 17:32:06 2004 From: ben@btucker.net (Benjamin Tucker) Date: Tue, 20 Jul 2004 12:32:06 -0400 Subject: [Maypole] link macro In-Reply-To: <20040719182700.GA19446@alibi.simon-cozens.org> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> <20040719182700.GA19446@alibi.simon-cozens.org> Message-ID: <5689D6B4-DA6A-11D8-9AEA-000A95AEF8FA@btucker.net> On Jul 19, 2004, at 2:27 PM, Simon Cozens wrote: > Benjamin Tucker: >> I apologize if this has been brought up before, I couldn't find it in >> the archive. The link macro as it ships with Maypole does not add a >> slash between the $base and $table variables. It seems to me it >> should, since trailing slashes are stripped from the uri_base. > > Thanks; I added the slash-trimming recently because I was getting > double-slashes from URLs, and then never added it back on the factory > templates. (Because I never use the factory templates) fwiw, this also applies to the factory macros mason component that ships with Marcus Ramberg's Maypole-View-Mason-0.1. in the link method: - <%$label%> + <%$label%> From mwangu@yahoo.com Tue Jul 20 20:20:23 2004 From: mwangu@yahoo.com (Mike Wangu) Date: Tue, 20 Jul 2004 12:20:23 -0700 (PDT) Subject: [Maypole] Maypole Example Message-ID: <20040720192023.95089.qmail@web40303.mail.yahoo.com> All, Apologies if this has been addressed before, but I have a horrid net connection that keeps breaking down so searching is VERY difficult! Does anyone have a fully functional Maypole application that I can have to take apart and learn how this thing works and can be customised for my requirements. I would need: - Apache config - Database Schema - TT2 files - Any other relevant info/data I appreciate this is asking a great deal, but it would be immensley appreciated. Thank you, Mike -- Long way from home ... __________________________________ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ From hayter@usc.edu Tue Jul 20 20:49:36 2004 From: hayter@usc.edu (Carl Hayter) Date: Tue, 20 Jul 2004 12:49:36 -0700 Subject: [Maypole] link macro In-Reply-To: <20040719183435.GD19446@alibi.simon-cozens.org> References: <31CD4936-D9AF-11D8-9AEA-000A95AEF8FA@btucker.net> <20040719182944.GA20731@panix.com> <20040719183435.GD19446@alibi.simon-cozens.org> Message-ID: <20040720194936.GE11040@usc.edu> --Os3yV+a5rIGRl17f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 19, 2004 at 07:34:35PM +0100, Simon Cozens wrote: > Jesse Sheidlower: > > Where does this stripping happen?=20 >=20 > Later. :) >=20 > Just as "base" is passed to the template. So the Apache::MVC stuff that r= elies > on the trailing slash being there still works. is the trailing slash on "base" a mod_perl thing? what i mean is given: http://example.com/app http://example.com/app/ http://example.com/app/frontpage http://example.com/app/table/list it seems like the first is the obvious thing to put in "base". i tweaked parse_location - $self->{path} =3D~ s/^($loc)?\///; + $self->{path} =3D~ s/^($loc\/*)?//; and templates to insert a slash between 'base' and 'table' where needed. is it a mod_perl thing to need the slash? i've only been using CGI::Maypole and FCGI::Maypole. is there some other reason behind the slash that i'm missing? (i'm no apache wiz) ---- Carl --Os3yV+a5rIGRl17f Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (SunOS) iD8DBQFA/XdQjSUgp1gR7V8RAohJAKCDf15zkJ4tx3mGEePdFaNeEZgJ2wCfWrl6 u7svkuQOqPh/n6XUPFM5mJo= =9Qlg -----END PGP SIGNATURE----- --Os3yV+a5rIGRl17f-- From wijnand@nedbsd.nl Tue Jul 20 19:28:48 2004 From: wijnand@nedbsd.nl (Wijnand Wiersma) Date: Tue, 20 Jul 2004 20:28:48 +0200 Subject: [Maypole] Maypole Example In-Reply-To: <20040720192023.95089.qmail@web40303.mail.yahoo.com> References: <20040720192023.95089.qmail@web40303.mail.yahoo.com> Message-ID: <40FD6460.5020303@nedbsd.nl> This is a cryptographically signed message in MIME format. --------------ms050304020908060204030707 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mike Wangu wrote: >Does anyone have a fully functional Maypole >application that I can have to take apart and learn >how this thing works and can be customised for my >requirements. > >I would need: > >- Apache config >- Database Schema >- TT2 files >- Any other relevant info/data > > I have been looking for the same thing. Wijnand --------------ms050304020908060204030707 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII6TCC As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zdWluZyBDQQIDDB0OMAkGBSsOAwIaBQCgggGnMBgGCSqGSIb3DQEJAzELBgkq hkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA0MDcyMDE4Mjg0OFowIwYJKoZIhvcNAQkEMRYE FBH46clEgoGeB13/oKA3eyaf2tVcMFIGCSqGSIb3DQEJDzFFMEMwCgYIKoZIhvcNAwcwDgYI KoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMHgG CSsGAQQBgjcQBDFrMGkwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0 aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1 aW5nIENBAgMMHQ4wegYLKoZIhvcNAQkQAgsxa6BpMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQK ExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29u YWwgRnJlZW1haWwgSXNzdWluZyBDQQIDDB0OMA0GCSqGSIb3DQEBAQUABIIBAFCaZBjvKKwM r1KkehwpZc3d0o5pU0G6aFosHUnUPmbrnV3J8YdX5gWc8aIlhueDbFxx6KkVyUAbkxJltzCZ sWpYWdpzXump99VzqMfM/cGpFhkZD0IsQjhEARwF1SqCgWwKAB7HFEnxwywH55qciPN/PH6a Bq2i7SXRtemxh0ZqYrhcvb+RTX1mThEjW+bM8ubxFU4FnaYZNrhTxExko6JmLEGl/0GVxFo6 SrCEYACa3M9vQ1VIHRqgOBTKA6I0X7Xw1Az+72ZNuUtmXqS7pi0HEiR6zsLaIx7dbk6p7/Fn g8umBlBgq56TOqxuzbeARjtlbTaDMoqiusboU1M0mJoAAAAAAAA= --------------ms050304020908060204030707-- From simon@simon-cozens.org Tue Jul 20 21:37:47 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 20 Jul 2004 21:37:47 +0100 Subject: [Maypole] Maypole Example In-Reply-To: <20040720192023.95089.qmail@web40303.mail.yahoo.com> References: <20040720192023.95089.qmail@web40303.mail.yahoo.com> Message-ID: <20040720203747.GA28347@alibi.simon-cozens.org> Mike Wangu: > Does anyone have a fully functional Maypole > application that I can have to take apart and learn > how this thing works and can be customised for my > requirements. Now I am finally convinced that writing the manual was a big waste of my time. :) The code to both the Flox and ibsportal example applications in the manual can be got from http://cvs.simon-cozens.org/viewcvs.cgi/ There's additional discussion of the Flox application in my IBM article, and there's the product catalogue application at perl.com, both referenced from http://maypole.simon-cozens.org/doc/ -- ?warning: write might change good version of `/dev/null' - plan9 has a bad day From wijnand@nedbsd.nl Tue Jul 20 20:21:00 2004 From: wijnand@nedbsd.nl (Wijnand Wiersma) Date: Tue, 20 Jul 2004 21:21:00 +0200 Subject: [Maypole] Maypole Example In-Reply-To: <20040720203747.GA28347@alibi.simon-cozens.org> References: <20040720192023.95089.qmail@web40303.mail.yahoo.com> <20040720203747.GA28347@alibi.simon-cozens.org> Message-ID: <40FD709C.9080000@nedbsd.nl> This is a cryptographically signed message in MIME format. --------------ms040803000703050405060700 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Simon Cozens wrote: >Now I am finally convinced that writing the manual was a big waste of my time. >:) > > No, it wasn't! >The code to both the Flox and ibsportal example applications in the manual >can be got from http://cvs.simon-cozens.org/viewcvs.cgi/ > > It looks good, I will give it a good look next week. And now while we are on this subject, can some of you subscribers provide a link to a real life application on the internet? It's always nice to see what others have done with this software. Wijnand --------------ms040803000703050405060700 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII6TCC As8wggI4oAMCAQICAwwdDjANBgkqhkiG9w0BAQQFADBi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GCSqGSIb3DQEJAzELBgkq hkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA0MDcyMDE5MjEwMFowIwYJKoZIhvcNAQkEMRYE FCCZOiBN/RzCntk/+S8J/K8a2haeMFIGCSqGSIb3DQEJDzFFMEMwCgYIKoZIhvcNAwcwDgYI KoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMHgG CSsGAQQBgjcQBDFrMGkwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0 aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1 aW5nIENBAgMMHQ4wegYLKoZIhvcNAQkQAgsxa6BpMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQK ExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29u YWwgRnJlZW1haWwgSXNzdWluZyBDQQIDDB0OMA0GCSqGSIb3DQEBAQUABIIBADkhY1m+prC/ rGvV4SMwBX1Q0JqkC1fBCAsBfW38Op5m+Ug9NmK8vK64B/RIPzyARfxD9YmCDKFpZcx3LZKp sGn8602O6xO/yrm4AdFG6vEyMcERz08cHgBaFoNwYHvrYKP+Q/eo1bXCLPdG7BsEGtkJ/xAo ulkxHABN2eUoL7Kpb1zpQYOT261rHTOO41e76nPCS/36CpFRgyZ9AY9D3RqFSoVAb9WxrWNQ ybRwqqB5M4J6G17cLbqAsdXrdn2AuxayAamf/8V2SHYZnAH9tCMvLRPKilqMuB5crFN8Gyhn z64Z1bRM0b1vKgVVjj+nOkb8b0sFNuYnzRcu4QddalQAAAAAAAA= --------------ms040803000703050405060700-- From simon@simon-cozens.org Tue Jul 20 23:24:17 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 20 Jul 2004 23:24:17 +0100 Subject: [Maypole] If you hated Maypole, you'll also dislike... Message-ID: <20040720222417.GA31832@alibi.simon-cozens.org> I don't know quite how to describe my latest web application framework, or how to explain it. If I called it "an abstraction layer above Maypole", you might think that my code was soon going to disappear up its own backside. Maybe it is. While Maypole was designed to be extended "vertically", in the sense of making it very easy to add new actions to a class - one template, one method, and you're done - it isn't so easy to extend "horizontally". You can't easily add new ideas and concepts (as represented by tables and classes) and have them fit in nicely with the rest of the application. This is a problem I looked at and solved when designing my Email::Store set of mail archiving modules - I wanted it to be possible for third-parties to add plugin modules to archive information they were interested in, and have their plugins feature as first-class members of the Email::Store system. I identified three things which could make this happen: embedded SQL, so that modules could define their own tables, provided by Class::DBI::DATA::Schema; a plugin loader for modules, provided by Module::Pluggable; and a pipelined system of trigger points, so that plugins could influence each other's behaviour, provided by what became Module::Pluggable::Ordered. Further, I needed Class::DBI::DATA::Schema's translation option so that the same schema code could work no matter what the database. For my next Maypole project, I needed the same style of pluggability, and realised that this three-way pluggability approach works equally well for Maypole classes. By tying the three techniques into Maypole, I created a Maypole-based framework that "stretches" in all directions - vertically with the simple addition of new actions, and horizontally with the simple addition of completely new classes. The "stretchy" result is called Rubberband, and it's available from CPAN. Here's an example of how I'm currently using Rubberband. I'm developing a blogging tool called Feuilleton. It has certain "core" concepts: blogs, posts, users, and so on. It then has "plugin" concepts: comments, blogrolls. Here's what Feuilleton.pm currently looks like: package Feuilleton; use Rubberband ( dsn => "dbi:mysql:feuilleton", search_path => [qw( Feuilleton::Core Feuilleton::Plugin )], translate_sql_from => "mysql" ); Feuilleton->config->{auth}{user_class} = "Feuilleton::Core::User"; Feuilleton->config->{base_url} = "http://localhost/feuilleton/"; Feuilleton->config->{template_root} = "/Users/simon/maypole-stuff/feuilleton/templates"; sub fresh_start { Feuilleton->create_database_tables(); Feuilleton->call_plugins("on_create_database"); } Unlike Maypole::Model::CDBI, Rubberband doesn't (by default) look at the database to load its classes, but looks at the plugin modules: the "search_path" line tells it to load up all of Feuilleton::Core::* and Feuilleton::Plugin::* and use them as Maypole classes *if* they are attached to a database table. "translate_sql_from" describes the data language that the SQL schema is going to be written in. Rubberband provides "create_database_tables", which runs the SQL statements embedded in every module, and "call_plugins", which fires off a trigger point. All will become clear when you see Feuilleton::Core::Blog: package Feuilleton::Core::Blog; use strict; __PACKAGE__->table("blog"); __PACKAGE__->columns(All => qw[id name]); sub view :Exported { } sub on_create_database_order { 1 } sub on_create_database { Feuilleton::Core::Blog->create({ name => "My new blog" }); } __DATA__ CREATE TABLE blog ( id integer not null primary key auto_increment, name varchar(255) ); When we call "Feuilleton->fresh_start", the "CREATE TABLE blog" statement is translated from mysql SQL to the local SQL, (which currently happens to be mysql, but the value of "dsn" will change) and then executed, along with any other SQL statements in data sections. "Blog" just happens to be core, but the distinction between core and plugin is deliberately minimal. Next, the "on_create_database" subroutines are collated from all plugin modules, and sorted by the "on_create_database_order" of each class, and then run in turn; this allows all the plugins to take their turns at setting up the data they need when the application is started. Rubberband is still very much in the early stages of development, and just like with Maypole itself, things change as I work out the easiest and best ways of working with it, but if you're brave, you've got time, and are prepare to mess about on your own without expecting much in the way of support or documentation ;-) then grab it from CPAN and give it a look. I think it's the new way of creating extensible web applications, and I like it a lot. -- Anyone who takes words on the screen personally should not be on IRC. From jester@panix.com Wed Jul 21 03:20:21 2004 From: jester@panix.com (Jesse Sheidlower) Date: Tue, 20 Jul 2004 22:20:21 -0400 Subject: [Maypole] Retrieve problems if :Exported sub used Message-ID: <20040721022021.GB10193@panix.com> Hey. I finally solved my problem with ::Plain, and now have been struck with another weird thing. In one of my packages, I have a custom "list" method that performs a special search via set_sql. With this method I get this error: [error] Can't retrieve unless primary columns are defined at /usr/local/lib/perl5/site_perl/5.8.4/Maypole/Model/Base.pm line 16 I get this even if I don't use the "list" method; for example, if I go to http://localhost/MyDB/view/4, with no "view" method defined, I still get the error. After some trial and error, I discovered that I get the error if _any_ :Exported method appears. I wrote a "sub randomsub {}" routine which works fine (i.e. it doesn't cause any other error), but "sub randomsub :Exported {}" returns the same error (again, for any other method). The only other Maypole discussion of this error was in relation to multiple-column primary keys, which I'm not using. The tables in question all have one-column integer primary keys, which are of course detected fine when there's no :Exported method in a package. Anyone seen this before, or have any thoughts? Thanks. Jesse Sheidlower From tony-maypole@kasei.com Wed Jul 21 11:23:17 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Wed, 21 Jul 2004 11:23:17 +0100 Subject: [Maypole] AsForm issues Message-ID: <20040721102316.GA30176@soto.kasei.com> I'm trying to steal the best bits of Maypole for the framework we use in an attempt to see if we can migrate parts of it to just being Maypole. Today's experiments are with the templating parts, and particularly Class::DBI::AsForm (now that it installs cleanly!) But I'm having a few problems, that I can't tell whether Maypole itself works around, or just lives with. 1) $class->to_cgi returns a hash rather than a hashref, making it difficult to use directly in TT. And, as it's a mixin, it's hard to subclass. I've had to take the nasty approach of changing MySite::DBI to use base 'MySite::__::DBI' which then does the use Class::DBI::AsForm, so that in MySite::DBI I can add: sub to_cgi { return { shift->SUPER::to_cgi }} Maypole gets around that by passing it into the template wrapped as a hashref, and I'll probably end up there, but it seems that AsForm would be much nicer if it was able to be used more directly in TT. Am I missing something obvious? 2) The has_many dropdown is nifty, but I'd really like to be able to specify how I order the list. Do I really have to override retrieve_all in the class in question to sort? Is there something that could be added to the interface for this instead? Thanks, Tony From simon@simon-cozens.org Wed Jul 21 11:31:59 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Wed, 21 Jul 2004 11:31:59 +0100 Subject: [Maypole] AsForm issues In-Reply-To: <20040721102316.GA30176@soto.kasei.com> References: <20040721102316.GA30176@soto.kasei.com> Message-ID: <20040721103159.GA20518@alibi.simon-cozens.org> Tony Bowden: > Maypole gets around that by passing it into the template wrapped as a > hashref, and I'll probably end up there, but it seems that AsForm would > be much nicer if it was able to be used more directly in TT. Am I > missing something obvious? You're correct, but changing it to be a hashref would be quite a big interface change. I guess I could probably get away with checking wantarry and deprecating list usage with a warning. > 2) The has_many dropdown is nifty, but I'd really like to be able to > specify how I order the list. Do I really have to override retrieve_all > in the class in question to sort? Is there something that could be added > to the interface for this instead? I'm not sure where would be the best place to put this in the interface. What would the ->to_field call look like in an ideal world? I'm also open to ways of turning many-to-many relationships into a multiple select, now we can get at the relationship metadata more easily. -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From tony-maypole@kasei.com Wed Jul 21 11:56:27 2004 From: tony-maypole@kasei.com (Tony Bowden) Date: Wed, 21 Jul 2004 11:56:27 +0100 Subject: [Maypole] AsForm issues In-Reply-To: <20040721103159.GA20518@alibi.simon-cozens.org> References: <20040721102316.GA30176@soto.kasei.com> <20040721103159.GA20518@alibi.simon-cozens.org> Message-ID: <20040721105627.GA31300@soto.kasei.com> On Wed, Jul 21, 2004 at 11:31:59AM +0100, Simon Cozens wrote: > You're correct, but changing it to be a hashref would be quite a big interface > change. I guess I could probably get away with checking wantarry and > deprecating list usage with a warning. I'm not sure how TT will cope with that. Is the default context list or scalar if I just do SET var = obj.to_cgi ? > > 2) The has_many dropdown is nifty, but I'd really like to be able to > > specify how I order the list. > I'm not sure where would be the best place to put this in the interface. > What would the ->to_field call look like in an ideal world? I'm not sure either. Especially as I don't call to_field, directly. In my template I'm just doing: SET fields = sale.to_cgi; fields.product.as_HTML; There's no obvious place to hook in there ... > I'm also open to ways of turning many-to-many relationships into a multiple > select, now we can get at the relationship metadata more easily. The simple case (where the linking table is solely a linking table) should be simple enough. The complex case (where you need extra info in the linking table - such as a 'character name' column in a Role table linking Actors and Films) is much more difficult. Tony From Joe.CUMMING@rbos.com Wed Jul 21 13:29:16 2004 From: Joe.CUMMING@rbos.com (CUMMING, Joe, FM) Date: Wed, 21 Jul 2004 13:29:16 +0100 Subject: [Maypole] If you hated Maypole, you'll also dislike... Message-ID: <8B5AEEBB4835A14194F3913ECB77ED370197809F@lon0350xns.fm.rbsgrp.net> Hi there, I don't know if this is of any use, but I have been happily extending Maypole "horizontally" for a while using a very minor change to the existing framework. I guess I don't understand it, but I think the "rubberband" approach might be a bit complicated. What I did was to add "views" to the config which did not correspond to tables but which acted in the same way as existing model classes over tables. To have Maypole recognise & react to the views all you have to do is add the views to the ok_tables config entry in Maypole.pm $config->{ok_tables} = {map {$_ => 1} (@{$config->{display_tables}}, @{$config->{views}}) }; For example, in my website/database "Tennis" I have Players & Matches corresponding to tables. I also have an "Admin" view which has no associated table Tennis->config->{display_tables} = [qw[players matches]]; Tennis->config->{views} = [qw[admin]]; You then just write Tennis::Admin package with the same structure as the Tennis::Players or Tennis::Matches ------------------------------------------------------------------ package Tennis3::Admin; use base 'Maypole::Model::CDBI'; use strict; sub list :Exported(Protected) { my ($self, $r) = @_; $r->objects([ $self->search_current_matches() ]); $r->{template} = "list"; } __PACKAGE__->set_sql(current_matches => qq {select date > now() "current" from matches}); ------------------------------------------------------------------ The views need not correspond to any table, they can just execute commands & then display a page as per usual. The only drawback I found is that when I wanted to have a view execute database commands I had to implement the db_Main method in the package to return a db handle from one of $r->$config->{classes}. Can anyone figure out how to have non "table tied" packages inherit properly and have the db_Main of the setup database implemented. Thanks, Joe p.s. the "protected" on the exported sub is something else I added so that all methods which are so assigned need authentication. Saves having to do custom "authenticate" methods -----Original Message----- From: maypole-admin@lists.netthink.co.uk [mailto:maypole-admin@lists.netthink.co.uk] On Behalf Of Simon Cozens Sent: 20 July 2004 23:24 To: Maypole List Subject: [Maypole] If you hated Maypole, you'll also dislike... I don't know quite how to describe my latest web application framework, or how to explain it. If I called it "an abstraction layer above Maypole", you might think that my code was soon going to disappear up its own backside. Maybe it is. While Maypole was designed to be extended "vertically", in the sense of making it very easy to add new actions to a class - one template, one method, and you're done - it isn't so easy to extend "horizontally". You can't easily add new ideas and concepts (as represented by tables and classes) and have them fit in nicely with the rest of the application. This is a problem I looked at and solved when designing my Email::Store set of mail archiving modules - I wanted it to be possible for third-parties to add plugin modules to archive information they were interested in, and have their plugins feature as first-class members of the Email::Store system. I identified three things which could make this happen: embedded SQL, so that modules could define their own tables, provided by Class::DBI::DATA::Schema; a plugin loader for modules, provided by Module::Pluggable; and a pipelined system of trigger points, so that plugins could influence each other's behaviour, provided by what became Module::Pluggable::Ordered. Further, I needed Class::DBI::DATA::Schema's translation option so that the same schema code could work no matter what the database. For my next Maypole project, I needed the same style of pluggability, and realised that this three-way pluggability approach works equally well for Maypole classes. By tying the three techniques into Maypole, I created a Maypole-based framework that "stretches" in all directions - vertically with the simple addition of new actions, and horizontally with the simple addition of completely new classes. The "stretchy" result is called Rubberband, and it's available from CPAN. Here's an example of how I'm currently using Rubberband. I'm developing a blogging tool called Feuilleton. It has certain "core" concepts: blogs, posts, users, and so on. It then has "plugin" concepts: comments, blogrolls. Here's what Feuilleton.pm currently looks like: package Feuilleton; use Rubberband ( dsn => "dbi:mysql:feuilleton", search_path => [qw( Feuilleton::Core Feuilleton::Plugin )], translate_sql_from => "mysql" ); Feuilleton->config->{auth}{user_class} = "Feuilleton::Core::User"; Feuilleton->config->{base_url} = "http://localhost/feuilleton/"; Feuilleton->config->{template_root} = "/Users/simon/maypole-stuff/feuilleton/templates"; sub fresh_start { Feuilleton->create_database_tables(); Feuilleton->call_plugins("on_create_database"); } Unlike Maypole::Model::CDBI, Rubberband doesn't (by default) look at the database to load its classes, but looks at the plugin modules: the "search_path" line tells it to load up all of Feuilleton::Core::* and Feuilleton::Plugin::* and use them as Maypole classes *if* they are attached to a database table. "translate_sql_from" describes the data language that the SQL schema is going to be written in. Rubberband provides "create_database_tables", which runs the SQL statements embedded in every module, and "call_plugins", which fires off a trigger point. All will become clear when you see Feuilleton::Core::Blog: package Feuilleton::Core::Blog; use strict; __PACKAGE__->table("blog"); __PACKAGE__->columns(All => qw[id name]); sub view :Exported { } sub on_create_database_order { 1 } sub on_create_database { Feuilleton::Core::Blog->create({ name => "My new blog" }); } __DATA__ CREATE TABLE blog ( id integer not null primary key auto_increment, name varchar(255) ); When we call "Feuilleton->fresh_start", the "CREATE TABLE blog" statement is translated from mysql SQL to the local SQL, (which currently happens to be mysql, but the value of "dsn" will change) and then executed, along with any other SQL statements in data sections. "Blog" just happens to be core, but the distinction between core and plugin is deliberately minimal. Next, the "on_create_database" subroutines are collated from all plugin modules, and sorted by the "on_create_database_order" of each class, and then run in turn; this allows all the plugins to take their turns at setting up the data they need when the application is started. Rubberband is still very much in the early stages of development, and just like with Maypole itself, things change as I work out the easiest and best ways of working with it, but if you're brave, you've got time, and are prepare to mess about on your own without expecting much in the way of support or documentation ;-) then grab it from CPAN and give it a look. I think it's the new way of creating extensible web applications, and I like it a lot. -- Anyone who takes words on the screen personally should not be on IRC. _______________________________________________ maypole mailing list maypole@lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole *********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: http://www.rbs.co.uk/CBFM http://www.rbsmarkets.com ******************************************************************************** From dfr1@wm.ru Fri Jul 23 14:03:34 2004 From: dfr1@wm.ru (dfr1@wm.ru) Date: Fri, 23 Jul 2004 17:03:34 +0400 Subject: [Maypole] Re: DBD::Pg Maypole and morning bug Message-ID: <7222556264.20040723170334@wm.ru> Hello, I realized that this is not morning bug, because all other methods works fine, error oocurs only in one metthod. It differs from others only by few thins: 1. it uses lot of other CDBI classes and doing search\retrieve on them 2. explicitly uses do_pager method and then $pager->retrieve_from_sql(...); so, what could it be ? when i submitting url by GET a got this: > [Mon Jul 12 12:08:50 2004] [error] DBD::Pg::st fetchrow_array failed: > no statemtement executing [for Statement "SELECT field4, field2, field3, field7, field1 > FROM p_board > WHERE bid=? > "] at /usr/local/lib/perl5/site_perl/5.8.2/DBIx/ContextualFetch.pm > line 87, .. > > I tried to use Apahce::DBI, but: > > > [Mon Jul 12 11:52:27 2004] [error] PBoard::PBoard can't SELECT bid > FROM p_board > WHERE bid = ? > : bind_columns called with 1 refs when 22 needed. at > /usr/local/lib/perl5.. but after pressing "Reload" button it worked ok -- Best regards, dfr1 mailto:dfr1@wm.ru From brian@alternation.net Fri Jul 23 15:25:55 2004 From: brian@alternation.net (brian@alternation.net) Date: Fri, 23 Jul 2004 11:25:55 -0300 (ADT) Subject: [Maypole] XHTML-izing the factory templates Message-ID: <59103.64.5.219.130.1090592755.squirrel@mail.alternation.net> Hello All, I've begun work to ensure that the factory templates will output valid XHTML Strict 1.0 screens. The results so far can be seen here: http://www.alternation.net/maypole/ At this point, I would be surprised if any pages were valid, but we're getting closer. To start the process I've: + Added a doctype to the header + Included the language (en) + lowercased the HTML tags + quoted all attributes + ensured all tags are closed At some point I'll go through a sample, default maypole installation and validate all of the pages and fix up the templates as needed. Note that I've not touched the css, and any future changes will most likely required the relevant css bits to be updated. -Brian From nicg@noslogan.org Sat Jul 24 22:21:19 2004 From: nicg@noslogan.org (Nic Gibson) Date: Sat, 24 Jul 2004 22:21:19 +0100 Subject: [Maypole] Odd (lack of) inheritence issue Message-ID: <20040724212119.GA98908@blue.amorality.net> --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Whilst tracking down a problem last night I discovered that I don't appear to be able to override :Exported methods defined in Maypole::Model::CDBI. Now, it's entirely possible that I'm doing something dumb here. I have a model class. It overrides do_edit very simply - I've added an include path to the constructor for CGI::Untaint so that we can get at some custom 'untainters'. So, it's basically the same as the original in Maypole::Model::CDBI but I've added a line or so. However, it doesn't get called. I'm relatively certain I'm doing something blindingly stupid. However, I'm having a trees and wood problem right now. I've attached my model class. Can anyone see where I've gone wrong? It's probably important to note that my table classes are all in separate modules and there's a BEGIN {PMR->setup...} at the start of the driver module, just before the 'use PMR::BaseOnModel' lines. Heyulp? nic -- the revolution will not be not rerun brothers the revolution will be live --huq684BweRXVnRxX Content-Type: application/x-perl Content-Disposition: attachment; filename="Model.pm" Content-Transfer-Encoding: quoted-printable package PMR::Model;=0A=0Ause strict;=0Ause warnings;=0A=0Ause base qw(Maypo= le::Model::CDBI);=0A=0Asub do_edit :Exported {=0A my ($self, $r) =3D @_;= =0A my $h =3D CGI::Untaint->new(=0A {INCLUDE_PATH =3D> $r->config->{un= taint_prefix}},=0A %{$r->{params}});=0A my $creating =3D 0;=0A my (= $obj) =3D @{$r->objects || []};=0A if ($obj) {=0A # We have somet= hing to edit=0A $obj->update_from_cgi($h =3D> {=0A require= d =3D> $r->{config}{$r->{table}}{required_cols} || [],=0A = });=0A } else {=0A $obj =3D $self->create_from_= cgi($h =3D> {=0A required =3D> $r->{config}{$r->{table}}{required= _cols} || [],=0A });=0A $creating= ++;=0A }=0A if (my %errors =3D $obj->cgi_update_errors) {=0A #= Set it up as it was:=0A $r->{template_args}{cgi_params} =3D $r->{pa= rams};=0A $r->{template_args}{errors} =3D \%errors;=0A $r->{t= emplate} =3D "edit";=0A undef $obj if $creating; # Couldn't create= =0A } else {=0A $r->{template} =3D "view";=0A }=0A $r->obje= cts([ $obj ]);=0A}=0A=0A=0A1;=0A --huq684BweRXVnRxX-- From ben@btucker.net Sat Jul 24 22:14:45 2004 From: ben@btucker.net (Benjamin Tucker) Date: Sat, 24 Jul 2004 17:14:45 -0400 Subject: [Maypole] multipart/form-data and Apache::MVC::parse_location Message-ID: <7CFE253D-DDB6-11D8-B8CC-000A95AEF8FA@btucker.net> I discovered that on a multipart/form-data POST, Apache::MVC::parse_location fails to fill the params slot. This patch fixes the problem, although there may be side-effects I'm not aware of. Ben --- MVC.pm Mon Jun 21 09:28:41 2004 +++ MVC.pm Sat Jul 24 12:38:38 2004 @@ -18,7 +18,7 @@ $self->{path} =~ s/^($loc)?\///; $self->parse_path; - $self->{params} = { $self->{ar}->content }; + $self->{params} = {%{$self->{ar}->param}}; while (my ($key, $value) = each %{$self->{params}}) { $self->{params}{$key} = '' unless defined $value; } From knoebi@gmail.com Mon Jul 26 08:14:56 2004 From: knoebi@gmail.com (knoebi) Date: Mon, 26 Jul 2004 09:14:56 +0200 Subject: [Maypole] If you hated Maypole, you'll also dislike... Message-ID: Hi list, I just read Simon's post and I also like his ideas! >While Maypole was designed to be extended "vertically", in the sense of making >it very easy to add new actions to a class - one template, one method, and >you're done - it isn't so easy to extend "horizontally". You can't easily add >new ideas and concepts (as represented by tables and classes) and have them >fit in nicely with the rest of the application. > .... >Further, I needed Class::DBI::DATA::Schema's translation option so that the >same schema code could work no matter what the database. What do you think about SQL::Translator? You could also be with your shemas database independent. > ... >I think it's the new way of creating extensible web applications, and I >like it a lot. yes, same goes for me ;-) I had this feeling also when I first saw Maypole working on my own database. There was another Web application-Framework where I had the same feeling when i first saw it working: CGI::Builder. I think this Framework would be a really good fit for Maypole (CGI, mod_perl1 and 2 compatible, TT support, and especially the concepts of Overrunning Handlers and Super Classes which makes it very good for "vertical" extending). ciao Philipp Knobel From Joe.CUMMING@rbos.com Mon Jul 26 09:26:21 2004 From: Joe.CUMMING@rbos.com (CUMMING, Joe, FM) Date: Mon, 26 Jul 2004 09:26:21 +0100 Subject: [Maypole] Odd (lack of) inheritence issue Message-ID: <8B5AEEBB4835A14194F3913ECB77ED37019780C3@lon0350xns.fm.rbsgrp.net> Nick, I had a similar problem and I fixed it by forcing all of my model classes to be "required". Either do it explicitly in your base web file or in the maypole setup routine add $subclass->require; in the subclass loop. I hope this fixes it. Joe -----Original Message----- From: maypole-admin@lists.netthink.co.uk [mailto:maypole-admin@lists.netthink.co.uk] On Behalf Of Nic Gibson Sent: 24 July 2004 22:21 To: Maypole Subject: [Maypole] Odd (lack of) inheritence issue Whilst tracking down a problem last night I discovered that I don't appear to be able to override :Exported methods defined in Maypole::Model::CDBI. Now, it's entirely possible that I'm doing something dumb here. I have a model class. It overrides do_edit very simply - I've added an include path to the constructor for CGI::Untaint so that we can get at some custom 'untainters'. So, it's basically the same as the original in Maypole::Model::CDBI but I've added a line or so. However, it doesn't get called. I'm relatively certain I'm doing something blindingly stupid. However, I'm having a trees and wood problem right now. I've attached my model class. Can anyone see where I've gone wrong? It's probably important to note that my table classes are all in separate modules and there's a BEGIN {PMR->setup...} at the start of the driver module, just before the 'use PMR::BaseOnModel' lines. Heyulp? nic -- the revolution will not be not rerun brothers the revolution will be live *********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: http://www.rbs.co.uk/CBFM http://www.rbsmarkets.com ******************************************************************************** From nicg@noslogan.org Mon Jul 26 14:58:46 2004 From: nicg@noslogan.org ('Nic Gibson') Date: Mon, 26 Jul 2004 14:58:46 +0100 Subject: [Maypole] Odd (lack of) inheritence issue In-Reply-To: <8B5AEEBB4835A14194F3913ECB77ED37019780C3@lon0350xns.fm.rbsgrp.net> References: <8B5AEEBB4835A14194F3913ECB77ED37019780C3@lon0350xns.fm.rbsgrp.net> Message-ID: <20040726135846.GF10251@blue.amorality.net> On Mon, Jul 26, 2004 at 09:26:21AM +0100, CUMMING, Joe, FM wrote: > Nick, > > I had a similar problem and I fixed it by forcing all of my model classes to > be "required". Thanks. I'll try that later on. I think this is well worth tracking down and I'll probably try to do so but imminent fatherhood suggests this'll be in about a month. nic > > Either do it explicitly in your base web file or in the maypole setup > routine add > > $subclass->require; > > in the subclass loop. > > I hope this fixes it. > > Joe > -- drinking fire water, with the devil's daughter goes down like liquid gold comes straight back up like liquid dynamite From rjkaes@flarenet.com Mon Jul 26 18:42:19 2004 From: rjkaes@flarenet.com (Robert James Kaes) Date: Mon, 26 Jul 2004 13:42:19 -0400 Subject: [Maypole] DBI Errors When Using Maypole Message-ID: <20040726174218.GA29659@flarenet.com> Hello all, I have a program I developed using Maypole and Class::DBI. The program works fine most of the time, but occasionally I'm receiving the following errors in my Apache error log file: [Sun Jul 25 20:20:41 2004] [error] Tracker::ContactType can't SELECT id\nFROM contact_type\n: DBD::mysql::st fetchrow_arrayref failed: fetch() without execute() [for Statement "SELECT id\nFROM contact_type\n"] at /usr/local/share/perl/5.8.3/DBIx/ContextualFetch.pm line 59.\n at /usr/local/share/perl/5.8.3/Class/DBI/AsForm.pm line 120\n [Sun Jul 25 20:21:08 2004] [error] DBD::mysql::st fetchrow_array failed: fetch() without execute() [for Statement "SELECT name\nFROM province\nWHERE id=?\n"] at /usr/local/share/perl/5.8.3/DBIx/ContextualFetch.pm line 87.\n [Sun Jul 25 21:21:21 2004] [error] Tracker::Contact can't SELECT id\nFROM contact\n: Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.3/Class/DBI.pm line 1125.\n at /usr/local/share/perl/5.8.3/Class/DBI/Pager.pm line 48\n [Sun Jul 25 21:21:44 2004] [error] DBD::mysql::st fetchrow_array failed: fetch() without execute() [for Statement "SELECT name\nFROM province\nWHERE id=?\n"] at /usr/local/share/perl/5.8.3/DBIx/ContextualFetch.pm line 87.\n [Sun Jul 25 21:26:52 2004] null: undef error - DBD::mysql::st fetchrow_array failed: fetch() without execute() [for Statement "SELECT mobile, email, city, person, fax, url, business, postalcode, address, province, company, home, country, created, type, title [Sun Jul 25 21:26:52 2004] null: FROM contact [Sun Jul 25 21:26:52 2004] null: WHERE id=? [Sun Jul 25 21:26:52 2004] null: "] at /usr/local/share/perl/5.8.3/DBIx/ContextualFetch.pm line 87. [Sun Jul 25 21:26:52 2004] [error] [client 192.168.0.3] File does not exist: /home/sidx/htdocs/tracker/contact/list/ As far as I can tell, these are not Maypole problems per se, but appear to be with DBIx::ContextualFetch, or Class::DBI, or Class::DBI::AsForm. I have no idea why I'm receiving these errors, since the program will run for hours before any of these errors being. If I restart the Apache process, the program runs correctly again. Is there anything I should be looking for to track down and solve this problem? -- Robert -- Robert James Kaes --- Flarenet Inc. --- (519) 426-3782 http://www.flarenet.com/consulting/ * Putting the Service Back in Internet Service Provider * From mfreeman451@gmail.com Tue Jul 27 05:08:38 2004 From: mfreeman451@gmail.com (Michael Freeman) Date: Mon, 26 Jul 2004 23:08:38 -0500 Subject: [Maypole] problems w/ Maypole.cgi Message-ID: <5fb17000407262108505f36cc@mail.gmail.com> Here are the errors I get with Maypole in CGI mode.. [Mon Jul 26 22:31:18 2004] [error] [client 68.117.35.204] Premature end of script headers: nursery.cgi [Mon Jul 26 22:31:18 2004] [error] [client 68.117.35.204] file error - cgi-binnursery.cgi: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68 root@frylock:/www/carvernursery/cgi-bin# cat nursery.cgi #!/usr/bin/perl use strict; use vars qw/$path/; BEGIN { $path = "/www/carvernursery/cgi-bin" }; use lib $path; use Nursery; Nursery->run(); ### and the Nursery.pm root@frylock:/www/carvernursery/cgi-bin# cat Nursery.pm package Nursery; use base 'CGI::Maypole'; use Class::DBI::Loader::Relationship; Nursery->setup("dbi:mysql:carvernursery", "maypole", "foobar"); Nursery->config->{uri_base} = "http://www.carvernursery.com/cgi-bin/"; Nursery->config->{rows_per_page} = 10; Nursery->config->{loader}->relationship($_) for ("a category has products", "a subcategory has products", "a category has subcategories"); 1; Heres what happens when I run it manually: root@frylock:/www/carvernursery/cgi-bin# perl nursery.cgi file error - nursery.cgi: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68. root@frylock:/www/carvernursery/cgi-bin# Any Ideas? From ben@btucker.net Tue Jul 27 05:30:20 2004 From: ben@btucker.net (Benjamin Tucker) Date: Tue, 27 Jul 2004 00:30:20 -0400 Subject: [Maypole] problems w/ Maypole.cgi In-Reply-To: <5fb17000407262108505f36cc@mail.gmail.com> References: <5fb17000407262108505f36cc@mail.gmail.com> Message-ID: --Apple-Mail-1-926274562 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On Jul 27, 2004, at 12:08 AM, Michael Freeman wrote: > [Mon Jul 26 22:31:18 2004] [error] [client 68.117.35.204] file error - > cgi-binnursery.cgi: not found at > /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68 In recent versions of maypole the trailing slash is removed from $base before it is passed into the view template. The factory templates have a bug[1] which is they still expect that trailing slash to be there. I suspect that is what is going on here. Ben [1] http://lists.netthink.co.uk/pipermail/maypole/2004-July/000489.html --Apple-Mail-1-926274562 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGEjCCAssw ggI0oAMCAQICAwulejANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhh d3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt YWlsIElzc3VpbmcgQ0EwHhcNMDQwMjA1MDUyMzU1WhcNMDUwMjA0MDUyMzU1WjBBMR8wHQYDVQQD ExZUaGF3dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg9iZW5AYnR1Y2tlci5uZXQw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtoArX0Dror8iWV0w3Ls66/ZYeyNn46LNt ZPmuOF8pKkpNF0eOT5IPqAv9UYvrnYdJvEljXXbPbYICahbSaUvpXvBxb25AePwr6gp+jaHDb2B6 VjLphVvWxiC84pOF+S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oYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25h bCBGcmVlbWFpbCBJc3N1aW5nIENBAgMLpXowDQYJKoZIhvcNAQEBBQAEggEAQHbrPRJvr7mohomI qm/3Wnrk3pSrC6m/Ng/q6ne8PJ2KQL+uhkpcDpT+x3W9guBE2p9srpXzntZp7Y8bdrLXx4v6VQnL emUS8evUJmTkpJ/qlG2I0iq6SCNw3YCAAS+jZ+BUjQem9o9tptb4MxEHjR5u5rrPZ/iQijWBhbQn zic1rSCwlZA9Psc3xzteszuDZKR65cvEaZ9fboBxQIXJxxNc9w9n0k+w/Xx8O+hr9asaCGV8aR7S OKLzN1ay/LxQ4+iIZSof4RrnbhAs23zL09sYWUkN4wsE5RrxFu7yrtKzub6Rf9K+zAn0SyoJV7SI wnonpWtHHPrq6kju+i3VVQAAAAAAAA== --Apple-Mail-1-926274562-- From simon@simon-cozens.org Tue Jul 27 16:17:03 2004 From: simon@simon-cozens.org (Simon Cozens) Date: Tue, 27 Jul 2004 16:17:03 +0100 Subject: [Maypole] If you hated Maypole, you'll also dislike... In-Reply-To: References: Message-ID: <20040727151703.GA13851@alibi.simon-cozens.org> knoebi: > >Further, I needed Class::DBI::DATA::Schema's translation option so that the > >same schema code could work no matter what the database. > > What do you think about SQL::Translator? You could also be with your shemas > database independent. I think its dependencies suck rocks, but it is precisely what Class::DBI::DATA::Schema's translation option uses. -- It can be hard to tell an English bigot from a monoglot with an inferiority complex, but one cannot tell a Welshman any thing a tall. - Geraint Jones. From Joe.CUMMING@rbos.com Wed Jul 28 08:52:00 2004 From: Joe.CUMMING@rbos.com (CUMMING, Joe, FM) Date: Wed, 28 Jul 2004 08:52:00 +0100 Subject: [Maypole] Request for help Message-ID: <8B5AEEBB4835A14194F3913ECB77ED37019780EA@lon0350xns.fm.rbsgrp.net> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C47477.C39C6A08 Content-Type: text/plain Hello, Can anyone please send me the compiled auto/Template/Stash/XS libraries for freebsd. I am trying to setup Maypole on my web provider but they do not have template toolkit installed as standard (dumb eh?). I am trying to install the TT by hand in my own area but am missing the correct auto-libraries for the provider's os. I need auto/Template/Stash/XS/XS.bs auto/Template/Stash/XS/XS.so for freebsd. Can anyone help? Thanks, Joe *********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: http://www.rbs.co.uk/CBFM http://www.rbsmarkets.com ******************************************************************************** ------_=_NextPart_001_01C47477.C39C6A08 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Request for help

Hello,

Can anyone please send me the= compiled auto/Template/Stash/XS librar= ies for freebsd.

I am trying to setup Maypole = on my web provider but they do not have= template toolkit installed as standard (dumb eh?).

I am trying to install the TT<= /FONT> by hand in my own area but am missing the correct auto-libraries for the provider's os.

I need

auto/Template/Stash/XS= /XS.bs

auto/Template/Stash/XS= /XS.so

for freebsd.

Can anyone help?

Thanks,

Joe



***************************************************************************= ********
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registere= d Office: 36 St Andrew Square, Edinburgh EH2 2YB. =
Authorised and regulated by the Financial Services Authority

This e-mail message is confidential and for use by the =
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your =
computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent. =
=
Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to =
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The Royal
Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
= Visit our websites at: =
http://www.rbs.co.uk/CBFM =
http://www.rbsmarkets.com =
= ***********************************************= *********************************
------_=_NextPart_001_01C47477.C39C6A08-- From mfreeman451@gmail.com Sat Jul 31 21:05:06 2004 From: mfreeman451@gmail.com (Michael Freeman) Date: Sat, 31 Jul 2004 15:05:06 -0500 Subject: [Maypole] problems with BeerDB Message-ID: <5fb170004073113052467fc5e@mail.gmail.com> (70) root@mercy:/var/www/beerdb# perl -MBeerDB -e1 Can't locate object method "set_db" via package "BeerDB::Beer" at /usr/local/share/perl/5.8.4/Class/DBI/Loader/mysql.pm line 23. Compilation failed in require. BEGIN failed--compilation aborted. (71) root@mercy:/var/www/beerdb# Help me please From roland@moriz.de Sat Jul 31 21:25:56 2004 From: roland@moriz.de (Roland Moriz) Date: Sat, 31 Jul 2004 22:25:56 +0200 Subject: [Maypole] problems with BeerDB In-Reply-To: <5fb170004073113052467fc5e@mail.gmail.com> References: <5fb170004073113052467fc5e@mail.gmail.com> Message-ID: <1091305556.13182.1.camel@pc-101.muc.de.moriz.net.> Hi, Am Samstag, den 31.07.2004, 15:05 -0500 schrieb Michael Freeman: > (70) root@mercy:/var/www/beerdb# perl -MBeerDB -e1 > Can't locate object method "set_db" via package "BeerDB::Beer" at > /usr/local/share/perl/5.8.4/Class/DBI/Loader/mysql.pm line 23. > Compilation failed in require. > BEGIN failed--compilation aborted. > (71) root@mercy:/var/www/beerdb# http://wiki.simon-cozens.org/index.cgi?InstallationIssues cpan Class::DBI::mysql regards, From russell@futureless.org Wed Jul 28 14:32:23 2004 From: russell@futureless.org (Russell Matbouli) Date: Wed, 28 Jul 2004 14:32:23 +0100 Subject: [Maypole] Request for help In-Reply-To: <8B5AEEBB4835A14194F3913ECB77ED37019780EA@lon0350xns.fm.rbsgrp.net> References: <8B5AEEBB4835A14194F3913ECB77ED37019780EA@lon0350xns.fm.rbsgrp.net> Message-ID: <20040728133223.GB11031@futureless.org> --z6Eq5LdranGa6ru8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Wed, Jul 28, 2004 at 08:52:00AM +0100, CUMMING, Joe, FM wrote: > Can anyone please send me the compiled auto/Template/Stash/XS libraries f= or > freebsd. I suspect you want to install TT without the XS stash enabled instead - I don't think the compiled files are guaranteed to work on anything other than the machine they were compiled upon. --=20 Russell Matbouli | There's nothing kinky about russell@futureless.org | pre-pubescent pigs PGP KeyID: 0x3CA84CF4 | -- Stray Toaster --z6Eq5LdranGa6ru8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBB6rndMkNGzyoTPQRAtS0AKDgnZ/xOvXjEPVxgK4pwB/hroocJQCeIOY3 G0wCpQ9hLCMa8/XhwtnVLHA= =F5Qw -----END PGP SIGNATURE----- --z6Eq5LdranGa6ru8-- From chromatic@wgz.org Wed Jul 28 15:13:42 2004 From: chromatic@wgz.org (chromatic) Date: Wed, 28 Jul 2004 07:13:42 -0700 Subject: [Maypole] Request for help In-Reply-To: <8B5AEEBB4835A14194F3913ECB77ED37019780EA@lon0350xns.fm.rbsgrp.net> References: <8B5AEEBB4835A14194F3913ECB77ED37019780EA@lon0350xns.fm.rbsgrp.net> Message-ID: <1091024022.2008.1.camel@localhost> On Wed, 2004-07-28 at 00:52, CUMMING, Joe, FM wrote: > I am trying to install the TT by hand in my own area but am missing > the correct auto-libraries for the provider's os. > > I need > > auto/Template/Stash/XS/XS.bs > > auto/Template/Stash/XS/XS.so > > for freebsd. How are you trying to install these? If you have a shell account capable of using the CPAN, you can use the following command to install: perl -MCPAN -e 'install Template' If you don't have root on the box, use this command: perldoc CPAN and search for "I am not root, how can I install a module in a personal directory?" Installing through the CPAN shell will also allow you to decide not to use the XS stash, if you desire. -- c