From will at serensoft.com Wed Jun 2 17:56:00 2010 From: will at serensoft.com (will@serensoft.com) Date: Wed Jun 2 17:56:07 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? Message-ID: Short version: Using [% c.req.uri_with({ page =3D> pager.next_page }) %] is fine for a sim= ple single-field search (where the form uses GET instead of POST)... but how do we PAGE through (and/or cache) a multi-field form search that uses POST? Long version: This is probably already a posted recipe somewhere, but I haven't had much luck finding answers via googling combinations of 'perl catalyst post cache pager' ... so pointers are welcome: # Form has lots of fields, we'll just nab a sample handful from the POST: my @terms =3D map{s/\s+//; $_} split /,/, $form->field('keywords'); # I know, but it's just an example, this isn't a robust search-field parser :) my %search =3D ( asof =3D> { # date field "asof" must be within date range '>=3D' =3D> $form->field('start_date'), '<=3D' =3D> $form->field('end_date'), }, terms =3D> [ # field "terms" can contain any of the keywords map { +{ -like =3D> '%' . $_ . '%' } } @terms ], ); my $page =3D $c->req->param('page'); $page =3D 1 if ! defined( $page ) || ! $page || $page =3D~ /\D/; my $result =3D $c->model('Package')->search( \%search, {page=3D>$page} ); $c->stash->{results} =3D $result; $c->stash->{pager} =3D $result->pager; Then, in the template: pager.prev_page}) %]">Prev pager.next_page}) %]">Next That works well for simple GET forms where the ?field=3Dval syntax is used = in the URI. What's the approach for paging the (cached?) query results from a complex-field POSTed search form? I'm imagining a two-table DB solution where we cache the found row-id's in table `cached_search_row` and link that to `cached_search`, then have the cached_search.id mentioned in the URI. I'm hoping there's a better way someone has already conjured up that doesn't have all the drawbacks of this approach that we haven't even thought of... Thanks in advance! -- = will trillich "It's only by saying 'no' that you can concentrate on the things that are really important." -- Steve Jobs -- = will trillich "It's only by saying 'no' that you can concentrate on the things that are really important." -- Steve Jobs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100602/ecc09= 07c/attachment.htm From swatt at infobal.com Wed Jun 2 18:11:23 2010 From: swatt at infobal.com (Stuart Watt) Date: Wed Jun 2 18:15:08 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: <4C069ECB.8060700@infobal.com> We do a redirect code 303 from the POST request handler to a GET handler = and page through it instead. This appears to be the HTTP 1.1 norm, and = anything else is risky, as POST is expected to change stuff in the = database. Paging through a POST result will (might) cause multiple = changes. This way caching is supposed to be handled right. --S Stuart Watt ARM Product Developer Information Balance On 6/2/2010 1:56 PM, will@serensoft.com wrote: > Short version: > > Using [% c.req.uri_with({ page =3D> pager.next_page }) %] is fine for a = > simple single-field search (where the form uses GET instead of = > POST)... but how do we PAGE through (and/or cache) a multi-field form = > search that uses POST? > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u= k/ > Dev site: http://dev.catalyst.perl.org/ > = -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100602/043c8= 1a6/attachment.htm From swatt at infobal.com Wed Jun 2 18:23:39 2010 From: swatt at infobal.com (Stuart Watt) Date: Wed Jun 2 18:27:25 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: <4C06A1AB.7090009@infobal.com> Actually, I'll elaborate our more detailed solution. 1. We don't actually use POST requests for search, but our GET requests = have many fields and strange Dojo magic 2. We serialize the query with its many fields, using a bit of = compression on the URI query string, and base 64 encoding, into a = relatively opaque and relatively short token 3. This string is used by our search request handler, which unpacks the = string and allows a pageable search by merging in a few additional = fields (_page and _page_size) which are not serialized (that was = underscore magic). Because the serialized/compressed search query token = is opaque and you can't have two searches with the same query token, we = use this as a cache key extensively for performance. We find this works well. Also, since we have a model object for the = search (with serialize/deserialize) we can create views on it which = allows us to generate nice textual descriptions of the search -- very = handy for user feedback. And our users like to keep a history using = these descriptions, so they can go back and look/run previous searches. The only problem would appear to be when the URLs become excessive for a = GET request. When this happens, the POST can handle the form, generate = the serialized/compressed search query bundle, and then hand off to the = GET request with that instead. One caveat we hit was Microsoft's IIS rejected path elements in URLs = which were more than 240 characters (bytes?) even the URL was sound. It = probably thought they might be files. So we did pass stuff as query = elements, as this seems to be more viable on Microsoft servers anyway. --S Stuart Watt ARM Product Developer Information Balance On 6/2/2010 1:56 PM, will@serensoft.com wrote: > Short version: > > Using [% c.req.uri_with({ page =3D> pager.next_page }) %] is fine for a = > simple single-field search (where the form uses GET instead of = > POST)... but how do we PAGE through (and/or cache) a multi-field form = > search that uses POST? > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u= k/ > Dev site: http://dev.catalyst.perl.org/ > = -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100602/81dcc= ca0/attachment.htm From syber.rus at gmail.com Thu Jun 3 12:51:16 2010 From: syber.rus at gmail.com (Oleg Pronin) Date: Thu Jun 3 12:51:31 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID:
... any number of params ... Page 2
2010/6/2 will@serensoft.com : > Short version: > Using [% c.req.uri_with({ page => pager.next_page }) %] is fine for a simple > single-field search (where the form uses GET instead of POST)... but how do > we PAGE through (and/or cache) a multi-field form search that uses POST? > > Long version: > This is probably already a posted recipe somewhere, but I haven't had much > luck finding answers via googling?combinations?of 'perl catalyst post cache > pager' ... so pointers are welcome: > > # Form has lots of fields, we'll just nab a sample handful from the POST: > my @terms = map{s/\s+//; $_} split /,/, $form->field('keywords'); > # I know, but it's just an example, this isn't a robust search-field parser > :) > my %search = ( > ?? ?asof => { > ?? ? ? ?# date field "asof" must be within date range > ?? ? ? ?'>=' =>?$form->field('start_date'), > ?? ? ? ?'<=' => $form->field('end_date'), > ?? ?}, > ?? ?terms => [ > ?? ? ? ?# field "terms" can contain any of the keywords > ?? ? ? ?map { +{ -like => '%' . $_ . '%' } } @terms > ?? ?], > ); > my $page = $c->req->param('page'); > $page = 1 if ! defined( $page ) || ! $page || $page =~ /\D/; > my $result = $c->model('Package')->search( \%search, {page=>$page} ); > $c->stash->{results} = $result; > $c->stash->{pager} = $result->pager; > > Then, in the template: > > Prev > Next > > That works well for simple GET forms where the ?field=val syntax is used in > the URI. > What's the approach for paging the (cached?) query results from a > complex-field POSTed search form? > I'm imagining a two-table DB solution where we cache the found row-id's in > table `cached_search_row` and link that to `cached_search`, then have the > cached_search.id mentioned in the URI. I'm hoping there's a better way > someone has already conjured up that doesn't have all the drawbacks of this > approach that we haven't even thought of... > Thanks in advance! > > -- > will trillich > "It's only by saying 'no' that you can concentrate on the things that are > really important." -- Steve Jobs > -- > will trillich > "It's only by saying 'no' that you can concentrate on the things that are > really important." -- Steve Jobs > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > From syber.rus at gmail.com Thu Jun 3 12:52:13 2010 From: syber.rus at gmail.com (Oleg Pronin) Date: Thu Jun 3 12:52:16 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: i forgot
2010/6/3 Oleg Pronin : > > ? > ?... any number of params > ? > ?... > > ? > ? ?Page 2 > ? > > > > 2010/6/2 will@serensoft.com : >> Short version: >> Using [% c.req.uri_with({ page => pager.next_page }) %] is fine for a simple >> single-field search (where the form uses GET instead of POST)... but how do >> we PAGE through (and/or cache) a multi-field form search that uses POST? >> >> Long version: >> This is probably already a posted recipe somewhere, but I haven't had much >> luck finding answers via googling?combinations?of 'perl catalyst post cache >> pager' ... so pointers are welcome: >> >> # Form has lots of fields, we'll just nab a sample handful from the POST: >> my @terms = map{s/\s+//; $_} split /,/, $form->field('keywords'); >> # I know, but it's just an example, this isn't a robust search-field parser >> :) >> my %search = ( >> ?? ?asof => { >> ?? ? ? ?# date field "asof" must be within date range >> ?? ? ? ?'>=' =>?$form->field('start_date'), >> ?? ? ? ?'<=' => $form->field('end_date'), >> ?? ?}, >> ?? ?terms => [ >> ?? ? ? ?# field "terms" can contain any of the keywords >> ?? ? ? ?map { +{ -like => '%' . $_ . '%' } } @terms >> ?? ?], >> ); >> my $page = $c->req->param('page'); >> $page = 1 if ! defined( $page ) || ! $page || $page =~ /\D/; >> my $result = $c->model('Package')->search( \%search, {page=>$page} ); >> $c->stash->{results} = $result; >> $c->stash->{pager} = $result->pager; >> >> Then, in the template: >> >> Prev >> Next >> >> That works well for simple GET forms where the ?field=val syntax is used in >> the URI. >> What's the approach for paging the (cached?) query results from a >> complex-field POSTed search form? >> I'm imagining a two-table DB solution where we cache the found row-id's in >> table `cached_search_row` and link that to `cached_search`, then have the >> cached_search.id mentioned in the URI. I'm hoping there's a better way >> someone has already conjured up that doesn't have all the drawbacks of this >> approach that we haven't even thought of... >> Thanks in advance! >> >> -- >> will trillich >> "It's only by saying 'no' that you can concentrate on the things that are >> really important." -- Steve Jobs >> -- >> will trillich >> "It's only by saying 'no' that you can concentrate on the things that are >> really important." -- Steve Jobs >> >> _______________________________________________ >> List: Catalyst@lists.scsys.co.uk >> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst >> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ >> Dev site: http://dev.catalyst.perl.org/ >> >> > From billcrawford1970 at gmail.com Fri Jun 4 15:58:35 2010 From: billcrawford1970 at gmail.com (Bill Crawford) Date: Fri Jun 4 15:58:40 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: On 2 June 2010 18:56, will@serensoft.com wrote: > Short version: > Using [% c.req.uri_with({ page => pager.next_page }) %] is fine for a simple > single-field search (where the form uses GET instead of POST)... but how do > we PAGE through (and/or cache) a multi-field form search that uses POST? What version of Catalyst::Runtime adds uri_with? Not found here using Ubuntu Lucid Loser (5.80022) ... From will at serensoft.com Fri Jun 4 16:26:57 2010 From: will at serensoft.com (will@serensoft.com) Date: Fri Jun 4 16:27:04 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: Bill -- We're running Catalyst::Runtime 5.80022 but uri_with comes via Catalyst::Request which doesn't appear to have a $VERSION specified. This is on Debian 5.0.4 (stable) but we've had to use CPAN to get more modern versions of many of the Debian libraries to get around the "uses NEXT which is deprecated" warnings. Oleg -- that seems delightfully sneaky for a GET form, definitely worth playing with. But how does that work the the $c->stash->{pager} paradigm to skip to "last page" for example? Stuart -- when you say you serialize the search form, are you using Javascript to compress/encapsulate things before they go to the server for unwrapping? And if you can elaborate more on the mechanics of 303-forwarding from a POST handler to a GET handler (or share a link or two) I'd be most appreciative. On Fri, Jun 4, 2010 at 10:58 AM, Bill Crawford wrote: > On 2 June 2010 18:56, will@serensoft.com wrote: > > Short version: > > Using [% c.req.uri_with({ page =3D> pager.next_page }) %] is fine for a > simple > > single-field search (where the form uses GET instead of POST)... but how > do > > we PAGE through (and/or cache) a multi-field form search that uses POST? > > What version of Catalyst::Runtime adds uri_with? Not found here using > Ubuntu Lucid Loser (5.80022) ... > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- = will trillich "It's only by saying 'no' that you can concentrate on the things that are really important." -- Steve Jobs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100604/0198b= 34d/attachment.htm From billcrawford1970 at gmail.com Fri Jun 4 18:14:12 2010 From: billcrawford1970 at gmail.com (Bill Crawford) Date: Fri Jun 4 18:14:15 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: References: Message-ID: On 4 June 2010 17:26, will@serensoft.com wrote: > Bill -- We're running Catalyst::Runtime 5.80022 but uri_with comes via > Catalyst::Request which doesn't appear to have a $VERSION specified. This is > on Debian 5.0.4 (stable) but we've had to use CPAN to get more modern > versions of many of the Debian?libraries?to get around the "uses NEXT which > is deprecated" warnings. It's OK, I typo'd a line to say "$c-req->uri_with(...)" and it gave me the helpfullest warning :) From moseley at hank.org Fri Jun 4 22:41:48 2010 From: moseley at hank.org (Bill Moseley) Date: Fri Jun 4 22:42:13 2010 Subject: [Catalyst] Catalyst::TraitFor::Model::DBIC::Schema::Replicated connect info Message-ID: The docs show: __PACKAGE__->config({ traits =3D> ['Replicated'] connect_info =3D> ['dbi:mysql:master', 'user', 'pass'], replicants =3D> [ ['dbi:mysql:slave1', 'user', 'pass'], ['dbi:mysql:slave2', 'user', 'pass'], ['dbi:mysql:slave3', 'user', 'pass'], ], balancer_args =3D> { master_read_weight =3D> 0.3 } }); Shouldn't that be regular connect_info? my %config =3D ( traits =3D> ['Replicated'], connect_info =3D> { dsn =3D> 'dbi:mysql:master', user =3D> 'username', pass =3D> 'password', }, replicants =3D> [ { dsn =3D> 'dbi:mysql:slave1', user =3D> 'username', pass =3D> 'password', }, { dsn =3D> 'dbi:mysql:slave1', user =3D> 'username', pass =3D> 'password', }, ], balancer_args =3D> { master_read_weight =3D> 0.3 } ); -- = Bill Moseley moseley@hank.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100604/e3985= dfb/attachment.htm From moseley at hank.org Sat Jun 5 02:19:37 2010 From: moseley at hank.org (Bill Moseley) Date: Sat Jun 5 02:20:00 2010 Subject: [Catalyst] Re: Catalyst::TraitFor::Model::DBIC::Schema::Replicated connect info In-Reply-To: References: Message-ID: It would seem there's a coercion for the synopsis syntax. So, I'm not clear if I'm using it incorrectly or if there's a problem. So, if I take the SYNOPSIS example: my %data =3D ( traits =3D> ['Replicated'], connect_info =3D> ['dbi:mysql:master', 'user', 'pass'], replicants =3D> [ ['dbi:mysql:slave1', 'user', 'pass'], ['dbi:mysql:slave2', 'user', 'pass'], ['dbi:mysql:slave3', 'user', 'pass'], ], balancer_args =3D> { master_read_weight =3D> 0.3 } ); and convert to YAML: balancer_args: master_read_weight: 0.3 connect_info: - dbi:mysql:master - user - pass replicants: - - dbi:mysql:slave1 - user - pass - - dbi:mysql:slave2 - user - pass - - dbi:mysql:slave3 - user - pass traits: - Replicated Then try with my actual YAML: balancer_args: master_read_weight: 0.3 connect_info: - dbi:Pg:dbname=3Dtest - - replicants: - - dbi:Pg:dbname=3Dslave - - traits: - Replicated Use of uninitialized value $driver in concatenation (.) or string at /usr/local/share/perl/5.10.0/DBIx/Class/Storage/DBI.pm line 935. DBIx::Class::Storage::throw_exception(): Can't locate DBIx/Class/Storage/DBI/.pm in @INC The hash-base connect_info works fine. -- = Bill Moseley moseley@hank.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100604/409d5= b75/attachment.htm From xyf.xiao at gmail.com Sun Jun 6 04:41:51 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Sun Jun 6 04:41:57 2010 Subject: [Catalyst] How use two wrapper? Message-ID: Hi, I'm new to Catalyst. I'd like to use one wrapper to some templates, the other wrapper to some other templates. But as Catalyst;:Manual::Tutorial, I can only define one wrapper like this: __PACKAGE__->config( # Change default TT extension TEMPLATE_EXTENSION =3D> '.tt2', # Set the location for TT files INCLUDE_PATH =3D> [ MyApp->path_to( 'root', 'src' ), ], # Set to 1 for detailed timer stats in your HTML as comments TIMER =3D> 0, # This is your wrapper template located in the 'root/src' WRAPPER =3D> 'wrapper.tt2', ); Thanks In advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100606/13732= 2b6/attachment.htm From xenoterracide at gmail.com Sun Jun 6 09:11:11 2010 From: xenoterracide at gmail.com (Caleb Cushing) Date: Sun Jun 6 09:11:18 2010 Subject: [Catalyst] How use two wrapper? In-Reply-To: References: Message-ID: On Sun, Jun 6, 2010 at 12:41 AM, Xiao Yafeng wrote: > ?? ? ?I'm new to Catalyst. I'd like to use one wrapper to some templates, > the other wrapper to some other templates. But as > Catalyst;:Manual::Tutorial, use different View's -- Caleb Cushing http://xenoterracide.blogspot.com From benvanstaveren at gmail.com Sun Jun 6 09:26:56 2010 From: benvanstaveren at gmail.com (Ben van Staveren) Date: Sun Jun 6 09:27:06 2010 Subject: [Catalyst] How use two wrapper? In-Reply-To: References: Message-ID: <4C0B69E0.4070805@gmail.com> Either set a stash variable indicating which wrapper you want to use, and modify your wrapper.tt2 as follows: [% IF stash_variable == 'thiswrapper' %] [% WRAPPER thiswrapper.tt2 %] [% content %] [% END %] [% ELSE %] [% WRAPPER thatwrapper.tt2%] [% content %] [% END %] [% END %] or just get rid of it altogether and set the right one in your templates. Xiao Yafeng wrote: > Hi, > I'm new to Catalyst. I'd like to use one wrapper to some > templates, the other wrapper to some other templates. But as > Catalyst;:Manual::Tutorial, > > I can only define one wrapper like this: > __PACKAGE__->config( > # Change default TT extension > TEMPLATE_EXTENSION => '.tt2', > # Set the location for TT files > INCLUDE_PATH => [ > MyApp->path_to( 'root', 'src' ), > ], > # Set to 1 for detailed timer stats in your HTML as comments > TIMER => 0, > # This is your wrapper template located in the 'root/src' > WRAPPER => 'wrapper.tt2', > ); > Thanks In advance! > ------------------------------------------------------------------------ > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- Ben van Staveren phone: +62 81 70777529 email: benvanstaveren@gmail.com From 2010 at denny.me Sun Jun 6 10:34:12 2010 From: 2010 at denny.me (Denny) Date: Sun Jun 6 10:34:24 2010 Subject: [Catalyst] How use two wrapper? In-Reply-To: References: Message-ID: <1275820452.4120.27.camel@serenity.denny.me> On Sun, 2010-06-06 at 12:41 +0800, Xiao Yafeng wrote: > I'm new to Catalyst. I'd like to use one wrapper to some templates, > the other wrapper to some other templates. Hiya, There's a page on the wiki which I think gives you what you want: http://wiki.catalystframework.org/wiki/gettingstarted/howtos/template_wrappers Read the 'Custom wrappers for parts of your site' section. Regards, Denny -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100606/5a80544f/attachment.pgp From xyf.xiao at gmail.com Sun Jun 6 11:15:43 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Sun Jun 6 11:15:50 2010 Subject: [Catalyst] How use two wrapper? In-Reply-To: <1275820452.4120.27.camel@serenity.denny.me> References: <1275820452.4120.27.camel@serenity.denny.me> Message-ID: Thanks! As your help, I've known a right way to do this. On Sun, Jun 6, 2010 at 6:34 PM, Denny <2010@denny.me> wrote: > On Sun, 2010-06-06 at 12:41 +0800, Xiao Yafeng wrote: > > I'm new to Catalyst. I'd like to use one wrapper to some templates, > > the other wrapper to some other templates. > > Hiya, > > There's a page on the wiki which I think gives you what you want: > > http://wiki.catalystframework.org/wiki/gettingstarted/howtos/template_wra= ppers > > Read the 'Custom wrappers for parts of your site' section. > > Regards, > Denny > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100606/2dded= f6f/attachment.htm From mopiw171 at gmail.com Mon Jun 7 09:15:40 2010 From: mopiw171 at gmail.com (prasad guna) Date: Mon Jun 7 09:15:44 2010 Subject: [Catalyst] Subclassing using Catalyst::Controller::REST Message-ID: HI All, I have implemented REST-ful interface to my app using Catalyst::Controller::Rest; i have several controllers and ideally i wanted to do something like this, package MyApp::Controller::RestOne; use base 'MyApp::Controller::RestParent'; sub thingOne:Path: ActionClass('REST'){} in the other class, package MyApp::Controller::RestTwo; use base 'MyApp::Controller::RestParent'; sub thingTwo:Path: ActionClass('REST'){} in the base class, package MyApp::Controller::RestParent; use base 'Catalyst::Controller::REST'; sub begin:Private{} .... in my config file, i have stash_key rest text/html View text/html TT text/xml XML::Simple text/x-yaml YAML application/json JSON text/x-json JSON and all the subclasses should inherit this config from the parent, and render the output using TT, however the child classes are using the default config and renders the output using YAML::HTML, so ideally what i need is, when a request is made the subclass should use the config from the parent class and forward to View::TT, Please let me know, how to do this. regards, Prasad. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/1deb1= 8e9/attachment.htm From bobtfish at bobtfish.net Mon Jun 7 13:17:02 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Mon Jun 7 13:14:25 2010 Subject: [Catalyst] Subclassing using Catalyst::Controller::REST In-Reply-To: References: Message-ID: <348FB149-5046-4731-AD5A-E7FA1FA1C883@bobtfish.net> On 7 Jun 2010, at 10:15, prasad guna wrote: > lasses are using the default config and renders the output using > YAML::HTML, > > so ideally what i need is, when a request is made the subclass > should use the config from the parent class and forward to View::TT, > > Please let me know, how to do this. Put the config you want shared into __PACKAGE__->config inside the parent class rather than the config file. Other than that, this will work exactly like you expect it to. Cheers t0m From mopiw171 at gmail.com Mon Jun 7 14:58:12 2010 From: mopiw171 at gmail.com (prasad guna) Date: Mon Jun 7 14:58:17 2010 Subject: [Catalyst] Subclassing using Catalyst::Controller::REST In-Reply-To: <348FB149-5046-4731-AD5A-E7FA1FA1C883@bobtfish.net> References: <348FB149-5046-4731-AD5A-E7FA1FA1C883@bobtfish.net> Message-ID: Thanks Tom, Its great and quick response and it Works now. PG. On Mon, Jun 7, 2010 at 2:17 PM, Tomas Doran wrote: > > On 7 Jun 2010, at 10:15, prasad guna wrote: > >> lasses are using the default config and renders the output using >> YAML::HTML, >> >> so ideally what i need is, when a request is made the subclass should use >> the config from the parent class and forward to View::TT, >> >> Please let me know, how to do this. >> > > Put the config you want shared into __PACKAGE__->config inside the parent > class rather than the config file. > > Other than that, this will work exactly like you expect it to. > > Cheers > t0m > > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/e8579= cf8/attachment.htm From rkitover at cpan.org Mon Jun 7 18:43:46 2010 From: rkitover at cpan.org (Rafael Kitover) Date: Mon Jun 7 18:43:46 2010 Subject: [Catalyst] Catalyst::Model::DBIC::Schema and dbh_maker In-Reply-To: References: Message-ID: <20100607184346.GF8723@hlagh.dongs> On Tue, May 25, 2010 at 07:36:36AM -0700, Bill Moseley wrote: > I would like my Catalyst::Model::DBIC::Schema model class to be able to > inspect the configuration and modify connect_info. Specifically, based on a > flag in the config either pass connect_info unmodified or replace > dsn/user/password with a dbh_maker sub. > > What seems to work ok is to use "before ' COMPONENT' => sub {}" and simply > modify the passed in arguments. I do not have any config in the model class > that I need to worry about merging with the passed in arguments. > > Is this a reasonable way to do this? You could also do "before setup => sub { ..." possibly in a trait. From rkitover at cpan.org Mon Jun 7 19:58:11 2010 From: rkitover at cpan.org (Rafael Kitover) Date: Mon Jun 7 19:58:12 2010 Subject: [Catalyst] Re: Catalyst::TraitFor::Model::DBIC::Schema::Replicated connect info In-Reply-To: References: Message-ID: <20100607195811.GG8723@hlagh.dongs> On Fri, Jun 04, 2010 at 07:19:37PM -0700, Bill Moseley wrote: ... > Then try with my actual YAML: > > balancer_args: > master_read_weight: 0.3 > connect_info: > - dbi:Pg:dbname=test > - > - > > replicants: > - > - dbi:Pg:dbname=slave > - > - > traits: > - Replicated > > > Use of uninitialized value $driver in concatenation (.) or string at > /usr/local/share/perl/5.10.0/DBIx/Class/Storage/DBI.pm line 935. > DBIx::Class::Storage::throw_exception(): Can't locate > DBIx/Class/Storage/DBI/.pm in @INC > > > The hash-base connect_info works fine. ... I think the extra blank line after the connect_info portion is throwing it off. I used this YAML successfully in my tutorial app: Model::DB: schema_class: MyApp::Schema traits: - Caching - Replicated connect_info: - dbi:SQLite:myapp.db - - replicants: - - dbi:SQLite:myapp2.db - - - - dbi:SQLite:myapp3.db - - - - dbi:SQLite:myapp4.db - - balancer_args: master_read_weight: 0.3 However, there is nothing wrong with using the hashref form, that is actually preferred. The arrayref form was used in the SYNOPSIS only to make the example more concise. The ::DBI::Replicated storage, to my knowledge, has only been tested on MySQL. If you are using it successfully with Postgres I would love to hear the details. Which replication software you are using, and does it work as you expect. From moseley at hank.org Tue Jun 8 00:39:25 2010 From: moseley at hank.org (Bill Moseley) Date: Tue Jun 8 00:39:51 2010 Subject: [Catalyst] Re: Catalyst::TraitFor::Model::DBIC::Schema::Replicated connect info In-Reply-To: <20100607195811.GG8723@hlagh.dongs> References: <20100607195811.GG8723@hlagh.dongs> Message-ID: On Mon, Jun 7, 2010 at 12:58 PM, Rafael Kitover wrote: > The ::DBI::Replicated storage, to my knowledge, has only been tested on > MySQL. If you are using it successfully with Postgres I would love to > hear the details. Which replication software you are using, and does it > work as you expect. > I've just started looking into using Replicated. Slony is used for replication and there's discussion of using pgbouncer for slave connection pooling. An existing application that uses the same database has a DBI subclass that works at the $dbh level to provide replication, so looking at using that also. Memcached is track when to force reads to the master after a write. This is keyed by user id -- i.e. once a user does a write then they are forced to the master for an amount of time to let the slaves catch up. What I'm now wondering about is where I could hook in to determine when a write to the master happens so I can make all subsequent queries also go to the master and to set a flag in memcached for other processes to detect. But, this is a discussion that should be on the DBIC list. -- = Bill Moseley moseley@hank.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/c6775= 1e0/attachment.htm From orasnita at gmail.com Tue Jun 8 08:16:44 2010 From: orasnita at gmail.com (Octavian Rasnita) Date: Tue Jun 8 08:16:57 2010 Subject: [Catalyst] Literal elements in uri_for generated paths Message-ID: Hi, I have tried to use uri_for() in some parameters of a Java applet, but that= URI should contain chars like { and } which then should be replaced by the= appled with something else: If I do this , { and } are URI encoded and I don't want that. Is it possible to create URIs that contain literal "{symbol}" when using ur= i_for() or uri_for_action()? Thanks. -- Octavian __________ Information from ESET NOD32 Antivirus, version of virus signatur= e database 5180 (20100607) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100608/ea2b4= 419/attachment.htm From moseley at hank.org Tue Jun 8 13:51:22 2010 From: moseley at hank.org (Bill Moseley) Date: Tue Jun 8 13:51:47 2010 Subject: [Catalyst] Wrong Content-Length value: 392918 Message-ID: I see these errors a few times a day. I wonder why this is happening -- could the browser really send the wrong content length? I seem to see it often in ajax calls for a progress bar, but also during file uploads and sometimes for just a normal post. Is there any additional info that could be included in the exception message that would help explain this? Perhaps the length of data actual read in addition to the content-length -- and maybe even the last few bytes read and the content-type? Could a failed or closed connection be causing this (and reported in the message)? # paranoia against wrong Content-Length header my $remaining =3D $length - $self->read_position; if ( $remaining > 0 ) { $self->finalize_read($c); Catalyst::Exception->throw( "Wrong Content-Length value: $length" ); } -- = Bill Moseley moseley@hank.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100608/e0417= db6/attachment.htm From stratman at gmail.com Wed Jun 9 14:13:41 2010 From: stratman at gmail.com (Mark A. Stratman) Date: Wed Jun 9 14:13:54 2010 Subject: [Catalyst] Literal elements in uri_for generated paths In-Reply-To: References: Message-ID: <148F28A2-5C5C-4C8B-8FE8-099ADD0D2389@gmail.com> If you're passing a string for the action anyway, why not just append the additional @args to it manually? String paths aren't url encoded, but the additional args will be. That is: c.uri_for('/static/data/eof/{symbol}.txt').path On Jun 8, 2010, at 3:16 AM, Octavian Rasnita wrote: > Hi, > > I have tried to use uri_for() in some parameters of a Java applet, but that URI should contain chars like { and } which then should be replaced by the appled with something else: > > > > If I do this , { and } are URI encoded and I don't want that. > > Is it possible to create URIs that contain literal "{symbol}" when using uri_for() or uri_for_action()? > > Thanks. > > -- > Octavian > > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 5180 (20100607) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100609/4606a189/attachment.htm From jshirley at gmail.com Wed Jun 9 14:44:20 2010 From: jshirley at gmail.com (J. Shirley) Date: Wed Jun 9 14:44:28 2010 Subject: [Catalyst] Literal elements in uri_for generated paths In-Reply-To: References: Message-ID: 2010/6/8 Octavian Rasnita : > Hi, > > I have tried to use uri_for() in some parameters of a Java applet, but that > URI should contain chars like { and } which then should be replaced by the > appled with something else: > > > > If I do this , { and } are URI encoded and I don't want that. > > Is it possible to create URIs that contain literal "{symbol}" when using > uri_for() or uri_for_action()? > > Thanks. > > -- > Octavian > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 5180 (20100607) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > This is a TODO test that I posted and haven't gotten around to actually fixing yet... sorry. http://cpansearch.perl.org/src/BOBTFISH/Catalyst-Runtime-5.80024/t/aggregate/unit_core_uri_for.t Search for "jshirley" and you'll see the test. I've completely forgotten about it, though. I'll see about fixing it shortly. The problem, if I recall, is that { is incorrectly seen as one of the characters that rfc3986 states should be encoded. Thanks, -Jay From will at serensoft.com Wed Jun 9 15:56:40 2010 From: will at serensoft.com (will@serensoft.com) Date: Wed Jun 9 16:05:09 2010 Subject: [Catalyst] Paging thru a complex POSTed search -- HOWTO? In-Reply-To: <4C06A1AB.7090009@infobal.com> References: <4C06A1AB.7090009@infobal.com> Message-ID: Stuart -- This sounds very intriguing. Can you share some code or pseudocode? That would be very instructive. Thanks! On Wed, Jun 2, 2010 at 1:23 PM, Stuart Watt wrote: > Actually, I'll elaborate our more detailed solution. > > 1. We don't actually use POST requests for search, but our GET requests > have many fields and strange Dojo magic > 2. We serialize the query with its many fields, using a bit of compression > on the URI query string, and base 64 encoding, into a relatively opaque a= nd > relatively short token > 3. This string is used by our search request handler, which unpacks the > string and allows a pageable search by merging in a few additional fields > (_page and _page_size) which are not serialized (that was underscore magi= c). > Because the serialized/compressed search query token is opaque and you ca= n't > have two searches with the same query token, we use this as a cache key > extensively for performance. > > We find this works well. Also, since we have a model object for the search > (with serialize/deserialize) we can create views on it which allows us to > generate nice textual descriptions of the search -- very handy for user > feedback. And our users like to keep a history using these descriptions, = so > they can go back and look/run previous searches. > > The only problem would appear to be when the URLs become excessive for a > GET request. When this happens, the POST can handle the form, generate the > serialized/compressed search query bundle, and then hand off to the GET > request with that instead. > > One caveat we hit was Microsoft's IIS rejected path elements in URLs which > were more than 240 characters (bytes?) even the URL was sound. It probably > thought they might be files. So we did pass stuff as query elements, as t= his > seems to be more viable on Microsoft servers anyway. > > --S > > Stuart Watt > ARM Product Developer > Information Balance > > On 6/2/2010 1:56 PM, will@serensoft.com wrote: > > Short version: > > Using [% c.req.uri_with({ page =3D> pager.next_page }) %] is fine for a > simple single-field search (where the form uses GET instead of POST)... b= ut > how do we PAGE through (and/or cache) a multi-field form search that uses > POST? > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u= k/ > Dev site: http://dev.catalyst.perl.org/ > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100609/faf0c= 3d7/attachment.htm From KBeal at crosscountry-auto.com Wed Jun 9 16:08:33 2010 From: KBeal at crosscountry-auto.com (Ken Beal) Date: Wed Jun 9 16:08:41 2010 Subject: [Catalyst] Question on upgraded module not working the way it used to (DBIx::Class::Schema::Loader) Message-ID: <4A714FC3FD5A3C468BF8E9F82815143E080614B7@BOS-MX.ccas-ccg.com> Hi, I recently upgraded the DBIx::Class::Schema::Loader module (from ??? to 0.05003), and found that it broke a previously-working syntax, of following a foreign key to another table. For instance, in the Catalyst Perl sub, I do "$c->stash->{builds} = [$c->model('DB::Build')->all];" Then, on the page (a TT page), I had a FOREACH loop "[% FOREACH build IN builds -%]", and inside it, printed out various values for each of the builds (server, version, source path, etc); one of these was a foreign key to an "environment" table, which has columns for "name" and "buildstring"; that line used to look like: [% build.environment_id.name %] ([% build.environment_id.buildstring %]) However, that syntax is no longer working; now I need to send the environment in a separate $c->stash call (and in several other places, in the Perl code, I have had to change it to do a lookup on the intermediate table first, then get the value-the multiple "->" no longer work). I realize this isn't strictly a Catalyst issue, but I do recall seeing a suggestion on the list to upgrade that module to fix something else (I think it was autocrud issues I was experiencing)-and now that it's breaking this very useful syntax, I'm wondering: a. if there's a way to bring it back easily (like adding some qw to the "use" line?); b. if I should revert to the working version (or some version in between what I previously had (how do I determine that, after the upgrade has already happened?), which fixes the autocrud issues but doesn't break the "multiple '->'" usefulness); and c. if there's perhaps some other solution? For now, the solution I've used seems kludgey; I added to the Perl sub this line: "$c->stash->{environments} = $c->model('DB::Environment')->all;". And, instead of the one-liner above in the TT, I now do 3 lines: [% envid = build.environment_id -%] [% env = environments.$envid -%] [% env.name %] ([% env.buildstring %]) Thanks, -- Ken Beal Senior Software Engineer, Build/Release Cross Country Automotive Services One Cabot Road Medford, MA 02155 p: (781) 306-3605 m: (978) 423-8977 e: kbeal@crosscountry-auto.com Confidentiality Note: This e-mail message and any attachments may contain confidential or privileged information. If you are not the intended recipient, please notify me immediately by replying to this message and destroy all copies of this message and any attachments. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100609/0dff9bfe/attachment.htm From rburbrid at cisco.com Wed Jun 9 21:53:06 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Wed Jun 9 21:50:45 2010 Subject: [Catalyst] Clean install doesn't work at all... any ideas? Message-ID: <4C100D42.1010905@cisco.com> Hey can anyone help me figure out this issue? I upgraded catalyst to = v5.80024 (from CPAN). A fresh install throws the following error. I = included module version numbers that seemed relevant ... Thanks! -Sir Moose: v1.07 Catalyst: v5.80024 Catalyst::Runtime: v5.80024 Catalyst::Devel: v1.27 possumtrot:~/dev/new/Catalyst/$ catalyst.pl TestApp created "TestApp" created "TestApp/script" created "TestApp/lib" created "TestApp/root" created "TestApp/root/static" created "TestApp/root/static/images" created "TestApp/t" created "TestApp/lib/TestApp" created "TestApp/lib/TestApp/Model" created "TestApp/lib/TestApp/View" created "TestApp/lib/TestApp/Controller" created "TestApp/testapp.conf" created "TestApp/lib/TestApp.pm" created "TestApp/lib/TestApp/Controller/Root.pm" created "TestApp/README" created "TestApp/Changes" created "TestApp/t/01app.t" created "TestApp/t/02pod.t" created "TestApp/t/03podcoverage.t" created "TestApp/root/static/images/catalyst_logo.png" created "TestApp/root/static/images/btn_120x50_built.png" created "TestApp/root/static/images/btn_120x50_built_shadow.png" created "TestApp/root/static/images/btn_120x50_powered.png" created "TestApp/root/static/images/btn_120x50_powered_shadow.png" created "TestApp/root/static/images/btn_88x31_built.png" created "TestApp/root/static/images/btn_88x31_built_shadow.png" created "TestApp/root/static/images/btn_88x31_powered.png" created "TestApp/root/static/images/btn_88x31_powered_shadow.png" created "TestApp/root/favicon.ico" created "TestApp/Makefile.PL" created "TestApp/script/testapp_cgi.pl" created "TestApp/script/testapp_fastcgi.pl" created "TestApp/script/testapp_server.pl" created "TestApp/script/testapp_test.pl" created "TestApp/script/testapp_create.pl" Change to application directory and Run "perl Makefile.PL" to make sure = your install is complete possumtrot:~/dev/new/Catalyst/$ cd TestApp/ possumtrot:~/dev/new/Catalyst/TestApp/$ script/testapp_server.pl Couldn't load class (TestApp) because: The metaclass of TestApp = (Moose::Meta::Class) is not compatible with the metaclass of its = superclass, Catalyst::Controller = (Class::MOP::Class::__ANON__::SERIAL::7) at = /misc/safeharbor/perl/i686-linux/Class/MOP/Class.pm line 190 = Class::MOP::Class::_check_metaclass_compatibility('Moose::Meta::Class=3DH= ASH(0x972d73c)') called at /misc/safeharbor/perl/i686-linux/Class/MOP/Class= .pm line 593 = Class::MOP::Class::superclasses('Moose::Meta::Class=3DHASH(0x972d73c)', = 'Moose::Object', 'Catalyst', 'Catalyst::Controller') called at = /misc/safeharbor/perl/i686-linux/Moose/Meta/Class.pm line 293 Moose::Meta::Class::superclasses('undef', 'Moose::Object', = 'Catalyst', 'Catalyst::Controller') called at = /misc/safeharbor/perl/Catalyst.pm line 97 Catalyst::import('Catalyst', '-Debug', 'ConfigLoader', = 'Static::Simple') called at = /auto/safeharbor/dev/safeharbor/rburbrid/new/Catalyst/TestApp/script/../lib= /TestApp.pm = line 15 TestApp::BEGIN() called at /misc/safeharbor/perl/Catalyst.pm line 19 eval {...} called at /misc/safeharbor/perl/Catalyst.pm line 19 require TestApp.pm called at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 114 Class::MOP::__ANON__() called at /misc/safeharbor/perl/Try/Tiny.pm = line 42 eval {...} called at /misc/safeharbor/perl/Try/Tiny.pm line 39 Try::Tiny::try('CODE(0x8db7a34)', 'CODE(0x97a2ea4)') called at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 125 Class::MOP::load_first_existing_class('TestApp') called at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 137 Class::MOP::load_class('TestApp') called at = /misc/safeharbor/perl/Catalyst/ScriptRole.pm line 61 = Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=3DHASH(0= x972d724)') called at /misc/safeharbor/perl/Catalyst/Script/Server.pm line = 181 = Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0x972d724)= ') called at /misc/safeharbor/perl/i686-linux/Class/MOP/Method/Wrapped.pm l= ine 48 = Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=3DHASH(0x= 972d724)') called at /misc/safeharbor/perl/i686-linux/Class/MOP/Method/Wrap= ped.pm line 89 = Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0x972d724)= ') called at /misc/safeharbor/perl/Catalyst/ScriptRunner.pm line 20 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'TestApp', = 'Server') called at script/testapp_server.pl line 8 BEGIN failed--compilation aborted at = /auto/safeharbor/dev/safeharbor/rburbrid/new/Catalyst/TestApp/script/../lib= /TestApp.pm = line 19. Compilation failed in require at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 114. at /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 120 Class::MOP::__ANON__('The metaclass of TestApp (Moose::Meta::Class) = is not compatib...') called at /misc/safeharbor/perl/Try/Tiny.pm line 66 Try::Tiny::try('CODE(0x8db7a34)', 'CODE(0x97a2ea4)') called at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 125 Class::MOP::load_first_existing_class('TestApp') called at = /misc/safeharbor/perl/i686-linux/Class/MOP.pm line 137 Class::MOP::load_class('TestApp') called at = /misc/safeharbor/perl/Catalyst/ScriptRole.pm line 61 = Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=3DHASH(0= x972d724)') called at /misc/safeharbor/perl/Catalyst/Script/Server.pm line = 181 = Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0x972d724)= ') called at /misc/safeharbor/perl/i686-linux/Class/MOP/Method/Wrapped.pm l= ine 48 = Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=3DHASH(0x= 972d724)') called at /misc/safeharbor/perl/i686-linux/Class/MOP/Method/Wrap= ped.pm line 89 = Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0x972d724)= ') called at /misc/safeharbor/perl/Catalyst/ScriptRunner.pm line 20 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'TestApp', = 'Server') called at script/testapp_server.pl line 8 possumtrot:~/dev/new/Catalyst/TestApp/$ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100609/f2b14= 9e6/attachment.htm From darren at darrenduncan.net Wed Jun 9 23:41:51 2010 From: darren at darrenduncan.net (Darren Duncan) Date: Wed Jun 9 23:41:55 2010 Subject: [Catalyst] Clean install doesn't work at all... any ideas? In-Reply-To: <4C100D42.1010905@cisco.com> References: <4C100D42.1010905@cisco.com> Message-ID: <4C1026BF.7030703@darrenduncan.net> Sir Robert Burbridge wrote: > Hey can anyone help me figure out this issue? I upgraded catalyst to > v5.80024 (from CPAN). A fresh install throws the following error. I > included module version numbers that seemed relevant ... > > Moose: v1.07 > Catalyst: v5.80024 > Catalyst::Runtime: v5.80024 > Catalyst::Devel: v1.27 I updated to the latest Moose et al and then created a new Catalyst app et al as you did, and I'm not seeing any errors. [Core Features] - Test::More ...loaded. (0.94 >= 0.88) - Catalyst::Runtime ...loaded. (5.80024 >= 5.80024) - Catalyst::Plugin::ConfigLoader ...loaded. (0.27) - Catalyst::Plugin::Static::Simple ...loaded. (0.29) - Catalyst::Action::RenderView ...loaded. (0.14) - Moose ...loaded. (1.07) - namespace::autoclean ...loaded. (0.11) - Config::General ...loaded. (2.48) Mind you, I also made sure to separately put Class::MOP up to date if that was needed, and I also did my tests on a different operating system, Mac OS X 10.6.3. I also had Perl 5.12.1, and I don't recall you saying what Perl version you had. -- Darren Duncan From bobtfish at bobtfish.net Thu Jun 10 08:58:18 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Thu Jun 10 08:55:44 2010 Subject: [Catalyst] Clean install doesn't work at all... any ideas? In-Reply-To: <4C100D42.1010905@cisco.com> References: <4C100D42.1010905@cisco.com> Message-ID: <03E0B175-C545-4358-ABF6-68AE68521414@bobtfish.net> On 9 Jun 2010, at 22:53, Sir Robert Burbridge wrote: > Hey can anyone help me figure out this issue? I upgraded catalyst > to v5.80024 (from CPAN). A fresh install throws the following > error. I included module version numbers that seemed relevant ... > > Thanks! > > -Sir > > Moose: v1.07 > Catalyst: v5.80024 > Catalyst::Runtime: v5.80024 > Catalyst::Devel: v1.27 What versions of the following do you have: Class::MOP MooseX::MethodAttributes MooseX::Role::WithOverloading if they're not the latest, can you upgrade each in turn and see if one of them fixes it for you? Cheers t0m From mopiw171 at gmail.com Thu Jun 10 09:58:19 2010 From: mopiw171 at gmail.com (prasad guna) Date: Thu Jun 10 09:58:23 2010 Subject: [Catalyst] Issues with IO module for my app Message-ID: HI All, I am running my app using fastCGi under lighttpd, I am getting the following error, i tried to trace the issue and googled for it, but cant find anything useful or does make sense to me, Can't load '/path/perl5/lib/perl5/darwin-2level/auto/IO/IO.bundle' for module IO: dlopen(/path/perl5/lib/perl5/darwin-2level/auto/IO/IO.bundle, 1): Symbol not found: _PL_Sv Referenced from: /path/perl5/lib/perl5/darwin-2level/auto/IO/IO.bundle Expected in: dynamic lookup at /path/perl5/lib/perl5/darwin-2level/IO.pm line 11 Compilation failed in require at /path/perl5/lib/perl5/darwin-2level/IO/Handle.pm line 266. BEGIN failed--compilation aborted at /path/perl5/lib/perl5/darwin-2level/IO/Handle.pm line 266. Compilation failed in require at /path/perl5/lib/perl5/darwin-2level/IO/Seekable.pm line 101. BEGIN failed--compilation aborted at /path/perl5/lib/perl5/darwin-2level/IO/Seekable.pm line 101. Compilation failed in require at /path/perl5/lib/perl5/darwin-2level/IO/File.pm line 133. BEGIN failed--compilation aborted at /path/perl5/lib/perl5/darwin-2level/IO/File.pm line 133. Compilation failed in require at /path/perl5/lib/perl5/Config/General.pm line 19. BEGIN failed--compilation aborted at /path/perl5/lib/perl5/Config/General.pm line 1/myApp9. Compilation failed in require at /myApp/lib/MyApp.pm line 27. BEGIN failed--compilation aborted at /myApp/lib/MyApp.pm line 27. Compilation failed in require at /myApp/script/myapp_fastcgi.pl line 11. BEGIN failed--compilation aborted at /myApp/script/myapp_fastcgi.pl line 11. other info: 1) the bundle is present in that path, 2) all the modules are uptodate. Please let me know , how to solve this issue. regards, Prasad. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100610/585d4= 0dd/attachment.htm From drew at drewtaylor.com Thu Jun 10 11:00:27 2010 From: drew at drewtaylor.com (Drew Taylor) Date: Thu Jun 10 11:00:36 2010 Subject: [Catalyst] Question on upgraded module not working the way it used to (DBIx::Class::Schema::Loader) In-Reply-To: <4A714FC3FD5A3C468BF8E9F82815143E080614B7@BOS-MX.ccas-ccg.com> References: <4A714FC3FD5A3C468BF8E9F82815143E080614B7@BOS-MX.ccas-ccg.com> Message-ID: T24gV2VkLCBKdW4gOSwgMjAxMCBhdCA1OjA4IFBNLCBLZW4gQmVhbCA8S0JlYWxAY3Jvc3Njb3Vu dHJ5LWF1dG8uY29tPndyb3RlOgoKPiAgSSByZWNlbnRseSB1cGdyYWRlZCB0aGUgREJJeDo6Q2xh c3M6OlNjaGVtYTo6TG9hZGVyIG1vZHVsZSAoZnJvbSA/Pz8gdG8KPiAwLjA1MDAzKSwgYW5kIGZv dW5kIHRoYXQgaXQgYnJva2UgYSBwcmV2aW91c2x5LXdvcmtpbmcgc3ludGF4LCBvZiBmb2xsb3dp bmcKPiBhIGZvcmVpZ24ga2V5IHRvIGFub3RoZXIgdGFibGUuICBGb3IgaW5zdGFuY2UsIGluIHRo ZSBDYXRhbHlzdCBQZXJsIHN1YiwgSQo+IGRvIOKAnCRjLT5zdGFzaC0+e2J1aWxkc30gPSBbJGMt Pm1vZGVsKCdEQjo6QnVpbGQnKS0+YWxsXTvigJ0KPgpGWUksIHRoZSBsYXRlc3QgdmVyc2lvbiBv ZiBTY2hlbWE6OkxvYWRlciBpcyBub3cgMC4wNy4gSXQgZ2VuZXJhdGVzIHNvbWUKdmVyeSBuaWNl IGxvb2tpbmcgUmVzdWx0IGNsYXNzZXMuIFBlcmhhcHMgeW91IHNob3VsZCBmaXJzdCB1cGdyYWRl IHRvIHRoaXMKdmVyc2lvbj8KCkRyZXcKLS0tLS0tLS0tLS0tLS0gbmV4dCBwYXJ0IC0tLS0tLS0t LS0tLS0tCkFuIEhUTUwgYXR0YWNobWVudCB3YXMgc2NydWJiZWQuLi4KVVJMOiBodHRwOi8vbGlz dHMuc2NzeXMuY28udWsvcGlwZXJtYWlsL2NhdGFseXN0L2F0dGFjaG1lbnRzLzIwMTAwNjEwLzkx ZTkzNzllL2F0dGFjaG1lbnQuaHRtCg== From bobtfish at bobtfish.net Thu Jun 10 14:19:20 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Thu Jun 10 14:16:40 2010 Subject: [Catalyst] Issues with IO module for my app In-Reply-To: References: Message-ID: <5F1F8365-EF70-43E1-8305-D4F7DDD63005@bobtfish.net> On 10 Jun 2010, at 10:58, prasad guna wrote: > I am running my app using fastCGi under lighttpd, > > I am getting the following error, i tried to trace the issue and > googled for it, but cant find anything useful or does make sense to > me, > > Can't load '/path/perl5/lib/perl5/darwin-2level/auto/IO/IO.bundle' > for module IO: dlopen(/path/perl5/lib/perl5/darwin-2level/auto/IO/ > IO.bundle, 1): Symbol not found: _PL_Sv > Referenced from: /path/perl5/lib/perl5/darwin-2level/auto/IO/ > IO.bundle > > 1) the bundle is present in that path, > 2) all the modules are uptodate. > > Please let me know , how to solve this issue. That module was built / installed with a different perl to the one you're running the application with. You'll want to force re-install it with the correct perl. Cheers t0m From rburbrid at cisco.com Thu Jun 10 15:11:45 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Thu Jun 10 15:09:21 2010 Subject: [Catalyst] Clean install doesn't work at all... any ideas? In-Reply-To: <03E0B175-C545-4358-ABF6-68AE68521414@bobtfish.net> References: <4C100D42.1010905@cisco.com> <03E0B175-C545-4358-ABF6-68AE68521414@bobtfish.net> Message-ID: <4C1100B1.1010609@cisco.com> On 06/10/2010 04:58 AM, Tomas Doran wrote: > > On 9 Jun 2010, at 22:53, Sir Robert Burbridge wrote: > >> Hey can anyone help me figure out this issue? I upgraded catalyst to = >> v5.80024 (from CPAN). A fresh install throws the following error. I = >> included module version numbers that seemed relevant ... >> >> Thanks! >> >> -Sir >> >> Moose: v1.07 >> Catalyst: v5.80024 >> Catalyst::Runtime: v5.80024 >> Catalyst::Devel: v1.27 > > What versions of the following do you have: > > Class::MOP > MooseX::MethodAttributes > MooseX::Role::WithOverloading > > if they're not the latest, can you upgrade each in turn and see if one = > of them fixes it for you? > > Cheers > t0m > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: = > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ Before updating -------------------- Perl: 5.8.6 Class::MOP: 1.01 MooseX::MethodAttributes: 0.22 (up to date) MooseX::Role::WithOverloading: 0.06 (up to date) I updated Class::MOP to from 1.01 -> 1.03 and this seems to have = resolved the error. In case it's helpful, I also just ran the versions of all catalyst deps = and have posted it below (slightly formatted for easier perusing). Thanks =3D) -Sir P.S. Let me know if there's any more info I can give to be helpful = towards fixing something if needed. Catalyst dependencies: possumtrot:~/dev/new/Catalyst/TestApp/$ perl -MCatalyst -e 'map { $_ =3D~ = s/\//::/g; $_ =3D~ s/\.pm//g; print "$_\n" } (keys %INC);' |sort +1 | = while read mod; do perlver $mod; done 0.08 Algorithm::C3 0.30 aliased 0.06 attributes 5.60 AutoLoader 2.06 base 0.08 B::Hooks::EndOfScope 1.03 Carp 6.04 Carp::Clan Carp::Heavy 5.80024 Catalyst Catalyst::ClassData Catalyst::Component Catalyst::Component::ApplicationAttribute Catalyst::Controller Catalyst::Exception Catalyst::Exception::Basic Catalyst::Exception::Detach Catalyst::Exception::Go Catalyst::Exception::Interface Catalyst::Log Catalyst::Request Catalyst::Request::Upload Catalyst::Response Catalyst::Utils 0.21 Class::C3 0.12 Class::C3::Adopt::NEXT Class::C3::next 1.03 Class::MOP 1.03 Class::MOP::Attribute 1.03 Class::MOP::Class 1.03 Class::MOP::Class::Immutable::Trait 1.03 Class::MOP::Deprecated 1.03 Class::MOP::Instance 1.03 Class::MOP::Method 1.03 Class::MOP::Method::Accessor 1.03 Class::MOP::Method::Constructor 1.03 Class::MOP::Method::Generated 1.03 Class::MOP::Method::Inlined 1.03 Class::MOP::Method::Wrapped 1.03 Class::MOP::Mixin 1.03 Class::MOP::Mixin::AttributeCore 1.03 Class::MOP::Mixin::HasAttributes 1.03 Class::MOP::Mixin::HasMethods 1.03 Class::MOP::Module 1.03 Class::MOP::Object 1.03 Class::MOP::Package 0.63 Class::Struct Config 1.04 constant 3.14 Cwd 1.08 Data::Dump 0.104 Data::OptList 0.02 Devel::GlobalDestruction 0.3 Devel::InnerPackage 1.05 DynaLoader 1.09 Errno 5.58 Exporter 5.58 Exporter::Heavy 1.05 Fcntl 2.73 File::Basename 2.08 File::Copy 1.07 File::Find 2.07 File::Path 3.14 File::Spec 1.3 File::Spec::Functions 1.5 File::Spec::Unix 1.00 File::stat 5.827 HTTP::Headers 5.834 HTTP::Message 5.827 HTTP::Request 1.21 IO 1.04 IO::Dir 1.10 IO::File 1.24 IO::Handle 1.09 IO::Seekable 1.28 IO::Socket 1.27 IO::Socket::INET 1.21 IO::Socket::UNIX 0.22 List::MoreUtils 1.23 List::Util 1.03 metaclass 3.9 Module::Pluggable::Object 1.07 Moose 1.07 Moose::Error::Default 1.07 Moose::Exporter 1.07 Moose::Meta::Class 1.07 Moose::Meta::Class::Immutable::Trait 1.07 Moose::Meta::Instance 1.07 Moose::Meta::Method 1.07 Moose::Meta::Method::Accessor 1.07 Moose::Meta::Method::Augmented 1.07 Moose::Meta::Method::Constructor 1.07 Moose::Meta::Method::Delegation 1.07 Moose::Meta::Method::Destructor 1.07 Moose::Meta::Method::Overridden 1.07 Moose::Meta::Role 1.07 Moose::Meta::Role::Application 1.07 Moose::Meta::Role::Application::RoleSummation 1.07 Moose::Meta::Role::Application::ToClass 1.07 Moose::Meta::Role::Application::ToInstance 1.07 Moose::Meta::Role::Application::ToRole 1.07 Moose::Meta::Role::Composite 1.07 Moose::Meta::Role::Method 1.07 Moose::Meta::Role::Method::Conflicting 1.07 Moose::Meta::Role::Method::Required 1.07 Moose::Meta::TypeCoercion 1.07 Moose::Meta::TypeCoercion::Union 1.07 Moose::Meta::TypeConstraint 1.07 Moose::Meta::TypeConstraint::Registry 1.07 Moose::Object 1.07 Moose::Role 1.07 Moose::Util 1.07 Moose::Util::MetaRole 1.07 Moose::Util::TypeConstraints 1.07 Moose::Util::TypeConstraints::OptimizedConstraints 0.00903 MooseX::Emulate::Class::Accessor::Fast MooseX::Emulate::Class::Accessor::Fast::Meta::Accessor 0.22 MooseX::MethodAttributes 0.22 MooseX::MethodAttributes::Inheritable 0.22 MooseX::MethodAttributes::Role 0.22 MooseX::MethodAttributes::Role::AttrContainer 0.22 MooseX::MethodAttributes::Role::AttrContainer::Inheritable 0.22 MooseX::MethodAttributes::Role::Meta::Class 0.22 MooseX::MethodAttributes::Role::Meta::Map 0.22 MooseX::MethodAttributes::Role::Meta::Method 0.22 MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped 0.22 MooseX::MethodAttributes::Role::Meta::Method::Wrapped 0.22 MooseX::MethodAttributes::Role::Meta::Role 0.22 MooseX::MethodAttributes::Role::Meta::Role::Application 0.06 MooseX::Role::WithOverloading 0.06 MooseX::Role::WithOverloading::Meta::Role 0.06 MooseX::Role::WithOverloading::Meta::Role::Application 0.06 MooseX::Role::WithOverloading::Meta::Role::Application::Composite 0.06 = MooseX::Role::WithOverloading::Meta::Role::Application::Composite::ToClass 0.06 = MooseX::Role::WithOverloading::Meta::Role::Application::Composite::ToInstan= ce = 0.06 = MooseX::Role::WithOverloading::Meta::Role::Application::Composite::ToRole 0.06 = MooseX::Role::WithOverloading::Meta::Role::Application::FixOverloadedRefs 0.06 MooseX::Role::WithOverloading::Meta::Role::Application::ToClass 0.06 MooseX::Role::WithOverloading::Meta::Role::Application::ToInstance 0.06 MooseX::Role::WithOverloading::Meta::Role::Application::ToRole 0.06 MooseX::Role::WithOverloading::Meta::Role::Composite 0.21 MooseX::Types 0.21 MooseX::Types::Base 0.21 MooseX::Types::CheckedUtilExports 0.21 MooseX::Types::Moose 0.21 MooseX::Types::TypeDecorator 0.21 MooseX::Types::UndefinedType 0.21 MooseX::Types::Util 0.11 MRO::Compat 0.11 namespace::autoclean 0.17 namespace::clean 0.60 NEXT 1.02 overload 0.03 Package::Stash 0.14 Params::Util 0.18 Path::Class 0.18 Path::Class::Dir 0.18 Path::Class::Entity 0.18 Path::Class::File 0.04 re 1.23 Scalar::Util 1.00 SelectSaver 1.77 Socket 2.15 Storable 1.03 strict 0.005 String::RewritePrefix 0.982 Sub::Exporter 0.04 Sub::Identify 0.925 Sub::Install 0.04 Sub::Name 1.05 Symbol 0.03 Text::SimpleTable 1.01 Tie::Hash 1.16 Tree::Simple 1.11 Tree::Simple::Visitor 0.02 Tree::Simple::Visitor::FindByUID 0.02 Try::Tiny 1.52 URI 3.29 URI::Escape URI::_generic URI::http URI::https URI::_query URI::QueryParam URI::_server 1.04 utf8 0.40 Variable::Magic 1.01 vars 1.03 warnings 1.00 warnings::register 0.02 XSLoader -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100610/3f17e= ded/attachment.htm From bobtfish at bobtfish.net Thu Jun 10 15:38:10 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Thu Jun 10 15:35:28 2010 Subject: [Catalyst] Clean install doesn't work at all... any ideas? In-Reply-To: <4C1100B1.1010609@cisco.com> References: <4C100D42.1010905@cisco.com> <03E0B175-C545-4358-ABF6-68AE68521414@bobtfish.net> <4C1100B1.1010609@cisco.com> Message-ID: <1FE65DAC-6B22-457B-AF61-28002EE022EA@bobtfish.net> On 10 Jun 2010, at 16:11, Sir Robert Burbridge wrote: > On 06/10/2010 04:58 AM, Tomas Doran wrote: >> >> >> On 9 Jun 2010, at 22:53, Sir Robert Burbridge wrote: >> >>> Hey can anyone help me figure out this issue? I upgraded catalyst >>> to v5.80024 (from CPAN). A fresh install throws the following >>> error. I included module version numbers that seemed relevant ... >>> >>> >>> Moose: v1.07 > Before updating > -------------------- > Perl: 5.8.6 > Class::MOP: 1.01 http://cpansearch.perl.org/src/FLORA/Moose-1.07/META.yml > > I updated Class::MOP to from 1.01 -> 1.03 and this seems to have > resolved the error. Not really surprising. The above META.yml implies that CMOP 1.02 is required for Moose 1.07. So either you've been force installing things manually and not paying attention, something is entirely broken in your toolchain which allowed this to happen or something deleted wherever the more recent release of Class::MOP was installed. Cheers t0m From rkitover at cpan.org Thu Jun 10 23:34:44 2010 From: rkitover at cpan.org (Rafael Kitover) Date: Thu Jun 10 23:34:38 2010 Subject: [Catalyst] Question on upgraded module not working the way it used to (DBIx::Class::Schema::Loader) In-Reply-To: <4A714FC3FD5A3C468BF8E9F82815143E080614B7@BOS-MX.ccas-ccg.com> References: <4A714FC3FD5A3C468BF8E9F82815143E080614B7@BOS-MX.ccas-ccg.com> Message-ID: <20100610233444.GJ8723@hlagh.dongs> On Wed, Jun 09, 2010 at 12:08:33PM -0400, Ken Beal wrote: > Then, on the page (a TT page), I had a FOREACH loop "[% FOREACH build IN > builds -%]", and inside it, printed out various values for each of the > builds (server, version, source path, etc); one of these was a foreign > key to an "environment" table, which has columns for "name" and > "buildstring"; that line used to look like: > > > > [% build.environment_id.name %] ([% > build.environment_id.buildstring %]) Now it would be: [% build.environment.name %] Look at your Result classes for the relationship names. If you want the old names, pass the naming=v4 option (after create=static on the helper command line.) From rkitover at cpan.org Thu Jun 10 23:46:34 2010 From: rkitover at cpan.org (Rafael Kitover) Date: Thu Jun 10 23:46:28 2010 Subject: [Catalyst] Re: Catalyst::TraitFor::Model::DBIC::Schema::Replicated connect info In-Reply-To: References: <20100607195811.GG8723@hlagh.dongs> Message-ID: <20100610234633.GK8723@hlagh.dongs> On Mon, Jun 07, 2010 at 05:39:25PM -0700, Bill Moseley wrote: > On Mon, Jun 7, 2010 at 12:58 PM, Rafael Kitover wrote: > > > The ::DBI::Replicated storage, to my knowledge, has only been tested on > > MySQL. If you are using it successfully with Postgres I would love to > > hear the details. Which replication software you are using, and does it > > work as you expect. > > > > I've just started looking into using Replicated. > > Slony is used for replication and there's discussion of using pgbouncer for > slave connection pooling. An existing application that uses the same > database has a DBI subclass that works at the $dbh level to provide > replication, so looking at using that also. > > Memcached is track when to force reads to the master after a write. This is > keyed by user id -- i.e. once a user does a write then they are forced to > the master for an amount of time to let the slaves catch up. > > What I'm now wondering about is where I could hook in to determine when a > write to the master happens so I can make all subsequent queries also go to > the master and to set a flag in memcached for other processes to detect. > > But, this is a discussion that should be on the DBIC list. > > -- > Bill Moseley > moseley@hank.org To detect a write, it is probably enough to 'around' insert, update, insert_bulk and delete (::DBI::Replicated is Moose.) They are handled by the master storage delegate. Two methods you might want to implement in your delegated-to storages are is_replicating and lag_behind_master (see ::Storage::DBI and ::DBI::Replicated::Pool .) With the default implementation, you of course are not guaranteed to always have the latest data when reading from a slave. From xyf.xiao at gmail.com Sat Jun 12 13:56:20 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Sat Jun 12 13:56:26 2010 Subject: [Catalyst] unrecognized characters Message-ID: Hi gurus, I'm new to Catalyst. I've found a strange situation when I wrote a website in utf-8. The page will change into unrecognized characters when I use DBD::Oracle plus WRAPPER directive. but if I use single module like DBD::Oracle or WRAPPER, it will retrieve correct words. Please help! any replies are welcome! I could post the source code if needed. Besides. I use Catalyst::Plugin::Unicode for encoding, it works fine when I just use DBD::Oracle module only. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100612/cce78= 416/attachment.htm From will at serensoft.com Sat Jun 12 14:22:30 2010 From: will at serensoft.com (will@serensoft.com) Date: Sat Jun 12 14:22:36 2010 Subject: [Catalyst] HOWTO: order_by a field in a related record, for paging Message-ID: $c->model()->search( {}, {order_by=3D>???, page=3D>$page} ) How do we "order_by" a field from a related record when pulling a resultset? We want to order users by team (then by lastname, firstname) and be able to PAGE back and forth... e.g. a User belongs_to a Team. my $team_name =3D $c->user->team->name; my $users =3D $c->model('My::User') ->search_rs( {}, { order_by =3D> { -asc =3D> ???user->team->name???, ###### howto? -asc =3D> 'lastname', -asc =3D> 'firstname', }, page =3D> $page, } ); We're wanting to order by team-name, then user-lastname, then user-firstname. Here's a perl sort AFTER we have the results: my $user_collection =3D [ sort { $a->team->name cmp $b->team->name || $a->lastname cmp $b->lastname || $a->firstname cmp $b->firstname } $users->all ]; But this approach doesn't allow for paging backward and forward over the list...? -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100612/91ad2= 240/attachment.htm From orasnita at gmail.com Sat Jun 12 19:11:07 2010 From: orasnita at gmail.com (Octavian Rasnita) Date: Sat Jun 12 19:11:21 2010 Subject: [Catalyst] HOWTO: order_by a field in a related record, for paging References: Message-ID: <68537A89725944D5B50119594FAC5922@teddy> From: > $c->model()->search( {}, {order_by=>???, page=>$page} ) > > How do we "order_by" a field from a related record when pulling a resultset? > We want to order users by team (then by lastname, firstname) and be able to > PAGE back and forth... > > e.g. a User belongs_to a Team. > > my $team_name = $c->user->team->name; > > my $users = $c->model('My::User') > ->search_rs( {}, { > order_by => { > -asc => ???user->team->name???, ###### howto? > -asc => 'lastname', > -asc => 'firstname', > }, > page => $page, > } ); > > We're wanting to order by team-name, then user-lastname, then > user-firstname. > > Here's a perl sort AFTER we have the results: > > my $user_collection = [ > sort { > $a->team->name cmp $b->team->name || > $a->lastname cmp $b->lastname || > $a->firstname cmp $b->firstname > } > $users->all > ]; > > But this approach doesn't allow for paging backward and forward over the > list...? > > -- > will trillich Hi, You can use an order_by block like: order_by => [ {-asc => 'team.name'}, {-asc => 'me.lastname'}, {-asc => 'me.firstname'}, ], Or, if there is -asc for everyone, you can use: order_by => ['team.name', 'me.firstname', 'me.lastname'], In the order_by blocks you need to use the names of the columns as they are used in the generated SQL query. For finding those names, use $ENV{DBIC_TRACE}++. HTH. Octavian From will at serensoft.com Sat Jun 12 19:43:58 2010 From: will at serensoft.com (will@serensoft.com) Date: Sat Jun 12 19:44:03 2010 Subject: [Catalyst] HOWTO: order_by a field in a related record, for paging In-Reply-To: <68537A89725944D5B50119594FAC5922@teddy> References: <68537A89725944D5B50119594FAC5922@teddy> Message-ID: Ah, after adding "join =3D> 'team'" (and tweaking fields to distinguish me.* items) that did the trick, thanks! $team_ids =3D [ map { "me.team" =3D> $_ } @id_list ]; my $users =3D $c->model('My::User') ->search_rs( $team_ids, { join =3D> 'team', order_by =3D> [ qw/team.name me.lastname me.firstname/ ], } ); Excellent, thanks! On Sat, Jun 12, 2010 at 2:11 PM, Octavian Rasnita wrote: > You can use an order_by block like: > > order_by =3D> [ > {-asc =3D> 'team.name'}, > {-asc =3D> 'me.lastname'}, > {-asc =3D> 'me.firstname'}, > ], > > Or, if there is -asc for everyone, you can use: > > order_by =3D> ['team.name', 'me.firstname', 'me.lastname'], > > In the order_by blocks you need to use the names of the columns as they a= re > used in the generated SQL query. For finding those names, use > $ENV{DBIC_TRACE}++. > > HTH. > > Octavian > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100612/5f4a0= a37/attachment.htm From will at serensoft.com Sat Jun 12 23:05:19 2010 From: will at serensoft.com (will@serensoft.com) Date: Sat Jun 12 23:05:23 2010 Subject: [Catalyst] FormBuilder: HOWTO make a particular OPTION disabled in a SELECT form? Message-ID: Catalyst (and Chaining in particular) is really, really sweet! Enjoying the exploration immensely. So here's our next puzzle: Objective: to DISABLE some of the We'd like to disable the SELECTNAME option and any INACTIVE options: We've tried using UNDEF in place of the team->id: $teams->[2][0] =3D undef; # where $teams->[2][1] eq 'Delta (inactiv= e)' But that just gives Is there a way to include DISABLED options without s/// after $form->prepare? -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100612/f005f= e27/attachment.htm From c.kras at pcc-online.net Sun Jun 13 09:14:44 2010 From: c.kras at pcc-online.net (Christiaan Kras) Date: Sun Jun 13 09:14:44 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? Message-ID: <4C14A184.1060401@pcc-online.net> Hi list, I'm currently looking at the available modules for implementing Log::Log4perl with my Catalyst app and would like to have some advice on it. I've found and tried Catalyst::Plugin::Log4perl::Simple but when using the module Catalyst warns about it using NEXT. So I'm wondering if it's smart to use it in its current state. When looking on I also found Log::Log4perl::Catalyst and Catalyst::Log::Log4perl. Where the former is part of the Log::Log4perl distribution. The latter still has some old issues open on which the author hasn't responded yet. So to me it seems abandoned. Other than that I don't really see much difference between both modules. I must note though that the former is very new and is only available since 2010/02/24 From this I'd say using Log::Log4perl::Catalyst is the way to go: it's part of the Log::Log4perl distribution and has no open bugs (at least not on the Catalyst module). Thanks. -- Christiaan Kras http://blog.htbaa.com http://www.brandweeruren.nl From davewood at gmx.at Sun Jun 13 09:42:50 2010 From: davewood at gmx.at (David Schmidt) Date: Sun Jun 13 09:42:54 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? In-Reply-To: <4C14A184.1060401@pcc-online.net> References: <4C14A184.1060401@pcc-online.net> Message-ID: On Sun, Jun 13, 2010 at 11:14 AM, Christiaan Kras wrote: > Hi list, > > I'm currently looking at the available modules for implementing > Log::Log4perl with my Catalyst app and would like to have some advice on it. > > I've found and tried Catalyst::Plugin::Log4perl::Simple but when using the > module Catalyst warns about it using NEXT. So I'm wondering if it's smart to > use it in its current state. > > When looking on I also found Log::Log4perl::Catalyst and > Catalyst::Log::Log4perl. Where the former is part of the Log::Log4perl > distribution. The latter still has some old issues open on which the author > hasn't responded yet. So to me it seems abandoned. Other than that I don't > really see much difference between both modules. I must note though that the > former is very new and is only available since 2010/02/24 > > From this I'd say using Log::Log4perl::Catalyst is the way to go: it's part > of the Log::Log4perl distribution and has no open bugs (at least not on the > Catalyst module). > > Thanks. > > -- > > Christiaan Kras > > http://blog.htbaa.com > http://www.brandweeruren.nl > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > Check whichever Plugin for log4perl Jay Shirley is recommending in this talk and go with it. http://www.presentingperl.org/opw2010/zen-maintenance/ greetings david -- David Schmidt | http://www.fm5.at From davewood at gmx.at Sun Jun 13 10:39:27 2010 From: davewood at gmx.at (David Schmidt) Date: Sun Jun 13 10:39:31 2010 Subject: [Catalyst] unrecognized characters In-Reply-To: References: Message-ID: On Sat, Jun 12, 2010 at 3:56 PM, Xiao Yafeng wrote: > Hi gurus, > ?? ? ? ? ? ?I'm new to Catalyst. I've found a strange situation when I wrote > a website in utf-8. The page will change into unrecognized characters when I > use DBD::Oracle plus WRAPPER directive. > but if I use single module like DBD::Oracle or WRAPPER, it will retrieve > correct words. > Please help! any replies are welcome! I could post the source code if > needed. > Besides. I use Catalyst::Plugin::Unicode for encoding, it works fine when I > just use DBD::Oracle module only. > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > Read the pod, the author suggests not to use it anymore http://search.cpan.org/dist/Catalyst-Plugin-Unicode/lib/Catalyst/Plugin/Unicode.pm -- David Schmidt | http://www.fm5.at From c.kras at pcc-online.net Sun Jun 13 10:56:01 2010 From: c.kras at pcc-online.net (Christiaan Kras) Date: Sun Jun 13 10:55:53 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? In-Reply-To: References: <4C14A184.1060401@pcc-online.net> Message-ID: <4C14B941.5080107@pcc-online.net> Thanks. He suggests Catalyst::Log::Log4perl. I guess I'll try both Catalyst::Log::Log4perl and Log::Log4perl::Catalyst then. Christiaan Kras http://blog.htbaa.com http://www.brandweeruren.nl Op 13-6-2010 11:42, David Schmidt schreef: > On Sun, Jun 13, 2010 at 11:14 AM, Christiaan Kras wrote: > >> Hi list, >> >> I'm currently looking at the available modules for implementing >> Log::Log4perl with my Catalyst app and would like to have some advice on it. >> >> I've found and tried Catalyst::Plugin::Log4perl::Simple but when using the >> module Catalyst warns about it using NEXT. So I'm wondering if it's smart to >> use it in its current state. >> >> When looking on I also found Log::Log4perl::Catalyst and >> Catalyst::Log::Log4perl. Where the former is part of the Log::Log4perl >> distribution. The latter still has some old issues open on which the author >> hasn't responded yet. So to me it seems abandoned. Other than that I don't >> really see much difference between both modules. I must note though that the >> former is very new and is only available since 2010/02/24 >> >> From this I'd say using Log::Log4perl::Catalyst is the way to go: it's part >> of the Log::Log4perl distribution and has no open bugs (at least not on the >> Catalyst module). >> >> Thanks. >> >> -- >> >> Christiaan Kras >> >> http://blog.htbaa.com >> http://www.brandweeruren.nl >> >> >> _______________________________________________ >> List: Catalyst@lists.scsys.co.uk >> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst >> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ >> Dev site: http://dev.catalyst.perl.org/ >> >> > Check whichever Plugin for log4perl Jay Shirley is recommending in > this talk and go with it. > > http://www.presentingperl.org/opw2010/zen-maintenance/ > > greetings > david > > > From jshirley at gmail.com Sun Jun 13 17:53:47 2010 From: jshirley at gmail.com (J. Shirley) Date: Sun Jun 13 17:53:55 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? In-Reply-To: <4C14B941.5080107@pcc-online.net> References: <4C14A184.1060401@pcc-online.net> <4C14B941.5080107@pcc-online.net> Message-ID: On Jun 13, 2010, at 3:56 AM, Christiaan Kras wrote: > Thanks. He suggests Catalyst::Log::Log4perl. > I guess I'll try both Catalyst::Log::Log4perl and Log::Log4perl::Catalyst then. > > Christiaan Kras The cspec issues can (in most cases) be safely ignored. If you do encounter any issues with using it, please let me know what they are and I'll work towards getting them fixed up. It does, however, look like the autoflush issue needs to be resolved. I'll see if I can get the tuits to chase that down next week. Thanks, -Jay From c.kras at pcc-online.net Sun Jun 13 21:09:11 2010 From: c.kras at pcc-online.net (Christiaan Kras) Date: Sun Jun 13 21:08:58 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? Message-ID: So far I haven't run into any issues. My app isn't production ready either so it doesn't receive much traffic either. -origineel bericht- Onderwerp: Re: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? Van: "J. Shirley" Datum: 13-06-2010 19:57 On Jun 13, 2010, at 3:56 AM, Christiaan Kras wrote: > Thanks. He suggests Catalyst::Log::Log4perl. > I guess I'll try both Catalyst::Log::Log4perl and Log::Log4perl::Catalyst then. > > Christiaan Kras The cspec issues can (in most cases) be safely ignored. If you do encounter any issues with using it, please let me know what they are and I'll work towards getting them fixed up. It does, however, look like the autoflush issue needs to be resolved. I'll see if I can get the tuits to chase that down next week. Thanks, -Jay _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ From xyf.xiao at gmail.com Mon Jun 14 01:05:35 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Mon Jun 14 01:05:41 2010 Subject: [Catalyst] unrecognized characters In-Reply-To: References: Message-ID: Thanks for your advice. I've solved it. On Sun, Jun 13, 2010 at 6:39 PM, David Schmidt wrote: > On Sat, Jun 12, 2010 at 3:56 PM, Xiao Yafeng wrote: > > Hi gurus, > > I'm new to Catalyst. I've found a strange situation when I > wrote > > a website in utf-8. The page will change into unrecognized characters > when I > > use DBD::Oracle plus WRAPPER directive. > > but if I use single module like DBD::Oracle or WRAPPER, it will retrieve > > correct words. > > Please help! any replies are welcome! I could post the source code if > > needed. > > Besides. I use Catalyst::Plugin::Unicode for encoding, it works fine wh= en > I > > just use DBD::Oracle module only. > > _______________________________________________ > > List: Catalyst@lists.scsys.co.uk > > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > > Dev site: http://dev.catalyst.perl.org/ > > > > > > Read the pod, the author suggests not to use it anymore > > > http://search.cpan.org/dist/Catalyst-Plugin-Unicode/lib/Catalyst/Plugin/U= nicode.pm > > > -- > David Schmidt | http://www.fm5.at > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100614/3b556= 9b0/attachment.htm From abuse at cabal.org.uk Mon Jun 14 09:02:29 2010 From: abuse at cabal.org.uk (Peter Corlett) Date: Mon Jun 14 09:02:35 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? In-Reply-To: <4C14A184.1060401@pcc-online.net> References: <4C14A184.1060401@pcc-online.net> Message-ID: <20100614090229.GA6495@mooli.org.uk> On Sun, Jun 13, 2010 at 11:14:44AM +0200, Christiaan Kras wrote: [...] > I've found and tried Catalyst::Plugin::Log4perl::Simple but when using the > module Catalyst warns about it using NEXT. So I'm wondering if it's smart > to use it in its current state. That's one of my modules, a very crude hack to scratch one of my itches. Although it gives a warning, it does work. It didn't give a warning when I wrote it, but CPAN has marched on. Since the warning's annoying me, I'll probably fix it over the next week or so. From dwueppel at gmail.com Mon Jun 14 13:46:01 2010 From: dwueppel at gmail.com (Derek Wueppelmann) Date: Mon Jun 14 13:46:16 2010 Subject: [Catalyst] FormBuilder: HOWTO make a particular OPTION disabled in a SELECT form? In-Reply-To: References: Message-ID: <1276523161.3119.4.camel@phosphorus.roaringpenguin.com> On Sat, 2010-06-12 at 18:05 -0500, will@serensoft.com wrote: > Catalyst (and Chaining in particular) is really, really sweet! > Enjoying the exploration immensely. So here's our next puzzle: > But that just gives > > Is there a way to include DISABLED options without s/// after > $form->prepare? You can manually render the form if you wish and then you can decide what to do when the value is undef, or your choice of value. That being said I can see why you would want to use the built-in render method. You should be able to perform any action on the $self->formbuilder object as you would to a CGI::FormBuilder, however a quick look through the man page and it doesn't seem like there is a built-in to disable a specific option. So it looks like you are going to have to manually render that form. That being said the default rendering template is fairly basic. -- o) Derek Wueppelmann (o (D . dwueppel@gmail.com D). ((` http://www.monkeynet.ca ( ) ` From bobtfish at bobtfish.net Mon Jun 14 23:05:58 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Mon Jun 14 23:03:14 2010 Subject: [Catalyst] unrecognized characters In-Reply-To: References: Message-ID: <67638108-2809-4D58-88B5-43B48C289BF7@bobtfish.net> On 14 Jun 2010, at 02:05, Xiao Yafeng wrote: > Thanks for your advice. I've solved it. Woo! \o/ Just for my information, what was the correct fix? Did C::P::Unicode::Encoding work better for you? Cheers t0m From bobtfish at bobtfish.net Mon Jun 14 23:10:26 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Mon Jun 14 23:07:45 2010 Subject: [Catalyst] Log::Log4perl::Catalyst or Catalyst::Log::Log4perl ? In-Reply-To: References: <4C14A184.1060401@pcc-online.net> <4C14B941.5080107@pcc-online.net> Message-ID: On 13 Jun 2010, at 18:53, J. Shirley wrote: > > On Jun 13, 2010, at 3:56 AM, Christiaan Kras wrote: > >> Thanks. He suggests Catalyst::Log::Log4perl. >> I guess I'll try both Catalyst::Log::Log4perl and >> Log::Log4perl::Catalyst then. >> >> Christiaan Kras > > The cspec issues can (in most cases) be safely ignored. There are patches to fix them (by removing most of the code) pending, but I haven't found the tuits to finish it yet.. > If you do encounter any issues with using it, please let me know > what they are and I'll work towards getting them fixed up. Ditto. > It does, however, look like the autoflush issue needs to be > resolved. I'll see if I can get the tuits to chase that down next > week. There are pending patches for a load of things - I haven't had the time to maintain it that it deserves recently, so if anyone else is prepared to help work on it I'd be entirely glad. I can say that it does work for me in production, and I do have some plans to get back to it (as I need to do some work on logging in various of my apps some time in the next couple of months)... Cheers t0m From xyf.xiao at gmail.com Tue Jun 15 00:58:43 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Tue Jun 15 00:58:49 2010 Subject: [Catalyst] unrecognized characters In-Reply-To: <67638108-2809-4D58-88B5-43B48C289BF7@bobtfish.net> References: <67638108-2809-4D58-88B5-43B48C289BF7@bobtfish.net> Message-ID: ;) You are right. I changed C::P::Unicode to C::P::Unicode::Encoding, and it works again. for more details, you may browse here: http://www.perlmonks.org/?node_id=3D844392 On Tue, Jun 15, 2010 at 7:05 AM, Tomas Doran wrote: > > On 14 Jun 2010, at 02:05, Xiao Yafeng wrote: > > Thanks for your advice. I've solved it. >> > > Woo! \o/ > > Just for my information, what was the correct fix? Did > C::P::Unicode::Encoding work better for you? > > Cheers > t0m > > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100615/ae2e3= 21d/attachment.htm From fayland at gmail.com Tue Jun 15 08:47:28 2010 From: fayland at gmail.com (Fayland Lam) Date: Tue Jun 15 08:47:53 2010 Subject: [Catalyst] possible to get uri fragment? Message-ID: c2VlLCBmb3IgZXhhbXBsZSBJIGhhdmUgc29tZSBjb2RlIGxpa2UKCiRjLT5sb2ctPmRlYnVnKER1 bXBlcihcJGMtPnJlcS0+dXJpKSk7CgppbiBpbmRleCBzdWIsIHRoZW4gSSB2aXNpdCBpdCBhcyBo dHRwOi8vbG9jYWxob3N0OjMwMDAvI3Rlc3QKd2hhdCBJIGNhbiBzZWUgaW4gdGhlIGRlYnVnIGNv bnNvbGUgaXMKCiRWQVIxID0gXGJsZXNzKCBkb3tcKG15ICRvID0gJ2h0dHA6Ly9sb2NhbGhvc3Q6 MzAwMC8nKX0sICdVUkk6Omh0dHAnICk7CgpzbywgaXMgaXQgcG9zc2libGUgdG8gZ2V0ICd0ZXN0 JyBpbiB0aGUgVVJMPyAoaXQncyBtYWlubHkgZm9yIHNvbWUgYWpheAp1c2luZywgalF1ZXJ5IGFk ZHJlc3MgY2hhbmdlcyB0aGUgdGhpbmdzIGFmdGVyICMgYW5kIHdlIHdhbnQgdG8gc2hvdyBwYWdl CmRlcGVuZHMgb24gdGhpbmdzIGFmdGVyICMgYWZ0ZXIgc2hhcmluZykKClRoYW5rcwoKLS0gCkZh eWxhbmQgTGFtIC8vIGh0dHA6Ly93d3cuZmF5bGFuZC5vcmcvCi0tLS0tLS0tLS0tLS0tIG5leHQg cGFydCAtLS0tLS0tLS0tLS0tLQpBbiBIVE1MIGF0dGFjaG1lbnQgd2FzIHNjcnViYmVkLi4uClVS TDogaHR0cDovL2xpc3RzLnNjc3lzLmNvLnVrL3BpcGVybWFpbC9jYXRhbHlzdC9hdHRhY2htZW50 cy8yMDEwMDYxNS80ODkzNTJiMi9hdHRhY2htZW50Lmh0bQo= From fayland at gmail.com Tue Jun 15 09:07:07 2010 From: fayland at gmail.com (Fayland Lam) Date: Tue Jun 15 09:07:31 2010 Subject: [Catalyst] Re: possible to get uri fragment? In-Reply-To: References: Message-ID: aG1tLCBpdCBzZWVtcyBzZXJ2ZXIgY2FuJ3QgZ2V0ICNmcmFnbWVudCBiZWNhdXNlIHRoZSBicm93 c2VyIGRvZXNuJ3Qgc2VuZCBpdAp0byBzZXJ2ZXI/CnNvIGxlYXZlIGl0LiBUaGFua3MKCk9uIFR1 ZSwgSnVuIDE1LCAyMDEwIGF0IDQ6NDcgUE0sIEZheWxhbmQgTGFtIDxmYXlsYW5kQGdtYWlsLmNv bT4gd3JvdGU6Cgo+IHNlZSwgZm9yIGV4YW1wbGUgSSBoYXZlIHNvbWUgY29kZSBsaWtlCj4KPiAk Yy0+bG9nLT5kZWJ1ZyhEdW1wZXIoXCRjLT5yZXEtPnVyaSkpOwo+Cj4gaW4gaW5kZXggc3ViLCB0 aGVuIEkgdmlzaXQgaXQgYXMgaHR0cDovL2xvY2FsaG9zdDozMDAwLyN0ZXN0Cj4gd2hhdCBJIGNh biBzZWUgaW4gdGhlIGRlYnVnIGNvbnNvbGUgaXMKPgo+ICRWQVIxID0gXGJsZXNzKCBkb3tcKG15 ICRvID0gJ2h0dHA6Ly9sb2NhbGhvc3Q6MzAwMC8nKX0sICdVUkk6Omh0dHAnICk7Cj4KPiBzbywg aXMgaXQgcG9zc2libGUgdG8gZ2V0ICd0ZXN0JyBpbiB0aGUgVVJMPyAoaXQncyBtYWlubHkgZm9y IHNvbWUgYWpheAo+IHVzaW5nLCBqUXVlcnkgYWRkcmVzcyBjaGFuZ2VzIHRoZSB0aGluZ3MgYWZ0 ZXIgIyBhbmQgd2Ugd2FudCB0byBzaG93IHBhZ2UKPiBkZXBlbmRzIG9uIHRoaW5ncyBhZnRlciAj IGFmdGVyIHNoYXJpbmcpCj4KPiBUaGFua3MKPgo+IC0tCj4gRmF5bGFuZCBMYW0gLy8gaHR0cDov L3d3dy5mYXlsYW5kLm9yZy8KPgoKCgotLSAKRmF5bGFuZCBMYW0gLy8gaHR0cDovL3d3dy5mYXls YW5kLm9yZy8KLS0tLS0tLS0tLS0tLS0gbmV4dCBwYXJ0IC0tLS0tLS0tLS0tLS0tCkFuIEhUTUwg YXR0YWNobWVudCB3YXMgc2NydWJiZWQuLi4KVVJMOiBodHRwOi8vbGlzdHMuc2NzeXMuY28udWsv cGlwZXJtYWlsL2NhdGFseXN0L2F0dGFjaG1lbnRzLzIwMTAwNjE1LzU0NWFjODhlL2F0dGFjaG1l bnQuaHRtCg== From cub.uanic at gmail.com Tue Jun 15 09:49:33 2010 From: cub.uanic at gmail.com (Oleg Kostyuk) Date: Tue Jun 15 09:50:03 2010 Subject: [Catalyst] Catalyst::Model::DBIC::Schema and dbh_maker In-Reply-To: References: Message-ID: 2010/5/25 Bill Moseley : > I would like my?Catalyst::Model::DBIC::Schema model class to be able to > inspect the configuration and modify connect_info. ?Specifically, based on a > flag in the config either pass connect_info unmodified or replace > dsn/user/password with a dbh_maker sub. Take a look at Catalyst::TraitFor::Model::DBIC::Schema::ConnectInfo::Several -- Sincerely yours, Oleg Kostyuk (CUB-UANIC) From bobtfish at bobtfish.net Tue Jun 15 10:21:33 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 15 10:18:37 2010 Subject: [Catalyst] Re: possible to get uri fragment? In-Reply-To: References: Message-ID: <42F9273E-52A9-47E9-A190-382A1F545060@bobtfish.net> On 15 Jun 2010, at 10:07, Fayland Lam wrote: > hmm, it seems server can't get #fragment because the browser doesn't > send it to server? Correct. Cheers t0m From stratman at gmail.com Tue Jun 15 13:58:07 2010 From: stratman at gmail.com (Mark A. Stratman) Date: Tue Jun 15 13:58:18 2010 Subject: [Catalyst] Re: possible to get uri fragment? In-Reply-To: References: Message-ID: <65BAFF58-2DC4-4D43-969C-4847DCA58130@gmail.com> On Jun 15, 2010, at 4:07 AM, Fayland Lam wrote: > hmm, it seems server can't get #fragment because the browser doesn't send it to server? > so leave it. Thanks If the links are being visited from other pages, what you can do is just add an http param to all named links. e.g. http://localhost/?anchor=test#test Or: http://localhost/test1#test1 http://localhost/test2#test2 etc Where all those are handled by your index and rendering the same template, and test1, test2 are just arguments. If the links are being clicked locally on the page with the anchors, then you'll need to set up some javascript 'click' handlers on the links. - mark From rburbrid at cisco.com Thu Jun 17 19:22:08 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Thu Jun 17 19:19:17 2010 Subject: [Catalyst] Extending Catalyst -- new elements Message-ID: <4C1A75E0.8070306@cisco.com> Looking through the catalyst docs, it looks like trying to use the = _create.pl script to create elements other than models, views, and = controllers is discouraged = (http://search.cpan.org/~bobtfish/Catalyst-Devel-1.28/lib/Catalyst/Helper.p= m#HELPERS). = Here's an excerpt. All helper classes should be under one of the following namespaces. Catalyst::Helper::Model:: Catalyst::Helper::View:: Catalyst::Helper::Controller:: I'm trying to canonize some best practices with my team at work = (thankfully we've just decided to move from vanilla-cgi to Catalyst, = Moose, DBIx::Class, etc.). I want to create some helpers for common = application elements (such as forms, for example -- I'm moving us = towards HTML::FormHandler). I'd like our structure to be something like: ./lib/ ./lib/MyApp.pm ./lib/MyApp/Model ./lib/MyApp/Model/DB.pm ./lib/MyApp/View ./lib/MyApp/View/TT.pm ./lib/MyApp/Controller ./lib/MyApp/Controller/Auth ./lib/MyApp/Controller/User ./lib/MyApp/Controller/... ./lib/MyApp/Schema/... ./lib/MyApp/Form/Auth/Login.pm ./lib/MyApp/Form/Auth/Register.pm ./lib/MyApp/Form/... I realize that HFH says "FormHandler does not provide a custom = controller for Catalyst because it isn't necessary. Interfacing to = FormHandler is only a couple of lines of code" -- but I don't quite = understand why I /wouldn't/ want one. It makes sense to me that I would be able to create a new form this way: script/myapp_create.pl form Auth::Login HTML::FormHandler --has_fields=3Dusername,password,email (or something). That would help to enforce the practice of putting form = stuff in the MyApp::Form:: namespace. As a helper, it doesn't really = seem to fit well with either Model, Controller, or View, so it seems as = though it would warrant being it's own element (I'm thinking along the = lines of Reaction or MVVM). My questions are: * Would this kind of functionality be better done in = Catalyst::Helper::(Model|View|Contoller):: or somewhere else? * Why? * Where can I read about how to put this wherever it should go? Thanks! -Sir -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100617/54829= 268/attachment.htm From pp at webtel.pl Fri Jun 18 08:58:51 2010 From: pp at webtel.pl (piotr pogorzelski) Date: Fri Jun 18 08:58:58 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <4C1A75E0.8070306@cisco.com> References: <4C1A75E0.8070306@cisco.com> Message-ID: <4C1B354B.90803@webtel.pl> > I'd like our structure to be something like: > > ./lib/ > ./lib/MyApp.pm > ./lib/MyApp/Model > ./lib/MyApp/Model/DB.pm > ./lib/MyApp/View > ./lib/MyApp/View/TT.pm > ./lib/MyApp/Controller > ./lib/MyApp/Controller/Auth > ./lib/MyApp/Controller/User > ./lib/MyApp/Controller/... > ./lib/MyApp/Schema/... > ./lib/MyApp/Form/Auth/Login.pm > ./lib/MyApp/Form/Auth/Register.pm > ./lib/MyApp/Form/... > Hi, I prefer instead of catalyst.pl MyApp run catalyst.pl MyApp::Catalyst and keep my model, helpers, or other application modules below MyApp::Catalyst, leaving MyApp::Catalyst for web interface modules. using DBIC::Schema i create it under MyApp::Schema later building model in MyApp::Model and importing it into Catalyst Model using Catalyst::Model::Adaptor Co catalyst is rather a big dispatcher and converter which on input maps web parameters to model parameters and model data to web methods specifications and renders it to html or JSON on output. -- regards piotr From bobtfish at bobtfish.net Fri Jun 18 09:15:04 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Fri Jun 18 09:12:10 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <4C1A75E0.8070306@cisco.com> References: <4C1A75E0.8070306@cisco.com> Message-ID: On 17 Jun 2010, at 20:22, Sir Robert Burbridge wrote: > My questions are: > * Would this kind of functionality be better done in > Catalyst::Helper::(Model|View|Contoller):: or somewhere else? No, you want to put it in about the right place. Currently the skeleton code generation only generates app templates and basic Model/View/Controller classes, as nobody has made the code generation flexible enough to generate other things. Patches to do so would be welcome, however it generally really is just a couple of lines of code, so the effort to work on it hasn't scratched anyone's itch really. Your talk of 'help enforce the practice of' makes me think that you're trying to solve a political / development organisation problem with code - which is rarely the right solution. I personally think you'd be better writing documentation / providing training to your team about why to do things a certain way, and/or instituting a code quality assurance process (such as code review). Both of these approaches are more likely to succeed in stopping people from generating shitty code than mandating a recipe with which you build applications by rote. Cheers t0m From bobtfish at bobtfish.net Fri Jun 18 09:17:37 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Fri Jun 18 09:14:41 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <4C1B354B.90803@webtel.pl> References: <4C1A75E0.8070306@cisco.com> <4C1B354B.90803@webtel.pl> Message-ID: <6D6D0760-EAE2-4FAE-8C76-ED6F41BB1CFD@bobtfish.net> On 18 Jun 2010, at 09:58, piotr pogorzelski wrote: > Hi, > I prefer instead of > catalyst.pl MyApp > run > catalyst.pl MyApp::Catalyst > > and keep my model, helpers, or other application > modules below MyApp::Catalyst, leaving MyApp::Catalyst for > web interface modules. > > using DBIC::Schema i create it under MyApp::Schema > > later building model in MyApp::Model and importing > it into Catalyst Model using Catalyst::Model::Adaptor I entirely agree with this idea, except for the naming scheme. I much prefer to name things by what they do, rather than what they are. E.g. MyApp::Web vs MyApp::Catalyst. E.g. MyApp::View::HTML vs MyApp::View::TT The former in both cases tells you what the code is _for_, the latter tells you instead what it's implemented with, which isn't (in my opinion) as semantically helpful when thinking about your application layout. Cheers t0m From rburbrid at cisco.com Fri Jun 18 14:48:33 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Fri Jun 18 14:45:36 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: References: <4C1A75E0.8070306@cisco.com> Message-ID: <4C1B8741.8000305@cisco.com> Thanks, t0m. The discussion on irc helped me clarify some things and figured out which way I wanted to pursue things. Comments inline. On 06/18/2010 05:15 AM, Tomas Doran wrote: > > On 17 Jun 2010, at 20:22, Sir Robert Burbridge wrote: >> My questions are: >> * Would this kind of functionality be better done in >> Catalyst::Helper::(Model|View|Contoller):: or somewhere else? > > No, you want to put it in about the right place. Ok, great. > Currently the skeleton code generation only generates app templates > and basic Model/View/Controller classes, as nobody has made the code > generation flexible enough to generate other things. > > Patches to do so would be welcome, however it generally really is just > a couple of lines of code, so the effort to work on it hasn't > scratched anyone's itch really. I'm going to mull over the skeleton code generation matter and see if it makes sense for me to work on that. If so, I'm happy to pass back some patches. > Your talk of 'help enforce the practice of' makes me think that you're > trying to solve a political / development organisation problem with > code - which is rarely the right solution. I personally think you'd be > better writing documentation / providing training to your team about > why to do things a certain way, and/or instituting a code quality > assurance process (such as code review). > One of the interesting things about some of the stuff I'm working on is that there's an influence from both the Ruby and PHP cultures. I have had to work on several php projects and it is the ugliest stuff I've ever had the displeasure to work with (maybe it was just those projects...). Ruby culture is pretty weird; they act like new money, with lots of ferraris and beach houses, but not a lot of substance (in fairness, that might be the rails culture, I'm not sure). Either way, RoR feels like a california investment banker in a convertable. In my experience, the PHP culture just plugs stuff in randomly until something works, then seals it up and builds on top of it. No real consultation of documentation, etc. RoR culture seems to need vods and helpers like crazy. Getting them to adopt Catalyst probably requires some "meeting them halfway" (in my projects, anyway). > Both of these approaches are more likely to succeed in stopping people > from generating shitty code than mandating a recipe with which you > build applications by rote. I'm actually OK with them generating bad code as long as it's well contained. I'm not trying to optimize for great code now, I'm trying to aim for the best use of time *over the next couple of years*. By creating generating stubs, I can help us create clean bundles of messy code that are relatively easy to straighten out as time goes on and we all get better at the craft (refactoring a terrible sub that has standardized input/output is way better than refactoring a module that has no discernable API!). > Cheers > t0m > Thanks, -Sir From rburbrid at cisco.com Fri Jun 18 14:49:21 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Fri Jun 18 14:46:23 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <4C1B354B.90803@webtel.pl> References: <4C1A75E0.8070306@cisco.com> <4C1B354B.90803@webtel.pl> Message-ID: <4C1B8771.2010101@cisco.com> On 06/18/2010 04:58 AM, piotr pogorzelski wrote: > >> I'd like our structure to be something like: >> >> ./lib/ >> ./lib/MyApp.pm >> ./lib/MyApp/Model >> ./lib/MyApp/Model/DB.pm >> ./lib/MyApp/View >> ./lib/MyApp/View/TT.pm >> ./lib/MyApp/Controller >> ./lib/MyApp/Controller/Auth >> ./lib/MyApp/Controller/User >> ./lib/MyApp/Controller/... >> ./lib/MyApp/Schema/... >> ./lib/MyApp/Form/Auth/Login.pm >> ./lib/MyApp/Form/Auth/Register.pm >> ./lib/MyApp/Form/... >> > > Hi, > I prefer instead of > catalyst.pl MyApp > run > catalyst.pl MyApp::Catalyst > > and keep my model, helpers, or other application > modules below MyApp::Catalyst, leaving MyApp::Catalyst for > web interface modules. > > using DBIC::Schema i create it under MyApp::Schema > > later building model in MyApp::Model and importing > it into Catalyst Model using Catalyst::Model::Adaptor > > Co catalyst is rather a big dispatcher and converter > which on input maps web parameters to model parameters and > model data to web methods specifications and renders it to > html or JSON on output. > > > -- > regards > piotr > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ Hmmm... That's a neat idea, poitr. Thanks. -Sir From rburbrid at cisco.com Fri Jun 18 14:50:53 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Fri Jun 18 14:47:55 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <6D6D0760-EAE2-4FAE-8C76-ED6F41BB1CFD@bobtfish.net> References: <4C1A75E0.8070306@cisco.com> <4C1B354B.90803@webtel.pl> <6D6D0760-EAE2-4FAE-8C76-ED6F41BB1CFD@bobtfish.net> Message-ID: <4C1B87CD.5050601@cisco.com> On 06/18/2010 05:17 AM, Tomas Doran wrote: > > On 18 Jun 2010, at 09:58, piotr pogorzelski wrote: >> Hi, >> I prefer instead of >> catalyst.pl MyApp >> run >> catalyst.pl MyApp::Catalyst >> >> and keep my model, helpers, or other application >> modules below MyApp::Catalyst, leaving MyApp::Catalyst for >> web interface modules. >> >> using DBIC::Schema i create it under MyApp::Schema >> >> later building model in MyApp::Model and importing >> it into Catalyst Model using Catalyst::Model::Adaptor > > I entirely agree with this idea, except for the naming scheme. I much > prefer to name things by what they do, rather than what they are. > > E.g. MyApp::Web vs MyApp::Catalyst. > E.g. MyApp::View::HTML vs MyApp::View::TT > > The former in both cases tells you what the code is _for_, the latter > tells you instead what it's implemented with, which isn't (in my > opinion) as semantically helpful when thinking about your application > layout. > > Cheers > t0m Yeah, that's just from habit (the docs on cpan and, I think, in the Catalyst book, have "script/myapp_create.pl view TT TT"). -Sir From bobtfish at bobtfish.net Fri Jun 18 16:10:41 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Fri Jun 18 16:07:38 2010 Subject: [Catalyst] Extending Catalyst -- new elements In-Reply-To: <4C1B87CD.5050601@cisco.com> References: <4C1A75E0.8070306@cisco.com> <4C1B354B.90803@webtel.pl> <6D6D0760-EAE2-4FAE-8C76-ED6F41BB1CFD@bobtfish.net> <4C1B87CD.5050601@cisco.com> Message-ID: On 18 Jun 2010, at 15:50, Sir Robert Burbridge wrote: > Yeah, that's just from habit (the docs on cpan and, I think, in the > Catalyst book, have "script/myapp_create.pl view TT TT"). I removed this from the help recently, and I believe it has also been removed from the manual (Caelum++). Use having documented things which when you stop to think about them are a horrible idea doesn't help ;) Cheers t0m From rburbrid at cisco.com Mon Jun 21 13:48:12 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Mon Jun 21 13:45:05 2010 Subject: [Catalyst] Contributing code Message-ID: <4C1F6D9C.3050104@cisco.com> Out of a discussion last week, I have some code to contribute (largely to Catalyst::Helper). Two quick questions: 1) I've never contributed code to a project outside my work before. How do I go about it? 2) I've noticed many times in the CPAN modules I've looked through tend to be very sparsely commented (disregarding POD). I tend to do a fair bit of inline comments (maybe about 1:2 comments:code). Is there some reason I should keep comments sparse in contributed code? Thanks! -Sir From avarab at gmail.com Mon Jun 21 14:19:02 2010 From: avarab at gmail.com (=?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?=) Date: Mon Jun 21 14:19:05 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C1F6D9C.3050104@cisco.com> References: <4C1F6D9C.3050104@cisco.com> Message-ID: On Mon, Jun 21, 2010 at 13:48, Sir Robert Burbridge wrote: > Out of a discussion last week, I have some code to contribute (largely to > Catalyst::Helper). > > Two quick questions: > > 1) ?I've never contributed code to a project outside my work before. ?How do > I go about it? Have you read http://wiki.catalystframework.org/wiki/contrib ? > 2) ?I've noticed many times in the CPAN modules I've looked through tend to > be very sparsely commented (disregarding POD). ?I tend to do a fair bit of > inline comments (maybe about 1:2 comments:code). ?Is there some reason I > should keep comments sparse in contributed code? It depends on what sort of comments you're making. Comments that explain tricky code that help with maintenance down the road are welcome everywhere. If you're just making comments that help someone completely unfamiliar with Catalyst to read the code it'll probably be more distracting than helpful to core devs. From rburbrid at cisco.com Mon Jun 21 14:31:12 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Mon Jun 21 14:28:01 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> Message-ID: <4C1F77B0.1030105@cisco.com> On 06/21/2010 10:19 AM, ?var Arnfj?r? Bjarmason wrote: > On Mon, Jun 21, 2010 at 13:48, Sir Robert Burbridge wrote: > >> Out of a discussion last week, I have some code to contribute (largely to >> Catalyst::Helper). >> >> Two quick questions: >> >> 1) I've never contributed code to a project outside my work before. How do >> I go about it? >> > Have you read http://wiki.catalystframework.org/wiki/contrib ? > > I hadn't -- thanks, that's what I needed to find. >> 2) I've noticed many times in the CPAN modules I've looked through tend to >> be very sparsely commented (disregarding POD). I tend to do a fair bit of >> inline comments (maybe about 1:2 comments:code). Is there some reason I >> should keep comments sparse in contributed code? >> > It depends on what sort of comments you're making. Comments that > explain tricky code that help with maintenance down the road are > welcome everywhere. If you're just making comments that help someone > completely unfamiliar with Catalyst to read the code it'll probably be > more distracting than helpful to core devs. > Hmmm ok. Tough call. I tend to explain rationale and ramifications more than describe the code. I'll try to keep everything terse (and I don't mind if the comments get removed by cooler heads =) Thanks -Sir From iainhubbard at googlemail.com Mon Jun 21 14:43:55 2010 From: iainhubbard at googlemail.com (iain) Date: Mon Jun 21 14:44:06 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> Message-ID: <4C1F7AAB.7050305@googlemail.com> ?var Arnfj?r? Bjarmason wrote: > It depends on what sort of comments you're making. Comments that > explain tricky code that help with maintenance down the road are > welcome everywhere. If you're just making comments that help someone > completely unfamiliar with Catalyst to read the code it'll probably be > more distracting than helpful to core devs. > > Surely the core devs can work with comments? Would having more comments not encourage more developers to contribute by lowering the barrier for entry? Iain. From jshirley at gmail.com Mon Jun 21 14:55:49 2010 From: jshirley at gmail.com (J. Shirley) Date: Mon Jun 21 14:55:56 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C1F7AAB.7050305@googlemail.com> References: <4C1F6D9C.3050104@cisco.com> <4C1F7AAB.7050305@googlemail.com> Message-ID: On Mon, Jun 21, 2010 at 7:43 AM, iain wrote: > ?var Arnfj?r? Bjarmason wrote: >> >> It depends on what sort of comments you're making. Comments that >> explain tricky code that help with maintenance down the road are >> welcome everywhere. If you're just making comments that help someone >> completely unfamiliar with Catalyst to read the code it'll probably be >> more distracting than helpful to core devs. >> >> > > Surely the core devs can work with comments? > > Would having more comments not encourage more developers to contribute by > lowering the barrier for entry? > I don't think I can count as a core developer anymore, but really the more comments the better (provided they aren't there so you can practice your buddy career as a novelist). If you can't write sane comments, though, I don't think you can write sane code :) From dwalu at cs.bu.edu Mon Jun 21 15:09:36 2010 From: dwalu at cs.bu.edu (Dwalu Z. Khasu) Date: Mon Jun 21 15:09:39 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C1F77B0.1030105@cisco.com> References: <4C1F6D9C.3050104@cisco.com> <4C1F77B0.1030105@cisco.com> Message-ID: On Mon, 21 Jun 2010, Sir Robert Burbridge wrote: =3D>On 06/21/2010 10:19 AM, =C6var Arnfj=F6r=F0 Bjarmason wrote: =3D>> On Mon, Jun 21, 2010 at 13:48, Sir Robert Burbridge =3D>> wrote: =3D>> = =3D>> > Out of a discussion last week, I have some code to contribute (larg= ely to =3D>> > Catalyst::Helper). =3D>> > =3D>> > Two quick questions: =3D>> > =3D>> > 1) I've never contributed code to a project outside my work before= . How =3D>> > do =3D>> > I go about it? =3D>> > = =3D>> Have you read http://wiki.catalystframework.org/wiki/contrib ? =3D>> =3D>> = =3D>I hadn't -- thanks, that's what I needed to find. =3D>> > 2) I've noticed many times in the CPAN modules I've looked through= tend =3D>> > to =3D>> > be very sparsely commented (disregarding POD). I tend to do a fair= bit of =3D>> > inline comments (maybe about 1:2 comments:code). Is there some rea= son I =3D>> > should keep comments sparse in contributed code? =3D>> > = =3D>> It depends on what sort of comments you're making. Comments that =3D>> explain tricky code that help with maintenance down the road are =3D>> welcome everywhere. If you're just making comments that help someone =3D>> completely unfamiliar with Catalyst to read the code it'll probably be =3D>> more distracting than helpful to core devs. =3D>> = =3D> =3D>Hmmm ok. Tough call. I tend to explain rationale and ramifications mo= re than =3D>describe the code. I'll try to keep everything terse (and I don't mind= if the =3D>comments get removed by cooler heads =3D) =3D> =3D> Rationale and ramifications (assumptions, etc), in my experience are much = more important than basic comments explaining the code or an attempt to = inject humor or hubris--which tends to be the average case. Better to have cogent 'Whys' any day so I say put them all in and if you = get enough complaints, they're easy enough to remove. -- = - Dwalu .peace -- I am an important person in this world - Now is the most important time in my life - My mistakes are my best teachers - So I will be fearless. - Student Creed From larryl at emailplus.org Mon Jun 21 15:23:46 2010 From: larryl at emailplus.org (Larry Leszczynski) Date: Mon Jun 21 15:23:50 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> Message-ID: <1277133826.20993.1381150777@webmail.messagingengine.com> > Have you read http://wiki.catalystframework.org/wiki/contrib ? To whom it may concern: This URL is currently (Jun. 21, 15:22:18 UTC) returning a 500 server error. Larry From pp at webtel.pl Mon Jun 21 15:59:10 2010 From: pp at webtel.pl (piotr pogorzelski) Date: Mon Jun 21 15:59:12 2010 Subject: [Catalyst] Contributing code In-Reply-To: <1277133826.20993.1381150777@webmail.messagingengine.com> References: <4C1F6D9C.3050104@cisco.com> <1277133826.20993.1381150777@webmail.messagingengine.com> Message-ID: <4C1F8C4E.7060405@webtel.pl> -------- Original Message -------- Subject: Re: [Catalyst] Contributing code From: Larry Leszczynski To: The elegant MVC web framework Date: Mon Jun 21 2010 17:23:46 GMT+0200 (CEST) >> Have you read http://wiki.catalystframework.org/wiki/contrib ? > > To whom it may concern: This URL is currently (Jun. 21, 15:22:18 UTC) > returning a 500 server error. > i got used to this feature, just reload the page once or twice From c.jackson at shadowcat.co.uk Mon Jun 21 16:14:27 2010 From: c.jackson at shadowcat.co.uk (Chris Jackson) Date: Mon Jun 21 16:14:31 2010 Subject: [Catalyst] Contributing code In-Reply-To: <1277133826.20993.1381150777@webmail.messagingengine.com> References: <4C1F6D9C.3050104@cisco.com> <1277133826.20993.1381150777@webmail.messagingengine.com> Message-ID: <4C1F8FE3.1040209@shadowcat.co.uk> Larry Leszczynski wrote: >> Have you read http://wiki.catalystframework.org/wiki/contrib ? > > To whom it may concern: This URL is currently (Jun. 21, 15:22:18 UTC) > returning a 500 server error. I'm afraid Mojomojo simply does that sometimes. Experienced Catalyst developers willing to work on it are welcome to do just that! ;) -- Chris Jackson Shadowcat Systems Ltd. From diment at gmail.com Mon Jun 21 21:38:12 2010 From: diment at gmail.com (Kieren Diment) Date: Mon Jun 21 21:38:24 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C1F6D9C.3050104@cisco.com> References: <4C1F6D9C.3050104@cisco.com> Message-ID: On 21/06/2010, at 11:48 PM, Sir Robert Burbridge wrote: > Out of a discussion last week, I have some code to contribute (largely to Catalyst::Helper). > > Two quick questions: > [snip q 1 ] > 2) I've noticed many times in the CPAN modules I've looked through tend to be very sparsely commented (disregarding POD). I tend to do a fair bit of inline comments (maybe about 1:2 comments:code). Is there some reason I should keep comments sparse in contributed code? > If you're contributing a to CPAN, then you're almost certainly contributing a reusable library. As a potential user of your library, I as a rule will want to avoid reading your source code if at all possible (there are people who don't feel this way, and code where this approach can be an exception, but for widest use, make this assumption). Given this, please ensure the POD you contribute is reasonably complete. However, I can see a role for comments in a Catalyst::Helper extension to provide educational information for other people wanting to contribute to the helper modules, so if you want to take this approach, then by all means give it a go. From darren at darrenduncan.net Tue Jun 22 02:05:56 2010 From: darren at darrenduncan.net (Darren Duncan) Date: Tue Jun 22 02:06:00 2010 Subject: [Catalyst] perms on gen script/ files differ between platforms Message-ID: <4C201A84.9050606@darrenduncan.net> I noticed today that generating a new Catalyst app under 2 different platforms, Mac OS X and Linux/CentOS, produces files with different sets of initial file permissions. Both of these are the latest released Catalyst under Perl 5.12.1. On Mac OS X, the initial 5 files in script/ had these permissions: -rwx------ ... where the owner can execute but no one else can do anything. On CentOS, the same files had these permissions: -rw-rw-r-- ... where no one can execute but everyone can read. So what is the reason for this difference? Is it intentional or a bug? Thank you. -- Darren Duncan From rafl at debian.org Tue Jun 22 02:10:04 2010 From: rafl at debian.org (Florian Ragwitz) Date: Tue Jun 22 02:10:06 2010 Subject: [Catalyst] perms on gen script/ files differ between platforms In-Reply-To: <4C201A84.9050606@darrenduncan.net> References: <4C201A84.9050606@darrenduncan.net> Message-ID: <20100622021003.GH20913@perldition.org> On Mon, Jun 21, 2010 at 07:05:56PM -0700, Darren Duncan wrote: > On Mac OS X, the initial 5 files in script/ had these permissions: > > -rwx------ > > ... where the owner can execute but no one else can do anything. > > On CentOS, the same files had these permissions: > > -rw-rw-r-- > > ... where no one can execute but everyone can read. > > So what is the reason for this difference? Is it intentional or a > bug? I'm guessing your umask settings on both systems differ. -- BOFH excuse #10: hardware stress fractures -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100622/065f1257/attachment.pgp From darren at darrenduncan.net Tue Jun 22 02:34:01 2010 From: darren at darrenduncan.net (Darren Duncan) Date: Tue Jun 22 02:34:04 2010 Subject: [Catalyst] perms on gen script/ files differ between platforms In-Reply-To: <20100622021003.GH20913@perldition.org> References: <4C201A84.9050606@darrenduncan.net> <20100622021003.GH20913@perldition.org> Message-ID: <4C202119.20006@darrenduncan.net> Florian Ragwitz wrote: > On Mon, Jun 21, 2010 at 07:05:56PM -0700, Darren Duncan wrote: >> On Mac OS X, the initial 5 files in script/ had these permissions: >> >> -rwx------ >> >> ... where the owner can execute but no one else can do anything. >> >> On CentOS, the same files had these permissions: >> >> -rw-rw-r-- >> >> ... where no one can execute but everyone can read. >> >> So what is the reason for this difference? Is it intentional or a >> bug? > > I'm guessing your umask settings on both systems differ. Thanks for the pointer; I wasn't previously aware of the "umask" feature of Unixes, though I'm not surprised it exists either. The umask does indeed differ on the 2 systems, but their values suggest this isn't the complete story. Typing "umask" on the Mac OS X gives "0022" and on Linux gives "0002". This would suggest default file permissions "-rw-r--r--" on Mac OS X and "-rw-rw-r--" on Linux. So, umask can explain the Linux perms all by themselves but there must be more to it with the Mac OS X. Regardless, I consider my question to be answered, so thank you. -- Darren Duncan From toby.corkindale at strategicdata.com.au Tue Jun 22 07:55:45 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue Jun 22 07:56:00 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> Message-ID: <4C206C81.4030007@strategicdata.com.au> On 22/06/10 00:19, ?var Arnfj?r? Bjarmason wrote: > On Mon, Jun 21, 2010 at 13:48, Sir Robert Burbridge wrote: >> Out of a discussion last week, I have some code to contribute (largely to >> Catalyst::Helper). >> >> Two quick questions: >> >> 1) I've never contributed code to a project outside my work before. How do >> I go about it? > > Have you read http://wiki.catalystframework.org/wiki/contrib ? I think I asked about this last time (to great silence), but.. what's the correct base path for the Git repos there? ie. git clone http://git.shadowcat.co.uk/????/Catalyst-Devel.git From chisel at chizography.net Tue Jun 22 10:27:51 2010 From: chisel at chizography.net (Chisel) Date: Tue Jun 22 10:28:02 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C206C81.4030007@strategicdata.com.au> References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: On Tue, Jun 22, 2010 at 8:55 AM, Toby Corkindale wrote: > > I think I asked about this last time (to great silence), but.. what's the correct base path for the Git repos there? > > ie. git clone http://git.shadowcat.co.uk/????/Catalyst-Devel.git $ git clone git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git Initialized empty Git repository in /private/tmp/Catalyst-Devel/.git/ remote: Counting objects: 2167, done. remote: Compressing objects: 100% (1059/1059), done. remote: Total 2167 (delta 1132), reused 1930 (delta 1018) Receiving objects: 100% (2167/2167), 341.08 KiB, done. Resolving deltas: 100% (1132/1132), done. mac008:tmp c.wright$ ls Catalyst-Devel/ Changes??? ??? MANIFEST.SKIP??? lib??? ??? t INSTALL.SKIP??? Makefile.PL??? share??? ??? xt I agree that it's a bit annoying that the summary page for the project isn't more helpful by explicitly showing the clone URL and relies on a bit of educated guessing to find. Chiz -- Chisel e: chisel@chizography.net w: http://chizography.net From rburbrid at cisco.com Tue Jun 22 14:32:04 2010 From: rburbrid at cisco.com (Sir Robert Burbridge) Date: Tue Jun 22 14:28:59 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> Message-ID: <4C20C964.9030203@cisco.com> On 06/21/2010 05:38 PM, Kieren Diment wrote: > On 21/06/2010, at 11:48 PM, Sir Robert Burbridge wrote: > > >> Out of a discussion last week, I have some code to contribute (largely to Catalyst::Helper). >> >> Two quick questions: >> [snip q 1 ] >> 2) I've noticed many times in the CPAN modules I've looked through tend to be very sparsely commented (disregarding POD). I tend to do a fair bit of inline comments (maybe about 1:2 comments:code). Is there some reason I should keep comments sparse in contributed code? >> >> > If you're contributing a to CPAN, then you're almost certainly contributing a reusable library. As a potential user of your library, I as a rule will want to avoid reading your source code if at all possible (there are people who don't feel this way, and code where this approach can be an exception, but for widest use, make this assumption). Given this, please ensure the POD you contribute is reasonably complete. > > However, I can see a role for comments in a Catalyst::Helper extension to provide educational information for other people wanting to contribute to the helper modules, so if you want to take this approach, then by all means give it a go. > Yeah, I generally do two kinds of documentation: * Comments provide engineering information * POD provides API information The two are for different purposes and targeted towards different audiences. -Sir From bobtfish at bobtfish.net Tue Jun 22 15:03:01 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 22 14:59:45 2010 Subject: [Catalyst] Contributing code In-Reply-To: <4C206C81.4030007@strategicdata.com.au> References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: <6372B14F-4F7C-48E3-AAC2-4F828A62AA26@bobtfish.net> On 22 Jun 2010, at 08:55, Toby Corkindale wrote: > I think I asked about this last time (to great silence), but.. > what's the correct base path for the Git repos there? > > ie. git clone http://git.shadowcat.co.uk/????/Catalyst-Devel.git Like the CPAN search page says, it is git://git.shadowcat.co.uk/ catagits/Catalyst-Devel.git (from http://search.cpan.org/dist/Catalyst-Devel/) Cheers t0m From bobtfish at bobtfish.net Tue Jun 22 15:04:11 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 22 15:00:54 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: On 22 Jun 2010, at 11:27, Chisel wrote: > I agree that it's a bit annoying that the summary page for the project > isn't more helpful by explicitly showing the clone URL and relies on a > bit of educated guessing to find. By 'the summary page for the project', you mean something other than the search.cpan page, right (as that does contain this info)? What? Cheers t0m From chisel at chizography.net Tue Jun 22 16:01:53 2010 From: chisel at chizography.net (Chisel) Date: Tue Jun 22 16:02:00 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: T24gVHVlLCBKdW4gMjIsIDIwMTAgYXQgNDowNCBQTSwgVG9tYXMgRG9yYW4gPGJvYnRmaXNoQGJv YnRmaXNoLm5ldD4gd3JvdGU6Cgo+IEJ5ICd0aGUgc3VtbWFyeSBwYWdlIGZvciB0aGUgcHJvamVj dCcsIHlvdSBtZWFuIHNvbWV0aGluZyBvdGhlciB0aGFuIHRoZQo+IHNlYXJjaC5jcGFuIHBhZ2Us IHJpZ2h0IChhcyB0aGF0IGRvZXMgY29udGFpbiB0aGlzIGluZm8pPwo+Cj4gV2hhdD8KPgoKSWYg eW91IGhhcHBlbiB1cG9uIHRoZSBnaXQgcmVwbyB0aGVyZSdzIG5vIG9idmlvdXMgZ2l0IGNsb25l IFVSTCAuLi4KCmh0dHA6Ly9naXQuc2hhZG93Y2F0LmNvLnVrL2dpdHdlYi9naXR3ZWIuY2dpP3A9 Y2F0YWdpdHMvQ2F0YWx5c3QtRGV2ZWwuZ2l0O2E9c3VtbWFyeQoKaXMgZnVsbCBvZiB1c2VmdWwg Y29tbWl0IG1lc3NhZ2VzLCBidXQgbm8gaGVscCBmb3IgcGVvcGxlIHRoYXQgd291bGQgbGlrZSB0 bwpjaGVjayBvdXQgdGhlIHByb2plY3QgYXMgbmV3LgoKSSdtIHNwb2lsZWQgYnkgZ2l0aHViIGFu ZCBnaXRvc2lzIGhhdmluZyBlYXN5IHRvIHNwb3QsIGNvcHkgYW5kIHVzZSBnaXQ6Ly8KVVJMcyBm b3IgYSByZXBvIGNsb25lIGFjdGlvbi4KCi0tIApDaGlzZWwKZTogY2hpc2VsQGNoaXpvZ3JhcGh5 Lm5ldAp3OiBodHRwOi8vY2hpem9ncmFwaHkubmV0Ci0tLS0tLS0tLS0tLS0tIG5leHQgcGFydCAt LS0tLS0tLS0tLS0tLQpBbiBIVE1MIGF0dGFjaG1lbnQgd2FzIHNjcnViYmVkLi4uClVSTDogaHR0 cDovL2xpc3RzLnNjc3lzLmNvLnVrL3BpcGVybWFpbC9jYXRhbHlzdC9hdHRhY2htZW50cy8yMDEw MDYyMi84MDA0M2VmNS9hdHRhY2htZW50Lmh0bQo= From bobtfish at bobtfish.net Tue Jun 22 17:26:21 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 22 17:23:06 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: On 22 Jun 2010, at 17:01, Chisel wrote: > I'm spoiled by github and gitosis having easy to spot, copy and use > git:// URLs for a repo clone action. Erm, you are looking at a gitosis install :) But I get exactly what you're saying about the clone URI - that would be entirely useful here.. Cheers t0m From asjo at koldfront.dk Tue Jun 22 17:39:02 2010 From: asjo at koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Date: Tue Jun 22 17:39:15 2010 Subject: [Catalyst] Re: Contributing code In-Reply-To: (chisel@chizography.net's message of "Tue, 22 Jun 2010 17:01:53 +0100") References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: <87ocf3nf0p.fsf@topper.koldfront.dk> On Tue, 22 Jun 2010 17:01:53 +0100, Chisel wrote: > http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Devel.git;a=summary > is full of useful commit messages, but no help for people that would like to > check out the project as new. > I'm spoiled by github and gitosis having easy to spot, copy and use git:// > URLs for a repo clone action. For what it is worth: cgit shows clone URLs as well - I think it compares quite nicely to gitweb: * http://hjemli.net/git/cgit/ Best regards, Adam -- "My internal clock is on Tokyo time." Adam Sj?gren asjo@koldfront.dk From nigel.metheringham at dev.intechnology.co.uk Tue Jun 22 19:21:07 2010 From: nigel.metheringham at dev.intechnology.co.uk (Nigel Metheringham) Date: Tue Jun 22 19:21:12 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> Message-ID: On 22 Jun 2010, at 18:26, Tomas Doran wrote: > > But I get exactly what you're saying about the clone URI - that would be entirely useful here.. Should just be a case of setting @git_base_url_list in the overall gitweb config file. Nigel. -- [ Nigel Metheringham Nigel.Metheringham@InTechnology.com ] [ - Comments in this message are my own and not ITO opinion/policy - ] From will at serensoft.com Tue Jun 22 20:15:18 2010 From: will at serensoft.com (will@serensoft.com) Date: Tue Jun 22 21:34:13 2010 Subject: [Catalyst] view error - file error - MyApp_Model_MyApp_Team: not found Message-ID: We've got a bit of a mystery here: User 1 from Team A can visit /team and see sub-teams and organize them just fine. User 2 from Team B gets a relatively low-level Catalyst error: "Here's the error message, on the off-chance that it means something to you: view error - file error - MyApp_Model_MyApp_Team: not found" We've done a serious amount of grepping and haven't found what might cause this. Odder still is that some users can access the /team url and others can't. It seems to be related to which TEAM a user belongs to... Move user X to team B, boom! Move user X to team A, all is lovely. Any suggestions on how to track down what might cause a VIEW ERROR like this? -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100622/083e1= 7b3/attachment.htm From bobtfish at bobtfish.net Tue Jun 22 22:42:57 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 22 22:39:51 2010 Subject: [Catalyst] view error - file error - MyApp_Model_MyApp_Team: not found In-Reply-To: References: Message-ID: <6C9C753A-4CC4-479A-A42B-CFACEAEA3587@bobtfish.net> On 22 Jun 2010, at 21:15, will@serensoft.com wrote: > "Here's the error message, on the off-chance that it means something > to you: view error - file error - MyApp_Model_MyApp_Team: not found" > > Any suggestions on how to track down what might cause a VIEW ERROR > like this? I would very much guess that something is stamping on $c->stash- >{template} (or just setting is so that it isn't being automatically determined). Dump an error page (with ?dump_info=1) from each of them and check if that stash variable is defined (and what it's set to) in each case? If you're manually setting the template yourself (rather than letting your view do it for you) then Value::Canary may be handy to find out where it's being stamped on from. Otherwise attacking your view class with some debugging to find out how it's working out the template name (and why it's getting it wrong) is probably the way to go. Cheers t0m From toby.corkindale at strategicdata.com.au Wed Jun 23 06:23:06 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed Jun 23 06:23:21 2010 Subject: [Catalyst] Contributing code In-Reply-To: <6372B14F-4F7C-48E3-AAC2-4F828A62AA26@bobtfish.net> References: <4C1F6D9C.3050104@cisco.com> <4C206C81.4030007@strategicdata.com.au> <6372B14F-4F7C-48E3-AAC2-4F828A62AA26@bobtfish.net> Message-ID: <4C21A84A.7050105@strategicdata.com.au> On 23/06/10 01:03, Tomas Doran wrote: > > On 22 Jun 2010, at 08:55, Toby Corkindale wrote: > >> I think I asked about this last time (to great silence), but.. what's >> the correct base path for the Git repos there? >> >> ie. git clone http://git.shadowcat.co.uk/????/Catalyst-Devel.git > > Like the CPAN search page says, it is > git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git (from > http://search.cpan.org/dist/Catalyst-Devel/) Cheers - can I suggest that URL is added to the Contributing Code wiki page that was originally linked in this email thread? From will at serensoft.com Wed Jun 23 06:37:27 2010 From: will at serensoft.com (will@serensoft.com) Date: Wed Jun 23 06:37:36 2010 Subject: [Catalyst] view error - file error - MyApp_Model_MyApp_Team: not found In-Reply-To: <6C9C753A-4CC4-479A-A42B-CFACEAEA3587@bobtfish.net> References: <6C9C753A-4CC4-479A-A42B-CFACEAEA3587@bobtfish.net> Message-ID: Curiouser and curiouser. The View class (TTSite) contains only __PACKAGE__->config, so there's not much to debug there. Comparing dump_info for situations where it works vs. doesn't work shows that one stash variable is different, and it's just something that's used in a .tt2 file for display. So there's... Waitaminit -- in that .tt2 file we were trying to implement recursive TT views via perlmonks.org/?node_id=3D570059 and after taking that out, all is well. SOLVED! Thanks for the dump_info tip, very nice! On Tue, Jun 22, 2010 at 5:42 PM, Tomas Doran wrote: > > On 22 Jun 2010, at 21:15, will@serensoft.com wrote: > >> "Here's the error message, on the off-chance that it means something to >> you: view error - file error - MyApp_Model_MyApp_Team: not found" >> >> > > > Any suggestions on how to track down what might cause a VIEW ERROR like >> this? >> > > > I would very much guess that something is stamping on $c->stash->{templat= e} > (or just setting is so that it isn't being automatically determined). > > Dump an error page (with ?dump_info=3D1) from each of them and check if t= hat > stash variable is defined (and what it's set to) in each case? > > If you're manually setting the template yourself (rather than letting your > view do it for you) then Value::Canary may be handy to find out where it's > being stamped on from. Otherwise attacking your view class with some > debugging to find out how it's working out the template name (and why it's > getting it wrong) is probably the way to go. > > Cheers > t0m > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100623/ad6db= 7f0/attachment.htm From bobtfish at bobtfish.net Wed Jun 23 11:29:57 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Wed Jun 23 11:26:41 2010 Subject: [Catalyst] view error - file error - MyApp_Model_MyApp_Team: not found In-Reply-To: References: <6C9C753A-4CC4-479A-A42B-CFACEAEA3587@bobtfish.net> Message-ID: <080CAE16-E62A-4D30-9CAB-0F1B0CCFC50F@bobtfish.net> On 23 Jun 2010, at 07:37, will@serensoft.com wrote: > The View class (TTSite) contains only __PACKAGE__->config, so > there's not much to debug there. That's entirely wrong, or it wouldn't work.. It also inherits from something. I was suggesting putting the debugging where the functionality is actually implemented.. :) Cheers t0m From will at serensoft.com Wed Jun 23 14:23:29 2010 From: will at serensoft.com (will@serensoft.com) Date: Wed Jun 23 14:30:34 2010 Subject: [Catalyst] view error - file error - MyApp_Model_MyApp_Team: not found In-Reply-To: <080CAE16-E62A-4D30-9CAB-0F1B0CCFC50F@bobtfish.net> References: <6C9C753A-4CC4-479A-A42B-CFACEAEA3587@bobtfish.net> <080CAE16-E62A-4D30-9CAB-0F1B0CCFC50F@bobtfish.net> Message-ID: Ah, yes, there is the inheritance. :) But no first-hand code to speak of... So we wound up doing what you were suggesting anyway without understanding that that was what you were suggesting. Bonk! Thanks for your help, t0m. On Wed, Jun 23, 2010 at 6:29 AM, Tomas Doran wrote: > > On 23 Jun 2010, at 07:37, will@serensoft.com wrote: > >> The View class (TTSite) contains only __PACKAGE__->config, so there's not >> much to debug there. >> > > That's entirely wrong, or it wouldn't work.. It also inherits from > something. > > I was suggesting putting the debugging where the functionality is actually > implemented.. :) > > > Cheers > t0m > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100623/8e570= 0dd/attachment.htm From will at serensoft.com Wed Jun 23 14:34:54 2010 From: will at serensoft.com (will@serensoft.com) Date: Wed Jun 23 14:34:59 2010 Subject: [Catalyst] What's the recommended EMAIL portion of the Catalyst framework, these days? Message-ID: Googling around the 'net we find all kinds of different advice about which packages to use for Emailing from Catalyst, each with a different timestamp and lots of recommendations about how other modules are deprecated... Catalyst::Plugin::Email? Catalyst::View::Email? MIME::Lite? Email::Sender::Simple? Email::Stuff? ...other? So we thought we'd ask the list: which module is modern and recommended enough to use for Emailing via Catalyst? Basically after a trouble-ticked is opened/created we want to send an email alerting appropriate folks to that fact... Thanks! -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100623/8b778= 046/attachment.htm From bogdan at sinapticode.ro Wed Jun 23 14:44:36 2010 From: bogdan at sinapticode.ro (Bogdan Lucaciu) Date: Wed Jun 23 14:44:51 2010 Subject: [Catalyst] What's the recommended EMAIL portion of the Catalyst framework, these days? In-Reply-To: References: Message-ID: We've used Catalyst::View::Email since forever and I recommend it. I would ignore Catalyst::Plugin::Email. C::V::Email uses?Email::Sender::Simple under the hood for everything, so you should be a bit familiar with its API. It previously used Email::Send (which is now deprecated in favor to Email::Sender), so make sure you don't confuse the two. Enjoy :) On Wed, Jun 23, 2010 at 5:34 PM, will@serensoft.com wrote: > > Googling around the 'net we find all kinds of different advice about which packages to use for Emailing from Catalyst, each with a different timestamp and lots of recommendations about how other modules are deprecated... > > Catalyst::Plugin::Email? > Catalyst::View::Email? > MIME::Lite? > Email::Sender::Simple? > Email::Stuff? > ...other? > > So we thought we'd ask the list: which module is modern and recommended enough to use for Emailing via Catalyst? > > Basically after a trouble-ticked is opened/created we want to send an email alerting appropriate folks to that fact... > > Thanks! > > -- > will trillich > "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- Bogdan Lucaciu Operations Manager, Sinapticode http://www.sinapticode.com From paulm at paulm.com Thu Jun 24 09:30:49 2010 From: paulm at paulm.com (Paul Makepeace) Date: Thu Jun 24 09:31:13 2010 Subject: [Catalyst] Repeatedly creating sessions Message-ID: I admit this is going to be epicly vague but... we've seen very intermittent (every couple of weeks) reports of users not being able to log in: they click login & are returned to the homepage (symptomatic of no cookie/session). I finally caught one happening and it seems Cat is creating a new session on each request. Unfortunately our remote desktop app failed and I couldn't see what Firefox was doing. My next attack is to watch with LiveHTTPHeaders over the wire. Any tips or suggestions on what this might be? Anyone else seen it? Debug tips next time we catch it? Cheers, Paul From garrison at zeta.org.au Thu Jun 24 10:23:47 2010 From: garrison at zeta.org.au (Charlie Garrison) Date: Thu Jun 24 10:23:59 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: Message-ID: Good evening, On 24/06/10 at 2:30 AM -0700, Paul Makepeace wrote: >Any tips or suggestions on what this might be? Anyone else seen it? >Debug tips next time we catch it? I've seen behaviour like that with two of the apps here, but it only seems to be happening with one particular browser (OmniWeb on Mac) so I don't think our problem is with Catalyst. I did detailed logging and communicated with OmniSoftware support; they agreed it looked a browser problem. Thought I'd chime in just in case the problem we're having is with Catalyst instead of the browser. Load the following modules to help with debugging: CatalystX::Debug::RequestHeaders CatalystX::Debug::ResponseHeaders And I'm keen to hear what you find with LiveHTTPHeaders. Charlie -- ? Charlie Garrison ? O< ascii ribbon campaign - stop html mail - www.asciiribbon.org ? http://www.ietf.org/rfc/rfc1855.txt From jspath at pangeamedia.com Thu Jun 24 12:42:22 2010 From: jspath at pangeamedia.com (James Spath) Date: Thu Jun 24 12:42:48 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: On Thu, Jun 24, 2010 at 5:30 AM, Paul Makepeace wrote: > I admit this is going to be epicly vague but... we've seen very > intermittent (every couple of weeks) reports of users not being able > to log in: they click login & are returned to the homepage > (symptomatic of no cookie/session). I finally caught one happening and > it seems Cat is creating a new session on each request. Unfortunately > our remote desktop app failed and I couldn't see what Firefox was > doing. > > My next attack is to watch with LiveHTTPHeaders over the wire. > > Any tips or suggestions on what this might be? Anyone else seen it? > Debug tips next time we catch it? Try http://www.charlesproxy.com/ instead ... it's worth the money (and even has a free trial). - Jim From peter at dragonstaff.co.uk Thu Jun 24 13:29:36 2010 From: peter at dragonstaff.co.uk (Peter Edwards) Date: Thu Jun 24 13:29:42 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: Incorrect clock on client PC leading to immediate cookie expiry? On 24 June 2010 13:42, James Spath wrote: > On Thu, Jun 24, 2010 at 5:30 AM, Paul Makepeace wrote: > > I admit this is going to be epicly vague but... we've seen very > > intermittent (every couple of weeks) reports of users not being able > > to log in: they click login & are returned to the homepage > > (symptomatic of no cookie/session). I finally caught one happening and > > it seems Cat is creating a new session on each request. Unfortunately > > our remote desktop app failed and I couldn't see what Firefox was > > doing. > > > > My next attack is to watch with LiveHTTPHeaders over the wire. > > > > Any tips or suggestions on what this might be? Anyone else seen it? > > Debug tips next time we catch it? > > Try http://www.charlesproxy.com/ instead ... it's worth the money (and > even has a free trial). > > - Jim > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100624/40926= a2b/attachment.htm From catalyst at bionikchickens.com Thu Jun 24 16:54:58 2010 From: catalyst at bionikchickens.com (Nicholas Wehr) Date: Thu Jun 24 16:55:24 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: I used charles proxy as well until I discovered how awesome the mozilla addon firebug is. unbeatable json (xhdr) and network activity analyzer. handles ssl too check it out! jim, is there a charles feature that stands out above firebug? I only used for one project until I re-discovered firebug... -nw On Thu, Jun 24, 2010 at 5:42 AM, James Spath wrote: > On Thu, Jun 24, 2010 at 5:30 AM, Paul Makepeace wrote: > > I admit this is going to be epicly vague but... we've seen very > > intermittent (every couple of weeks) reports of users not being able > > to log in: they click login & are returned to the homepage > > (symptomatic of no cookie/session). I finally caught one happening and > > it seems Cat is creating a new session on each request. Unfortunately > > our remote desktop app failed and I couldn't see what Firefox was > > doing. > > > > My next attack is to watch with LiveHTTPHeaders over the wire. > > > > Any tips or suggestions on what this might be? Anyone else seen it? > > Debug tips next time we catch it? > > Try http://www.charlesproxy.com/ instead ... it's worth the money (and > even has a free trial). > > - Jim > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100624/1a913= 392/attachment.htm From mdietrich at cpan.org Thu Jun 24 19:51:30 2010 From: mdietrich at cpan.org (Matthias Dietrich) Date: Thu Jun 24 19:51:34 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: Nicholas, Am 24.06.2010 um 18:54 schrieb Nicholas Wehr: > I used charles proxy as well until I discovered how awesome the mozilla addon firebug is. unbeatable json (xhdr) and network activity analyzer. handles ssl too check it out! > > jim, is there a charles feature that stands out above firebug? I only used for one project until I re-discovered firebug... I haven't bought Charles yet but used it for a longer time. A big plus is that you can display the content depending on its type (eg. JSON and AMF as collapsable tree, but doesn't has a display mode for every type, I guess). And it's browser independent so you can test with Safari and other clients (like native apps!), too. You can record transferred data, stop recording, open new sessions while the old ones are still present. If FF crashes or you navigate to a different page, Charles is still there and showing the recorded and opened sessions. Firebug is nice for single request tracking (yes, you can let the requests be "sticky", but that's not the same and a bit ugly, even sometimes it doesn't show the content if there's some), CSS, Javascript and HTML, but if you need to debug more intensive and longer I would prefer something like Charles. Thanks, Matthias -- rainboxx Software Engineering Matthias Dietrich rainboxx Matthias Dietrich | Phone: +49 7141 / 2 39 14 71 K?nigsallee 43 | Fax : +49 3222 / 1 47 63 00 71638 Ludwigsburg | Mobil: +49 151 / 50 60 78 64 | WWW : http://www.rainboxx.de CPAN: http://search.cpan.org/~mdietrich/ XING: https://www.xing.com/profile/Matthias_Dietrich18 GULP: http://www.gulp.de/profil/rainboxx.html From jspath at pangeamedia.com Thu Jun 24 19:56:35 2010 From: jspath at pangeamedia.com (James Spath) Date: Thu Jun 24 19:57:00 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: On Thu, Jun 24, 2010 at 3:51 PM, Matthias Dietrich wrote: > Nicholas, > > Am 24.06.2010 um 18:54 schrieb Nicholas Wehr: > >> I used charles proxy as well until I discovered how awesome the mozilla addon firebug is. unbeatable json (xhdr) and network activity analyzer. handles ssl too check it out! >> >> jim, is there a charles feature that stands out above firebug? I only used for one project until I re-discovered firebug... > > I haven't bought Charles yet but used it for a longer time. ?A big plus is that you can display the content depending on its type (eg. JSON and AMF as collapsable tree, but doesn't has a display mode for every type, I guess). ?And it's browser independent so you can test with Safari and other clients (like native apps!), too. ?You can record transferred data, stop recording, open new sessions while the old ones are still present. ?If FF crashes or you navigate to a different page, Charles is still there and showing the recorded and opened sessions. > > Firebug is nice for single request tracking (yes, you can let the requests be "sticky", but that's not the same and a bit ugly, even sometimes it doesn't show the content if there's some), CSS, Javascript and HTML, but if you need to debug more intensive and longer I would prefer something like Charles. What Matthias said :) The biggest features for me are a full history beyond the current page load ... and also the ability to redirect requests to different servers or even to a local file on your machine. Don't get me wrong, I use Firebug all the time, but Charles definitely has its uses. - Jim From paulm at paulm.com Thu Jun 24 20:07:40 2010 From: paulm at paulm.com (Paul Makepeace) Date: Thu Jun 24 20:08:06 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: Thanks - I checked & it's not this. It's apparently happening to a selection of polled users on different machines, just very infrequently. All Firefox so far so am suggesting a subset use Safari etc. Thanks for other suggestions, I'll look into Charles & firebug. (Is firebug a superset functionally of livehttpheaders now?) On Thu, Jun 24, 2010 at 06:29, Peter Edwards wrote: > Incorrect clock on client PC leading to immediate cookie expiry? > > > On 24 June 2010 13:42, James Spath wrote: >> >> On Thu, Jun 24, 2010 at 5:30 AM, Paul Makepeace wrote: >> > I admit this is going to be epicly vague but... we've seen very >> > intermittent (every couple of weeks) reports of users not being able >> > to log in: they click login & are returned to the homepage >> > (symptomatic of no cookie/session). I finally caught one happening and >> > it seems Cat is creating a new session on each request. Unfortunately >> > our remote desktop app failed and I couldn't see what Firefox was >> > doing. >> > >> > My next attack is to watch with LiveHTTPHeaders over the wire. >> > >> > Any tips or suggestions on what this might be? Anyone else seen it? >> > Debug tips next time we catch it? >> >> Try http://www.charlesproxy.com/ instead ... it's worth the money (and >> even has a free trial). >> >> - Jim >> > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > From catalyst at bionikchickens.com Thu Jun 24 20:14:33 2010 From: catalyst at bionikchickens.com (Nicholas Wehr) Date: Thu Jun 24 20:14:58 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: I see - sounds really cool and I fell into using firebug before I really got a chance to use it to it's fullest. firebug also allows for javascript debugging which was pretty critical for me, since I'm kind of a debugger junkie ;) On Thu, Jun 24, 2010 at 12:56 PM, James Spath wrote: > On Thu, Jun 24, 2010 at 3:51 PM, Matthias Dietrich > wrote: > > Nicholas, > > > > Am 24.06.2010 um 18:54 schrieb Nicholas Wehr: > > > >> I used charles proxy as well until I discovered how awesome the mozilla > addon firebug is. unbeatable json (xhdr) and network activity analyzer. > handles ssl too check it out! > >> > >> jim, is there a charles feature that stands out above firebug? I only > used for one project until I re-discovered firebug... > > > > I haven't bought Charles yet but used it for a longer time. A big plus > is that you can display the content depending on its type (eg. JSON and A= MF > as collapsable tree, but doesn't has a display mode for every type, I > guess). And it's browser independent so you can test with Safari and oth= er > clients (like native apps!), too. You can record transferred data, stop > recording, open new sessions while the old ones are still present. If FF > crashes or you navigate to a different page, Charles is still there and > showing the recorded and opened sessions. > > > > Firebug is nice for single request tracking (yes, you can let the > requests be "sticky", but that's not the same and a bit ugly, even someti= mes > it doesn't show the content if there's some), CSS, Javascript and HTML, b= ut > if you need to debug more intensive and longer I would prefer something l= ike > Charles. > > What Matthias said :) > > The biggest features for me are a full history beyond the current page > load ... and also the ability to redirect requests to different > servers or even to a local file on your machine. > > Don't get me wrong, I use Firebug all the time, but Charles definitely > has its uses. > > - Jim > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100624/558f3= c5b/attachment.htm From davewood at gmx.at Thu Jun 24 21:11:37 2010 From: davewood at gmx.at (David Schmidt) Date: Thu Jun 24 21:11:40 2010 Subject: [Catalyst] Repeatedly creating sessions In-Reply-To: References: Message-ID: On Thu, Jun 24, 2010 at 10:14 PM, Nicholas Wehr wrote: > I see - sounds really cool and I fell into using firebug before I really got > a chance to use it to it's fullest. firebug also allows for javascript > debugging which was pretty critical for me, since I'm kind of a debugger > junkie ;) > > On Thu, Jun 24, 2010 at 12:56 PM, James Spath > wrote: >> >> On Thu, Jun 24, 2010 at 3:51 PM, Matthias Dietrich >> wrote: >> > Nicholas, >> > >> > Am 24.06.2010 um 18:54 schrieb Nicholas Wehr: >> > >> >> I used charles proxy as well until I discovered how awesome the mozilla >> >> addon firebug is. unbeatable json (xhdr) and network activity analyzer. >> >> handles ssl too check it out! >> >> >> >> jim, is there a charles feature that stands out above firebug? I only >> >> used for one project until I re-discovered firebug... >> > >> > I haven't bought Charles yet but used it for a longer time. ?A big plus >> > is that you can display the content depending on its type (eg. JSON and AMF >> > as collapsable tree, but doesn't has a display mode for every type, I >> > guess). ?And it's browser independent so you can test with Safari and other >> > clients (like native apps!), too. ?You can record transferred data, stop >> > recording, open new sessions while the old ones are still present. ?If FF >> > crashes or you navigate to a different page, Charles is still there and >> > showing the recorded and opened sessions. >> > >> > Firebug is nice for single request tracking (yes, you can let the >> > requests be "sticky", but that's not the same and a bit ugly, even sometimes >> > it doesn't show the content if there's some), CSS, Javascript and HTML, but >> > if you need to debug more intensive and longer I would prefer something like >> > Charles. >> >> What Matthias said :) >> >> The biggest features for me are a full history beyond the current page >> load ... and also the ability to redirect requests to different >> servers or even to a local file on your machine. >> >> Don't get me wrong, I use Firebug all the time, but Charles definitely >> has its uses. >> >> - Jim >> >> _______________________________________________ >> List: Catalyst@lists.scsys.co.uk >> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst >> Searchable archive: >> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ >> Dev site: http://dev.catalyst.perl.org/ > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > With http://getfirebug.com/firebuglite you can debug on other browsers aswell. david -- David Schmidt | http://www.fm5.at From paulm at paulm.com Fri Jun 25 00:58:46 2010 From: paulm at paulm.com (Paul Makepeace) Date: Fri Jun 25 00:59:13 2010 Subject: [Catalyst] Re: [Dbix-class] DBIx-Class-Schema-Loader-0.07000 marks composed primary keys in SQLite with 'is_auto_increment => 1' In-Reply-To: References: Message-ID: +catalist On Thu, Jun 24, 2010 at 15:06, Zbigniew Lukasiak wrote: > PS. By the way what is the current repo for this dist? > > _______________________________________________ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk This has come up a couple of times recently. How about adding the dists to the email footer (as well as the various other sensible suggestions)? Paul From john.lifsey at nrl.navy.mil Fri Jun 25 15:02:51 2010 From: john.lifsey at nrl.navy.mil (John Lifsey - Contractor - 5595) Date: Fri Jun 25 15:02:57 2010 Subject: [Catalyst] RESTy Chained actions Message-ID: <4C24C51B.8090909@nrl.navy.mil> Is there any way to chain actions such that they can be endpoints or intermediate steps? For example: I want to have a REST controller that allows these URLs to work using ActionClass REST and Chained http://myapp.com/car - dispatch to sub car_GET for list of cars http://myapp.com/car/corvette - dispatch to car_GET for a single record http://myapp.com/car/corvette/model - dispatch to sub model_GET chained to sub car{} for a list of corvette types http://myapp.com/car/corvette/model/Z06 - dispatch to sub model_GET chained to sub car{} for a single corvette type record something like this doesn't quite work: sub car :ActionClass('REST') Chained CaptureArgs(1) {} sub model :ActionClass('REST') Chained('car') Args(1) {} So my question: Is there a Chained incantation to allow all of the following to be endpoints? /car /car/aCarID /car/aCarID/model /car/aCarID/model/aModelID Or am I just DoingItWrong all together? From will at serensoft.com Fri Jun 25 15:57:59 2010 From: will at serensoft.com (will@serensoft.com) Date: Fri Jun 25 15:58:02 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <4C24C51B.8090909@nrl.navy.mil> References: <4C24C51B.8090909@nrl.navy.mil> Message-ID: Lemme take a stab at this -- we're pretty new to Catalyst, so beware :) I think it would work like this: sub car_instance : Chained PathPath('car') CaptureArgs(1) {} sub car : Chained('car_instance') Args(0) {} sub model_instance : Chained('car_instance') PathPart('') CaptureArgs(1) {} sub model : Chained('model_instance') PathPath('') Args(0) {} etc. I think. Right? Here's a post from Aristotle a few weeks back that goes into more detail: =3D=3D=3D=3D=3D ---------- Forwarded message ---------- From: Aristotle Pagaltzis Date: Sat, May 29, 2010 at 9:10 PM Subject: [Catalyst] Re: A point of confusion/frustration on chained actions To: catalyst@lists.scsys.co.uk * Ash Berlin [2010-05-20 00:40]: > sub tutorials : Chained('/') PathPart CaptureArgs(0) { > # stash tutorials rs > } > sub all_tutorials : Chained('tutorials') PathPart('') Args(0) { > # empty, or set stash for view > } > > sub a_tutorial : Chained('tutorials') PathPart('') CaptureArgs(1) { > # stash tutorial > } > sub show_tutorial : Chained('a_tutorial') Args(0) PathPart('') { > # setup view > } > > sub comments : Chained('a_tutorial') CaptureArgs(0) PathPart { > # stash comments rs from stash->{tutorial} > } > > # You get the idea hopefully.... > sub show_tutorial_comments : Chained('comments') Args(0) PathPart('') {} > sub a_comment : Chained('comments') CaptureArgs(1) PathPart('') {} > > sub show_comment : Chained('a_comment') Args(0) PathPart('') { } > > sub replies : Chained('a_comment') PathPart CaptureArgs(0) {} > sub show_replies : Chained('replies') Args(0) PathPart('') {} > sub a_reply : Chained('replies') CaptureArgs(1) PathPart('') {} > sub show_reply : Chained('a_reply') Args(0) PathPart('') {} FWIW, I=92d pull this out to several controllers and then use the naming convention I=92ve adopted for this sort of thing: package MyApp::Controller::Tutorials; sub base : Chained PathPart('tutorials') CaptureArgs(0) { # stash tutorials rs } sub list : Chained('base') PathPart('') Args(0) { # setup index view } sub item : Chained('base') PathPart('') CaptureArgs(1) { # stash one tutorial } sub view : Chained('item') PathPart('') Args(0) { # almost always empty } package MyApp::Controller::Comments; sub base : Chained('/tutorials/item') PathPart('comments') CaptureArgs(0) { # stash comments rs from stash->{tutorial} } sub list : Chained('base') PathPart('') Args(0) {} sub item : Chained('base') PathPart('') CaptureArgs(1) {} sub view : Chained('item') PathPart('') Args(0) {} package MyApp::Controller::Replies; sub base : Chained('/comments/item') PathPart('comments') CaptureArgs(0) {} sub list : Chained('base') PathPart('') Args(0) {} sub item : Chained('base') PathPart('') CaptureArgs(1) {} sub view : Chained('item') PathPart('') Args(0) {} You get the idea. This also makes it very nice to navigate the template structure when using RenderView, as you can always relate everything to its purpose at a glance without referring to the controllers once. I kept the namespace structure flat here intentionally. I recommend doing so even if your URIs are nested =96 unless there are several different kinds of comments and replies in the system. In that case I would nest the package names in order to make it simpler to navigate the source. Chained dispatch makes it easy to get just about any URI structure, regardless of how the code is laid out; this is a feature, you should use it. =3D=3D=3D=3D=3D On Fri, Jun 25, 2010 at 10:02 AM, John Lifsey - Contractor - 5595 < john.lifsey@nrl.navy.mil> wrote: > Is there any way to chain actions such that they can be endpoints or > intermediate steps? > > For example: > > I want to have a REST controller that allows these URLs to work using > ActionClass REST and Chained > > http://myapp.com/car - dispatch to sub car_GET for list of cars > > http://myapp.com/car/corvette - dispatch to car_GET for a single record > > http://myapp.com/car/corvette/model - dispatch to sub model_GET chained to > sub car{} for a list of corvette types > > http://myapp.com/car/corvette/model/Z06 - dispatch to sub model_GET > chained to sub car{} for a single corvette type record > > something like this doesn't quite work: > > sub car :ActionClass('REST') Chained CaptureArgs(1) {} > sub model :ActionClass('REST') Chained('car') Args(1) {} > > So my question: Is there a Chained incantation to allow all of the > following to be endpoints? > > /car > /car/aCarID > /car/aCarID/model > /car/aCarID/model/aModelID > > Or am I just DoingItWrong all together? > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > -- = will trillich "I think it would be worse to expect nothing than to be disappointed." -- Anne (with an 'e') Shirley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100625/1805e= e80/attachment.htm From stephen at enterity.com Fri Jun 25 16:08:04 2010 From: stephen at enterity.com (Stephen Howard) Date: Fri Jun 25 16:10:03 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <4C24C51B.8090909@nrl.navy.mil> References: <4C24C51B.8090909@nrl.navy.mil> Message-ID: <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> I'm wrapping up a project where I do this. Here's my method signatures. The url structure is: /tutorials /tutorials/* /tutorials/*/comments /tutorials/*/comments/* /tutorials/*/comments/*/replies /tutorials/*/comments/*/replies/* # ------------------------------------------------------------------------------ sub list :Chained('/') PathPart('tutorials') Args(0) : ActionClass('REST') {} sub list_GET { ... } sub list_POST { ... } sub list_HEAD { ... } # ------------------------------------------------------------------------------ sub find_tutorial :Chained('/') PathPart('tutorials') CaptureArgs(1) { ... } # ------------------------------------------------------------------------------ sub single :Chained('find_tutorial') PathPart('') Args(0) ActionClass('REST') { ... } sub single_GET { ... } sub single_POST { ... } # ------------------------------------------------------------------------------ sub comments :Chained('find_tutorial') PathPart('comments') Args(0) :ActionClass('REST') {} sub comments_GET { ... } sub comments_POST { ... } # ------------------------------------------------------------------------------ sub find_comment :Chained('find_tutorial') PathPart('comments') CaptureArgs(1) { ... } # ------------------------------------------------------------------------------ sub comment :Chained('find_comment') PathPart('') Args(0) :ActionClass('REST') {} sub comment_GET { ... } sub comment_POST { ... } sub comment_DELETE {...} # ------------------------------------------------------------------------------ sub replies :Chained('find_comment') PathPart('replies') Args(0) :ActionClass('REST') {} sub replies_GET { ... } sub replies_POST { ... } # ------------------------------------------------------------------------------ sub reply :Chained('find_comment') PathPart('replies') Args(1) :ActionClass('REST') { ... } sub reply_POST { ... } sub reply_DELETE { ... } On Jun 25, 2010, at 8:02 AM, John Lifsey - Contractor - 5595 wrote: > Is there any way to chain actions such that they can be endpoints or > intermediate steps? > > For example: > > I want to have a REST controller that allows these URLs to work > using ActionClass REST and Chained > > http://myapp.com/car - dispatch to sub car_GET for list of cars > > http://myapp.com/car/corvette - dispatch to car_GET for a single > record > > http://myapp.com/car/corvette/model - dispatch to sub model_GET > chained to sub car{} for a list of corvette types > > http://myapp.com/car/corvette/model/Z06 - dispatch to sub model_GET > chained to sub car{} for a single corvette type record > > something like this doesn't quite work: > > sub car :ActionClass('REST') Chained CaptureArgs(1) {} > sub model :ActionClass('REST') Chained('car') Args(1) {} > > So my question: Is there a Chained incantation to allow all of the > following to be endpoints? > > /car > /car/aCarID > /car/aCarID/model > /car/aCarID/model/aModelID > > Or am I just DoingItWrong all together? > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ From john.lifsey at nrl.navy.mil Fri Jun 25 17:34:29 2010 From: john.lifsey at nrl.navy.mil (John Lifsey - Contractor - 5595) Date: Fri Jun 25 17:34:34 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> Message-ID: <4C24E8A5.7020403@nrl.navy.mil> > > sub list :Chained('/') PathPart('tutorials') Args(0) : > ActionClass('REST') {} > sub find_tutorial :Chained('/') PathPart('tutorials') CaptureArgs(1) { > sub single :Chained('find_tutorial') PathPart('') Args(0) Many thanks. That was exactly what I needed. I had been missing the intermediate step. From xyf.xiao at gmail.com Mon Jun 28 04:17:30 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Mon Jun 28 04:17:35 2010 Subject: [Catalyst] Catalyst::View::JSON & jqGrid Message-ID: Hi, ?? ? I'm using Catalyst::View::JSON and Catalyst::TraitFor::Controller::jQuery::jqGrid to retrieve JSON data to front page. Below is the code concerned (copy much partially from Catalyst::TraitFor::Controller::jQuery::jqGrid example): package UW::Controller::Site; use utf8; use Moose; use namespace::autoclean; BEGIN {extends 'Catalyst::Controller'; } with 'Catalyst::TraitFor::Controller::jQuery::jqGrid'; sub json : Local{ my ($self, $c) = @_; my $merchant_rs = $c->model('WindyDB::Merchant')->search({}); $merchant_rs = $self->jqgrid_page($c, $merchant_rs); ? ?my $row = 0; my @row_data; my $i = 0; while (my $mer = $merchant_rs->next){ $i ++; my $mer_id = $mer->mer_id; $c->log->debug($mer_id); my $single_row = { 'id' ? => $i, 'cell' => [ 'id' => $mer->mer_id, 'name' => $mer->mer_name, ], }; push @row_data, $single_row; } $c->log->debug( @row_data); $c->stash->{json_data}->{rows} = \@row_data; $c->stash->{current_view} ?= 'JSON'; } But I found the format is a little weird : {"current_view":"JSON","json_data":{"page":0,"records":"8","rows":[{id:1, cell:["test1","6"]},{id:2, cell["test2","7"]}],"total":1}} Actually, as jqGrid doument, data format should be: { total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", "cell22", "cell23"]}, ... ] } Does That means "current_view" and "json_data" pairs are surplus? So is there a way to remove current_view and json_data before server ship? or does I use the modules incorrectly? I'm new to Catalyst and jqGrid, please help. Any replies are really appreciated! From catalyst at iandocherty.com Mon Jun 28 06:24:08 2010 From: catalyst at iandocherty.com (Ian Docherty) Date: Mon Jun 28 06:24:19 2010 Subject: [Catalyst] Catalyst::View::JSON & jqGrid In-Reply-To: References: Message-ID: <4C284008.4040804@iandocherty.com> I suspect you have not configured your View::JSON correctly. Ensure you have it configured in your equivalent to MyApp.pm as follows. __PACKAGE__->config->{'View::JSON'} = { expose_stash => 'json_data', }; and it should then do what you want. Regards Ian On 28/06/2010 05:17, Xiao Yafeng wrote: > Hi, > I'm using Catalyst::View::JSON and > Catalyst::TraitFor::Controller::jQuery::jqGrid to retrieve JSON data > to front page. Below is the code concerned (copy much partially from > Catalyst::TraitFor::Controller::jQuery::jqGrid example): > > package UW::Controller::Site; > use utf8; > use Moose; > use namespace::autoclean; > BEGIN {extends 'Catalyst::Controller'; } > with 'Catalyst::TraitFor::Controller::jQuery::jqGrid'; > > sub json : Local{ > my ($self, $c) = @_; > my $merchant_rs = $c->model('WindyDB::Merchant')->search({}); > $merchant_rs = $self->jqgrid_page($c, $merchant_rs); > my $row = 0; > my @row_data; > my $i = 0; > while (my $mer = $merchant_rs->next){ > $i ++; > my $mer_id = $mer->mer_id; > $c->log->debug($mer_id); > my $single_row = { > 'id' => $i, > 'cell' => [ > 'id' => $mer->mer_id, > 'name' => $mer->mer_name, > ], > }; > push @row_data, $single_row; > > } > > $c->log->debug( @row_data); > $c->stash->{json_data}->{rows} = \@row_data; > $c->stash->{current_view} = 'JSON'; > } > > > But I found the format is a little weird : > {"current_view":"JSON","json_data":{"page":0,"records":"8","rows":[{id:1, > cell:["test1","6"]},{id:2, cell["test2","7"]}],"total":1}} > Actually, as jqGrid doument, data format should be: > { total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", > cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", > "cell22", "cell23"]}, ... ] } > > Does That means "current_view" and "json_data" pairs are surplus? So > is there a way to remove current_view and json_data before server > ship? > or does I use the modules incorrectly? I'm new to Catalyst and jqGrid, > please help. > Any replies are really appreciated! > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > From catalyst at iandocherty.com Mon Jun 28 06:26:03 2010 From: catalyst at iandocherty.com (Ian Docherty) Date: Mon Jun 28 06:26:15 2010 Subject: [Catalyst] Catalyst::View::JSON & jqGrid In-Reply-To: References: Message-ID: <4C28407B.5070205@iandocherty.com> If you think that either the code or documentation of Catalyst::TraitFor::Controller::jQuery::jqGrid is wrong then drop me an email please. Regards Ian On 28/06/2010 05:17, Xiao Yafeng wrote: > Hi, > I'm using Catalyst::View::JSON and > Catalyst::TraitFor::Controller::jQuery::jqGrid to retrieve JSON data > to front page. Below is the code concerned (copy much partially from > Catalyst::TraitFor::Controller::jQuery::jqGrid example): > > package UW::Controller::Site; > use utf8; > use Moose; > use namespace::autoclean; > BEGIN {extends 'Catalyst::Controller'; } > with 'Catalyst::TraitFor::Controller::jQuery::jqGrid'; > > sub json : Local{ > my ($self, $c) = @_; > my $merchant_rs = $c->model('WindyDB::Merchant')->search({}); > $merchant_rs = $self->jqgrid_page($c, $merchant_rs); > my $row = 0; > my @row_data; > my $i = 0; > while (my $mer = $merchant_rs->next){ > $i ++; > my $mer_id = $mer->mer_id; > $c->log->debug($mer_id); > my $single_row = { > 'id' => $i, > 'cell' => [ > 'id' => $mer->mer_id, > 'name' => $mer->mer_name, > ], > }; > push @row_data, $single_row; > > } > > $c->log->debug( @row_data); > $c->stash->{json_data}->{rows} = \@row_data; > $c->stash->{current_view} = 'JSON'; > } > > > But I found the format is a little weird : > {"current_view":"JSON","json_data":{"page":0,"records":"8","rows":[{id:1, > cell:["test1","6"]},{id:2, cell["test2","7"]}],"total":1}} > Actually, as jqGrid doument, data format should be: > { total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", > cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", > "cell22", "cell23"]}, ... ] } > > Does That means "current_view" and "json_data" pairs are surplus? So > is there a way to remove current_view and json_data before server > ship? > or does I use the modules incorrectly? I'm new to Catalyst and jqGrid, > please help. > Any replies are really appreciated! > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > > From xyf.xiao at gmail.com Mon Jun 28 06:57:24 2010 From: xyf.xiao at gmail.com (Xiao Yafeng) Date: Mon Jun 28 06:57:30 2010 Subject: [Catalyst] Catalyst::View::JSON & jqGrid In-Reply-To: <4C28407B.5070205@iandocherty.com> References: <4C28407B.5070205@iandocherty.com> Message-ID: it works. I've known what mistake I made. Thanks! BTW. remind users configuring expose_stash would be more friendly for new user like me. ;) On Mon, Jun 28, 2010 at 2:26 PM, Ian Docherty wrote: > If you think that either the code or documentation of > Catalyst::TraitFor::Controller::jQuery::jqGrid is wrong then drop me an > email please. > > Regards > Ian > > On 28/06/2010 05:17, Xiao Yafeng wrote: >> >> Hi, >> ? ? ?I'm using Catalyst::View::JSON and >> Catalyst::TraitFor::Controller::jQuery::jqGrid to retrieve JSON data >> to front page. Below is the code concerned (copy much partially from >> Catalyst::TraitFor::Controller::jQuery::jqGrid example): >> >> package UW::Controller::Site; >> use utf8; >> use Moose; >> use namespace::autoclean; >> BEGIN {extends 'Catalyst::Controller'; } >> with 'Catalyst::TraitFor::Controller::jQuery::jqGrid'; >> >> sub json : Local{ >> my ($self, $c) = @_; >> my $merchant_rs = $c->model('WindyDB::Merchant')->search({}); >> $merchant_rs = $self->jqgrid_page($c, $merchant_rs); >> ? ?my $row = 0; >> my @row_data; >> my $i = 0; >> while (my $mer = $merchant_rs->next){ >> $i ++; >> my $mer_id = $mer->mer_id; >> $c->log->debug($mer_id); >> my $single_row = { >> 'id' ? => ?$i, >> 'cell' => ?[ >> 'id' => ?$mer->mer_id, >> 'name' => ?$mer->mer_name, >> ], >> }; >> push @row_data, $single_row; >> >> } >> >> $c->log->debug( @row_data); >> $c->stash->{json_data}->{rows} = \@row_data; >> $c->stash->{current_view} ?= 'JSON'; >> } >> >> >> But I found the format is a little weird : >> {"current_view":"JSON","json_data":{"page":0,"records":"8","rows":[{id:1, >> cell:["test1","6"]},{id:2, cell["test2","7"]}],"total":1}} >> Actually, as jqGrid doument, data format should be: >> { total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", >> cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", >> "cell22", "cell23"]}, ... ] } >> >> Does That means "current_view" and "json_data" pairs are surplus? So >> is there a way to remove current_view and json_data before server >> ship? >> or does I use the modules incorrectly? I'm new to Catalyst and jqGrid, >> please help. >> Any replies are really appreciated! >> >> _______________________________________________ >> List: Catalyst@lists.scsys.co.uk >> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst >> Searchable archive: >> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ >> Dev site: http://dev.catalyst.perl.org/ >> >> > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > From john.lifsey at nrl.navy.mil Tue Jun 29 13:06:12 2010 From: john.lifsey at nrl.navy.mil (John Lifsey - Contractor - 5595) Date: Tue Jun 29 13:06:19 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> Message-ID: <4C29EFC4.9050806@nrl.navy.mil> On 6/25/10 12:08 PM, Stephen Howard wrote: > /tutorials > /tutorials/* > /tutorials/*/comments > /tutorials/*/comments/* > /tutorials/*/comments/*/replies > /tutorials/*/comments/*/replies/* > > # > ------------------------------------------------------------------------------ > > sub list :Chained('/') PathPart('tutorials') Args(0) : > ActionClass('REST') {} > > sub list_GET { ... } > sub list_POST { ... } > sub list_HEAD { ... } > > # > ------------------------------------------------------------------------------ > > sub find_tutorial :Chained('/') PathPart('tutorials') CaptureArgs(1) { > ... } > > # > ------------------------------------------------------------------------------ > > sub single :Chained('find_tutorial') PathPart('') Args(0) > ActionClass('REST') { ... } > sub single_GET { ... } > sub single_POST { ... } > > # > ------------------------------------------------------------------------------ > > sub comments :Chained('find_tutorial') PathPart('comments') Args(0) Well, if you teach a man to fish, apparently he'll ask you to teach him how to fly spaceships next. While this example worked well, it led me to another related problem. I have a parent Controller class for typical behavior on a resource from which I inherit and override as needed for each type of resource. package MyBaseController; extends 'Catalyst::Controller::REST'; sub index : Chained PathPrefix Args(0) ActionClass('REST') {} sub find : Chained PathPrefix CaptureArgs(1) {} sub single : Chained('find') PathPart('') Args(0) {} etc.. 1; Using the previous poster's example this works just fine in MyApp::Controller::Tutorial but it will not work for MyApp::Controller::Tutorial::Comments At first, from looking at the documentation I thought that setting the controller config key "path" to a regex or "/tutorial/*/" might do the trick, but alas it does not. This is further complicated by my desire to break from the previous example and allow Comments to be at the same hierarchical level as Tutorial. That is to say: MyApp::Controller::Tutorial ISA MyBaseController; and MyApp::Controller::Comments ISA MyBaseController; So that I could reference a particular comment ID at /myapp/comments/* or at /myapp/tutorial/*/comments/* Upon documentation review I thought __PACKAGE__->config(action=>{'*'=>{ blah, blah }}); would be my salvation, but it appears that '*' doesn't actually work in myapp, at least as written in the documentation. Now that I've gotten myself worked entirely into a lather thinking in circles it's time to request insight from the crowd. Any suggestions? From stephen at enterity.com Tue Jun 29 13:43:42 2010 From: stephen at enterity.com (Stephen Howard) Date: Tue Jun 29 13:45:42 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <4C29EFC4.9050806@nrl.navy.mil> References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> <4C29EFC4.9050806@nrl.navy.mil> Message-ID: I may be off the mark on what you're trying to do, but here goes. In my brief experience with catalyst, inheritance doesn't do much for you when constructing actions. I believe that chained actions are pretty tightly bound to the urls you are building, so there's no way to reuse them for different urls. That said, something I often do is $c->forward my way to common private functions, rather than try to do it through inheritance. So, from that same project: sub find_tutorial :Chained('/') PathPart('tutorials') CaptureArgs(1) { $_[1]->forward('/exists',['tutorial' => 'Tutorial' => $_[2] ]) } sub find_comment :Chained('find_tutorial') PathPart('comments') CaptureArgs(1) { $_[1]->forward('/exists',['comment' => 'Comment::Thread' => $_[2] ]) } where, 'exists' is defined in my root controller as: sub exists :Private { my( $self, $c, $name, $class, $id ) = @_; unless( $c->stash->{$name} = $c->model("DB::$class")->find($id) ) { $c->res->status('404'); $c->detach('/default'); } } HTH Stephen On Jun 29, 2010, at 6:06 AM, John Lifsey - Contractor - 5595 wrote: > > On 6/25/10 12:08 PM, Stephen Howard wrote: >> /tutorials >> /tutorials/* >> /tutorials/*/comments >> /tutorials/*/comments/* >> /tutorials/*/comments/*/replies >> /tutorials/*/comments/*/replies/* >> >> # >> ------------------------------------------------------------------------------ >> >> sub list :Chained('/') PathPart('tutorials') Args(0) : >> ActionClass('REST') {} >> >> sub list_GET { ... } >> sub list_POST { ... } >> sub list_HEAD { ... } >> >> # >> ------------------------------------------------------------------------------ >> >> sub find_tutorial :Chained('/') PathPart('tutorials') >> CaptureArgs(1) { >> ... } >> >> # >> ------------------------------------------------------------------------------ >> >> sub single :Chained('find_tutorial') PathPart('') Args(0) >> ActionClass('REST') { ... } >> sub single_GET { ... } >> sub single_POST { ... } >> >> # >> ------------------------------------------------------------------------------ >> >> sub comments :Chained('find_tutorial') PathPart('comments') Args(0) > > Well, if you teach a man to fish, apparently he'll ask you to teach > him how to fly spaceships next. > > While this example worked well, it led me to another related > problem. I have a parent Controller class for typical behavior on a > resource from which I inherit and override as needed for each type > of resource. > > package MyBaseController; > extends 'Catalyst::Controller::REST'; > > sub index : Chained PathPrefix Args(0) ActionClass('REST') {} > sub find : Chained PathPrefix CaptureArgs(1) {} > sub single : Chained('find') PathPart('') Args(0) {} > etc.. > > 1; > > Using the previous poster's example this works just fine in > MyApp::Controller::Tutorial > > but it will not work for MyApp::Controller::Tutorial::Comments > At first, from looking at the documentation I thought that setting > the controller config key "path" to a regex or "/tutorial/*/" might > do the trick, but alas it does not. > > This is further complicated by my desire to break from the previous > example and allow Comments to be at the same hierarchical level as > Tutorial. That is to say: > > MyApp::Controller::Tutorial ISA MyBaseController; > and > MyApp::Controller::Comments ISA MyBaseController; > > So that I could reference a particular comment ID at /myapp/comments/ > * or at /myapp/tutorial/*/comments/* > > Upon documentation review I thought __PACKAGE__- > >config(action=>{'*'=>{ blah, blah }}); would be my salvation, but > it appears that '*' doesn't actually work in myapp, at least as > written in the documentation. > > Now that I've gotten myself worked entirely into a lather thinking > in circles it's time to request insight from the crowd. Any > suggestions? > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ From bobtfish at bobtfish.net Tue Jun 29 15:02:20 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 29 15:02:10 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> <4C29EFC4.9050806@nrl.navy.mil> Message-ID: <25546ADE-527A-4B63-9CD2-FCDED59E8BEC@bobtfish.net> On 29 Jun 2010, at 14:43, Stephen Howard wrote: > I may be off the mark on what you're trying to do, but here goes. > > In my brief experience with catalyst, inheritance doesn't do much > for you when constructing actions. > I believe that chained actions are pretty tightly bound to the urls > you are building, so there's no way to reuse them for different urls. Entirely incorrect. > That said, something I often do is $c->forward my way to common > private functions, rather than try to do it through inheritance. > So, from that same project: You can compose the actions you want to override from a role (or superclass, or whatever), and then use config to override the paths. Here's an example (note the code here is simplistic / prototype, but it shows the concept): http://github.com/bobtfish/Kaizendo/blob/master/lib/App/Kaizendo/Web/Controller/Project.pm Cheers t0m From stephen at enterity.com Tue Jun 29 15:10:15 2010 From: stephen at enterity.com (Stephen Howard) Date: Tue Jun 29 15:12:15 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: <25546ADE-527A-4B63-9CD2-FCDED59E8BEC@bobtfish.net> References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> <4C29EFC4.9050806@nrl.navy.mil> <25546ADE-527A-4B63-9CD2-FCDED59E8BEC@bobtfish.net> Message-ID: very cool. I need to go find the docs that talk about that bit of config magic, as I hadn't run into it yet. - Stephen On Jun 29, 2010, at 8:02 AM, Tomas Doran wrote: > > On 29 Jun 2010, at 14:43, Stephen Howard wrote: > >> I may be off the mark on what you're trying to do, but here goes. >> >> In my brief experience with catalyst, inheritance doesn't do much >> for you when constructing actions. >> I believe that chained actions are pretty tightly bound to the urls >> you are building, so there's no way to reuse them for different urls. > > Entirely incorrect. > >> That said, something I often do is $c->forward my way to common >> private functions, rather than try to do it through inheritance. >> So, from that same project: > > > > You can compose the actions you want to override from a role (or > superclass, or whatever), and then use config to override the paths. > > Here's an example (note the code here is simplistic / prototype, but > it shows the concept): > > http://github.com/bobtfish/Kaizendo/blob/master/lib/App/Kaizendo/Web/Controller/Project.pm > > Cheers > t0m > > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ From bobtfish at bobtfish.net Tue Jun 29 15:16:54 2010 From: bobtfish at bobtfish.net (Tomas Doran) Date: Tue Jun 29 15:16:43 2010 Subject: [Catalyst] RESTy Chained actions In-Reply-To: References: <4C24C51B.8090909@nrl.navy.mil> <6F25AE0E-5D58-439D-B247-4B0D18AE1BD2@enterity.com> <4C29EFC4.9050806@nrl.navy.mil> <25546ADE-527A-4B63-9CD2-FCDED59E8BEC@bobtfish.net> Message-ID: <6AF44647-B821-4766-9DFC-6FC541D3FF5B@bobtfish.net> On 29 Jun 2010, at 16:10, Stephen Howard wrote: > very cool. I need to go find the docs that talk about that bit of > config magic, as I hadn't run into it yet. http://www.catalystframework.org/calendar/2008/11 Also documented in the relevant classes. Patches of course welcome if you think it can be made more obvious/clear. Cheers t0m From jlmartinez-lists-catalyst at capside.com Wed Jun 30 08:22:56 2010 From: jlmartinez-lists-catalyst at capside.com (Jose Luis Martinez) Date: Wed Jun 30 08:23:13 2010 Subject: [Catalyst] The state of (JSON|XML)-RPC modules Message-ID: <4C2AFEE0.7060800@capside.com> Hi, I'm trying to get JSON/XML RPC support into a Catalyst app, and I'm seeing that the state of the different plugins, at best, is unmaintained, and all of them seem to be broken... We have a couple of applications that were using Catalyst::Plugin::Server::XMLRPC from debian Etch/Lenny packages. In squeeze, it is not included (It doesn't seem to work in Cat 5.8). So I decided to go an fix it. Trying to understand what is broken in that module I stumbled across Catalyst::Plugin::XMLRPC and Catalyst::Plugin::JSONRPC: the two broken/unmaintained. So... I've been playing around with them in github http://github.com/pplu/Catalyst-Plugin-Server, and have these results: - Catalyst::Plugin::XMLRPC: Working again :). It needed: - update NEXT to MRO::Compat - the Action('XMLRPC') was not working. Changed it to be an ActionClass('XMLRPC'). Was this the correct move? - Catalyst::Plugin::JSONRPC : It's now fixed. It needed: - update to JSON 2.X API calls - update test to not use [MVC] naming - Change the way the plugin was getting the method to call: http://github.com/pplu/Catalyst-Plugin-Server/commit/3e79e0b8a3176ff32c6a8c658c24116366bb6986. I'm not sure if this is the correct way to do it (feedback welcome). - Catalyst::Plugin::Server : Not working (yet) - updated the calls to MRO::Compat style All of this has brought me a couple of questions to mind: if these modules are actually not working: have I not seen a module that is maintained and working? Is there no interest in JSONRPC and XMLRPC these days? (no need to update apps that used these modules?) Also: help is welcome. If you have a hint of what is wrong with Catalyst::Plugin::Server, please feel free to tell me so... Best Regards, Jose Luis Martinez jlmartinez@capside.com From alexander.hartmaier at t-systems.at Wed Jun 30 12:40:51 2010 From: alexander.hartmaier at t-systems.at (Alexander Hartmaier) Date: Wed Jun 30 12:40:56 2010 Subject: [Catalyst] Contributing code In-Reply-To: References: <4C1F6D9C.3050104@cisco.com> <4C1F7AAB.7050305@googlemail.com> Message-ID: <1277901651.4797.25.camel@ahartmai-nb> I'd prefer *much* more inline comments as well to make it easier to work on code parts I've never touched before when debugging or adding features as it's very hard to figure out what the methods do and how they interact. -- Best regards, Alex Am Montag, den 21.06.2010, 16:55 +0200 schrieb J. Shirley: > On Mon, Jun 21, 2010 at 7:43 AM, iain wrote: > > ?var Arnfj?r? Bjarmason wrote: > >> > >> It depends on what sort of comments you're making. Comments that > >> explain tricky code that help with maintenance down the road are > >> welcome everywhere. If you're just making comments that help someone > >> completely unfamiliar with Catalyst to read the code it'll probably be > >> more distracting than helpful to core devs. > >> > >> > > > > Surely the core devs can work with comments? > > > > Would having more comments not encourage more developers to contribute by > > lowering the barrier for entry? > > > > I don't think I can count as a core developer anymore, but really the > more comments the better (provided they aren't there so you can > practice your buddy career as a novelist). > > If you can't write sane comments, though, I don't think you can write > sane code :) > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*