Re: [Catalyst] While the Catalyst CPAN install discussion is still going on....

2006-08-22 Thread Zbigniew Lukasiak
Just yesterday I tried installing modules on my Windows box (cygwin) - and I had a memory problem so frequently that I gave up.  It was something like cannot allocate heap.  But this was Windows of course.--Zbyszek
On 8/22/06, Dennis Daupert <[EMAIL PROTECTED]> wrote:
I've used CPAN.pm a lot, have installed Catalyst on various unix boxen  (linux, solaris), have always been able to coerce mods to install. Until now. My ISP runs BSD, perl 5.8.0 (oh my god!! and yes, I've asked them to  upgrade, and was told "someday, we just don't know what day"). I loaded  cat-in-a-box just fine, but I need MORE.
When I try to fire up CPAN, I get an out-of-memory error while CPAN is  downloading one of his database files -- I forget which one, authors or  modules. I am allocated 5 GIGs, and am using nowhere near that. Has  anyone run into this one?
/dennis  
___List: Catalyst@lists.rawmode.orgListinfo: 
http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/-- 
Zbigniew Lukasiakhttp://brudnopis.blogspot.com/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Sessions not working with Store::File State Cookie

2006-08-22 Thread Yuval Kogman
On Wed, Aug 23, 2006 at 03:30:25 +0200, Roland Lammel wrote:
> I had a very strange behaviour when using the latest session plugin with
> store::file and state::cookie.
> 
> These are the versions used along with Catalyst 5.70001
> 
> 0.11 Catalyst::Plugin::Session
> 0.08 Catalyst::Plugin::Session::Store::File
> 0.01 Catalyst::Plugin::Session::State::Cookie

State::Cookie needs an upgrade... There was a big fat warning in the
Makefile.PL, i guess you missed it when you upgraded. Sorry =/


-- 
  Yuval Kogman <[EMAIL PROTECTED]>
http://nothingmuch.woobling.org  0xEBD27418



pgpFGl7R6Po0H.pgp
Description: PGP signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] load more than 2 yaml files in Catalyst

2006-08-22 Thread Fayland Lam
Joel Bernstein wrote:
> On Tue, Aug 22, 2006 at 01:37:49AM +, Fayland Lam wrote:
>> Joel Bernstein wrote:
>>> On Mon, Aug 21, 2006 at 10:09:10AM +, fayland wrote:
 Now I'm using Config::YAML to load more than 2 yaml files in Catalyst, 
 but I wonder why ConfigLoader don't support to load more than 2 yaml 
 files? (like a.yaml b.yaml c.yaml, but not a.yaml a_local.yaml)
>> something like:
>>
>> __PACKAGE__->config( file => ['a.yml', 'b.yml', 'c.yml'] );
>>
>> It doesn't work for me? What's wrong?
> 
> Well, to put it bluntly, it doesn't work because you just made that
> interface up. If you read the ConfigLoader synopsis at:
> http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.12/lib/Catalyst/Plugin/ConfigLoader.pm#SYNOPSIS
> 
> you'll see that the interface expects file => filename, ie a scalar NOT
> an arrayref.
> 
> However, I've initiated a discussion on the catalyst-dev list about
> whether this is a reasonable change to make to the interface, ie for it
> to accept either a scalar or an arrayref of scalars. If the dev team
> like the idea I'll make up a patch to ConfigLoader.
> 
> I'd point out at this point that anything you can do with multiple
> config files, you could do with a single one -- what is your rationale
> for needing multiple ones? Do you store each class's configuration
> separately? I can sort of see the logic in doing that. Please mail the
> list back and explain what you're doing with the multiple files, so we
> can understand the use case better and see if there's a better way to do
> what you need. At the very least it'll help me to make up a patch to get
> the behaviour you want.

Thanks. why I need multiple YAML config files is because one site may 
have more than one projects, and I like one config file for one project.
It seems much more clear logically.

A patch would be greatly appreciated. Best,

> 
> In summary, then:
> 1) the interface doesn't work like you think it does...for now anyway
> 2) you can get around it by rolling your multiple files into a single
> one
> 3) just making up an interface doesn't magically cause it to exist
> 
> /joel
> 
> ___
> List: Catalyst@lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Sessions not working with Store::File State Cookie

2006-08-22 Thread Roland Lammel
I had a very strange behaviour when using the latest session plugin with store::file and state::cookie.These are the versions used along with Catalyst 5.700010.11 Catalyst::Plugin::Session0.08 Catalyst::Plugin::Session::Store::File
0.01 Catalyst::Plugin::Session::State::CookieOn every request a new session was created, where usually the same session will be reused.Digging into the code I found that the sessionid is not stored correctly in the cookie. In 
Cookie.pm the sid was not set anymore when the finalize_cookie was called. Checking the finalize method in Session.pm I found that the session state is cleared before even finalize_cookie is called.
After fixing this sessions still did not work. The log showed the cookie to be used and it seemed the session has been set, but the a new session was created again.Although $c->sessionid($sid) is called, the session id is not set. I changed that to use the same code of create_session_id from 
Session.pmAnyone else experienced those problems? Any comments would be greatly appreciated.Here are the patches, I haven't had any sideeffects so far, but then again I'm just starting with the app (first one with 
5.7).Patch to Catalyst/Plugin/Session/State/Cookie.pm:63,64c65< $c->_sessionid($sid);< $c->set_session_id($sid);---> $c->sessionid($sid);
Patch to Catalyst/Plugin/Session.pm:99,100d98< $c->NEXT::finalize(@_);< 101a100,101> > $c->NEXT::finalize(@_);
Best regards+rl
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] While the Catalyst CPAN install discussion is still going on....

2006-08-22 Thread Lee Standen
There's a difference between memory and storage space.  I find it highly 
unlikely that you have 5GB of RAM to access, more likely that's 5GB of 
storage...a whole different matter.
The chances are you're only allocated a few MB of memory for whatever 
you run on your server, to prevent resource hogging.

Dennis Daupert wrote:
> I've used CPAN.pm a lot, have installed Catalyst on various unix boxen 
> (linux, solaris), have always been able to coerce mods to install.
>
> Until now.
>
> My ISP runs BSD, perl 5.8.0 (oh my god!! and yes, I've asked them to 
> upgrade, and was told "someday, we just don't know what day"). I 
> loaded cat-in-a-box just fine, but I need MORE.
>
> When I try to fire up CPAN, I get an out-of-memory error while CPAN is 
> downloading one of his database files -- I forget which one, authors 
> or modules. I am allocated 5 GIGs, and am using nowhere near that. Has 
> anyone run into this one?
>
> /dennis
>
> 
>
> ___
> List: Catalyst@lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>   


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'

2006-08-22 Thread Daniel McBrearty
h. thanks. as it happens, I *did* wonder what all that juno crap
was about  :-)

On 8/22/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
> * Jonathan Rockway <[EMAIL PROTECTED]> [2006-08-22 20:00]:
> > cpan My::Module Another::Module
> >
> > is the correct invocation.
>
> Or you can pass `-i` to be explicit:
>
> cpan -i My::Module Another::Module
>
> Regards,
> --
> Aristotle Pagaltzis // 
>
> ___
> List: Catalyst@lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] While the Catalyst CPAN install discussion is still going on....

2006-08-22 Thread Dennis Daupert
I've used CPAN.pm a lot, have installed Catalyst on various unix boxen  (linux, solaris), have always been able to coerce mods to install. Until now. My ISP runs BSD, perl 5.8.0 (oh my god!! and yes, I've asked them to  upgrade, and was told "someday, we just don't know what day"). I loaded  cat-in-a-box just fine, but I need MORE.When I try to fire up CPAN, I get an out-of-memory error while CPAN is  downloading one of his database files -- I forget which one, authors or  modules. I am allocated 5 GIGs, and am using nowhere near that. Has  anyone run into this one?/dennis  ___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'

