Re: [Catalyst] Catalyst Comprehensive Tutorials Needed
Jonathan Rockway wrote: On Sun, 2007-12-16 at 15:40 +0800, Tony Winslow wrote: Hi, all! I'm new to Catalyst. I'm eager to learn it. Yet I cannot find a systematic book or tutorial about it. Can anyone here help me find one or even write one for the world? Good timing. My Catalyst book is now shipping: http://www.packtpub.com/catalyst-perl-web-application/book Thanks for the link! I've ordered one just now, and I'm awaiting their shipping confirmation (though I expect that won't come before monday...) Matija ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
I use Media Temple. I think you can get Cat to run on their Grid service, but I've never actually tried. I pay the $50/mo for a base level dedicated-virtual host. By default those hosts come with a Plesk install, but you can easily (free) request a plain vanilla linux host that runs normal old Centos 4. Amazing service, excellent upgrade paths, fair pricing, and no downtime to be heard of (on the dv product, which I can speak for). I do run 2 small Cat apps there, but these guys are just good hosting in general in my opinion. -d Martin Ellison wrote: Thanks Ashley. 1. What sort of outages dopes DreamHost have? 2. Any other hosting companies? 3. Should we go for a virtual server instead, and install Catalyst myself? On 16/12/2007, *Ashley Pond V* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: DreamHost is used by a few of us. It has several caveats. They oversell and are somewhat dishonest about how they do it and what their definitions for disk usage are. They have more outages than some hosts (I would not put a 24/7 business there) b/c they let a lot of dynamic, db-heavy, sites sit on boxes together. That said, they have a nice control panel, they usually do seem to try to please, they are typically zippy for flat files, and I can't find anyone else who offers half of what they do, including fastcgi to run you Cat app, for $8/month. I've been there for 4 years for about 15 sites. There is a Catalyst promotion code so that your signup goes to benefit Cat development. Check the archives or (better still, they've changed how referrals work in the last year) wait for someone else to post it again. -Ashley On Dec 15, 2007, at 8:07 PM, Martin Ellison wrote: Can anyone recommend a web hosting provider for Catalyst applications? Or for that matter, warn us off any providers that you have had bad experiences with? -- Regards, Martin ( [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.org ___ List: Catalyst@lists.scsys.co.uk mailto:Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/ -- Regards, Martin ([EMAIL PROTECTED] mailto:[EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.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/[EMAIL PROTECTED]/ 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/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Comprehensive Tutorials Needed
On Dec 16, 2007 3:41 AM, Jonathan Rockway [EMAIL PROTECTED] wrote: On Sun, 2007-12-16 at 15:40 +0800, Tony Winslow wrote: Hi, all! I'm new to Catalyst. I'm eager to learn it. Yet I cannot find a systematic book or tutorial about it. Can anyone here help me find one or even write one for the world? Good timing. My Catalyst book is now shipping: What no free chapters to entice buyers? :) ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
I started this same thread a few months ago and many people were kind enough to reply. It seemed a decision between linode.com and slicehost.com. Slicehost sounds cool and very well may be cool, however it is newer, has a waiting list (not extremely long), and what got me was that they say no up front but then require up front just to get early on the list. By contrast I have watched linode for a long time, and I had an awesome chat with its owner caker, who periodically adds new resources to your account for free, and it seems they have more offerings, including upcoming HA failover across linodes it seems. Anyway both have neat looking communities and possibly slicehost has newer technology but it's a tossup to me, as linode also is not standing still. Finally they have multiple data centers including one at Huriccaine Electric which I also had watched for a while. Getting a linode at HE which is 50-100ms closer was also a big plus. Add to that a very personal vibe I got from caker, which decided me. My own decision was to start off with a single linode and also get a baby account on hostgator, which also was top in reviews. I got it for some family sites and to hold heavy content like film. Possibly catalyst might even work in their environment but I am planning on using the linode for that. Probably the linode will have to be upgraded with memory. I have not had time to play with it yet so I can't report on the result, but so far it looks nice and inexpensive. Since I joined in fact I have gotten a free upgrade already. Granted VPS companies have to keep up with the market, I left my old one due to incompetence and overcharging. Possibly slicehost may have difficulty keeping up but I wish them all luck and wouldn't mind getting a slice too some time to try out. Both linode and slicehost give you a choice of distros and root access which should make catalyst installation easy. Perhaps someone else can give you their experience but first you might want to search the archive. Matt R. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
Le Dim 16 décembre 2007 12:17, Will Hawes a écrit : I've used www.bytemark.co.uk for the past two years and have found pricing, uptime and support to be excellent. On Dec 15, 2007, at 8:07 PM, Martin Ellison wrote: Can anyone recommend a web hosting provider for Catalyst applications? Or for that matter, warn us off any providers that you have had bad experiences with? If you're in Europe, check this: http://www.kimsufi.com/ If that's too light, have a look there: http://www.ovh.com/fr/produits/start100m.xml I have one of each and am really satisfied with both. Much better imho than a virtual server. David Morel ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] configurable base url?
On Sat, Dec 08, 2007 at 06:04:14PM +1100, Charlie Garrison wrote: Good afternoon, On 7/12/07 at 9:32 AM -0800, Pablo Collins [EMAIL PROTECTED] wrote: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta content=text/html;charset=ISO-8859-1 http-equiv=Content-Type /head body bgcolor=#ff text=#00 Thanks guys for your help.br I'm not sure what the list rules state, but I would appreciate it if messages could at least contain a non-empty plain-text part. While I have no trouble reading html, I don't like using my brain to parse messages that way. I don't believe we have official rules for this. But HTML only mail is Bad and Wrong. Maybe I should poke the list intro message to tell people not to ... -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
I used bytemark.co.uk for several years, had great service and zero downtime. I'd recommend them. Then I found linode.com for about the same price and twice as much memory (about 300MB, which I did really need after porting to catalyst), and also great refs. Been there for several months now, also very impressive. The web interface is also neat and hadny for quick checks. These virtual servers are so good and cheap that you'd be nuts to do it any other way, unless you are very budget constrained indeed. -- Daniel McBrearty email : danielmcbrearty at gmail.com http://www.engoi.com http://danmcb.vox.com http://danmcb.blogger.com find me on linkedin and facebook BTW : 0873928131 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
What distro are you using I'm curious. Then I found linode.com for about the same price and twice as much memory (about 300MB, which I did really need after porting to catalyst), and also great refs. Been there for several months now, also very impressive. The web interface is also neat and hadny for quick checks. These virtual servers are so good and cheap that you'd be nuts to do it any other way, unless you are very budget constrained indeed. -- Daniel McBrearty email : danielmcbrearty at gmail.com http://www.engoi.com http://danmcb.vox.com http://danmcb.blogger.com find me on linkedin and facebook BTW : 0873928131 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ 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/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
On Dec 15, 2007, at 10:21 PM, Martin Ellison wrote: Thanks Ashley. 1. What sort of outages dopes DreamHost have? http://uptime.besthostratings.com/viewreport.php?host=dreamhost 2. Any other hosting companies? I was with http://www.johncompanies.com/jc_vps.html for awhile so I could run a modperl app. I liked them very much. I never had a single outage in two years (it was low traffic though) and was only asked to reboot my stuff once. 3. Should we go for a virtual server instead, and install Catalyst myself? Maybe. If you do that don't use DreamHost, I think. If you're paying $50+, look at JohnCompanies or some of the ones others have mentioned. My install on DreamHost is completely custom though, just on a regular account; in a local lib. That's part of why I like them enough to stay despite some problems. You can do almost anything with your account. On 16/12/2007, Ashley Pond V [EMAIL PROTECTED] wrote: DreamHost is used by a few of us. It has several caveats. They oversell and are somewhat dishonest about how they do it and what their definitions for disk usage are. They have more outages than some hosts (I would not put a 24/7 business there) b/c they let a lot of dynamic, db-heavy, sites sit on boxes together. That said, they have a nice control panel, they usually do seem to try to please, they are typically zippy for flat files, and I can't find anyone else who offers half of what they do, including fastcgi to run you Cat app, for $8/month. I've been there for 4 years for about 15 sites. There is a Catalyst promotion code so that your signup goes to benefit Cat development. Check the archives or (better still, they've changed how referrals work in the last year) wait for someone else to post it again. -Ashley On Dec 15, 2007, at 8:07 PM, Martin Ellison wrote: Can anyone recommend a web hosting provider for Catalyst applications? Or for that matter, warn us off any providers that you have had bad experiences with? -- Regards, Martin ( [EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.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/ [EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/ -- Regards, Martin ([EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.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/ [EMAIL PROTECTED]/ 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/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] DBIx relationships
On Sat, Dec 08, 2007 at 03:44:18AM +0200, Angel Kolev wrote: 2007/12/8, J. Shirley [EMAIL PROTECTED]: First, two things: #1. This is not the DBIC mailing list #2. It is called DBIx::Class or DBIC. DBIx is an entire namespace hosting many projects. DBIx::Class is just one of those projects. Thanks, -Jay Sorry but im just badly stucked at this :( You're going to keep being stuck if you ask DBIx::Class questions on the Catalyst list. DBIx::Class is a separate project with its own mailing list. Ask on there and you'll find people are much more willing to help. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] using Catalyst with legacy cgi scripts
On Mon, Dec 10, 2007 at 02:26:31PM +, Ton Voon wrote: On 7 Dec 2007, at 19:53, Ashley Pond V wrote: Please do put this up. I can definitely see using it (maybe on something right now) and I think many others would end up using it in a Registry.pm-like way to segue into a shinier codebase. Any new trails on the migration path to Cat help everyone eventually b/c it will build up the community. OK. Can someone bootstrap the Catalyst way of testing Controller code please? I can add the code specific testing, but I don't really know how to test a controller properly. Just nick a TestApp from $other_controller_dist - PathArgs or BindLex are two reasonable candidates. I'm happy to add documentation, the Module::Install and maybe even an advent entry. Can I have a commit bit for this portion of the svn tree? Done. I didn't remember you volunteering to clean up and dist this or I'd've been hounding you mercilessly. Now you've done so in public your fate is sealed ... -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
On Dec 16, 2007 7:15 PM, Matt Rosin [EMAIL PROTECTED] wrote: What distro are you using I'm curious. I use a Debian 4.0 image that they had. It's been very good so far. I always use Deb/Ubuntu pretty much. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] using Catalyst with legacy cgi scripts
On Sun, 2007-12-16 at 19:10 +, Matt S Trout wrote: Just nick a TestApp from $other_controller_dist - PathArgs or BindLex are two reasonable candidates. FWIW CatalystX::Starter from CPAN will auto-generate one for you. The auto-generated TestApp also works from the command-line, so you can try TestApp out in your browser easily. I like it :) Regards, Jonathan Rockway signature.asc Description: This is a digitally signed message part ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
Matt Rosin wrote: What distro are you using I'm curious. Ubuntu 6.06. Also tried CentOS 5 but didn't get on too well with it. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Setting the Catalyst Request object
On Thu, Dec 13, 2007 at 09:55:30AM -0800, Bill Moseley wrote: On Thu, Dec 13, 2007 at 10:09:39AM -0500, Christopher H. Laco wrote: Bill Moseley wrote: Yesterday I needed to add JSON support (both in the request and response) to a few actions. I decided to try Catalyst::Action::REST. Well, actually, I first tried using just C::A::Serialize and C::A::Deserialize -- but was not sure if those could be used separately. That didn't work so then I just tried using the full REST setup as described in the calendar. Well, that brings in C::Request::REST, which set the request object, and I already have C::P::Server which does the same thing. Is there a way that multiple add-ons can work better together when they need to add methods to the request object? I would think you could beat them at their own game. Make your own subclass, which inherits from both of their Request subclasses. Then, just have Cat use yours instead. Yes. But I'm wondering if there can't be a defined approach so that module authors don't have to worry about stepping on other modules. Moose roles will fix that in 5.80. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Web hosting?
On Sunday 16 December 2007 06:50:41 am Matt Rosin wrote: I started this same thread a few months ago and many people were kind enough to reply. It seemed a decision between linode.com and slicehost.com. Slicehost sounds cool and very well may be cool, however it is newer, has a waiting list (not extremely long), and what got me was that they say no up front but then require up front just to get early on the list. Actually slicehost has cleared out their backlog, there's once again no wait. Minimum prepayment term is still 3 months and it doesn't look like they intend to change that, but if you cancel within a month (for example) they'll still refund you two. Larger prepayments get a discount, but that's probably not a big incentive if you're just trialing them :) Linode offers a bit more RAM and a higher bandwidth cap for the price, which is nice, while Slicehost gives you four virtual CPUs, more I/O allowance, and has a nifty backup system. Both have very responsible developers/admins. I've been running some things (including a couple Catalyst sites) on Slicehost now for over a year, and they've been good to me. No performance issues once I figured out how best to configure apache to save on memory. Linode certainly looks good too. I figure it's the kind of competition that benefits the customer. Andrew ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Comprehensive Tutorials Needed
On Sunday 16 December 2007 01:40:57 am Tony Winslow wrote: Hi, all! I'm new to Catalyst. I'm eager to learn it. Yet I cannot find a systematic book or tutorial about it. Can anyone here help me find one or even write one for the world? Besides the book, of course, there's perldoc Catalyst::Manual::Tutorial :) Andrew ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] no role configuration found -- authorization: dbic and DBI::Schema::Loader
Continuing saga. So I set up the many_to_many and lo! It worked. But it worked with *any* role, even fake ones, so obviously something was bad. Turned out that it was silently failing instead of throwing an access exception (but there was a template set by the namespace so the page rendered as expected). # failed silently (as far as Cat was concerned) $c-assert_user_roles(there is no role called this); So, dug into the log: [Sun Dec 16 16:13:20 2007] [error] [client 67.170.68.172] [warn] Store class Catalyst::Authentication::Store::DBIx::Class not found, trying deprecated ::Plugin:: style naming. , referer: [...] Would love to have more, rather than fewer exceptions thrown. I think the missing class was the cause of a couple of red herrings I followed down the rabbit hole trying to get this running yesterday [I'm entitled to mix metaphors, I pay an annual fee]. After I get an admin to install the missing package in the morning I'll regale you with my next series of missteps and annoying language. Live free or die early, die often, -Ashley On Dec 15, 2007, at 9:52 PM, Jay K wrote: Hi There Ashley, The DBIx::Class module expects to use the relation provided in the role_relation config element to retrieve one or more rows, which must contain a field called by whatever you provide in role_field. My guess is that your user_roles table is a cross-ref table - userid and roleid essentially. In order to solve this you need to use a many_to_many relationship mapping to the textual role names. The DBIx::Class module expects you are going to route it to the information it needs using the role_relation. So what you really need to do is create the schema class and just define the many-to- many for roles. Then provide that relation to 'role_relation' and all your problems should go away. It still works with dynamic schema - but you have to create the relationship. You can do that by creating your schema module to look something like this: package MyApp::Schema::Users; use strict; use warnings; use base 'DBIx::Class'; __PACKAGE__-load_components(PK::Auto, Core); __PACKAGE__-has_many('roles_map', MyApp::Schema::RoleMap, user_id'); __PACKAGE__-many_to_many( roles = 'role_map, 'role'); 1; I might have that slightly wrong - I've been moving today so I'm a bit overtired. but basically that allows your schema to dynamically figure itself out, but you define the relationships for it. For some database types, DBIx::Class can figure out your relationships for you - but I don't think it can sort out many-to- many's anyway. Hope that helps. And I hope it makes as much sense to you as I make to myself in my head at the moment. This, I understand, may not be the case. If not, I'll try again tomorrow. Jay On Dec 15, 2007, at 5:57 PM, Ashley Pond V wrote: Progressing… Looking at Catalyst/Plugin/Authentication/Store/DBIC/ User.pm I saw a couple of items in the authentication config I could set. With role_relation and role_field set-- authentication: default_realm: users realms: users: credential: class: Password password_field: password password_type: hashed password_hash_type: SHA-1 store: class: DBIx::Class user_class: User role_relation: user_roles role_field: role --I now get the roles checked but they are failing because they are checking (returning) the role id instead of the name. $c-user-roles returns a list of the IDs too. So, from reading this, Catalyst::Plugin::Authentication::Store::DBIx::Class::roles() it looks like dynamic loader schemas are incompatible right now? I'm trying to figure this out but there is a lot of inter-related code to read, cross-package-configuration, and documentation drift/ lag. Throw me a bone, er, a line! -Ashley On Dec 15, 2007, at 10:18 AM, Ashley Pond V wrote: Can you elaborate? map_user_role ne user_role. I have role_rel set to the UserRole class. I tried adding user_role but it didn't help and I don't see it anywhere in the docs. I should rephrase, I think. Is anyone using DBIC::Schema::Loader dynamically with role authorization? If so, please share your configuration or advise of which FMTR. Thanks again, -Ashley ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/ [EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/ --- For most things, throwing yourself at the wall over and over is a better way to improve than thinking hard about the wall and taking pictures of it. -- D.Litwack ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/ [EMAIL PROTECTED]/ Dev site:
Re: [Catalyst] no role configuration found -- authorization: dbic and DBI::Schema::Loader
Hi Ashley, The log message you see is a result of the recent move away from the Catalyst::Plugin::Authentication namespace for stores / credentials. It falls back to the old naming and warns if it can't find the new module.. It should, however, have no effect on the functionality of the code. It's not a bad idea to update the DBIx::Class store - but be sure to remove the Catalyst::Plugin::Authentication::Store::DBIx::Class module first - just to avoid conflicts. Nothing has changed related to roles in the update, so it shouldn't make any difference. I don't know why the assert is failing, it should not - what do you get if you use $c-check_user_roles() - valid results? Jay On Dec 16, 2007, at 4:27 PM, Ashley Pond V wrote: Continuing saga. So I set up the many_to_many and lo! It worked. But it worked with *any* role, even fake ones, so obviously something was bad. Turned out that it was silently failing instead of throwing an access exception (but there was a template set by the namespace so the page rendered as expected). # failed silently (as far as Cat was concerned) $c-assert_user_roles(there is no role called this); So, dug into the log: [Sun Dec 16 16:13:20 2007] [error] [client 67.170.68.172] [warn] Store class Catalyst::Authentication::Store::DBIx::Class not found, trying deprecated ::Plugin:: style naming. , referer: [...] Would love to have more, rather than fewer exceptions thrown. I think the missing class was the cause of a couple of red herrings I followed down the rabbit hole trying to get this running yesterday [I'm entitled to mix metaphors, I pay an annual fee]. After I get an admin to install the missing package in the morning I'll regale you with my next series of missteps and annoying language. Live free or die early, die often, -Ashley On Dec 15, 2007, at 9:52 PM, Jay K wrote: Hi There Ashley, The DBIx::Class module expects to use the relation provided in the role_relation config element to retrieve one or more rows, which must contain a field called by whatever you provide in role_field. My guess is that your user_roles table is a cross-ref table - userid and roleid essentially. In order to solve this you need to use a many_to_many relationship mapping to the textual role names. The DBIx::Class module expects you are going to route it to the information it needs using the role_relation. So what you really need to do is create the schema class and just define the many-to- many for roles. Then provide that relation to 'role_relation' and all your problems should go away. It still works with dynamic schema - but you have to create the relationship. You can do that by creating your schema module to look something like this: package MyApp::Schema::Users; use strict; use warnings; use base 'DBIx::Class'; __PACKAGE__-load_components(PK::Auto, Core); __PACKAGE__-has_many('roles_map', MyApp::Schema::RoleMap, user_id'); __PACKAGE__-many_to_many( roles = 'role_map, 'role'); 1; I might have that slightly wrong - I've been moving today so I'm a bit overtired. but basically that allows your schema to dynamically figure itself out, but you define the relationships for it. For some database types, DBIx::Class can figure out your relationships for you - but I don't think it can sort out many-to- many's anyway. Hope that helps. And I hope it makes as much sense to you as I make to myself in my head at the moment. This, I understand, may not be the case. If not, I'll try again tomorrow. Jay On Dec 15, 2007, at 5:57 PM, Ashley Pond V wrote: Progressing… Looking at Catalyst/Plugin/Authentication/Store/DBIC/ User.pm I saw a couple of items in the authentication config I could set. With role_relation and role_field set-- authentication: default_realm: users realms: users: credential: class: Password password_field: password password_type: hashed password_hash_type: SHA-1 store: class: DBIx::Class user_class: User role_relation: user_roles role_field: role --I now get the roles checked but they are failing because they are checking (returning) the role id instead of the name. $c-user-roles returns a list of the IDs too. So, from reading this, Catalyst::Plugin::Authentication::Store::DBIx::Class::roles() it looks like dynamic loader schemas are incompatible right now? I'm trying to figure this out but there is a lot of inter-related code to read, cross-package-configuration, and documentation drift/ lag. Throw me a bone, er, a line! -Ashley On Dec 15, 2007, at 10:18 AM, Ashley Pond V wrote: Can you elaborate? map_user_role ne user_role. I have role_rel set to the UserRole class. I tried adding user_role but it didn't help and I don't see it anywhere in the docs. I should rephrase, I think. Is anyone using DBIC::Schema::Loader dynamically with role authorization? If so, please share your
Re: [Catalyst] no role configuration found -- authorization: dbic and DBI::Schema::Loader
Thanks for still looking at this, Jay. This is the top of the method with some die decoration: Take 1: my ( $self, $c ) = @_; die This will die; $c-assert_user_roles(no such role); Take 2: my ( $self, $c ) = @_; $c-assert_user_roles(no such role); die This will not fire; I can put the assert in an eval block but $@ is not set so it doesn't help to see what's happening. There is no information in the logs at the point the code fails. I guess I'll ask our admin to pull Catalyst::Plugin::Authentication::Store::DBIx::Class, yeah? Authentication is working fine, by the by. It's just Authorization that's wonky right now. Pasting my setup stuff below. -Ashley -- use Catalyst qw/ ConfigLoader -Debug Unicode StackTrace Static::Simple Authentication Authorization::Roles Session Session::Store::FastMmap Session::State::Cookie /; ...User.pm __PACKAGE__-has_many( user_roles, MyApp::Schema::UserRole, { foreign.user = self.id }, ); # Created by DBIx::Class::Schema::Loader v0.04004 @ 2007-12-16 13:36:55 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qroNdEXQL4pOH80kVPQquw __PACKAGE__-many_to_many(roles = 'user_roles', 'name'); --- yml authentication: default_realm: users realms: users: credential: class: Password password_type: hashed password_hash_type: SHA-1 store: class: DBIx::Class user_class: User role_relation: roles role_field: name # doesn't matter whether or not the authorization stuff is there but this is what i've played with (and *many* permutations of the arguments) authorization: dbic: role_class: Role role_field: name user_class: User user_field: user user_role_user_field: user user_role_role_field: role role_rel: user_roles user_role_class: UserRole On Dec 16, 2007, at 9:20 PM, Jay K wrote: Hi Ashley, The log message you see is a result of the recent move away from the Catalyst::Plugin::Authentication namespace for stores / credentials. It falls back to the old naming and warns if it can't find the new module.. It should, however, have no effect on the functionality of the code. It's not a bad idea to update the DBIx::Class store - but be sure to remove the Catalyst::Plugin::Authentication::Store::DBIx::Class module first - just to avoid conflicts. Nothing has changed related to roles in the update, so it shouldn't make any difference. I don't know why the assert is failing, it should not - what do you get if you use $c-check_user_roles() - valid results? Jay On Dec 16, 2007, at 4:27 PM, Ashley Pond V wrote: Continuing saga. So I set up the many_to_many and lo! It worked. But it worked with *any* role, even fake ones, so obviously something was bad. Turned out that it was silently failing instead of throwing an access exception (but there was a template set by the namespace so the page rendered as expected). # failed silently (as far as Cat was concerned) $c-assert_user_roles(there is no role called this); So, dug into the log: [Sun Dec 16 16:13:20 2007] [error] [client 67.170.68.172] [warn] Store class Catalyst::Authentication::Store::DBIx::Class not found, trying deprecated ::Plugin:: style naming. , referer: [...] Would love to have more, rather than fewer exceptions thrown. I think the missing class was the cause of a couple of red herrings I followed down the rabbit hole trying to get this running yesterday [I'm entitled to mix metaphors, I pay an annual fee]. After I get an admin to install the missing package in the morning I'll regale you with my next series of missteps and annoying language. Live free or die early, die often, -Ashley On Dec 15, 2007, at 9:52 PM, Jay K wrote: Hi There Ashley, The DBIx::Class module expects to use the relation provided in the role_relation config element to retrieve one or more rows, which must contain a field called by whatever you provide in role_field. My guess is that your user_roles table is a cross-ref table - userid and roleid essentially. In order to solve this you need to use a many_to_many relationship mapping to the textual role names. The DBIx::Class module expects you are going to route it to the information it needs using the role_relation. So what you really need to do is create the schema class and just define the many-to- many for roles. Then provide that relation to 'role_relation' and all your problems should go away. It still works with dynamic schema - but you have to create the relationship. You can do that by creating your schema module to look something like this: package MyApp::Schema::Users; use strict; use warnings; use base 'DBIx::Class'; __PACKAGE__-load_components(PK::Auto, Core); __PACKAGE__-has_many('roles_map', MyApp::Schema::RoleMap, user_id'); __PACKAGE__-many_to_many( roles =