Re: [Catalyst] get the path to the home
On 09/28/2007 07:30 AM, Octavian Rasnita wrote: Hi, I have a I18N module in my Catalyst application and I want to get the path to the home directory of the application. Is it possible to get it without hard codding it in that module? $c-path_to() -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] CMS
On 08/24/2007 10:41 AM, Matt Rosin wrote: 2b. This reduces templates to a list of assets (snippets) called by name interspersed with HTML tags and TT directives. Text snippets would reside in a database and could be edited in a CMS, at least like the utility of 1a/b above. Image pathnames or a single DIV's HTML could also all be stored in the db. The template would just pull the snippets out with a simple $c method like loc in the above I18N modules. A standard facility for editing these things (a module and TT templates) would also be useful. I'm working on such an app right now, except that snippets are kept in SVN instead of a database. The idea is to allow .tt files to be edited via web UI, storing metadata in each .tt file in a special reserved hash. Still deciding on which JS UI toolkit to use. Leaning toward TinyMCE. Hardest part (right now) is figuring out how to provide real-time re-use of other .tt files (via PROCESS) within the .tt file being edited. So a user could (e.g.) pick a snippet from a dropdown list and insert it, and then see the rendered text immediately. But on save, only the [% PROCESS foo %] gets written. Oh, and images. :) -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] New auth stuff and LDAP store...
On 07/21/2007 10:02 PM, Jay K wrote: For the benefit of the list: This issue has been resolved. It turned out to be a disagreement between what C::P::Authenticaiton was trying to place in $user-store () and what LDAP was trying to place in $user-store() LDAP was correct, and C::P::Authentication should keep it's grubby little hands off of $user-store() - I am pushing a maintenance release of C::P::Authentication to CPAN now. Should be available from CPAN in a few hours. I am now trying to use ::Store::LDAP 0.04 with ::Authentication 0.10002 and I cannot seem to get the config right. I just asked about this on #catalyst and was advised to use the older pre-0.1 base Authentication plugin. I have a feeling I'm just not getting the config right. But if it is is more systemic than that, and the LDAP plugins need some help getting up to the latest Authentication API, I have tuits to spend on it and would gladly contribute code/tests/docs if I was told those were needed, and given a pointer to where to start. TIA -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] CatalystX::CRUD
On 09/23/2007 11:24 AM, Matt S Trout wrote: On Fri, Sep 21, 2007 at 08:57:35AM -0500, Peter Karman wrote: CXCM subclasses would need to implement at least the following methods: * new_object - returns CatalystX::CRUD::Object-new() * fetch - returns CatalystX::CRUD::Object-new()-read() * search - returns zero or more CXCO instances as an arrayref * interator - like search() but returns an iterator * count - like search() but returns an integer Have you looked at the way the Handel storage stuff works? That already supports both DBIC and RDBO so might be an interesting start. I have looked through it (I had to figure out that Handel-Storage-RDBO is packaged separately...) and it looks like the base Storage API is much more complex and full-featured than what I am suggesting. But all the methods I mention are there in one or another. I'll probably dig in to the DBIC implementation when/if I need help with that part of CXCM (/me hoping not write that all by myself...). Do you have any thoughts on how to paper over DBIC's ability to chain searches vs. the lack of that feature in RDBO? I know most RDBO users don't feel they're deprived not having it but DBIC users are generally fairly addicted :) I've read about that feature difference in the mail archives, but since I haven't used DBIC myself, other than to just play for about an hour, I'm not sure what the equivalent RDBO code would look like. I do all kinds of multiple relationships in my RDBO code, where I chain together method calls to get at related data. Is the difference that RDBO might be making multiple db calls, whereas DBIC doesn't? For example, in your reply to Perrin you used this example: This sort of thing in DBIC just becomes $posts_rs = $users_rs-search_related('posts'); In RDBO, if I wanted all the posts for a given user, I might just say: $posts = $user-posts; So how is that different? Because $users_rs might represent multiple users? If so, yes RDBO would require something a little longer, like: map { push @posts, $_-posts } @$users; Which, depending on if I pre-fetched the posts when creating $users, might end up being lots more trips to the db. And it doesn't give me $posts_iterator, which might be preferable to @posts. But I think for the purposes of this CatalystX::CRUD proposal, the harder issues are going to be abstracting the conversion of $c-params() to what gets passed to search(), iterator(), count(), etc. Right now that is all very RDBO-specific in CCR::Search. Couldn't the whole DBIC search_related issue just be resolved by pushing the issue out into the controller and/or view space? In your CCR::Search subclass: my $results = $c-model('My::CatX::CRUD::Model::DBIC') -search(@params)-search_related('foo'); -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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::Controller::Rose::Simple = CatalystX::RoseIntegrator
On 09/23/2007 10:36 AM, Alexandre Jousset wrote: Hello list, Following the preceding discussion, I scheduled Catalyst::Controller::Rose::Simple for deletion on CPAN and uploaded the same module under the name CatalystX::RoseIntegrator. Please wait the time required for it to show up. Thank you. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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::Model::Search
On 09/23/2007 11:28 AM, Marcus Ramberg wrote: Catalyst::Model::Search is a quite old module which have been living in Catalyst trunk for quite a while. It's being used by MojoMojo, and it just happened to work, so I pushed it to CPAN so that MojoMojo could depend on it. If anyone want to clean it up or document the Search base class, patches are more than welcome. See attached. I'd like to also suggest that C::M::Search, C::M::Search::Results and C::M::Search::Item be de-coupled from all the Lucene and Plucene classes that are currently bundled with them. That way someone could install C::M::Search and get all they need to implement a new subclass, without also needing to satisfy all the Plucene dependencies. cheers, pek -- Peter Karman . [EMAIL PROTECTED] . http://peknet.com/ --- Search.pm.orig 2007-09-24 10:33:51.534326000 -0500 +++ Search.pm 2007-09-24 10:56:49.088527000 -0500 @@ -4,69 +4,151 @@ use NEXT; use base qw/Catalyst::Base/; -our $VERSION = '0.01'; +our $VERSION = '0.02'; -sub new { +sub new { my ( $self, $c ) = @_; - -return $self-NEXT::new( $c ); +$self-init($c); +return $self-NEXT::new($c); } sub init { my $self = shift; - +my $c= shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement init()' -); +message = ( ref $self || $self ) . ' does not implement init()' ); } sub add { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement add()' -); +message = ( ref $self || $self ) . ' does not implement add()' ); } sub update { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement update()' -); +message = ( ref $self || $self ) . ' does not implement update()' ); } sub remove { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement remove()' -); +message = ( ref $self || $self ) . ' does not implement remove()' ); } sub query { -my $self = shift; - +my $self = shift; +my $query = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement query()' -); +message = ( ref $self || $self ) . ' does not implement query()' ); } sub is_indexed { my $self = shift; - -Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement is_indexed()' -); +my $key = shift; + +Catalyst::Exception-throw( message = ( ref $self || $self ) +. ' does not implement is_indexed()' ); } sub optimize { my $self = shift; - -Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement optimize()' -); + +Catalyst::Exception-throw( message = ( ref $self || $self ) +. ' does not implement optimize()' ); } 1; __END__ + + +=head1 NAME + +Catalyst::Model::Search - base class for Catalyst search models + +=head1 SYNOPSIS + + package Catalyst::Model::MySearchApp; + use base qw(Catalyst::Model::Search); + + # must implement all the following methods + sub init {} + sub add{} + sub update {} + sub remove {} + sub query {} + sub is_indexed {} + sub optimize {} + +=head1 DESCRIPTION + +Catalyst::Model::Search is a base class for providing full-text search +to a Catalyst application. The premise is that existing search projects +can be integrated with Catalyst's Model framework using a common API, allowing +you to swap in Xapian or KinoSearch or Plucene or Swish-e or +IYourSearchAppHere without needing to change any Controller or View code. + +=head1 METHODS + +The following methods are implemented. Those methods +that must be overridden in your subclass are marked as such. + +=head2 new + +The basic boilerplate new() required by Catalyst::Model subclasses. +The init() method is called by new(). + +=head2 init + +Setup your search indexes or any other initialization required. +BThis method must be overridden. + +=head2 add( Idata ) + +Add Idata to an index. + +=head2 update( Idata ) + +Update Idata in an index. + +=head2 remove( Idata ) + +Remove Idata from an index. + +=head2 query ( Iquery ) + +Search an index for Iquery. In scalar context should return +a Catalyst::Model::Search::Results object. In array context should +return the value of a Results object's get_items() method. + +=head2 is_indexed( Ikey ) + +Test the index for the presence of a record identified by Ikey +Returns true if the record is in the index. + +=head2 optimize + +Perform optimizing magic on the index. + +=head1 AUTHOR + +Andy Grundman, [EMAIL PROTECTED] +Marcus Ramberg, [EMAIL PROTECTED] + +=head1 COPYRIGHT + +This program is free software, you can
Re: [Catalyst] Catalyst::Model::Search
On 09/24/2007 11:02 AM, Peter Karman wrote: On 09/23/2007 11:28 AM, Marcus Ramberg wrote: Catalyst::Model::Search is a quite old module which have been living in Catalyst trunk for quite a while. It's being used by MojoMojo, and it just happened to work, so I pushed it to CPAN so that MojoMojo could depend on it. If anyone want to clean it up or document the Search base class, patches are more than welcome. See attached. oops. Forgot to include the 'required' boilerplate. new version attached. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.com/ --- Search.pm.orig 2007-09-24 10:33:51.534326000 -0500 +++ Search.pm 2007-09-24 11:16:11.646096000 -0500 @@ -4,69 +4,157 @@ use NEXT; use base qw/Catalyst::Base/; -our $VERSION = '0.01'; +our $VERSION = '0.02'; -sub new { +sub new { my ( $self, $c ) = @_; - -return $self-NEXT::new( $c ); +$self-init($c); +return $self-NEXT::new($c); } sub init { my $self = shift; - +my $c= shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement init()' -); +message = ( ref $self || $self ) . ' does not implement init()' ); } sub add { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement add()' -); +message = ( ref $self || $self ) . ' does not implement add()' ); } sub update { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement update()' -); +message = ( ref $self || $self ) . ' does not implement update()' ); } sub remove { my $self = shift; - +my $data = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement remove()' -); +message = ( ref $self || $self ) . ' does not implement remove()' ); } sub query { -my $self = shift; - +my $self = shift; +my $query = shift; + Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement query()' -); +message = ( ref $self || $self ) . ' does not implement query()' ); } sub is_indexed { my $self = shift; - -Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement is_indexed()' -); +my $key = shift; + +Catalyst::Exception-throw( message = ( ref $self || $self ) +. ' does not implement is_indexed()' ); } sub optimize { my $self = shift; - -Catalyst::Exception-throw( -message = ( ref $self || $self ) . ' does not implement optimize()' -); + +Catalyst::Exception-throw( message = ( ref $self || $self ) +. ' does not implement optimize()' ); } 1; __END__ + + +=head1 NAME + +Catalyst::Model::Search - base class for Catalyst search models + +=head1 SYNOPSIS + + package Catalyst::Model::MySearchApp; + use base qw(Catalyst::Model::Search); + + # must implement all the following methods + sub init {} + sub add{} + sub update {} + sub remove {} + sub query {} + sub is_indexed {} + sub optimize {} + +=head1 DESCRIPTION + +Catalyst::Model::Search is a base class for providing full-text search +to a Catalyst application. The premise is that existing search projects +can be integrated with Catalyst's Model framework using a common API, allowing +you to swap in Xapian or KinoSearch or Plucene or Swish-e or +IYourSearchAppHere without needing to change any Controller or View code. + +=head1 METHODS + +The following methods are implemented. Those methods +that must be overridden in your subclass are marked as such. + +=head2 new + +The basic boilerplate new() required by Catalyst::Model subclasses. +The init() method is called by new(). + +=head2 init + +Setup your search indexes or any other initialization required. +BThis method must be overridden. + +=head2 add( Idata ) + +Add Idata to an index. +BThis method must be overridden. + +=head2 update( Idata ) + +Update Idata in an index. +BThis method must be overridden. + +=head2 remove( Idata ) + +Remove Idata from an index. +BThis method must be overridden. + +=head2 query ( Iquery ) + +Search an index for Iquery. In scalar context should return +a Catalyst::Model::Search::Results object. In array context should +return the value of a Results object's get_items() method. +BThis method must be overridden. + +=head2 is_indexed( Ikey ) + +Test the index for the presence of a record identified by Ikey +Returns true if the record is in the index. +BThis method must be overridden. + +=head2 optimize + +Perform optimizing magic on the index. +BThis method must be overridden. + +=head1 AUTHOR + +Andy Grundman, [EMAIL PROTECTED] +Marcus Ramberg, [EMAIL PROTECTED] + +=head1 COPYRIGHT + +This program is free software, you can redistribute it and/or modify
RE: [Catalyst] New auth stuff and LDAP store...
On 09/24/2007 09:55 AM, Alan Humphrey wrote: Here's what's working for me: authentication: default_realm: users realms: users: credential: class: 'Password' password_type: 'self_check' store: class: LDAP::Backend ldap_server: 'ldap://localhost:389' user_basedn: 'dc=birdwebdev,dc=dnsalias,dc=org' binddn: 'cn=admin,dc=birdwebdev,dc=dnsalias,dc=org' bindpw: 'x' Note in particular the store class name. FWIW, I'm using OpenLDAP. Thanks. That works. I'm using OpenLDAP too. However, I'm concerned about a few things. (1) the LDAP documentation is wrong. (2) in grokking the Authentication.pm code, I see that the LDAP modules are still working by virtue of a lot of code labeled 'BACKWARDS COMPATABILITY' and 'old-style' and warnings about the interface eventually disappearing. These include get_user() instead of the newer find_user() et al. As I have the time (and who knows how long that will last...), I'd still like to bring the LDAP plugins up to speed. I'll hack on it a bit today and see where I get. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] New auth stuff and LDAP store...
On 09/24/2007 11:55 AM, Peter Karman wrote: As I have the time (and who knows how long that will last...), I'd still like to bring the LDAP plugins up to speed. I'll hack on it a bit today and see where I get. These patches seem to bring the LDAP plugins up the latest Authentication API, to support realms, etc. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.com/ --- /home/msi/pek/perl/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/Authentication/Store/LDAP/Backend.pm 2006-03-21 17:31:19.0 -0600 +++ lib/Catalyst/Plugin/Authentication/Store/LDAP/Backend.pm 2007-09-24 12:19:06.36691 -0500 @@ -75,6 +75,8 @@ use strict; use warnings; +our $VERSION = '0.02'; + use Catalyst::Plugin::Authentication::Store::LDAP::User; use Net::LDAP; @@ -115,10 +117,24 @@ return $self; } +=head2 find_user($id) + +Creates a LCatalyst::Plugin::Authentication::Store::LDAP::User object +for the given User ID. This is the preferred deprecated mechanism for getting a +given User out of the Store. + +=cut + +sub find_user { +my ( $self, $authinfo, $c ) = @_; +return $self-get_user( $authinfo-{id} || $authinfo-{username} ); +} + + =head2 get_user($id) Creates a LCatalyst::Plugin::Authentication::Store::LDAP::User object -for the given User ID. This is the preferred mechanism for getting a +for the given User ID. This is the old deprecated mechanism for getting a given User out of the Store. =cut --- /home/msi/pek/perl/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/Authentication/Store/LDAP.pm 2006-03-21 17:31:39.0 -0600 +++ lib/Catalyst/Plugin/Authentication/Store/LDAP.pm 2007-09-24 12:09:49.138025000 -0500 @@ -5,28 +5,14 @@ use strict; use warnings; -our $VERSION = '0.04'; +our $VERSION = '0.05'; use Catalyst::Plugin::Authentication::Store::LDAP::Backend; -sub setup { -my $c = shift; - -if (exists($c-config-{'authentication'})) { -unless (exists($c-config-{'authentication'}-{'ldap'})) { -Catalyst::Exception-throw(I require \$c-config-{'authentication'}-{'ldap'} to be configured.); -} -} else { -Catalyst::Exception-throw(I require \$c-config-{'authentication'}-{'ldap'} to be configured.); -} - -$c-default_auth_store( -Catalyst::Plugin::Authentication::Store::LDAP::Backend-new( -$c-config-{'authentication'}-{'ldap'} -) -); - - $c-NEXT::setup(@_); +sub new { +my ( $class, $config, $app ) = @_; +return Catalyst::Plugin::Authentication::Store::LDAP::Backend-new( +$config); } __PACKAGE__; @@ -84,7 +70,10 @@ sub login : Global { my ( $self, $c ) = @_; -$c-login( $c-req-param(login), $c-req-param(password), ); +$c-authenticate({ +id = $c-req-param(login), +password= $c-req-param(password) + }); $c-res-body(Welcome . $c-user-username . !); } @@ -122,29 +111,37 @@ # Config for Store::LDAP authentication: -ldap: -ldap_server: ldap.yourcompany.com -ldap_server_options: -timeout: 30 -binddn: anonymous -bindpw: dontcarehow -start_tls: 1 -start_tls_options: -verify: none -user_basedn: ou=people,dc=yourcompany,dc=com -user_filter: ((objectClass=posixAccount)(uid=%s)) -user_scope: one -user_field: uid -user_search_options: -deref: always -use_roles: 1 -role_basedn: ou=groups,ou=OxObjects,dc=yourcompany,dc=com -role_filter: ((objectClass=posixGroup)(memberUid=%s)) -role_scope: one -role_field: uid -role_value: dn -role_search_options: -deref: always +default_realm: ldap +realms: +ldap: +credential: +class: Password +password_field: password +password_type: self_check +store: +class: LDAP +ldap_server: ldap.yourcompany.com +ldap_server_options: +timeout: 30 +binddn: anonymous +bindpw: dontcarehow +start_tls: 1 +start_tls_options: +verify: none +user_basedn: ou=people,dc=yourcompany,dc=com +user_filter: ((objectClass=posixAccount)(uid=%s)) +user_scope: one +user_field: uid +user_search_options: +deref: always +use_roles: 1 +role_basedn: ou=groups,ou=OxObjects,dc=yourcompany,dc=com +role_filter: ((objectClass=posixGroup)(memberUid=%s
Re: [Catalyst] New auth stuff and LDAP store...
On 09/24/2007 12:22 PM, Peter Karman wrote: On 09/24/2007 11:55 AM, Peter Karman wrote: As I have the time (and who knows how long that will last...), I'd still like to bring the LDAP plugins up to speed. I'll hack on it a bit today and see where I get. These patches seem to bring the LDAP plugins up the latest Authentication API, to support realms, etc. heh. that should be 'preferred' not 'preferred deprecated'. :/ +=head2 find_user($id) + +Creates a LCatalyst::Plugin::Authentication::Store::LDAP::User object +for the given User ID. This is the preferred deprecated mechanism for getting a +given User out of the Store. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] Re: Announce: CatalystX::Controller::reCAPTCHA
Kieren Diment wrote on 9/24/07 7:17 PM: Thanks to mst clarifying what the CatalystX namespace is for [snip] I, for one, would benefit from that clarification. Matt, can you fill me [us] in? -- Peter Karman . http://peknet.com/ . [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/
[Catalyst] Catalyst::Model::Search
I see Catalyst::Model::Search on CPAN now. As the maintainer of Catalyst::Model::SWISH, I'd love to get in on that namespace action. Is Catalyst::Model::Search intentionally undocumented? Are there plans for a formal API to which subclasses of Catalyst::Model::Search must adhere? signed, a search junkie -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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] CatalystX::CRUD
I've been thinking the last couple days about ways to expand Catalyst::Controller::Rose to play more nicely with other models besides C::M::RDBO. This is per mst's request to open up the RHTMLO goodness to non-RDBO users, and because I now find myself wanting the same thing. I have a model that isn't RDBO that I'd like to use in a project. So I'm proposing the following -- comments/criticism welcome. * CatalystX::CRUD::Model (CXCM) A base class for CRUD-like models. CXCM isa Catalyst::Model. Any CXCM subclass could be used with the C::C::Rose classes (or any other controller that decided to adhere to the CXCM API). C::M::RDBO would become a CXCM subclass. CXCM subclasses would need to implement at least the following methods: * new_object - returns CatalystX::CRUD::Object-new() * fetch - returns CatalystX::CRUD::Object-new()-read() * search - returns zero or more CXCO instances as an arrayref * interator - like search() but returns an iterator * count - like search() but returns an integer (For those following along at home, you'll notice that's basically the C::M::RDBO API.) * CatalystX::CRUD::Object (CXCO) A base class for objects returned by CatalystX::CRUD::Model subclasses. In the case of RDBO, this would just be a thin wrapper class that 'hasa' RDBO object. So e.g. calling create() or update() on a CatalystX::CRUD::Object::RDBO object would just look something like: sub create { my $self = shift; # CXCO object $self-rdbo-save(@_); } # same thing for update() CXCO subclasses would need to implement at least the following methods: * create- write a new object to store * read - load a new object from store * update- save an existing object to store * delete- remove an existing object from store (How original! CRUD!) You'll notice that the required CXCO methods are intentionally few. I assume that subclasses would want to also provide accessors to any underlying objects so that controllers could act directly on them (e.g., the rdbo() method in the above create example). I imagine that there could then be classes like: CatalystX::CRUD::Model::DBIC CatalystX::CRUD::Object::DBIC CatalystX::CRUD::Model::CDBI CatalystX::CRUD::Object::CDBI etc., that would all play nicely with C::C::Rose. Thoughts? -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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::Model::Search
On 09/21/2007 09:39 AM, Jonathan Rockway wrote: Peter Karman wrote: I see Catalyst::Model::Search on CPAN now. As the maintainer of Catalyst::Model::SWISH, I'd love to get in on that namespace action. Is Catalyst::Model::Search intentionally undocumented? Are there plans for a formal API to which subclasses of Catalyst::Model::Search must adhere? People can upload whatever they want to CPAN for any reason with any name :) Please mail the maintainer directly and collaborate with him. If there's something seriously wrong with the module (no docs for an important namespace like Search is a good reason), please let the core team know on the dev list, and we'll do what we can to make sure the users of the module have the best experience possible. The C::M::Search package is under Marcus Ramberg's acct, though the author listed in the POD is Andy Grundman. Since both those gentlemen are core devs, I figured this list was as good as any, especially since the resulting conversation might be of interest to all Catalyst users. But I'll write to them directly as you suggest. Collaboration is the key. Modules that one guy uploads to the CPAN on a whim are rarely useful. amen. That's why I asked. :) Finally, what do you envision for the ::Search namespace? A common interface to various search mechanisms? Exactly. My original question, though, was more along the lines of what do the *maintainers* envision for the namespace. 'Search' is (as you point out) an important namespace, and the idea of a uniform API for writing models seems like a Good Idea. The lack of documentation was what piqued me. -- Peter Karman . [EMAIL PROTECTED] . http://peknet.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::Controller::Rose::Simple
Alexandre Jousset wrote on 9/20/07 11:41 AM: Hello Matt, Matt S Trout wrote: Feel free to ask me any question you want. Why haven't you submitted patches to the existing C-C-Rose? Any module called '-Simple' usually means there was an existing module that worked but I'm too lazy to patch it - please justify why that isn't the case here :) Well, I wasn't meaning that kind of question but hey, I said any question you want ;-)... Seriously, this is of course a good question, so here is my answer. I'm sure I haven't your experience but for me (and also for Peter Karman, C::C::Rose author), the suffix ::Simple (suggested by him) means Take all that [what already exists, i.e. Catalyst and Rose] and make it simpler to use together. Alexandre, Actually, I had suggested you use ::Simple because in your original email to me, (a) you had indicated you intended to use C::C::Rose, but with an API similar to the FormBuilder philosophy, and (b) you had a working title of C::C::Rose::FormManager, which I thought would be misleading, since all the existing C::C::Rose::* classes also manage forms. As you indicate below, you don't use any of the C::C::Rose code, design or philosophy, so sharing the namespace seems misleading at the very least. So I'd prefer it if you used a difference namespace altogether. I believe the latest best practice recommendation is to use the CatalystX top-level space. Perhaps something like CatalystX::RHTMLOManager or similar. In fact I don't even use its modules in mine since the goals are not the same and the functionalities don't overlap. The key point is that you can see it as the C::C::FormBuilder module reimplemented for Rose (and that was really the case). At first, on Peter's advice, I looked at C::C::Rose::* but I did not found anything relevant for what I was trying to do. I'd like to encourage you in your efforts at making the Rose projects easier to use with Catalyst. Since you've got a different approach to what easy means than I do, starting with a namespace that clearly delineates your project from mine seems to be in your best interest. pek -- Peter Karman . http://peknet.com/ . [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] CMS
That would be good. I went through this exercise a while ago and ended up using CMS Made Simple (a PHP app) because it was easy for end users to understand and there were a lot of plugins you could auto-install. Plus I only had 2 weeks to develop a system. I found Bricolage too complex and powerful to use for a simple CMS system. CMSMS wouldn't be a bad place to start from, doing a straight rewrite. I think a lot of the difficulty is in the design issues for stylesheets, templates, cross-browser Javascript and how they fit together with code plugins. Regards, Peter Dragonstaff Limited http://www.dragonstaff.com http://www.dragonstaff.com/ Business IT Consultancy _ For while I've been thinking it would be nice to have a Cat-based CMS with multiple features built on top of a platform. The platform can include basic things like Authn, Authz, Sessions, a basic user schema and pre-built HTML. The pre-built HTML can include controllers/templates/etc for registration, login/logout, openid, etc. Then on top of the platform you can have plug-and-play features like forums, blogs, photo galleries, surveys etc. If it was built the right way, you could have your choice of forums, etc. You can also only load the features that you want. I'm not sure how easy this would be to do but I think it would be neat. -- John Wang http://www.dev411.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] C::P::Authentication IE Problem - Time Issue
I was experiencing a weird annoyance with C::P::Authentication today. I saw reports of similar symptoms in the list, but nobody with my particular solution. In Firefox everything was working fine, but in all the IE browsers auth cookies weren't being stored. Eventually I grabbed a HTTP Session inspector to see how the cookies were being set. The expire time on the cookies was sent as GMT several hours in the past. What I've done before is send the server time as part of the login screen and use some Javascript to warn if the server time is more than a set time away from the client PC time. Sometimes it's server time drift, sometimes client PC time drift. It's annoying that IE simply drops a historic cookie without warning and then you think the user is typing the password wrong. As a side note, is there a way to control the session length of the authentication cookie? In your conf set: cookie_expires http://search.cpan.org/author/NUFFIN/Catalyst-Plugin-Session-State-Cookie-0. 07/lib/Catalyst/Plugin/Session/State/Cookie.pm You can set session expiry with conf: expires http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-0.18/lib/Catalyst/Plu gin/Session.pm You also need to extend an expiring cookie by calling session_expires() somewhere (e.g. in auto :Private in your main controller) to resend it otherwise by default it times out after 2 hours. Regards, Peter ___ 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 server-dependent static content
Good afternoon - I am working on a Catalyst application that serves dynamic website content for multiple sites, and I've run into some difficulty about static content. Each website has unique static content (images, css, rss) and I am trying to serve that static content from the site's unique directory. I have found lots of documentation on how to serve all static content from a single directory, but not much on a servername-dependent directory. For example: Request: http://www.timjohnson.com/css/global.css Should be served with: /var/www/html/sites/timjohnson.com/css/global.css I came close to making this happen just using the Alias directive in httpd.conf, but I couldn't get that to accept a variable, %{SERVER_NAME}, in it. If someone has a solution from the Apache side, that's fine but I suspect that it might be easier to do this with Catalyst::Plugin::Static::Simple, though I again have not figured out how to tell it to use a variable name when it creates the path the request is supposed to be mapped to. I am sending this to the Catalyst list because I suspect it might be something other people have faced before using Catalyst. My setup is a recent version of Catalyst running on Apache 2.2 with mod_perl. Any suggestions would be quite welcome - thank you very much. Peter Lytle _ Blue Campaign Solutions Peter Lytle, Principal [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.bluecampaigns.com http://www.bluecampaigns.com/ Phone: 202.742.2737 Cell: 614.893.4603 Fax: 866.727.1883 http://www.bluecampaigns.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] Problems forwarding to view
Adeola Awoyemi wrote on 8/2/07 6:12 AM: Hi all, I'm trying to use Catayst::View::XSLT and my end sub looks like this: # from MyApp::Controller::Root sub end : Private { my ( $c, $self ) = @_; $c-forward( $c-view('XSLT') ); } my ($self, $c) = @_; you got 'em reversed. -- Peter Karman . http://peknet.com/ . [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] Test server as a child process
Try using IPC::Run. I can see the You can connect message when using it to run scripts/myapp_server.pl (I guess it goes through ptys?) Regards, Peter -Original Message- From: Ivan Fomichev [mailto:[EMAIL PROTECTED] Sent: 31 July 2007 09:34 To: catalyst@lists.rawmode.org Subject: [Catalyst] Test server as a child process Hello, I intend to write a script, that would start the test server as a child process and then run tests. The thing I'm failing to do is to get output from the test server in order to determine, when the server has started. The problem is that test server doesn't print its prompt (You can connect to your server at http://localhost:3000;) when run as a child process :-( I dug Catalyst's sources, but didn't understood much. I put 'sleep' in parent process for now, but I don't like it. Could anyone suggest an adequate work-around? Thank you in advance. ___ 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 Newbie - Installation/Quickstart Issues -Vista
This issue is discussed here http://www.gossamer-threads.com/lists/catalyst/users/15143?search_string=str ftime; and is caused by a bug in ASPerl. Try patching Helper.pm as follows and see if it works then. Regards, Peter For the sake of saving the next soul who wants to use Catalyst under Win32, which apparently doesn't like %T, suggest changing to: my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time); --- Helper.pm Wed Jul 11 03:24:55 2007 +++ Helper.pm.orig Mon Oct 30 18:00:42 2006 @@ -387,7 +387,7 @@ sub _mk_changes { my $self = shift; my $dir = $self-{dir}; - my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time); + my $time = strftime('%Y-%m-%d %T', localtime time); $self-render_file( 'changes', $dir\/Changes, { time = $time } ); } _ From: Jamie Nicholson [mailto:[EMAIL PROTECTED] Sent: 26 July 2007 22:53 To: catalyst@lists.rawmode.org Subject: [Catalyst] Catalyst Newbie - Installation/Quickstart Issues -Vista Hi, I'm trying to install Catalyst on a new laptop which is running Vista, Activestate - v5.8.8 - build [820]. After installing the catalyst-devel via ppm I've tried to run the 'perl catalyst.pl MyApp' command but it just seems to hang, unless that's what it's meant to do. perl catalyst.pl MyApp Output created MyApp created MyApp\script created MyApp\lib created MyApp\root created MyApp\root\static created MyApp\root\static\images created MyApp\t created MyApp\lib\MyApp created MyApp\lib\MyApp\Model created MyApp\lib\MyApp\View created MyApp\lib\MyApp\Controller created MyApp\myapp.yml created MyApp\lib\MyApp.pm created MyApp\lib\MyApp\Controller\Root.pm created MyApp/README I figured this must of been the way I installed it so I've tried several different web links, via ppm everything installs ok, but the example above just hangs or I can't get to the end of the maze so to speak. Links I've tried http://lists.rawmode.org/pipermail/catalyst/2005-April/000119.html - was close on this one, using the hops db http://catalyst.infogami.com/install/windows - couldn't get the quickstart going http://www.shadowcatsystems.co.uk/static/cat-install - balked on the command line length, so i installed cygwin and it complained as well Extra PPM Repositories used trouchelle.com theoryx5.uwinnipeg.ca Thats about it, any help, hints or tips would be appreciated. I'm thinking a new OS is probably the best place to start :) Thanks Jamie ___ 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 Newbie - Installation/Quickstart Issues -Vista
Regards, Peter Dragonstaff Limited http://www.dragonstaff.com/ http://www.dragonstaff.com Business IT Consultancy Technology House, 151 Silbury Boulevard, Central Milton Keynes, Bucks MK9 1LH, UK Skype: callto://Peter.Edwards/ Peter.Edwards Tel/Fax: 0845 0537418 Direct: 01908 424400 Mob: 07986 842718 _ From: Jamie Nicholson [mailto:[EMAIL PROTECTED] Sent: 26 July 2007 22:53 To: catalyst@lists.rawmode.org Subject: [Catalyst] Catalyst Newbie - Installation/Quickstart Issues -Vista Hi, I'm trying to install Catalyst on a new laptop which is running Vista, Activestate - v5.8.8 - build [820]. After installing the catalyst-devel via ppm I've tried to run the 'perl catalyst.pl MyApp' command but it just seems to hang, unless that's what it's meant to do. perl catalyst.pl MyApp Output created MyApp created MyApp\script created MyApp\lib created MyApp\root created MyApp\root\static created MyApp\root\static\images created MyApp\t created MyApp\lib\MyApp created MyApp\lib\MyApp\Model created MyApp\lib\MyApp\View created MyApp\lib\MyApp\Controller created MyApp\myapp.yml created MyApp\lib\MyApp.pm created MyApp\lib\MyApp\Controller\Root.pm created MyApp/README I figured this must of been the way I installed it so I've tried several different web links, via ppm everything installs ok, but the example above just hangs or I can't get to the end of the maze so to speak. Links I've tried http://lists.rawmode.org/pipermail/catalyst/2005-April/000119.html - was close on this one, using the hops db http://catalyst.infogami.com/install/windows - couldn't get the quickstart going http://www.shadowcatsystems.co.uk/static/cat-install - balked on the command line length, so i installed cygwin and it complained as well Extra PPM Repositories used trouchelle.com theoryx5.uwinnipeg.ca Thats about it, any help, hints or tips would be appreciated. I'm thinking a new OS is probably the best place to start :) Thanks Jamie ___ 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] Re: Announce: Catalyst::Plugin::Authentication 0.10000 Released
Just an announcement that the new Authentication plugin is finally released! It is available here: Also - thanks in advance to all the folks who are about to update and will soon send their bug reports and feature requests now that it's out in the wild as a release. Cheers! JayK I upgraded an app to use this today, authenticating with crypted Unix type password and using the new DBIx::Class storage module. It was easy to understand the documentation and was a smooth change. I like being able to auth against different realms so I could do some from Unix /etc/passwd and some from LDAP/Active Directory Server. Regards, Peter Dragonstaff Limited http://www.dragonstaff.com Business IT Consultancy ___ 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] Re: [RHTMLO] RDBO/RHTMLO integration with Catalyst - work in progress
Matt S Trout wrote on 7/22/07 12:48 PM: On Sat, Jul 21, 2007 at 08:02:24AM -0500, Peter Karman wrote: check out Catalyst::Controller::Rose on cpan. It has a different philosophy than what you've described. But if you find features missing that you think would make it more useful, please send me patches/tests/docs etc. You might consider writing a new Catalyst::Controller::Rose::SomeThing to implement what you're describing with YAML. Do you have any plans to split the dependencies a bit on this? I hadn't any plans, but since you've raised the issue, I'd be happy to discuss it. I've always been quite fond of RHTMLO and have been on a couple projects now where we considered Controller::Rose and had to pass on it because it assumed you wanted RDBO as well. C::C::Rose assumes that you are going to override methods in your subclasses, so it should be able to work with just about any model, I would think. All that is required is that the model class returned by model_name() implement the same methods as C::M::RDBO. C::M::RDBO is intentionally agnostic w.r.t. method names. I.e., it doesn't use the same method names as RDBO or RDBO::Manager. So a model needs to implement: * create() - make an object (i.e. MyObject-new()) * fetch()- load an object's data * search() - return an arrayref of objects * count()- return a count of matches * iterator() - return an iterator instead of arrayref of objects fetch_all() and all() are just aliased to search() right now. C::C::Rose::CRUD just needs fetch() and create() to work, and for the returned object to implement a save() and delete() method. Even save() is optional -- just override save_obj() and make the object do whatever you want. C::C::Rose::Search is a little trickier since rose_query() and setup() assume RDBO::QueryBuilder is the target SQL generator. But again, those can be overridden to adapt to whatever your model's search() method can accept. So if (for example) you wanted to use DBIC with C::C::Rose, you'd need a model that implements the methods above. But grok C::M::RDBO -- with the execption of fetch(), there's really not much going on in there. I wouldn't think it would be hard to write a DBIC-compatible model than implements the C::M::RDBO API. How do you imagine C::C::R::CRUD and ::Search could play friendlier with other models? Catalyst stuff should really be as non-opinionated as possible - people might want to use RDBO with a different form library too, and it'd be nice for the glue to elegantly support that case as well. Hm. Catalyst stuff should be non-opinionated, but I don't see how one Controller can be all things to all users. C::C::Rose assumes RHTMLO but can be flexible with the Model. And you can use C::M::RDBO with any kind of controllers you want. But if folks wanted to use a different form library with C::M::RDBO, and their form library doesn't have an API remotely close to RHTMLO's, then they should probably be using a different package. We don't ask Catalyst::Controller::FormBuilder to support RHTMLO do we? ;) -- Peter Karman . http://peknet.com/ . [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/
[Catalyst] Re: [RHTMLO] RDBO/RHTMLO integration with Catalyst - work in progress
check out Catalyst::Controller::Rose on cpan. It has a different philosophy than what you've described. But if you find features missing that you think would make it more useful, please send me patches/tests/docs etc. You might consider writing a new Catalyst::Controller::Rose::SomeThing to implement what you're describing with YAML. Alexandre Jousset wrote on 7/21/07 7:56 AM: Hello lists, Since I haven't seen any work like this before (if I'm wrong please give me pointers!) I started to write a Catalyst Controller called Catalyst::Controller::RHTMLO to integrate RHTMLO (and a few bits of RDBO) to Catalyst the same way Catalyst::Controller::FormBuilder do. In fact my work is originally based on it. For the moment the only thing one can do with it is to define a form in YAML (or any config file recognized by Config::Loader) and have it displayed in the template (TT2 for the moment, but others are planned). The module also defines, like the FormBuilder one, a 'Form' method attribute. The plan is to have forms automagically validated and, if no errors, give the user (developper) the ability to save them as objects in the db. Else, the error messages are set for user convenience. Here is an example of a YAML file for the action /user/create, located in .../root/forms/user/create.yaml: name: UserCreateForm # optional, automatically computed method: post rdbo: User # class of the rdbo object, used to load/save objects and also for field init (see below, types are sometimes missing, but it works) fields_order: - login - disp_name - mail - disp_mail - home_page - pass - pass2 - submit fields: login: label:Login validate: /^.{4\,40}$/, /^\w*$/ message: Between 4 and 40 characters, Only alphanumeric characters required: 1 disp_name: label:Real name (public) validate: /^.{0\,50}$/, /^[\w\.-\(\)]*$/ message: Max 50 characters, Forbidden character(s) mail: label:Real Email type: email message: Invalid Email required: 1 disp_mail: label:Displayed Email (public) validate: /^.{0\,80}$/ message: Max 80 characters home_page: label:URL validate: /^.{0\,100}$/ message: Invalid URL pass: label:Password type: password validate: /^.{4\,40}$/ required: 1 message: Between 4 and 40 characters pass2: label:Password confirmation type: password validate: /^.{4\,40}$/ message: Between 4 and 40 characters required: 1 submit: type: submit I haven't packaged it yet and I think it is too early (despite the release early, release often moto) so I can't upload it to CPAN but I have some question to ask to you all: - Is the name I gave a good name? I don't think so. I think it should mention the fact that it also concerns RDBO. - Are you interested in a module like this? I'm pretty sure somebody is ;-) I'm the first ;-) - What are your requests / suggestions about a module like this? Feel free to ask questions if my explanation wasn't enough. - Should I keep the validation system like this, or should I create validation classes (better IMHO)? For the moment the error messages are localized in the template with a macro. Thank you for your attention. Regards, -- Peter Karman . http://peknet.com/ . [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] Re: [RHTMLO] RDBO/RHTMLO integration with Catalyst - work in progress
Alexandre Jousset wrote on 7/21/07 1:12 PM: Peter Karman a écrit : check out Catalyst::Controller::Rose on cpan. It has a different philosophy than what you've described. But if you find features missing that you think would make it more useful, please send me patches/tests/docs etc. You might consider writing a new Catalyst::Controller::Rose::SomeThing to implement what you're describing with YAML. I've had seen your modules but I did not check them enough to understand what they do exactly. Now I did... I'm still studying them to be sure what is the right thing to do... But any advice is welcome... C::C::Rose takes the thin controller/fat model approach. Look at the example app in the t/examples dir to see one implementation. I prefer to follow the RHTMLO convention of a Perl class for each form, rather than YAML magic, etc. So C::C::Rose basically is a thin glue between a Rose::HTML::Form subclass and a Rose::DB::Object subclass (via Catalyst::Model::RDBO, which is also thin glue). My approach has been to write just enough code to get RHTMLO and RDBO working in a Catalyst context, in a generic CRUD fashion. The idea is that my RHTMLO and RDBO subclasses can exist happily on their own, or pulled into Catalyst with the thin glue of the C::C::Rose and C::M::RDBO base classes. -- Peter Karman . http://peknet.com/ . [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/
[Catalyst] Catalyst::Helper passes %T to POSIX::strftime - causesinfinite loop under Win32
12:32:48PM -0400, bits wrote: Catalyst::Helper::_mk_changes calls POSIX::strftime on line 390: my $time = strftime('%Y-%m-%d %T', localtime time); the %T parameter causes my Activestate Perl 5.8.8 820 to infinite loop. I'm using AS Perl 5.8.8 817 and POSIX::strftime %T is broken in that. strftime(%Y-%m-%d %T, localtime time) gives '2007-07-18 ', empty string in place of %T strftime(%T, localtime time) hangs bits, I suggest you raise a bug with AS. Regards, Peter Dragonstaff Limited http://www.dragonstaff.com Business IT Consultancy --- ___ 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] RFC for handling reverse proxies not deployed to standard ports.
Marlon Bailey wrote on 6/15/07 11:24 AM: I suggest adding the ability for Catalyst to set the host's port from a X-Forwarded-Host-Port header value. What do you guys think? I like. I have kludgy workarounds for this in my code that it be nice to see part of the core app. See also http://article.gmane.org/gmane.comp.web.catalyst.general/6703/match=moseley+port+http+backend -- Peter Karman . http://peknet.com/ . [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] Auth plugin for mod_auth_tkt
Charlie Garrison wrote on 6/6/07 4:15 PM: Good morning, I am about to create a plugin to use mod_auth_tkt for authentication, but just wanted to check that no one else has done one before I start. And I'm still on my Catalyst learning curve, so if there are any HOWTOs or tutorials on writing authentication plugins, I would love to know about them. In case anyone wants to know why I'm using mod_auth_tkt, I'm porting an old app to Catalyst. And the app has apache frontend process (mod_perl backend) which needs to protect static content. If you have other suggestions for protecting static content in frontend apache that works well with Catalyst, I'm happy to look at alternatives to mod_auth_tkt. Thanks, Charlie PS. Is there any interest from others for this plugin? I will be happy to share if there is. I also use mod_auth_tkt. I submitted a patch to the author several weeks ago that makes it easier to get at the internal cookie values via Apache::AuthTkt. You might want to post to that list and nudge him to release a new version to CPAN. It'll probably make your plugin much easier to write. Are you planning this plugin to work with the existing Session::* stuff? -- Peter Karman . http://peknet.com/ . [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] deploying a Catalyst app
On 06/01/07 15:00, mla wrote: I've always used cvs/svn for the app. Tagged it for staging/prod and pulled the changes to the appropriate servers. svn++ -- Peter Karman . http://peknet.com/ . [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] template toolkit caching
John Goulah wrote on 5/31/07 11:34 AM: Is there any way to override the file cache in the template toolkit, and use some other form of caching such as memcache? File cache really isn't that desirable when shared across many servers and I'd prefer not to have to write to disk. I believe Template::Plugin::Cache will do what you want. Perrin (the author) has a patch from me that lets you pass in the Cache object from Catalyst and use that, so any supported backend is available. If you bug him, I'll bet he'll get a new version up on CPAN. ;) -- Peter Karman . http://peknet.com/ . [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] [ANNOUNCE] Grokbase - Catalyst-based mailing listarchive
I liked the site, cool stuff and love to see the source. I tried opening the slides in Firefox and saw nothing? _ From: John Wang [mailto:[EMAIL PROTECTED] Sent: 28 May 2007 18:00 To: The elegant MVC web framework Subject: Re: [Catalyst] [ANNOUNCE] Grokbase - Catalyst-based mailing listarchive On 5/28/07, Gavin Henry [EMAIL PROTECTED] wrote: Very nice, and definitely a Google App feel to it. I can see dojo etc. there too. It's fast and I like the red Loading... message, just like google. Thanks Gavin. I'm glad you like it and that it's snappy for you. Keeping the performance acceptable was a big design objective. Is this a closed app? It is closed for now but that may (or may not) change in the future. There are a number of reasons why it may be pre-mature to open. I think it would be more beneficial to start opening some of the underlying libraries and adding functionality to some existing Perl modules, both of which would be of more general use. Also, a number of architecture / design departures were made from standard practices so some discussion and proving is needed. A while back I put together the following slides about what I learned from building this project so far. I'd like to see if the ideas in there are generally useful and if / how they could work with a higher layer of abstraction, e.g. Reaction, which would also provide more broad ranging benefits. http://www.dev411.com/slides/webappdesign.xul It would be great to hear what people thought about the slides as well. -- John Wang http://www.dev411.com/blog/ ___ 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] [ANNOUNCE] Grokbase - Catalyst-based mailinglistarchive
Hi John, that was using a copy I'd downloaded to browse locally. I tried again and http://www.dev411.com/slides/webappdesign.xul works fine off the web. Regards, Peter _ From: John Wang [mailto:[EMAIL PROTECTED] Sent: 28 May 2007 18:55 To: The elegant MVC web framework Subject: Re: [Catalyst] [ANNOUNCE] Grokbase - Catalyst-based mailinglistarchive On 5/28/07, Peter Edwards [EMAIL PROTECTED] wrote: I tried opening the slides in Firefox and saw nothing? If you move your cursor to the top of the window does the Firefox slide show bar appear? Are you able to view other XUL slides? Also, what version of Firefox are you using? It works for me on 2.0.0.3 and 1.5x. -- John Wang http://www.dev411.com/blog/ http://www.dev411.com/blog/ ___ 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] JavaScript::Minifier new version
On 5/26/07, Matt S Trout [EMAIL PROTECTED] wrote: On Sat, May 26, 2007 at 10:58:09AM -0700, Peter Michaux wrote: Hi All, I'm new to Perl and Catalyst. I thought I'd give first (before the onslaught of Catalyst questions;-)). I wrote a new version of JavaScript::Minifier and since you are web folks I thought some might find it userful. Get your ass on #catalyst on irc.perl.org then instead of confusing me in freenode#perl! The module is not Catalyst specific so I thought #perl was more appropriate. Peter ___ 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] JavaScript::Minifier new version
Hi Nilson, Thanks for the feedback. On 5/26/07, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 5/26/07, Peter Michaux [EMAIL PROTECTED] wrote: I'm new to Perl and Catalyst. I thought I'd give first (before the onslaught of Catalyst questions;-)). I wrote a new version of JavaScript::Minifier and since you are web folks I thought some might find it userful. This is probably something handy to have around. However I think you forgot to clean up your SVN working copy before committing the module to CPAN. I forgot to do export instead of a fresh checkout. Ok. I'll get that next time. By the way, I looked at the code and I think I'll make some suggestions. First of all: don't be afraid to use regular expressions. They're fast and can make your code cleaner and shorter. I'll change them in the next version. I didn't realize regexps are that much faster. Since you're new to Perl and, according to your blog posts, you're wondering if a language could be any uglier than Perl, may I suggest you take a look at more modern ways of coding Perl such as using Moose or even reading Higher Order Perl (since you seem to like Lisp). I won't suggest Catalyst itself (along with DBIx::Class) because, since you're here, you're probably already aware of it. ;-) Thanks for the suggestions. I just want to keep a little utility module like this plain Perl without any dependencies. Just because I think Perl if funny looking doesn't affect whether or not I'll be using it. With my first Perl adventure I did notice that it is very slow to type $s-{a} instead of s.a like in JavaScript. Thanks again, Peter ___ 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] JavaScript::Minifier new version
On 5/26/07, Matt S Trout [EMAIL PROTECTED] wrote: On Sat, May 26, 2007 at 01:04:19PM -0700, Peter Michaux wrote: On 5/26/07, Matt S Trout [EMAIL PROTECTED] wrote: On Sat, May 26, 2007 at 10:58:09AM -0700, Peter Michaux wrote: Hi All, I'm new to Perl and Catalyst. I thought I'd give first (before the onslaught of Catalyst questions;-)). I wrote a new version of JavaScript::Minifier and since you are web folks I thought some might find it userful. Get your ass on #catalyst on irc.perl.org then instead of confusing me in freenode#perl! The module is not Catalyst specific so I thought #perl was more appropriate. Sigh. Way to take a silly comment seriously. Go get a beer :) It is hard to tell on the internet when people are serious or sarcastic. :) Peter ___ 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] JavaScript::Minifier new version
Hi Jonathan, On 5/26/07, Jonathan Rockway [EMAIL PROTECTED] wrote: To prepare a tarball of your CPAN module for CPAN release, try running make dist. That will prevent inclusion of working-copy cruft (like Makefile, pm_to_blib, .svn, etc.). You can also run make disttest to test your distribution, to make sure you didn't forget something in your MANIFEST or whatever. Now why didn't the camel book tell me that? :) Thanks for the info. That makes things much easier! Peter ___ 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 and CGI::Ajax
Petri Ruutikainen wrote on 5/23/07 3:59 PM: Hi! Is there anyhow possible to include CGI::Ajax to Catalyst using Template Toolkit (TTSite)? I know that using Prototype one can get Ajax functionality to Catalyst but I have been unable to initiate that. Or is there some more detailed tutorial about the matter (Ajax or Prototype used with Catalyst) besides the Catalyst tutorial and/or Cookbook? A big thanks to anybody who will be answering and setting me to the right (or left) track. IME using Ajax without any kind of Catalyst plugin or explicit view is pretty painless. Just include the relevant libraries in the .tt files, write the javascript to use them in your .tt files, and then write controller code to handle the requests. The pitfalls I have stumbled into have been more with the javascript itself rather than anything particularly Catalystic. Understanding the relationship between your js and your Cat code (the request and response cycle) is important when it comes time to debug, and using the wrappers can (IME) actually impede the learning because there's simply too much magic going on. See the example app here for how I do it with Prototype and Scriptaculous: http://search.cpan.org/src/KARMAN/Catalyst-Controller-Rose-0.02/t/examples/CatRose/ And yes Dojo/Mocha/YUI/lib-de-jour lovers, I know Prototype isn't cool anymore. ;) -- Peter Karman . http://peknet.com/ . [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] ActiveRecord for Perl
Christopher H. Laco wrote on 5/22/07 2:47 PM: Well, to be fair to RDBO, I'm just not as familiar with it as I am with DBIC. When I was doing the storage layer for RDBO, what I missed (aside from deploy) was the *_related methods and the fact that resultsets are chainable. DBIC appears to take the approach that given object A, I can always get to related object B through object A accessors, helpers, *_related etc. RDBO seemed to tale take the opposite approach. Instead of working from one object to another, you went through *Manager classes when odd things are called for. Actually, RDBO works like you describe DBIC. The *Manager classes are for groups of objects. For one object to another, you use the fk and relationship Metadata definitions (1-1, 1-m, m-m, etc). $objectB = $objectA-objectB; -- Peter Karman . http://peknet.com/ . [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] Catalyst with apache, how to auto restart like run myapp_server.pl -r?
Cookie scribbled on 5/21/07 8:21 PM: Is there any way to configurate my apache configuration files to be available that I don't need to restart my apache server?(Like I run myapp_server.pl -r) no. all the -r option does for the dev server is automatically poll for file changes and restart the app. It's not a config option; it's a feature of the server. Apache has no such feature. My Second question is: When I visit my web site,the link in http://loalhost/catalyst becomes http://localhost/item,but the real link is http://localhost/catalyst/item. How can I solve this bug? My template like this: a href=/itemh1[% item %]/h1/a a href=[% c.uri_for('/item') %][% item %]/h1/a That second is a FAQ. Make sure you read the Catalyst advent calendars at: http://www.catalystframework.org/calendar/2005/ http://www.catalystframework.org/calendar/2006/ -- Peter Karman . http://peknet.com/ . [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] Form validation in insert() and update()?
mla scribbled on 05/15/07 13:42: Perrin Harkins wrote: And where do you handle the validation? Only in the controller or in both the model and controller? Could you give a short example of taking an actual field from the request parameters, validating it, and updating a row with it? You can see an example of this with Rose::DB::Object, Rose::HTML::Objects and the db (sqlite in this case) at: http://search.cpan.org/src/KARMAN/Catalyst-Controller-Rose-0.02/t/examples/CatRose/ Basically, the form object validates and spits back friendly errors messages to the user. If for some reason the data makes it to the ORM (RDBO) level, the data is also validated there and 500 error returned to the user. Finally, the db itself has contraints on it that should validate in consistent ways with the form and the ORM. This pattern seems to be similar to what mst, Perrin and Bill are also describing. -- Peter Karman . http://peknet.com/ . [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] Shoot out -- Catalyst / RoR / Other MVC apps --
Christopher H. Laco scribbled on 5/9/07 7:56 AM: The best approach for me has been what mst has said before. Make your core stuff usable outside of the work of Catalyst. Seems like a no brainer, but when you're just learning Cat and following examples, it's easy to forget. yes, it took me a year of fulltime Catalyst to arrive at this same place. I there was probably decent documentation and mailing list advice out there that could have pointed me in that direction from the start, although my experience with Perl in general is that I (can) do things my own way for awhile until I figure out on my own what more experienced folks already know: * search CPAN thoroughly before rolling your own * subclass subclass subclass * a couple levels of indirection can increase re-usability immensely * etc. [snip] The main theme being...the models are just DB thingies...they're completely usable outside core classes (domains/business logic, etc)... The Catalyst::Model:RDBO model uses this approach. It's just a thin layer around a single RDBO class (which represents one table). Just a shim to get your extra-Catalyst classes available within the Catalyst Model feature. -- Peter Karman . http://peknet.com/ . [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] Shoot out -- Catalyst / RoR / Other MVC apps --
Dave Rolsky scribbled on 5/9/07 10:02 AM: [snip] That's the subclassing piece. The delegation is that rather than implement the functionality of breadcrumbs in the response object, the breadcrumbs accessor simply returns a VegGuide::Breadcrumbs object. ah. that makes sense. Now I have a name for something I already do. :) On a side note, Catalyst plugins as a rule seem to jam _way_ too many methods into the things they extend (the session plugin is truly egregious). Some day I'd like to write a version of the session plugin that adds one method to the core Catalyst object, session(), and all the rest of the methods would be available via the object returned from session(). Yes, the Catalyst::Plugin::Cache system could work much the same way. There seem to be a lot of syntatically sweet methods in some plugins that just wrap around the core method. -- Peter Karman . http://peknet.com/ . [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] How to make MyApp::B a part of MyApp::A ?
Oleg Pronin scribbled on 5/2/07 5:30 AM: Greetings! I want to make MyApp::B a part of MyApp::A under namespace for example /folder/ Both B and A are normal catalyst applications. (both do '__PACKAGE__-setup()' and etc. and therefore cannot work together). How to do this with minimal changes to application A (for example, using B as plugin) and any complex changes to application B ? I do not want to do this using apache features (setting MyApp::B's handler to location /folder/). I want this: if MyApp::A loads MyApp::B as plugin then all of functionalities of B goes under A/folder/. this sounds like a straightforward subclassing arrangement -- unless I'm missing something crucial? MyBaseClass.pm: package MyBaseClass; # all the stuff currently in MyApp::B here 1; MyApp/A.pm: package MyApp::A; use base qw( MyBaseClass ); 1; MyApp/B.pm: package MyApp::B; use base qw( MyBaseClass ); 1; then override and extend MyApp::A and MyApp::B for whatever application-specific reasons you have. -- Peter Karman . http://peknet.com/ . [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] MySQL server has gone away
I've seen this problem under Red Hat Enterprise Linux 4 and Mysql 3.23 and suspect it was down to incorrect configuration of full/half duplex on the Network Interface Card against the router, possibly combined with a Linux Ethernet driver bug. Some useful pointers here http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html http://dev.mysql.com/doc/refman/5.0/en/gone-away.html We put in code to wrap the DBI calls, detect the error and re-run the transactions in that case. You can detect it with $sth-execute() fails and $sth-errstr() =~ m/gone away/i For lookups we use tie() through a locking wrapper to DB_File, generating the DBM databases from master data in the database. Regards, Peter Dragonstaff Limited http://www.dragonstaff.com Oleg Pronin wrote: One can say that it is a very rare situation. I can tell you that in production environment (about 1.000.000 hits per day) it happens every day several times. Some users just see an error, some lost their data. This is just not always visible to you. The OP may find a requirement to incorporate a transaction model (explicit start txn/commit/rollback) to solve this problem in MySQL; which is what they'd have to do for Oracle or Postgres or Rdb. I'd hope that MySQL reports a transaction failure when the database connection evaporates. This would allow a retry on the failed transaction. However, it may be that the Catalyst Controller / View design/implementation is only what would ordinarily be flat file accesses that use SQL instead of keyed-access flat files. If that's the case, wrapping a transaction around each of these SQL prepare/execute pairs will be a substantial performance hit. ___ 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] [ANNOUNCE] Rose::* modules on CPAN
Cattle-lusters, As mentioned here in passing last month, I have uploaded some base components to CPAN for use with Rose::HTML::Objects, Rose::DB::Object and Catalyst. * http://search.cpan.org/dist/Catalyst-Model-RDBO/ (latest: 0.03) A Model base class for integrating RDBO with Catalyst. Mostly a thin convenience wrapper around Rose::DB::Object and Rose::DB::Object::Manager. * http://search.cpan.org/dist/Catalyst-Controller-Rose/ (latest: 0.02) A collection of Controller base classes for easing CRUD-style application development with RHTMLO and RDBO. Included with the C::C::R controllers is an entire example Catalyst app called CatRose. It's in the t/examples/ directory. It includes templates, in-place-editing with Javascript, and some other goodies. Comments/patches/tests welcome. cheers, pek -- Peter Karman . http://peknet.com/ . [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] [ANNOUNCE] Rose::* modules on CPAN
Jeff Chimene scribbled on 4/23/07 1:06 PM: I've installed the Catalyst-Controller-Rose 0.02 and the examples stayed in the CPAN working directory. Is this the intended behavior? yup. They're just examples. -- Peter Karman . http://peknet.com/ . [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] HOWTO reference config settings from template
Jeff Chimene scribbled on 4/12/07 9:29 AM: Hi, I'm not sure if this is a Catalyst question - How do I reference __PACKAGE__config settings from a Template Toolkit template? I'd like to use the config tool to set values outside the stash. [% c.config.yourconfigkeyhere %] -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: [EMAIL PROTECTED] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] HOWTO reference config settings from template
Jeff Chimene scribbled on 4/12/07 10:35 AM: and I don't see the TT2 configuration settings. When I try the similar experiment in the perl module, dump __PACKAGE__-config, the TT2 configuration settings are displayed. that's because your TT config probably isn't getting set in the master config for your app, which is what c.config returns. Every M/V/C in Catalyst has a config() method (iirc -- please correct me, oh gurus), and the master MyApp class has a config() too, which is where you generally set values for the entire application. You can set your TT config there too. But looking at what you're trying to do, I wonder if what you really want is a TT type config file, which can set constants and other relevant TT stuff. CatRose has an example of how I do it: http://search.cpan.org/src/KARMAN/Catalyst-Controller-Rose-0.01/examples/CatRose/lib/CatRose/View/TT.pm cheers. pek -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: [EMAIL PROTECTED] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] little syntax
Will Smith scribbled on 4/12/07 11:43 AM: I have the following piece of code: # in controller ... while ( my $row = $file-read ) { push @record, { id = $row-{id}, name = $row-{name}, }; } $c-stash-{recs} = @records; . What is the syntax on the tt2 to access the id and name? Or please point me to somewhere that I could do some reading on the question. you want: $c-stash-{recs} = [EMAIL PROTECTED]; and then in tt: [% FOR rec IN recs; rec.id; rec.name; END %] -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: [EMAIL PROTECTED] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Handling slow uploads externally
Brian Kirkbride scribbled on 4/12/07 12:16 PM: Is there something like this in existence already? I searched Google and CPAN but didn't find anything promising. I'd appreciate any tips or suggestions. If I do implement it from scratch, would there be any interest in the CGI and a Catalyst base controller being released on CPAN? I'd be interested in collaborating on something if you end up rolling your own. We were looking at this recently: http://trac.lighttpd.net/trac/wiki/Docs%3AModUploadProgress and doing something similar to what you're describing. -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: [EMAIL PROTECTED] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] HTML::FormFu and Rose::DB::Object?
Quinn Weaver scribbled on 4/3/07 12:40 PM: If so, will FormFu be compatible with Rose::DB::Object, or will it be tied to DBIC? (I know the Rose framework has its own way of handling forms, but I like FormFu better because of its clean separation of concerns.) Any words of wisdom from the FormFu masters? :) I'm no master, nor have I looked at FormFu. However, I'd suggest you look at the Catalyst::Controller::Rose stuff I posted to CPAN last week: http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.01/ That has base Controllers for use with RDBO and RHTMLO, and I'd expect you might use it as a starting place for tying in FormFu instead of RHTMLO. See in particular: http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.01/lib/Catalyst/Controller/Rose/CRUD.pm and the init_object() and init_form() methods. That said, what exactly is it about RHTMLO that strikes you as less than a clear separation of concerns? -- Peter Karman . http://peknet.com/ . [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] Can not start my apache with catalyst app under mod_perl
Paul Rudolf Seebacher scribbled on 4/3/07 3:57 PM: Hi, i want to run my catalyst application under mod_perl. So I made a Virtual Host: VirtualHost * DocumentRoot /var/srv/sugo ServerName sugo.* PerlSwitches -I/var/srv/sugo/lib/ PerlModule sugo Location / SetHandler modperl PerlResponseHandler sugo /Location /VirtualHost Put when I restart Apache, I get this error message in my error.log: [Tue Apr 03 22:51:01 2007] [error] Can't locate sugo.pm in @INC (@INC contains: /usr/lib/perl5/Apache2 /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc/apache2) at (eval 3) line 3.\n [Tue Apr 03 22:51:01 2007] [error] Can't load Perl module sugo for server sugo.seepaul.dyndns.org:0, exiting... How can I say Perl where to seek for this script? though the mod_perl docs claim that PerlSwitches can be inside a vhost, I had a similar experience the other day that was solved by putting that -I/path outside the vhost directive. -- Peter Karman . http://peknet.com/ . [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] Swish-e
Jim Spath scribbled on 3/22/07 2:44 PM: What about Xapian? I noticed that it has some Catalyst support in the form of Catalyst::Model::Xapian. Xapian also seems like a possible long term solution as it can handle more documents that Swish-e or KinoSeach. see also this recent thread: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/msg06061.html -- Peter Karman . http://peknet.com/ . [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] PageCache and Apache
vti scribbled on 3/13/07 3:12 PM: Hi I have something strange happening while using PageCache plugin and Apache server. When plugin has cached a page the next request i get 550 error response, next time i refresh everything is ok, next time again 550. I have had this same error. It seems to happen especially with FireFox. My workaround was to explicitly set 'set_http_headers' to 0 in my page_cache config. That turns off the cache headers that tell your browser it's ok to cache the page locally, which means each request will get a fresh copy from the server. But since that fresh copy is cached on the server, it seemed a fair tradeoff to me if it solved the problem. -- Peter Karman . http://peknet.com/ . [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] Performance
Robert 'phaylon' Sedlacek scribbled on 3/9/07 9:04 AM: Christopher H. Laco wrote: Sure, it they're that different. The goal still stands, don't use uri_for everywhere. Only use it when you really need it. Jep. But this is not getting easier if you start to have captures in your chains. I'm still having high hopes to build something fast(er) with URI::Template. http://search.cpan.org/~jsiracusa/Rose-URI-0.021/lib/Rose/URI.pm -- Peter Karman . http://peknet.com/ . [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] Re: memory usage of mod_perl process
Jeffrey Ng wrote: so are you saying in general catalyst is pretty heavy, and its not for site with many concurrent users?... No, not at all. It all depends on what your application does, how many web screens, how many peak concurrent users and equivalent requests/second, how many discrete users, how many data feeds in/out, data volumes, network transfer volumes. Your limiting factor might be CPU, database I/O or network bandwidth. Different architectural models are best for different cases. There is a cost equation between using a powerful framework that increases robustness, maintainability and speed of development versus how many servers you need. Say a server costs you $100 per month to rent and each Catalyst server maxes at 30 requests per second but you get a peak load of 90 reqs/sec. You would need to load balance your app across 3 servers. There would be an initial configuration cost and then you'd be paying $200 p.m. = $2400 p.a. more for the two extra servers. Let's say a developer, including overhead, costs you $1000 per day. If you move away from Catalyst to a lighter framework and it costs you more than 2.5 developer days extra then you're losing money. Catalyst has a lot of tried and tested pluggable modules and if you end up re-writing any of those you're almost certainly spending money. what other light weight approach would you go for? First thing, set up proper caching (either Squid or a lightweight Apache) and use a tool like Fiddler to examine the HTTP request Cache headers to make sure it's working properly. That's a huge saving. Then do profiling and benchmarking to determine exactly what the bottlenecks are before making any changes. If you're doing a lot of dynamic Ajax stuff with complex SQL, there might be a case for hand-tuning that part of the app. Look at whether you can pre-calculate and cache expensive queries or change the app design to allow this. If necessary, you could write a separate lightweight app to serve those requests. I didn't find a suitable lightweight mod_perl framework so wrote one using CGI::Session, DBIx::Class, Template toolkit. It's not that difficult. If you would like some details please feel free to email off-list or call me. However, that was an atypical case and as soon as you start needing internationalization, RSS feeds etc. I think you're better off with Catalyst. You said you need to serve JS from the same server as the heavyweight app. Assuming the JS pages are static or can be precalculated and stored in a static dir, and you have the JS below /js and your app below /app in the URI namespace: On the same server run two Apaches (or one Apache + one Fastcgi) 1) Lightweight proxy. Build it yourself from source, turn off all unnecessary options and shared libraries except mod_proxy/mod_rewrite. Use rewrite rules to proxy /app/. on to heavy server, e.g. based on an Apache 1 setup I have that's live: RewriteEngine On RewriteRule^/app/(.*$) http://localhost:2000/app/$1 [P] ProxyPassReverse / http://localhost:2000/ RewriteRule^proxy:.* - [F] The /js and /images get served by the proxy server (which has a 1MB memory footprint per child) 2) Heavy mod_perl server listening at localhost:2000. Maps /app on to your handler (40-100MB memory per child). Say you had to handle the Ajax part separately. With this model you can add another proxy entry that routes, say, /ajax/ on to another Apache server on the same host (e.g. localhost:2001) or on another host altogether (e.g. http://ajax1.zorpia.com http://ajax1.zorpia.com/ ). If you need to scale more, use DNS round robin to a set of front end proxies like this and route requests to a farm of backend servers using a shared database server. I'd be surprised if you couldn't get decent performance out of a well-designed Catalyst app. There are businesses listed on the Catalyst pages that offer consultancy help if you need further pointers. As a business I used Shadowcat Systems last year and received good technical design advice. Regards, Peter Edwards www.dragonstaff.com http://www.dragonstaff.com/ ~ Business IT Consultancy ___ 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] Re: memory usage of mod_perl process
Are you hitting the database very hard? Complex joins? Are your pages very complex? No, it's a fairly simple backend processor that mostly handles XML transactions for a Flash frontend. There are some XHTML admin pages generated with Template::Toolkit (and so are slower) but they are rarely hit. For the database a typical run hits a session table, user table, writes a log table and reads data from a couple of other tables. No complex joins. The app handles user registration, some league tables, polls, competition entries and users submitting images that are approved and shown on the site. In this case I knew there was the potential for a huge number of users so went for a lightweight approach that could easily be tuned further. For a more complex app with fewer peak users I'd have used Catalyst. Regards, Peter www.dragonstaff.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] Re: memory usage of mod_perl process
There are a lot of good tuning tips in the Apache docs, as Perrin says. I presume you've tried things like using a lightweight front end proxy (to serve images/static files) and building a custom backend mod_perl Apache that includes *only* the modules you need. If you use the stock Fedora/Redhat Apache that's not optimal. In your Apache config preload everything pre-fork (if you use that model) including setting up the DB connection. Write code that caches expensive calculated values/lookup files/SQL values in memory with a cheap last-modified check before re-doing work. Don't set MaxRequestsPerChild too high (I use 100) as the mem usage will climb as Perl switches some shared memory variables to new memory, as the Apache mod_perl docs describe. For comparison, I'm using DBIx::Class across 15 tables and a really simple hand-rolled MVC (not Cat) for a medium volume site. It gives 'top' lines like: PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 21495 apache15 0 203m 43m 6188 S 0.0 4.5 0:01.46 httpd This can handle over 300 requests/sec with 1GB memory on an x86_64 single processor. Regards, Peter www.dragonstaff.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] Bread crumb
Jason Kohles scribbled on 2/6/07 8:33 AM: It still feels a little kludgy, but this is how I'm doing it currently... [...] fwiw, that is pretty close to how http://search.cpan.org/~tigris/Catalyst-Plugin-Breadcrumbs-5/lib/Catalyst/Plugin/Breadcrumbs.pm does it. I have been using a (modified) version of C::P::Breadcrumbs for a while and it works ok. -- Peter Karman . http://peknet.com/ . [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] Difference in running application via perl -dvscommand line
As I recall there was a posting on the ActiveState support forum but AS claimed it was a problem in DBI... I think they're wrong as a simple recompilation fixes it. Regards, Peter -Original Message- From: Lampert, Hugh [mailto:[EMAIL PROTECTED] Sent: 06 February 2007 16:41 To: The elegant MVC web framework Cc: Peter Edwards Subject: RE: [Catalyst] Difference in running application via perl -dvscommand line Thanks, I force installed the DBI module from CPAN and that has eliminated the error. Is there something easy that I can do (like tell ActiveState something specific about their version of DBI), that would make their PPM version stop doing this? ___ 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] Difference in running application via perl -d vscommand line
I had the same problem. It is caused by the PPM version of DBI. Recompile DBI using GCC (from Makefile.PL) and it goes away. (Thanks to Matt Trout for pointing this out to me) Regards, Peter http://www.dragonstaff.com I'm not asking anyone to solve this for me, just point me in the right direction as to what I should check. I'm thinking there's some problem with the model mechanics when the app runs from the command line (DBD::ADO or the Catalyst DBIC model modules). U:\LBBWCompliance\LBBWCompliancescript\lbbwcompliance_server.pl Attempt to free unreferenced scalar: SV 0x9a90e30, Perl interpreter: 0x2245bc at C:/Perl/site/lib/DBD/ADO/TypeInfo.pm line 454. snipped many attempts to free unreferenced scalar messages here... C:/Perl/site/lib/DBD/ADO.pm line 326. Attempt to free unreferenced scalar: SV 0x9a8c5d0, Perl interpreter: 0x2245bc at C:/Perl/site/lib/DBIx/Class/ResultSource.pm line 194. ___ 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] Recommend methods for form handling
Jim Spath scribbled on 1/17/07 12:09 PM: I was wondering what the current consensus among Catalyst users is about what the best way to approach forms is? I like Rose::HTML::Objects (specifically Rose::HTML::Form). Used along with Rose::DB::Object, my code is starting to get slimmer and slimmer. -- Peter Karman . http://peknet.com/ . [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/
OT: [Catalyst] creating binaries
Can you tell me how to find the source code from a perlapp program? Everyone says that it is very simple, but nobody was able to do it. The answer is in the manual http://perldoc.perl.org/perlfaq3.html#How-can-I-hide-the-source-for-my-Perl- program%3f Perlmonks is a better place for these kind of questions http://www.perlmonks.org/index.pl?node_id=243011 I'm still not really sure what you're trying to achieve as you haven't really said what your app will do. There are several approaches to consider: 1) Use a remote server to host part of the application and talk to it from a front end via SOAP and XML-RPC. That's a lot easier than it sounds provided your users have net access http://search.cpan.org/~rjray/RPC-XML-0.59/. 2) Write part of your app in VB or C# and supply a DLL wrapped in copy-protection. It will still be possible to crack but a lot more difficult than trying to hide perl. Bear in mind if your software is popular enough it only takes one person to crack it and list it on astalavista http://www.google.co.uk/search?hl=enq=software+wrapper+copy+protectionbtnG =Google+Searchmeta= 3) Go the Open Source route. My customers have started going this way. Why? A lot cheaper. Cost of developing software is 50% testing and if you use popular Open Source or sponsor its development you get a lot of free testing and quicker time to stable software. Regards, Peter ___ 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] creating binaries
If a language is interpreted, this doesn't mean that the programs that were made with it cannot be protected in any way. It will be fairly easy to crack installed Perl software. Or, is there another way of protecting the code from a Catalyst app? Offer an Application Service Provider model. I.e. run a hosted service on a server you control and provide access to HTTP or SOAP XML-RPC web services. Regards, Peter ___ 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 vs Rails vs Django Cook off
For businesses the cost-to-develop and cost-to-maintain are usually more important than handler performance. The reason is that in most medium-large transactional web systems the bottleneck is the database and not the framework. A 10-100x slowdown in using an ORM or your framework of choice doesn't make much difference in terms of end user perceived speed (assuming you serve static content from a lightweight proxy web server). It does save a lot of money in cost-to-maintain. Sure there is a place for optimised libraries and so on, but it's only worth optimising bottlenecks and the handler usually isn't one. I recently had to hand-write a TCP/IP server in Perl using POE to handle one particularly heavy case but most situations are easily dealt with by Apache mod_perl or FastCGI, in fact running Perl in CGI mode is often adequate. More important questions to me about frameworks are how: - easy to learn - quick to develop - flexible - comprehensive in terms of supporting infrastructure (templates, components) - easy/expensive to recruit staff - easy to integrate with other systems Realistic approaches include .NET J2EE Catalyst, Jifty RoR They all have strengths/weaknesses. For example, you'll get a Jifty or RoR app up quickly if you do it the standard way. If you want to build a bigger system that doesn't quite fit their model you're probably better off with Catalyst or another framework. I did one large system with Catalyst last year and it was great for that. I did a smaller system just before Christmas and wrote my own simple MVC framework for convenience. It's a question of choosing the right tool for the job. Regards, Peter Edwards www.dragonstaff.com Business IT Consultancy -Original Message- From: Hermida, Leandro [mailto:[EMAIL PROTECTED] Sent: 15 January 2007 09:30 To: The elegant MVC web framework Subject: RE: [Catalyst] Catalyst vs Rails vs Django Cook off From: Carl Johnstone [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 10:21 To: catalyst@lists.rawmode.org Subject: Re: [Catalyst] Catalyst vs Rails vs Django Cook off Is it true that Catalyst is so slow comparing with other frameworks? Does it matter? If speed is so important, you should write your own custom httpd that does exactly what you need in assembly language. Carl Speed does matter and I believe the original thread question is a valid one. Not everyone has the time or the know-how to do wheel reinvention and write custom daemons (I know I don't). That's why people write kernels and libraries and abstraction of lower level things so that others can build things on top. Otherwise we would never get anything done. ___ 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] HTML to plain text conversion
Xavier Robin scribbled on 1/8/07 11:14 AM: Do you know a (catalyst plugin|perl module|external tool) that converts HTML to plain text? I mean, keeping some formatting (especially lists and links...), not just stripping HTML tags... I use the w3m tool: % w3m -dump file.html file.txt I like it because it preserves tables pretty well. -- Peter Karman . http://peknet.com/ . [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] Catalyst::Plugin::Authentication::Store::LDAPsettingsfor Microsoft Active Directory
Hermida, Leandro scribbled on 12/22/06 10:11 AM: -Original Message- From: Peter Karman [mailto:[EMAIL PROTECTED] http://article.gmane.org/gmane.comp.web.catalyst.general/7523/ match=ldap It works! Thanks for this link! glad it helped. TLS or SSL don't seem to work when connecting to Active Directory so please do not set start_tls: 1 nor specify the ldap_server as a URI with ldaps://. If someone has managed to get this to work using Net::LDAP, I would really like to know. I had a similar issue (nearly a year ago now) with TLS/SSL and AD, and trying to get the (now deprecated) C::P::Auth::LDAP module working. I ended up just putting a simple CGI in front of the AD server under https as a web service. The CGI uses Net::LDAP across a LAN from the Linux/Apache CGi host to the AD server. It does the auth and returns a simple XML (or could be json or whatever) string indicating the auth status and roles/groups on success. Then I just cache the roles in the session. It was the easiest way to provide secure auth across the 'net using AD and Catalyst. Plus, now we use it outside of Catalyst since it's just a CGI. tmtowtdi, pek -- Peter Karman . http://peknet.com/ . [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] problem deploying with apache: templates not found
Have you tried doing warn posedb-path_to( 'root' ) ? /home/marcl/catalyst/posedb/root Still 'Coldn't render template file error - search.tt2: not found' though, while it resides in /home/marcl/catalyst/posedb/root/src/search.tt2 Shouldn't that be /home/marcl/catalyst/posedb/root/search.tt2 Also the dump before referred to a different path with myapp not posedb dirs = [, home, marcl, catalyst, myapp, root], Regards, Peter ___ 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] Checking client browsers, best approach?
Ryan scribbled on 9/20/06 7:44 AM: OK, here is what I need to do. I'm writing a reservation system for a hotel and I have some cool features in mind for the process but they require javascript and newer browsers. What I was planning on doing is creating the bare-bones pages that work in any browser, no JS just all server calls etc...then I want to go back and insert the new stuff where it's appropriate but only for the people that can handle it. I was thinking of having a landing page(default or something) that ran some tests to see if that could fail. Then I thought it might be easier in the begin function to just check browsers and set a variable in the stash if they can handle the new stuff or not. What's the best way to go about doing this, should I just scan the req variables that come in and make my decision on that or does Catalyst have something better? I use C::Plugin::Browser and then check that in my templates for what fancy stuff to include. In TT: [% IF c.request.browser.windows c.request.browser.ie %] # do something [% END %] I've also done similar to what you describe and set stash var in begin() method: if ($c-req-browser-windows $c-req-browser.ie) { $c-stash-{ie_win_too_bad}++; } -- Peter Karman . http://peknet.com/ . [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/
[Catalyst] patch: C::P::Compress::Deflate
Patch below allows Compress::Deflate plugin to play nicely with Static::Simple and to allow for skipping deflation based on browser. Specifically, we found issues with older versions of IE that claimed to deal with the deflate encoding but balked. I'm not sure if the way I detect presence of Static::Simple is the Right Way or not. Comments welcome. --- /usr/lib/perl5/site_perl/5.8.6/Catalyst/Plugin/Compress/Deflate.pm 2006-09-05 11:29:48.0 -0500 +++ Catalyst/Plugin/Compress/Deflate.pm 2006-09-19 10:15:16.0 -0500 @@ -2,6 +2,8 @@ use strict; +our $VERSION = '0.02'; + use Compress::Zlib (); sub finalize { @@ -29,6 +31,25 @@ return $c-NEXT::finalize; } +# skip if using Static::Simple +if ( $c-can('_serve_static') ) { +$c-log-debug(skipping Compress::Deflate due to Static::Simple) + if $c-debug; +return $c-NEXT::finalize; +} + +# skip if we have a particular browser type +if ($c-request-browser +and $c-request-browser-windows +and $c-request-browser-ie +and $c-request-browser-major() +( $c-config-{compress}-{skip_ie} || 0 ) ) +{ +$c-log-debug(skipping Compress::Deflate due to skip_ie detection) + if $c-debug; +return $c-NEXT::finalize; +} + my ( $d, $out, $status, $deflated ); ( $d, $status ) = Compress::Zlib::deflateInit( @@ -80,6 +101,21 @@ Deflate compress response if client supports it. +=head1 CONFIGURATION + +The config key Bcompress can be used. If you need to skip deflation for IE +browsers, you can set the Bskip_ie key to the major version below which you +want to skip deflation. + +Example: + + __PACKAGE__-config( compress = { skip_ie = 6 } ) + +will skip deflation for all IE browsers below version 6. + +BNOTE: The Bskip_ie feature requires the Catalyst::Plugin::Browser module. + + =head1 SEE ALSO LCatalyst. -- Peter Karman . http://peknet.com/ . [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] patch: C::P::Compress::Deflate
Perrin Harkins scribbled on 9/19/06 11:46 AM: Since you use apache in production, have you considered using mod_deflate for compression? It seems like a better solution than something at the perl level. I started to write a long response, then realized why I was having the whole compression/caching issue in the first place. I was caching compressed pages, which meant that browser headers were ignored, etc. doh! So now I need to implement mod_deflate. Since y'all have likely done this before, I'll ask here. We have a typical proxy frontend/mod_perl backend setup. Which server should handle the compression? Seems like maybe the backend could, since we are caching pages, but don't know if there are accepted best practices on this. Thanks. -- Peter Karman . http://peknet.com/ . [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] Force server to send data to browser....
Is there a way to send stuff as it's running, like forcing the server to send info every so often? Good question, not sure how you'd do it with Catalyst. I've done this before to show output from a lengthy batch program, using CGI.pm, sending the header then the start of the output followed by a flushed space char every minute to stop the browser timing out. Like a tail -f on a log file. Regards, Peter ___ 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
Alan Humphrey scribbled on 8/22/06 11:37 AM: 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? I have a small JS lib built on Prototype that I am getting near to open sourcing. It does exactly this: spreadsheet-style editing of multiple rows of data. Let me know offlist if you'd like an alpha copy; I'd love to get some feedback on it. cheers, pek -- Peter Karman . http://peknet.com/ . [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] how to get started?
Hi burninbruce, setting up CPAN to follow prequisites and install them automatically might make it easier. # perl -MCPAN -e shell If it's the first time, it will ask a load of setup questions, choose to follow prerequisites. Otherwise you can set it on with cpan o conf prerequisites_policy follow cpan q Then try reinstalling Regards, Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 21 August 2006 10:04 To: catalyst@lists.rawmode.org Subject: [Catalyst] how to get started? I'm a programmer with many years experience with perl and some with CGI scripts but little with CPAN and none with web app frameworks. 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. ___ 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] Why scaffolding? Validation and Learning
Hi Max, There's that, and there's also the ease of prototyping an application really, really fast when scaffolding is available. Without such scaffolding, you may end up taking a month to build a prototype. It certainly depends on the complexity of the project, however, speed may be more important in some cases. I am mostly referring to being able to say I can show you something right now to your manager/client/etc. Stuff like this really raises your level of credibility. Yes, this is important. As you say, there's a commercial aspect to pitching for work and showing prototypes. If you're using an Agile project management methodology like DSDM, then doing several iterations of modelling and delivery is essential in order to migrate closer to what a customer needs rather than what they initially want. This only works for small-medium projects, with larger ones in the long run you need a well designed system or it will croak as the complexity increases and the code base degenerates. Regards, Peter ___ 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] Bug in uri_for()
Paul Makepeace scribbled on 7/13/06 7:44 AM: Folks may already know about this, sorry I haven't checked RT etc: I've just upgraded from 5.66 to 5.70 and noticed a bug with uri_for - it seems that if one of the final-arg hash ref parameters has a value that is not something it's expecting it dies, for example, $c-uri_for($base, @args, { url = $c-req-base }); # Non-array reference (URI::http) passed to uri_for() The $c-req-base is a URI::http. My solution was to force it to stringify by appending a blank string (e.g. .'') I don't think this is a bug. Had a similar problem this morning. I think the issue is how the URI::http object is overloaded. My solution was to do the same thing the overloading does: $c-uri_for( $c-req-base-as_string ) which is similar to what you're doing, but with the documented method rather than forcing the overload to occur. -- Peter Karman . http://peknet.com/ . [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] pass array to template?
Hi Sarah How can I pass an array to Template Toolkit, then loop through it? You need to pass a pointer to array otherwise you get the scalar (length) of the array: $c-stash-{numarray} = [EMAIL PROTECTED]; Regards, Peter ___ 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] Problem with 'login' method in tutorial
Hello,I'm a Catalyst newbie stuck on the tutorial with following problem. In the Users.pm file, the login function fails, as the call to $c-login() gets the following error: [Thu Jun 22 15:57:00 2006] [catalyst] [error] Caught exception Can't locate object method login via package tutorial at /home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm line 82. This would normally imply that I'm missing modules, however, I have installed all the necessary plugins through CPAN (as far as I can tell). One possible cause, but I don't think it is normally an issue, is that the Catalyst plugins on my machine (running Ubuntu 'dapper drake'), are in two directories. One directory (/usr/share/perl5/Catalyst/) has a few plugins provided by Ubuntu's apt repository. The other directory (/usr/local/share/perl/5.8.7/Catalyst/) has the new plugins installed with CPAN. Both directories are in @INC when printed from the tutorial app. I tried copying the CPAN installed plugins (Authentication::Credential::Password, Authentication::Simple, etc.) to the Ubuntu perl dir, but it made no difference. I did restart the test server on each change. At this point, I'm not quite sure what else to do to get the app to see Authentication::Credential::Password which apparently provides the 'login' method. A search of Google and the list archives hasn't turned up anyone with the same problem. Any suggestions/help would be greatly appreciated. Also, at the end of this email I've included a dump of my $c object from right before the login call fails. Many thanks. Peter___[Thu Jun 22 16:27:18 2006] [catalyst] [debug] **[Thu Jun 22 16:27:18 2006] [catalyst] [debug] * Request 1 (0.250/s) [16278][Thu Jun 22 16:27:18 2006] [catalyst] [debug] ** [Thu Jun 22 16:27:18 2006] [catalyst] [debug] GET request for users/login from 192.168.1.11[Thu Jun 22 16:27:18 2006] [catalyst] [debug] Path is users/login [Thu Jun 22 16:27:18 2006] [catalyst] [debug] $VAR1 = bless( { 'request' = bless( { 'protocol' = 'HTTP/1.0', 'headers' = bless( { 'accept-charset' = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'user-agent' = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: 1.8.0.4) Gecko/20060508 Firefox/1.5.0.4', 'connection' = 'keep-alive', 'keep-alive' = '300', 'accept' = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'accept-language' = 'en-us,en;q= 0.5', 'accept-encoding' = 'gzip,deflate', 'host' = ' 192.168.1.10:3000' }, 'HTTP::Headers' ), '_context' = $VAR1, 'snippets' = [], 'body_parameters' = {}, 'secure' = 0, 'hostname' = 'localhost', 'uploads' = {}, 'user' = undef, '_body' = bless( { 'content_length' = 0, 'body' = undef, 'length' = 0, 'content_type' = undef, 'upload' = {}, 'buffer' = '', 'param' = $VAR1-{'request'}{'body_parameters'}, 'state' = 'buffering' }, 'HTTP::Body::OctetStream' ), 'method' = 'GET', 'address' = ' 192.168.1.11', 'base' = bless( do{\(my $o = 'http://192.168.1.10:3000/')}, 'URI::http' ), 'cookies' = {}, 'match' = 'users/login', 'path' = 'users/login', 'uri' = bless( do{\(my $o = ' http://192.168.1.10:3000/users/login')}, 'URI::http' ), 'query_parameters' = {}, 'parameters' = {}, 'action' = 'users/login', 'arguments' = [] }, 'Catalyst::Request' ), 'stash' = { 'template' = ' userlogin.tt' }, 'namespace' = 'users', 'stack' = [ bless( { 'namespace' = 'users', 'name' = '_DISPATCH', 'class' = 'tutorial::Controller::Users', 'attributes' = { 'Regex' = undef, 'LocalRegex' = undef, 'Regexp' = undef, 'Private' = [ undef ], 'LocalRegexp' = undef }, 'code' = sub { DUMMY }, 'reverse' = 'users/_DISPATCH' }, 'Catalyst::Action' ), bless( { 'namespace' = 'users', 'name' = '_ACTION', 'class' = 'tutorial::Controller::Users', 'attributes' = { 'Regex' = undef, 'LocalRegex' = undef, 'Regexp' = undef, 'Private' = [ undef ], 'LocalRegexp' = undef }, 'code' = sub { DUMMY }, 'reverse' = 'users/_ACTION' }, 'Catalyst::Action' ), bless( { 'namespace' = 'users', 'name' = 'login', 'class' = 'tutorial::Controller::Users', 'attributes' = { 'Regex' = undef, 'LocalRegex' = undef, 'Regexp' = undef, 'Local' = [ undef ], 'LocalRegexp' = undef }, 'code' = sub { DUMMY }, 'reverse' = 'users/login' }, 'Catalyst::Action' ) ], 'response' = bless( { 'body' = '', 'cookies' = {}, 'headers' = bless( { 'x-catalyst' = '5.61' }, 'HTTP::Headers' ), '_context' = $VAR1, 'status' = 200 }, 'Catalyst::Response' ), 'stats' = [], 'state' = 0, 'action' = $VAR1-{'stack'}[2], 'counter' = { 'users/login' = 1, 'users/_AUTO' = 1, 'users/_DISPATCH' = 1, 'users/_ACTION' = 1, 'users/_BEGIN' = 1 } }, 'tutorial' );[Thu Jun 22 16:27:18 2006] [catalyst] [debug] Rendering template userlogin.tt[Thu Jun 22 16:27:19 2006] [catalyst] [error] Caught exception Can't locate object method login via package tutorial at /home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm line 82
Re: [Catalyst] Problem with 'login' method in tutorial
On 6/22/06, Ash Berlin [EMAIL PROTECTED] wrote: Peter Traub wrote: Hi Ash, Thanks for the reply. I should've mentioned that the top of my app (tutorial.pm http://tutorial.pm ) follows the tutorial directions to the letter, and thus has: use Catalyst qw/-Debug Static::Simple AuthenticationAuthentication::Store::MinimalAuthentication::Credential::Password Session Session::Store::File Session::State::Cookie/; All those modules have been installed with CPAN. It should just complain if it can't find any of those modules whenever the app is called, right? But it doesn't (which implies that it sees them doesn't it?), it only complains about the 'login' method call. Thanks.Check what:perl -MCatalyst::Plugin::Authentication -e1 give? (If nothing then it means that it found the module okay)Ashyep, it returns nothing, so it finds the plugin ok. Is it possible that it checks the first Catalyst directory (the Ubuntu one), and when it doesn't find it there, fails to look in the other directory even though both directories are in @INC? peter ___ 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] Problem with 'login' method in tutorial
yep, it's in: /usr/local/share/perl/5.8.7/Catalyst/Plugin/Authentication/Credential/Password.pm and I looked at it yesterday and there is nothing unusual about the file. Not sure where to go from here. My system is a fresh and clean install that I also just did yesterday. The only non-apt installed software are the various perl libs I installed through CPAN. Thanks again. Best,PeterOn 6/22/06, Matt S Trout [EMAIL PROTECTED] wrote: Peter Traub wrote: On 6/22/06, *Matt S Trout* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Peter Traub wrote: Hello, I'm a Catalyst newbie stuck on the tutorial with following problem. In the Users.pm http://Users.pm http://Users.pm file, the login function fails, as the call to $c-login() gets the following error: [Thu Jun 22 15:57:00 2006] [catalyst] [error] Caught exception Can't locate object method login via package tutorial at /home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm line 82. This would normally imply that I'm missing modules, however, I have installed all the necessary plugins through CPAN (as far as I can tell). One possible cause, but I don't think it is normally an issue, is that the Catalyst plugins on my machine (running Ubuntu 'dapper drake'), are in two directories. One directory (/usr/share/perl5/Catalyst/) has a few plugins provided by Ubuntu's apt repository. The other directory (/usr/local/share/perl/5.8.7/Catalyst/) has the new plugins installed with CPAN. Both directories are in @INC when printed from the tutorial app. I tried copying the CPAN installed plugins (Authentication::Credential::Password, Authentication::Simple, etc.) to the Ubuntu perl dir, but it made no difference. I did restart the test server on each change. At this point, I'm not quite sure what else to do to get the app to see Authentication::Credential::Password which apparently provides the 'login' method. A search of Google and the list archives hasn't turned up anyone with the same problem. Any suggestions/help would be greatly appreciated. Also, at the end of this email I've included a dump of my $c object from right before the login call fails. Many thanks. cain$ perl -MCatalyst::Plugin::Authentication::Credential::Password -e 'print Yay if Catalyst::Plugin::Authentication::Credential::Password-can(login);' Yay Strange. It doesn't print Yay. However, perl -e 'use Catalyst::Plugin::Authentication::Credential::Password' also doesn't complain, so it is there.Ok. Now use perldoc -l to find out where it is and go see if there's anythingodd about that file. If it isn't, I'd politely suggest this isn't Catalyst's fault and something REALLY WEIRD is going on with your system :)--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.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/