2006-08-22 Thread A. Pagaltzis
* Jonathan Rockway <[EMAIL PROTECTED]> [2006-08-22 20:00]:
> cpan My::Module Another::Module
> 
> is the correct invocation.

Or you can pass `-i` to be explicit:

cpan -i My::Module Another::Module

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Defining User and Role in a same table for authorization

2006-08-22 Thread Nagarajan M
Hi All,     I am trying out the examples provided in the tutorial for authentication and authorization. In that example user and role are seperated out, in my case I want to use one table which contain role as a column,        like  id username password role (ie. one user will have one role)     How do represent this one in the yml file, it has entry for role table and relation between role and user.     Can any one help me on this,     Thanks for your time  Nagarajan 
	

	
		 
Here's a new way to find what you're looking for - Yahoo! Answers  
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Framework Confusion: Catalyst, Jifty, Woodstock (Mojo)? 'Sup?

2006-08-22 Thread Matt S Trout
Hugh Lampert wrote:
> Experts:  Why is Catalyst a qw/better more-robust more-enduring 
> better-Rails-Killer easier-to-use/  framework than Jifty or 
> (Woodstock|Mojo)?
> 
> Seeing these other frameworks mentioned online - just curious.

Catalyst is designed to be flexible, extensible and basically let you do 
things whatever way your app needs. It's not designed to be a Rails killer. 
Rails is a toy. We go where Rails apps fear to tread (like, say, multi-column 
primary keys, full-stack utf8 support and integrating with SVN, LDAP and all 
manner of other models).

Jifty is substantially focused on new database-backed web applications and 
provides One True Way to do everything (and nice integration of said true 
ways) and Rails-like declarative syntax.

Mojo is vapourware, and I fully expect it to be released shortly after Duke 
Nukem Forever for Vista ships.

-- 
  Matt S Trout   Offering custom development, consultancy and support
   Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Brandon Black
On 8/22/06, Josef Chladek <[EMAIL PROTECTED]> wrote:
my only remaining problem is that restarts take so long becauseapache can't end the child-processes cleanlyThis I really haven't a clue on.  We don't muck with signals AFAIK in any of the standard Cat/DBIC code.  My first guess would be that a DESTROY handler somewhere is taking an inordinate amount of time to get the job done.
-- Brandon
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Brandon Black
On 8/22/06, Josef Chladek <[EMAIL PROTECTED]> wrote:
to make mod_perl the same speed I put in my perl_startup.pluse XMLForm::Model::use XMLForm::Schema::
for ALL my models -> same speed.WM 0.097695 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line304.[... gets slower ...] 
UserDepotExternal 0.52905 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line 304.is the result (+/-) for the three test-scenarios.if I put 'WM' as the last to be 'newed', I get
WM 0.544998 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line304.this is strange, is not it?Yes, that's definitely strange and interesting and warrants further investigation...
Down another avenue: I haven't tried this myself as I don't have 20 different schemas/models to load at once, and so I'm not sure if it would break things, but you might try this hack in your mod_perl startup.pl thingy before the app loads:
--use Class::C3;{    no warnings 'redefine';    local *Class::C3::reinitialize = sub { };    my @schema_classes = qw/ XMLForm::Schema:: XMLForm::Schema:: . /;
    $_->require for (@schema_classes);}Class::C3::reinitialize();--It might screw up source registrations, I'm not sure at this point.  If it does, perhaps we can make some changes in DBIC to make this sort of hack possible (or even make a sane patch for globally lazy C3 reinit with some sort of sane interface).
-- Brandon
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Josef Chladek

Am 22.08.2006 um 20:29 schrieb Brandon Black:

>
>
> On 8/22/06, Brandon Black <[EMAIL PROTECTED]> wrote:
> [...] and it might not be possible to make it significantly faster  
> without rewriting it in XS [...]
>
> Ok, I lied.  I went back to stare at Algorithm::C3 and Class::C3,  
> and I remembered an earlier performance hack I had tried, but never  
> got around to cleaning up and committing and pushing out.  It won't  
> solve all your ills, but it should give another incremental  
> performance boost for DBIC start times and its a relatively  
> nonintrusive change that can be made Right Now.  Attached are  
> patches against the latest CPAN versions of Algorithm::C3 and  
> Class::C3, please give them a shot (if nothing else, I'd like some  
> testing feedback on them before committing and pushing this stuff).

well, the patches made my startup time 20% better, everything working  
as expected (so far...)

my only remaining problem is that restarts take so long because  
apache can't end the child-processes cleanly

thanks
josef

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Dispatch matching more than the path?

2006-08-22 Thread Garrett Goebel
On Aug 22, 2006, at 3:49 AM, Matt S Trout wrote:
 > > Garrett Goebel wrote:
 > >
 > > I hacked something into the Path and Regex dispatchers to get  
collective
 > > matching on method and path working in the prototype.
 >
 > You shouldn't need to hack anything into these; just use a custom  
ActionClass
 > that overrides $action->match to introspect onto the request  
method and
 > anything else you need (this is already how :Args is handled, see the
 > Catalyst::Action source for the implementation).

Thanks. I'd found the :Args code in Catalyst::Action last night and  
managed to shoehorn the request method and path parameter matching  
checks into it. How to subclass or override it was going to be my  
next question. I'll check out using a custom ActionClass.

Last night I also sub-classed the Request class to add:
__PACKAGE__->mk_accessors(qw/path_parameters accept_extension/);

And I'm currently subclassing the Dispatcher to override  
prepare_action in order to:
o  remove uri path parameters from $c->request->path and add to
$c->request->path_parameters
o  remove "file" extension from last path segment and add to
$c->request->accept_extension
o  filter body parameters from using content_type implied by the
accept_extension (json, yaml, etc) and add to $c->request- 
 >parameters.
Perhaps I should consider just using the $c->request->content_type?
o  check POST requests for hidden _method=DELETE|PUT parameter and  
update
$c->request->method accordingly

These are all things I want to do once per request, not once per  
action. Certainly there are better places to perform some of these  
tasks. And I would like to hear any advice on the best place to  
override catalyst for each. In the mean time, at least I've got a  
proof of concept working.


My controller now is able to look like:

# GET http://foo.com/model
# GET http://foo.com/model.json
sub index :GET :Path('') Args(0) {
 my ($self, $c) = @_;
 my @models = grep { UNIVERSAL::can($c->model($_),  
'result_source') }
  $c->models;
 $self->out($c, [EMAIL PROTECTED]);
 1;
}

# GET http://foo.com/model/Person
sub show :GET :Path('') :Args(1) {
 my ($self, $c, $model) = @_;
 my @pkcols = $c->model($model)->result_source->primary_columns;
 my @pk_tuples = map(
 { my $tuple = $_; csv_encode(map({ $tuple->$_ } @pkcols)) }
 $c->model($model)->search(undef,
   {columns  => [EMAIL PROTECTED],
distinct => 1,
order_by => [EMAIL PROTECTED])
 );
 $self->out($c, [EMAIL PROTECTED]);
 1;
}

# GET http://foo.com/model/Person;edit
sub edit :GET :Path('') :PathParam(edit) :Args(1) {...}

# GET http://foo.com/model/Person;add
sub add :GET :Path('') :PathParam(add) :Args(1) {...}


# GET http://foo.com/model/Person;column_info
# GET http://foo.com/model/Person.yaml;column_info
sub show_column_info :GET :Path('') :PathParam(column_info) :Args(1) {
 my ($self, $c, $model) = @_;
 my $rs  = $c->model($model)->result_source;
 my %column_info = map { $_ => $rs->column_info($_)} $rs->columns;
 $self->out($c, \%column_info);
 1;
}

# POST http://foo.com/model/Person;new
sub create :POST :Path('') :PathParam(new) :Args(1) {...}

# PUT http://foo.com/model/Person/32
sub update :PUT :Path('') :Args(2) {...}

# DELETE http://foo.com/model/Person/32
sub destroy :DELETE :Path('') :Args(2) {...}







___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Josef Chladek

Am 22.08.2006 um 17:29 schrieb Brandon Black:

> Is this timed under mod_perl, or standalone?  If you're timing it  
> under mod_perl, its probably just getting progressively slower as  
> all of the copies get started up.  If not, can the increasing times  
> be explained by increasing schema complexity?  At "$schema_class- 
> >require" is when load_classes runs and you should be mostly seeing  
> Class::C3/Alg::C3/load_components/etc initialization delays (which  
> is what I'm still working on reducing, but it may be a little  
> while).  I'm surprised that ->connection takes any significant time  
> in perl, are you sure this isn't a case of the DB server responding  
> slower and slower?

well, looked into it a bit closer:
tried it mod_perl, lighttpd and .pl
mod_perl and lighttpd are nearly the same for loading all the models,  
the .pl was twice as fast.
to make mod_perl the same speed I put in my perl_startup.pl
use XMLForm::Model::
use XMLForm::Schema::

for ALL my models -> same speed.

WM 0.097695 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line  
304.
B2B 0.049378 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Users 0.094624 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Waren 0.103613 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Stats 0.142956 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Matrix 0.155247 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
BElogs 0.236735 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Zeitung 0.278145 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Threads 0.303832 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
BEBoard 0.312186 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Calendar 0.345289 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
WBContest 0.352483 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
PDFFolder 0.372447 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
UserDepot 0.3975 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Newsletter 0.427306 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Abonummern 0.438931 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Businesspeople 0.484535 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Exportersweekly 0.495835 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
UserDepotExternal 0.52905 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.

is the result (+/-) for the three test-scenarios.

if I put 'WM' as the last to be 'newed', I get

WM 0.544998 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line  
304.

this is strange, is not it?


> %TimeSec. #calls   sec/call  F  name
> 27.671.2513  259   0.004831 Algorithm::C3::merge
> 24.691.1163  161   0.006933  
> Class::C3::_calculate_method_dispatch_table
>  4.520.2042  161   0.001269  
> Class::C3::_remove_method_dispatch_table
>  3.640.1646   161   0.001023  
> Class::C3::_apply_method_dispatch_table
>  2.970.1343   98   0.001370  
> DBIx::Class::Componentised::ensure_class_loaded
>  2.750.1243 5837   0.21 :...e_perl/5.8.8/ 
> Class/C3.pm:146
>  1.930.0871  482   0.000181  
> DBIx::Class::AccessorGroup::_mk_group_accessors
>  1.380.0626  183   0.000342  
> DBIx::Class::Schema::register_source

I get nearly the same results
%TimeSec. #calls   sec/call  F  name
32.263.3351 1154   0.002890  
Class::C3::_calculate_method_dispatch_table
31.973.3050 1236   0.002674 Algorithm::C3::merge
12.371.2791 1154   0.001108  
Class::C3::_remove_method_dispatch_table
4.840.5008 1154   0.000434  
Class::C3::_apply_method_dispatch_table
3.280.338724373   0.14 :...y/Perl/5.8.6/Class/ 
C3.pm:146

times are ok now for me, except that apache has to kill all children  
in restart, that takes a lot of time...

thanks, will try the patches!

josef

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Framework Confusion: Catalyst, Jifty, Woodstock (Mojo)? 'Sup?

2006-08-22 Thread Brandon Black
On 8/22/06, Hugh Lampert <[EMAIL PROTECTED]> wrote:
Experts:  Why is Catalyst a qw/better more-robust more-enduringbetter-Rails-Killer easier-to-use/  framework than Jifty or(Woodstock|Mojo)?Seeing these other frameworks mentioned online - just curious.
Well, for one thing, Jifty is the only framework that comes with a Pony :)-- Brandon
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Framework Confusion: Catalyst, Jifty, Woodstock (Mojo)? 'Sup?

2006-08-22 Thread Jonathan Rockway

Hugh Lampert wrote:
> Experts:  Why is Catalyst a qw/better more-robust more-enduring 
> better-Rails-Killer easier-to-use/  framework than Jifty or 
> (Woodstock|Mojo)?

Only you can answer these questions.  Try them out, and use what you like.

Catalyst's advantage is flexibility.  It can do anything.

Jifty's advantage is that it was designed (mostly) by one person -- so
there's only one way to do things.

I personally have tried and failed to use Jifty a number of times,
whereas I have several Cat application under my belt.  YMMV, of course.

Regards,
Jonatahan Rockway

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Brandon Black
On 8/22/06, Brandon Black <[EMAIL PROTECTED]> wrote:
[...] and it might not be possible to make it significantly faster without rewriting it in XS [...]Ok, I lied.  I went back to stare at Algorithm::C3 and Class::C3, and I remembered an earlier performance hack I had tried, but never got around to cleaning up and committing and pushing out.  It won't solve all your ills, but it should give another incremental performance boost for DBIC start times and its a relatively nonintrusive change that can be made Right Now.  Attached are patches against the latest CPAN versions of Algorithm::C3 and Class::C3, please give them a shot (if nothing else, I'd like some testing feedback on them before committing and pushing this stuff).
-- Brandon
=== MANIFEST
==
--- MANIFEST	(revision 13297)
+++ MANIFEST	(local)
@@ -12,5 +12,6 @@
 t/004_merge.t
 t/005_order_disagreement.t
 t/006_complex_merge.t
+t/007_cached_merge.t
 t/pod.t
 t/pod_coverage.t
=== lib/Algorithm/C3.pm
==
--- lib/Algorithm/C3.pm	(revision 13297)
+++ lib/Algorithm/C3.pm	(local)
@@ -9,11 +9,10 @@
 our $VERSION = '0.04';
 
 sub merge {
-my ($root, $parent_fetcher) = @_;
+my ($root, $parent_fetcher, $cache) = @_;
 
+$cache ||= {};
 my @STACK;  # stack for simulating recursion
-my %fcache; # cache of _fetcher results
-my %mcache; # cache of merge do-block results
 
 my $pfetcher_is_coderef = ref($parent_fetcher) eq 'CODE';
 
@@ -42,13 +41,13 @@
 ]);
 
 $current_root = $new_root;
-$current_parents = $fcache{$current_root} ||= [ $current_root->$parent_fetcher ];
+$current_parents = $cache->{pfetch}->{$current_root} ||= [ $current_root->$parent_fetcher ];
 $recurse_mergeout = [];
 $i = 0;
 next;
 }
 
-my $mergeout = $mcache{$current_root} ||= do {
+my $mergeout = $cache->{merge}->{$current_root} ||= do {
 
 # This do-block is the code formerly known as the function
 # that was a perl-port of the python code at
@@ -183,7 +182,7 @@
 
 =over 4
 
-=item B
+=item B
 
 This takes a C<$root> node, which can be anything really it
 is up to you. Then it takes a C<$func_to_fetch_parent> which 
@@ -214,6 +213,26 @@
 for C to extract the parents of C<$root>. This is 
 needed for C3 to be able to do it's work.
 
+The C<$cache> parameter is an entirely optional performance
+measure, and should not change behavior.
+
+If supplied, it should be a hashref that merge can use as a
+private cache between runs to speed things up.  Generally
+speaking, if you will be calling merge many times on related
+things, and the parent fetching funtion will return constant
+results given the same arguments during all of these calls,
+you can and should reuse the same shared cache hash for all
+of the calls.  Example:
+
+  sub do_some_merging {
+  my %merge_cache;
+  my @foo_mro = Algorithm::C3::Merge('Foo', \&get_supers, \%merge_cache);
+  my @bar_mro = Algorithm::C3::Merge('Bar', \&get_supers, \%merge_cache);
+  my @baz_mro = Algorithm::C3::Merge('Baz', \&get_supers, \%merge_cache);
+  my @quux_mro = Algorithm::C3::Merge('Quux', \&get_supers, \%merge_cache);
+  # ...
+  }
+
 =back
 
 =head1 CODE COVERAGE
=== t/007_cached_merge.t
==
--- t/007_cached_merge.t	(revision 13297)
+++ t/007_cached_merge.t	(local)
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 12;
+
+BEGIN {
+use_ok('Algorithm::C3');
+}
+
+=pod
+
+Just like 006_complex_merge, but with the caching turned on.
+
+This example is taken from: http://rt.cpan.org/Public/Bug/Display.html?id=20879
+
+   --- --- ---
+Level 5 8 | A | 9 | B | A | C |(More General)
+   --- --- ---   V
+  \ | /  |
+   \|/   |
+\   |   /|
+ \  |  / |
+   ---   |
+Level 4 7 | D |  |
+   ---   |
+  /   \  |
+ / \ |
+  ---   ---  |
+Level 34 | G |   6 | E | |
+  ---   ---  |
+   | |   |
+   | |   |
+  ---   ---  |
+Level 23 | H |   5 | F | |
+  ---   ---  |
+  \   /  |   |
+   \ /   |   |
+\|   |
+   / \   |   |
+  /   \  |   |
+  ---   ---  |
+Le

[Catalyst] Framework Confusion: Catalyst, Jifty, Woodstock (Mojo)? 'Sup?

2006-08-22 Thread Hugh Lampert
Experts:  Why is Catalyst a qw/better more-robust more-enduring 
better-Rails-Killer easier-to-use/  framework than Jifty or 
(Woodstock|Mojo)?

Seeing these other frameworks mentioned online - just curious.

-- Hugh
-
there are 10 kinds of people: those who understand binary and those who 
don't.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Forms and Plugins and Tutorials, oh my!!

2006-08-22 Thread Kevin Monceaux
Carl,

On Fri, Aug 18, 2006 at 04:09:42PM +0100, Carl Franks wrote:
 
> All contributions will help!
> Working on HTML-Widget-Dojo might be suitable, and of immediate value to
> you.

Sorry, I didn't mean to drop off the radar.  

To make a long story somewhat short I've spent the past few days overhauling
the cpan setup on my main box.  My test box is running FreeBSD 6.1 and
installing Catalyst on it was a snap.  The latest version of Catalyst was
available via the FreeBSD ports collection.  But, my test box is an ancient
Pentium MMX 233 box.  Saying the Catalyst test server ran slow on it would
be a bit of an uderstatement.  

So, I decided it might be more fun, rewarding, and quick to get Catalyst
working on my main box, which has a bit more horsepower.  The box in
question is currently running Gentoo Linux, but will be switched to FreeBSD
as soon as I get some stuff backed up.  After a few days of negotiation
between myself, cpan, and cpanplus I finally have Catalyst running on my
main box.  Like others reported in a recent thread I found some things
installed/upgraded better using plain old cpan and some work better with
cpanplus.  The main cause of problems were packages that had been installed
through Gentoo's package manager, portage.  Cpan and/or cpanplus couldn't
upgrade those packages until I uninstalled them through portage.

> Then you can just try adding a widget to a page, with elements from
> H-W-Dojo.  See if you come across any errors.  Have a look through the
> dojo library to see if there's any other widgets you'd like to add to
> H-W-Dojo.

I'll start tinkering shortly.


Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'

2006-08-22 Thread Jonathan Rockway

Daniel McBrearty wrote:
> it's usually easier to let cpan find the distribution itself. try :
> 
> cpan install My::Module 
> 

This is not the correct way to invoke cpan.  CPAN installs by default;
the command you've listed will install "install" and "My::Module".
install.pm happens to be in "Junoscript-perl", so if you're wondering
why that always installs, it's because you're telling it to install :)

cpan My::Module Another::Module

is the correct invocation.  If you use cpanp, then "install" is required.

Regards,
Jonathan Rockway

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Jonathan Rockway
More CPAN trivia.

The generally-regarded-as-safe way to determine the version of a Module
(as per EUMM, anyway) is:

perl -MModule -e 'print Module->VERSION';

VERSION is provided by UNIVERSAL, so it will always work (even if the
module picked an odd way of declaring its version).  Of course, it could
be overriding VERSION, but hopefully it's not. There isn't actually a
way to get it right every time, but this is the best :)

There was a long discussion about this on perl-qa about a month ago, if
you're interested :)

> What does 
> 
>perl -e 'use Algorithm::C3; print $Algorithm::C3::VERSION'
> 
> say? 

Regards,
Jonathan Rockway

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] multiple row entry

2006-08-22 Thread Nate Wiger
Alan Humphrey wrote:
> All –
> 
> I have a UI problem that I’d like to see how other people deal with.  
> Using the CDs example, imagine a data input page containing fields for 
> the following:
> 
> CD title
> 
> Artist(s)
> 
> Tracks
> 
> There’s one title, 1 or more artists and 1 or more tracks.
> 
> How to you handle the data entry of the tracks and artists?  I’ve 
> thought about an “add” button that would open up a separate page for 
> each track, but that’s clunky.  Is there a better way?  Something Ajaxian?

This is going to sound like a plug, but CGI::FormBuilder supports a 
"growable" option for fields that automatically gives you client side JS 
hooks to do this. You get a button that would say something like 
"Additional Artist" which would append to the DOM more fields of a given 
type on the fly. These inherit any field validation you have specified 
as well (both server and client validation is generated).

FormBuilder is on CPAN and there's a plugin (which may become a 
controller class later) for Catalyst as well. It slots right into the TT 
view.

-Nate (FormBuilder Author)


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] multiple row entry

2006-08-22 Thread A. Pagaltzis
* Alan Humphrey <[EMAIL PROTECTED]> [2006-08-22 18:45]:
> How to you handle the data entry of the tracks and artists?
> I've thought about an "add" button that would open up a
> separate page for each track, but that's clunky. Is there a
> better way? Something Ajaxian?

The oldskool way is to have several more input fields than are
typically necessary, then when the user submits the form, you add
that many new blank fields. Say you start with 3 inputfields for
artists and 10 for tracks; if the user submits the page, you send
him back to the form, which is prepopulated with his inputs and
has 2 blank artist fields and 4 blank track fields, say.

This is cumbersome (mildly), but it’s actually not really
painful.

The fashionable way is indeed to use DHTML (needn’t talk back to
the server, though can do that too if you want to) to add fields
on the fly before the user hits submit.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] multiple row entry

2006-08-22 Thread Alan Humphrey








All –

 

I have a UI problem that I’d like to see how other
people deal with.  Using the CDs example, imagine a data input page
containing fields for the following:

 

CD title

 

Artist(s)

 

Tracks

 

There’s one title, 1 or more artists and 1 or more
tracks.

 

How to you handle the data entry of the tracks and
artists?  I’ve thought about an “add” button that would
open up a separate page for each track, but that’s clunky.  Is there
a better way?  Something Ajaxian?

 

Thanks for your thoughts!

 

- Alan






___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Brandon Black
On 8/22/06, Josef Chladek <[EMAIL PROTECTED]> wrote:
what we notice: in Catalyst/Model/DBIC/Schema.pm the time of therequire of the schema$schema_class->requireis fast for the first loaded schemas (0.05s) but takes about 0.6s forthe last schemas. also time to connect
$self->schema->connection(@{$self->{connect_info}});begins with 0.05s and goes up to 0.6s, so overall the startup processtakes now about 15s for 19 models/schemas.Is this timed under mod_perl, or standalone?  If you're timing it under mod_perl, its probably just getting progressively slower as all of the copies get started up.  If not, can the increasing times be explained by increasing schema complexity?  At "$schema_class->require" is when load_classes runs and you should be mostly seeing Class::C3/Alg::C3/load_components/etc initialization delays (which is what I'm still working on reducing, but it may be a little while).  I'm surprised that ->connection takes any significant time in perl, are you sure this isn't a case of the DB server responding slower and slower?
If you want to find a spot in one of the public modules to improve performance, you should profile your models under Devel::Profile to point out the hotspots.  Make a script which "uses" all of your model classes, then sets up any config on them that was coming from YAML or other such sources (connect_info and/or schema class), then calls ->new on each of them and exits.  Run it w/ "perl -D:Profile 
testscript.pl", then look at the top entries in the generated prof.out.  This example is typical of what I usually see percentage-wise:%Time    Sec. #calls   sec/call  F  name27.67    1.2513  259   
0.004831 Algorithm::C3::merge24.69    1.1163  161   0.006933 Class::C3::_calculate_method_dispatch_table 4.52    0.2042  161   0.001269 Class::C3::_remove_method_dispatch_table 3.64    0.1646
  161   0.001023 Class::C3::_apply_method_dispatch_table 2.97    0.1343   98   0.001370 DBIx::Class::Componentised::ensure_class_loaded 2.75    0.1243 5837   0.21 :...e_perl/5.8.8/Class/C3.pm:146
 1.93    0.0871  482   0.000181 DBIx::Class::AccessorGroup::_mk_group_accessors 1.38    0.0626  183   0.000342 DBIx::Class::Schema::register_sourceIt was based on this kind of feedback that I focused on Alg::C3 first (its time is down substantially from what it used to be, and it might not be possible to make it significantly faster without rewriting it in XS).  Obviously the *_method_dispatch_table methods in Class::C3 are another target that needs looking at (and again, there's some work in progress on this, which involves XS code, but it might not be ready until sometime after YAPC::EU at the least).
-- Brandon
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] load more than 2 yaml files in Catalyst

2006-08-22 Thread Joel Bernstein
On Tue, Aug 22, 2006 at 01:37:49AM +, Fayland Lam wrote:
> Joel Bernstein wrote:
> > On Mon, Aug 21, 2006 at 10:09:10AM +, fayland wrote:
> >> Now I'm using Config::YAML to load more than 2 yaml files in Catalyst, 
> >> but I wonder why ConfigLoader don't support to load more than 2 yaml 
> >> files? (like a.yaml b.yaml c.yaml, but not a.yaml a_local.yaml)
> something like:
> 
> __PACKAGE__->config( file => ['a.yml', 'b.yml', 'c.yml'] );
> 
> It doesn't work for me? What's wrong?

Well, to put it bluntly, it doesn't work because you just made that
interface up. If you read the ConfigLoader synopsis at:
http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.12/lib/Catalyst/Plugin/ConfigLoader.pm#SYNOPSIS

you'll see that the interface expects file => filename, ie a scalar NOT
an arrayref.

However, I've initiated a discussion on the catalyst-dev list about
whether this is a reasonable change to make to the interface, ie for it
to accept either a scalar or an arrayref of scalars. If the dev team
like the idea I'll make up a patch to ConfigLoader.

I'd point out at this point that anything you can do with multiple
config files, you could do with a single one -- what is your rationale
for needing multiple ones? Do you store each class's configuration
separately? I can sort of see the logic in doing that. Please mail the
list back and explain what you're doing with the multiple files, so we
can understand the use case better and see if there's a better way to do
what you need. At the very least it'll help me to make up a patch to get
the behaviour you want.

In summary, then:
1) the interface doesn't work like you think it does...for now anyway
2) you can get around it by rolling your multiple files into a single
one
3) just making up an interface doesn't magically cause it to exist

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] InstantCRUD version 0.0.12

2006-08-22 Thread Zbigniew Lukasiak
I've just uploaded the version 0.0.12 of Instant to PAUSE.  There are quite big changes introduced by Jonas Alvas - like support for many to many relations, authentication etc.  It's all still pretty experimentall, but I'm feeling a bit overwhelmed with testing this all alone so I decided to publish what I've got. I also finally added some tests.
For those with slower mirrors it's at: http://zby.aster.net.pl/Catalyst-Example-InstantCRUD-v0.0.12.tar.gzI am looking forward for any comments.
-- Zbigniew Lukasiakhttp://brudnopis.blogspot.com/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Book Authoring

2006-08-22 Thread Kieren Diment
On 22/08/06, Tobias Kremer <[EMAIL PROTECTED]> wrote:
There has been some discussion about a Catalyst book a while back on thelist and if my memory serves me well, O'Reilly was not interested whichI don't really understand because Catalyst is one of the best things
that ever happened to Perl lately and there are quite a lot of O'ReillyRuby On Rails books for instance.I think some printed stuff would make Catalyst a lot more accessible andwider known - which is almost always a good thing!
So, who's gonna do it? :)There's kind of a plan to do an edited book on an open documentation licence kind of like the TT book ( which is basically repackaged docs with more examples).  I'd kind of volunteered to do this.  The goal is to have something more well formed after the next advent calendar at christmas time. 
In the absence of funding or a publishers advance it ain't going to be quicker than that, but there's a lot of material there - it just needs to be reorganised and expanded a little. 
TobyZitat von Douglas Paterson <[EMAIL PROTECTED]>:>> Hello,>> I'm a Development Editor with Packt Publishing, and I am looking for> potential authors interested in working on a book about the Catalyst
> Framework. If this sounds appealing to you, then please contact me at> [EMAIL PROTECTED] to discuss things further. I look forward to hearing from> you.
___List: Catalyst@lists.rawmode.orgListinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Book Authoring

2006-08-22 Thread Tobias Kremer
I recently started porting our current web application over to Catalyst.
The Catalyst documentation surely has made a big leap forward and is
better than what many other frameworks out there have to offer.

Nevertheless I feel an urgent need for a diverse best practices collection.
While Catalyst eases many tasks, its versatility often makes it kinda hard
to know what's the best way to do something (this is even more cumbering
if you are the only developer who has to decide everything on his/her own).
This is where a book could really come in handy IMHO.

There has been some discussion about a Catalyst book a while back on the
list and if my memory serves me well, O'Reilly was not interested which
I don't really understand because Catalyst is one of the best things
that ever happened to Perl lately and there are quite a lot of O'Reilly
Ruby On Rails books for instance.

I think some printed stuff would make Catalyst a lot more accessible and
wider known - which is almost always a good thing!

So, who's gonna do it? :)

Toby


Zitat von Douglas Paterson <[EMAIL PROTECTED]>:
>
> Hello,
>
> I'm a Development Editor with Packt Publishing, and I am looking for
> potential authors interested in working on a book about the Catalyst
> Framework. If this sounds appealing to you, then please contact me at
> [EMAIL PROTECTED] to discuss things further. I look forward to hearing from
> you.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst Book Authoring

2006-08-22 Thread Douglas Paterson
 
Hello,

I'm a Development Editor with Packt Publishing, and I am looking for
potential authors interested in working on a book about the Catalyst
Framework. If this sounds appealing to you, then please contact me at
[EMAIL PROTECTED] to discuss things further. I look forward to hearing from
you.

Thanks,
 
Douglas Paterson
Development Editor
[Packt Publishing]
www.packtpub.com
 



___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Bypass TT wrapper

2006-08-22 Thread Jason Kohles
On 8/21/06, Tobias Kremer <[EMAIL PROTECTED]> wrote:
Hi list,I have set up a site which utilizes the TTSite defaults for providing a commonheader/footer using TTs wrapper mechanism. What if I want to bypass theheader/footer for certain URLs (specifically, I've forms which are injected
into DIVs via AJAX and those forms are not supposed to have the commonheader/footer around 'em)? Is that possible? Something like Mason'sI handle this by changing the css/js/txt line in the wrapper, to look like this:
    IF template.name.match('\.(css|js|txt)') OR nowrap OR template.nowrap;This way you can disable the wrapping either in the template, by putting [% META nowrap = 1 %], or in the controller, using $c->stash->{ 'nowrap' } = 1.
-- Jason Kohles[EMAIL PROTECTED] - http://www.jasonkohles.com/"A witty saying proves nothing."  -- Voltaire

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Mango

2006-08-22 Thread Christopher H. Laco
Chisel Wright wrote:
> This popped up in one of my feeds - looks like something to keep an eye
> on - I know I'm interested to see the end results:
> 
> http://news.perlfoundation.org/2006/08/grant_approved_mango.html
> 

I just found out this morning. I'm still in shock it was approved, since
I applied more as an exercise of learning than thinking it would get
approved. :-)

Now I _really_ need to get Handel 1.0 done. Let the late nights being.

This is geared as a project to help promote Catalyst+Handel+DBIC, so by
all means, started adding your ideas, comments, features, request etc to
the wiki:

http://handelframework.com/wiki/Mango

-=Chris



signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] how to get started?

2006-08-22 Thread Thomas Hartman
"Finally, as a response to others in the thread, try CPANPLUS::Dist::Deb"Do you have to be running Debian to get use out of this, or will any linux distro do? (I'm running SUSE, and not particularly liking it.)
2006/8/21, Jonathan Rockway <[EMAIL PROTECTED]>:
Strangely, I've never had any trouble installing Catalyst.  I usually do"cpanp install Catalyst::Runtime Catalyst::DevelModule::Install::Catalyst", and I'm set.  Alternatively, I could justrun Makefile.PL
 for one of my Cat apps, and that works as well.  (Butfor various reasons, I don't keep inc/ in revision control, so I have tohave Module::Install installed on the target machine.  So I have toinstall Module::Install::Catalyst first.)
This, BTW, works equally well with plain-old-cpan, but I prefer CPANPLUS.I did have some problems installing the prerequisites for Angerwhale onmy Cygwin setup, but I submitted patches to the relevant projects, so
that shouldn't be a problem for anyone else.  I encourage others to dothe same.  No bug reports, no fixes.  Maintainers aren't psychic.> I've been trying for days to install Catalyst and haven't gotten
> far.  I've tried both "perl -MCPAN 'install Task::Catalyst'" and> cat-install and they both fail with many errors in various> prerequisite modules.  I've tried this on Sun Solaris, NetBSD,
> and Cygwin, and they fail in similar ways on all three>Include error reports, otherwise we have no idea what's wrong.  Plentyof other people are using Catalyst on Solaris, NetBSD, and Cygwin, so
it's not a "known issue" that you're reporting.Finally, as a response to others in the thread, try CPANPLUS::Dist::Debif you want to install CPAN modules as packages.  It works great, butyou have to start from scratch from a clean install.  I tried it for a
while; it wasn't worth the effort.  Muck up your CPAN dependencies, andyour security updates won't work (without uninstalling the CPAN modules,of course). However, if you like to be able to uninstall things, that works great.
Regards,Jonathan Rockway___List: Catalyst@lists.rawmode.orgListinfo: 
http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: 
http://dev.catalyst.perl.org/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Josef Chladek

Am 22.08.2006 um 11:35 schrieb Matt S Trout:

> Lars Balker Rasmussen wrote:
>> On Tue, Aug 22, 2006 at 09:51:31AM +0200, Josef Chladek wrote:
>>> Am 22.08.2006 um 00:54 schrieb Brandon Black:
 Yes, or take a stab at improving the performance yourself of  
 course :)
>>> well, could you point me in the direction where 'most' of the  
>>> time is
>>> spent during startup? is it the connect, checking, preloading, ...?
>>> which module? we might do our best to help...
>>
>> What does
>>
>>perl -e 'use Algorithm::C3; print $Algorithm::C3::VERSION'
>>
>> say?  There have been tremendous speed-ups in DBIC start-times due to
>> recent improvements by Brandon.  (Sorry if I missed this being  
>> covered
>> earlier.)
>
> And in the pathtools stuff which Module::Find uses.
>
> Upgrading to 0.07001 will automatically pull in the relevant  
> versions of stuff
> as depencies.

well, we are running 0.07001, so A::C3 at version 0.04

what we notice: in Catalyst/Model/DBIC/Schema.pm the time of the  
require of the schema

$schema_class->require

is fast for the first loaded schemas (0.05s) but takes about 0.6s for  
the last schemas. also time to connect

$self->schema->connection(@{$self->{connect_info}});

begins with 0.05s and goes up to 0.6s, so overall the startup process  
takes now about 15s for 19 models/schemas.
and: as soon as we put the cat app in the apache config, a restart  
takes very long - apache sends

[Tue Aug 22 14:04:31 2006] [warn] child process x did not exit,  
sending another SIGHUP
[Tue Aug 22 14:04:33 2006] [warn] child process x still did not  
exit, sending a SIGTERM
[Tue Aug 22 14:04:37 2006] [error] child process x still did not  
exit, sending a SIGKILL

for all the running processes - any hint why this happens?

thanks
josef




___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Mango

2006-08-22 Thread Chisel Wright
This popped up in one of my feeds - looks like something to keep an eye
on - I know I'm interested to see the end results:

http://news.perlfoundation.org/2006/08/grant_approved_mango.html

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Matt S Trout
Lars Balker Rasmussen wrote:
> On Tue, Aug 22, 2006 at 09:51:31AM +0200, Josef Chladek wrote:
>> Am 22.08.2006 um 00:54 schrieb Brandon Black:
>>> Yes, or take a stab at improving the performance yourself of course :)
>> well, could you point me in the direction where 'most' of the time is  
>> spent during startup? is it the connect, checking, preloading, ...?  
>> which module? we might do our best to help...
> 
> What does 
> 
>perl -e 'use Algorithm::C3; print $Algorithm::C3::VERSION'
> 
> say?  There have been tremendous speed-ups in DBIC start-times due to
> recent improvements by Brandon.  (Sorry if I missed this being covered
> earlier.)

And in the pathtools stuff which Module::Find uses.

Upgrading to 0.07001 will automatically pull in the relevant versions of stuff 
as depencies.

-- 
  Matt S Trout   Offering custom development, consultancy and support
   Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ways to do stuff and why

2006-08-22 Thread Matt S Trout
Kaare Rasmussen wrote:
>> There is one practical argument for having the business logic in the model
>> - it is the necessity of using it from command line/cron job tools.  I have
> 
> But it's easily overcome if you put your logic in separate modules. I don't 
> think that practical problems like this should dictate your design 
> philosophy.
> 
> More than that, it seems to me that it's a major shortcoming of the MVC model 
> that there's no real good place to put the real beef, the logic. i'd like to 
> keep the model as a persistence layer. The logic I'd put there should only be 
> concerned with keeping data consistent.
> The controller should only be interested in moving things around and the 
> viewer is completely out of the question :-)
> So in my view, business logic, rules, computations (other than simple data 
> twisting) and other stuff that has to be flexible doesn't really fit in. Of 
> course you can have it in the model, but then the model really has two 
> layers, a persistence and a processing layer.

Actually, arguably the Model should be the processing and logic layer - it's a 
*model* of your domain. That it talks to a persistence store of some sort (or 
to something completely different, e.g. a set of network servers in the case 
of an IM app) is merely an implementation detail.

-- 
  Matt S Trout   Offering custom development, consultancy and support
   Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] automatic CRUD (was: how to get started?)

2006-08-22 Thread Carl Franks
On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> fireartist wrote:
> > Many modules, particularly DBI / DBD::SQLite, include C code which
> > needs to be compiled on the target machine.
>
> Ok, now I realize Catalyst isn't what I'm looking for.
>
> I need something more lightweight.  I'm doing this for fun in my
> spare time and wanting something I can host on a cheap web hosting
> provider that only supports perl/CGI/PHP and MySQL but doesn't
> allow compiling and installing my own C software.  Or if there's
> nothing that does what I want in perl or PHP, I could pop for a
> slightly more expensive hosting service that would support Python
> or Java or Ruby on Rails, but still not installing new C software.

You can get even very cheap webhosting with SSH included - if you
don't have SSH, then installing anything will be hard.
In my experience, there's very few hosting packages that don't support
C compilation.
Just log in and type `which cc` or `which gcc` to check whether
there's a C compiler.
If there is, then it's very much harder to install XS perl modules,
than it is pure-perl. Either way, you'll need to create your own
library folder, and set CPAN.pm to install there.
To make sure that any Module::Build based modules install properly,
first use CPAN.pm to install ExtUtils::CBuilder, and everything should
go smoothly.

> What I want should be simple: a utility written entirely in Perl
> or PHP that I'd run once to query the schema of an existing MySQL
> database, which would output a set of new scripts (also entirely
> in Perl or PHP) that would let a user perform basic web-based
> CRUD operations on the tables in the database, preferably using a
> nice, simple MVC design.  Then I could customize those scripts as
> needed.  Does such a utility exist?

I think you'll find very few module's authors avoid XS modules - in
which case it's up to you to check the dependencies.
If you search cpan, there are sometimes pure-perl variants of modules,
e.g. DBD::mysqlPP, DBD::PgPP

I recently installed Fedora Core 5, and was pleasantly surprised that
I just had to type

> sudo cpan
cpan> install ExtUtils::CBuilder
cpan> install Catalyst::Runtime
cpan> install Catalyst::Devel
cpan> install Task::Catalyst

and everything installed with no problems.

Carl

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Lars Balker Rasmussen
On Tue, Aug 22, 2006 at 09:51:31AM +0200, Josef Chladek wrote:
> Am 22.08.2006 um 00:54 schrieb Brandon Black:
> > Yes, or take a stab at improving the performance yourself of course :)
> 
> well, could you point me in the direction where 'most' of the time is  
> spent during startup? is it the connect, checking, preloading, ...?  
> which module? we might do our best to help...

What does 

   perl -e 'use Algorithm::C3; print $Algorithm::C3::VERSION'

say?  There have been tremendous speed-ups in DBIC start-times due to
recent improvements by Brandon.  (Sorry if I missed this being covered
earlier.)
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'

2006-08-22 Thread Matt S Trout
Samuel Baechler wrote:
>> it's usually easier to let cpan find the distribution itself. try :
>>
>> cpan install My::Module 
> well, as i said in my previous mail i tried this too (samuel# cpan 
> install Catalyst::Plugin::Session::Store::FastMmap
> ). but the problem remains the same: cpan can't find the plugin 
> 'Catalyst::Plugin::SessionStateTest'. when i search for it on 
> search.cpan.org i can't find anything. so basically my question is:
> (i) where can i find this plugin?
> (ii) is there a possiblity to install 
> 'Catalyst::Plugin::Session::Store::FastMmap' without 
> 'Catalyst::Plugin::SessionStateTest'?

Actually, what you really need is an answer to (iii):

Why is my cpan mirror fucked?

This was resolved *ages* ago. Try making CPAN.pm use 
http://cpan.shadowcatprojects.net/ and if the problems still persist shout and 
we'll have a poke.

-- 
  Matt S Trout   Offering custom development, consultancy and support
   Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Dispatch matching more than the path?

2006-08-22 Thread Matt S Trout
Garrett Goebel wrote:
> I've been looking at Audrey Tang's Jifty::Plugin::Dispatcher::REST 
> (http://pugs.blogs.com/pugs/2006/07/rhox_slides_las.html) and DHH's 
> "Discovering a world of Resources on Rails" 
> (http://www.loudthinking.com/lt-files/worldofresources.pdf) presentation 
> from the 2006 RoR conference. I'm trying to work up something similar 
> for Catalyst.
> 
> My understanding from reading Catalyst's source, is that its dispatcher 
> exclusively matches on path. I'm finding that I often want to 
> collectively match the path, request method and uri path parameters 
> (i.e., what follows the ';' in the path segments of the path components 
> of the uri). 
> 
> I hacked something into the Path and Regex dispatchers to get collective 
> matching on method and path working in the prototype.

You shouldn't need to hack anything into these; just use a custom ActionClass 
that overrides $action->match to introspect onto the request method and 
anything else you need (this is already how :Args is handled, see the 
Catalyst::Action source for the implementation).

-- 
  Matt S Trout   Offering custom development, consultancy and support
   Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ways to do stuff and why

2006-08-22 Thread Zbigniew Lukasiak
If I reformulate my statement as follow:There is one practical argument not to have the business logic in the controller - it is ...Can we agree?The result I would like to get from this conversation is that I don't see  some point of time controllers with business logic in them at CPAN.
--ZbyszekOn 8/22/06, Kaare Rasmussen <[EMAIL PROTECTED]> wrote:
> There is one practical argument for having the business logic in the model> - it is the necessity of using it from command line/cron job tools.  I haveBut it's easily overcome if you put your logic in separate modules. I don't
think that practical problems like this should dictate your designphilosophy.More than that, it seems to me that it's a major shortcoming of the MVC modelthat there's no real good place to put the real beef, the logic. i'd like to
keep the model as a persistence layer. The logic I'd put there should only beconcerned with keeping data consistent.The controller should only be interested in moving things around and theviewer is completely out of the question :-)
So in my view, business logic, rules, computations (other than simple datatwisting) and other stuff that has to be flexible doesn't really fit in. Ofcourse you can have it in the model, but then the model really has two
layers, a persistence and a processing layer.Each developer has to solve that independently at least until Catalyst willshine as the first MLVC (Model-Logic-View-Controller) system ;-)--Med venlig hilsen
Kaare Rasmussen, JasonicJasonic Telefon: +45 3816 2582Nordre Fasanvej 122000 Frederiksberg  Email: [EMAIL PROTECTED]___
List: Catalyst@lists.rawmode.orgListinfo: http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: 
http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: http://dev.catalyst.perl.org/
-- Zbigniew Lukasiakhttp://brudnopis.blogspot.com/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Serving binary content with Catalyst

2006-08-22 Thread Kentucky Mandeloid Mo.
Hi, all
I have some issue with serving binary content through Cat using FastCGI 
engine.
Sometimes in the server logs appears messages like 
FastCGI sent in stderr: "UTF-16 surrogate 0xd80f 
at /usr/lib/perl/5.8/IO/Handle.pm line 199"

I think FCGI output stream is set to :utf8 somewhere.
So I just need to binmode it to :raw.

Sounds easy but I unable to find a way how to do that other then patch 
Engine::FastCGI.

Actually what I found is that binmode doesn't help at all even if it placed in 
FastCGI.pm just before *STDOUT->syswrite().
What helped was change from syswrite() to write().
However there are notes in the .pm:
"# FastCGI does not stream data properly if using 'print $handle',
# but a syswrite appears to work properly."

Placing 'no warnings "utf8"' just before the syswrite() call doesn't make 
sence too.

The only way to I found is using write() instead of syswrite().

Is there a proper way to serve binary content with Catalyst?






___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ways to do stuff and why

2006-08-22 Thread Kaare Rasmussen
> There is one practical argument for having the business logic in the model
> - it is the necessity of using it from command line/cron job tools.  I have

But it's easily overcome if you put your logic in separate modules. I don't 
think that practical problems like this should dictate your design 
philosophy.

More than that, it seems to me that it's a major shortcoming of the MVC model 
that there's no real good place to put the real beef, the logic. i'd like to 
keep the model as a persistence layer. The logic I'd put there should only be 
concerned with keeping data consistent.
The controller should only be interested in moving things around and the 
viewer is completely out of the question :-)
So in my view, business logic, rules, computations (other than simple data 
twisting) and other stuff that has to be flexible doesn't really fit in. Of 
course you can have it in the model, but then the model really has two 
layers, a persistence and a processing layer.

Each developer has to solve that independently at least until Catalyst will 
shine as the first MLVC (Model-Logic-View-Controller) system ;-)

-- 

Med venlig hilsen
Kaare Rasmussen, Jasonic

Jasonic Telefon: +45 3816 2582
Nordre Fasanvej 12
2000 Frederiksberg  Email: [EMAIL PROTECTED]

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] dbic models and startup time server

2006-08-22 Thread Josef Chladek

Am 22.08.2006 um 00:54 schrieb Brandon Black:

> Yes, or take a stab at improving the performance yourself of course :)

well, could you point me in the direction where 'most' of the time is  
spent during startup? is it the connect, checking, preloading, ...?  
which module? we might do our best to help...


> Are all of your 20 models using the same schema, or is it 20 unique  
> schemas that are truly different? (You could probably shave  
> considerable time by reusing identical schema classes rather than  
> duplicating them, for instance - same goes for identical source  
> classes referenced by multiple schemas).

they are completely different, no duplicate code so far

> Another trick that has helped others is modify your source classes  
> to use a common base which does the load_components part, such as:
>
> lib/MyDBICStuff/SourceBase.pm:
> package MyDBICStuff::SourceBase;
> use base qw/DBIx::Class/;
> __PACKAGE__->load_components(qw/PK::Auto Core/);
> 1;
>
> lib/XMLForm/Schema/BElogs/SomeTable.pm:
> package XMLForm::Schema::BElogs::SomeTable;
> use base qw/MyDBICStuff::SourceBase/;
> __PACKAGE__->table('sometable');
> # ... other usual source definition stuff
> 1;

tried that and changed all Table.pms (a lot of!), but there is no  
noticeable effect
thanks anyway
josef




___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'

2006-08-22 Thread Samuel Baechler
>
> it's usually easier to let cpan find the distribution itself. try :
>
> cpan install My::Module 
well, as i said in my previous mail i tried this too (samuel# cpan 
install Catalyst::Plugin::Session::Store::FastMmap
). but the problem remains the same: cpan can't find the plugin 
'Catalyst::Plugin::SessionStateTest'. when i search for it on 
search.cpan.org i can't find anything. so basically my question is:
(i) where can i find this plugin?
(ii) is there a possiblity to install 
'Catalyst::Plugin::Session::Store::FastMmap' without 
'Catalyst::Plugin::SessionStateTest'?

cheers

sam

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ways to do stuff and why

2006-08-22 Thread Zbigniew Lukasiak
There is one practical argument for having the business logic in the model - it is the necessity of using it from command line/cron job tools.  I have not yet heard a similar argument from the other side - that is for having the logic in the controller.
--ZbyszekOn 8/21/06, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
"Mark Blythe" <[EMAIL PROTECTED]>
08/21/2006 :
> > Matt Trout Wrote:
> > I think the main bone of contention
here is that Len is referring to his
> > persistence layer as the model,
whereas I consider it to just be a persistence
> > layer - stuff like Model::DBIC::Schema
is really only there for simple apps
> > where what you're modeling
*is* the database. If you're modeling a domain,
> > then your Model::* stuff should
be the model of the domain, and whether or not
> > said model happens to use
DBIC stuff as its persistence store should be merely
> > an implementation detail that
the Controller never sees.
> 
> If the controller truly never sees
DBIC stuff, does that mean that
> your model logic never returns
DBIC objects?  For instance, let's say
> you have a logic method called
findBestFit() that's supposed to return
> shoes that fit a given person and
activity the best.  Would it return
> a DBIC ResultSet made up of Shoe
row objects, or would findBestFit()
> deal with those objects only internally
and construct something
> non-DBIC for the return?


In my reality, I want findBestFit()
to return a set of Shoes. The Shoe can be a 
DBIC  mydb::Shoe row object, from
which I'm likely to call vanilla accessors,
or they will be MyDomain::Shoe objects,
each one decorating a mydb::Shoe object,
and containing more shoe logic.

findBestFit() should return objects
that conform to your abstract notion of a shoe.
Then you're insulated from your data
source.

Your business logic should deal with
Shoes.  If using a DBIC Shoe row works for you, 
that's totally cool. But your business
logic should contain one thin layer to insulate 
findBestFit() from the gory details
of your data store.  

Again, I'll make the comparison to DBI/DBD
which emulated ODBC in that you program 
to a general API, and the vendor specific
stuff is under the hood.  So now, your ORM
returns objects instead of hashrefs.
But the specific method of setting up a query
differs from ORM to ORM.  So you
either choose to code to your ORM's API, or write 
a ORM independent access layer.

In my MVC world, the Model is only the
raw data, the Controller is the business logic, 
and the view is the display. The model
simply gets the data from wherever it is stored,
and puts it back when it's done.  The
view shows the data in the model, to the
logs, to the HTML page, etc.  The
controller applies the business logic to the model.
Sometimes the controller changes the
view, other times it does its job silently.
The controller wants to deal in abstractions:
Shoes, Stockroom, ShoppingCart, Discount.
It wants to execute Stockroom.findBestFit(myBigFeet.measurments())
and get back a set
of Shoes to manipulate.

In Catalyst, the model tends to map
one-to-one to my idea of a model. It interacts with
my data store.  The view maps well
also. Here's my stash, work your magic. Now the trick
with the catalyst controller, is not
to put vast amounts of business logic in them.  Use 
them for handling web parameters, but
then allocate business objects and manipulate them.
It's better to instantiate a big wrapper
object, ShoeStore and execute 
ShoeStore.gotAnyAirJordansInMySize(MyFeet),
returning Shoes, which then get plugged into
stash for the view to use, than to write
the whole search in the catalyst action.  Better,
because then you can call you business
objects from any perl program regardless of the
user interface.


Len.
My fingers hurt.



This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.


___List: Catalyst@lists.rawmode.orgListinfo: 
http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/-- 
Zbigniew Lukasiakhttp://brudnopis.