Re: [Catalyst] New view: ICal?
A View is fine but because there is a format for files and it's natural to show/deliver content with a view. The view is going to be very THIN though. Basically nothing but a wrapper around what iCalendar really is which is data and therefore the Model domain. The view will essentially be Data::ICal->as_string + Content-Type => text/calendar + file disposition name something reasonable with a .ics or .ifb. I think the model should do all the heavy lifting. That allows it to be easily repurposed in other places, tools, and tests. I'm somewhat surprised no one has already done this. Casual searches look like maybe it's been solved before but not released to the CPAN. I was toying with a similar project years ago but never got the buy-in from the project leader. :P ___ 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/
Re: [Catalyst] New design
On Tue, Jul 23, 2013 at 4:30 PM, David Dorward da...@dorward.me.uk wrote: On 23 Jul 2013, at 9:48, Mark Keating wrote: The nice chaps at Evozon have recently been making design mocks for a bunch of Perl sites and they have come up with a fresh look for Catalyst. Take a look and let me know what you guys think. Concur with some recent feedback. It's done nattily but it's incohesive, seems more targeted at HR and biz dev than software developers, and 2001 was approximately when Perl died and the movie makes me think of the 1960s, killer computers, and LSD, not MVC development for the future. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Chained and exceptions
Blast from the past: http://grokbase.com/t/sc/catalyst/077e7jhw9g/rfc-catalyst-plugin-errorout On Thu, May 9, 2013 at 1:42 PM, Bill Moseley mose...@hank.org wrote: On Thu, May 9, 2013 at 9:34 AM, Aristotle Pagaltzis pagalt...@gmx.dewrote: * Bill Moseley mose...@hank.org [2013-05-09 15:30]: What's the reasoning that chained actions continue to run after an earlier exception? Seems like an accident of the design to me, borderline bug. Agreed. Seems like something that could be easily overlooked. If like me you don’t like it, Catalyst::ActionRole::DetachOnDie Oh, that's nice. Tricks for applying it globally? I went the monkey patch route. Shield your eyes: use Catalyst::ActionChain; sub Catalyst::ActionChain::dispatch { my ( $self, $c ) = @_; my @captures = @{$c-req-captures||[]}; my @chain = @{ $self-chain }; my $last = pop(@chain); foreach my $action ( @chain ) { my @args; if (my $cap = $action-number_of_captures) { @args = splice(@captures, 0, $cap); } local $c-request-{arguments} = \@args; $action-dispatch( $c ); * return if @{ $c-error }; # Patch* } $last-dispatch( $c ); } -- Bill Moseley mose...@hank.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/ ___ 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/
Re: [Catalyst] Catalyst and Java
On Wed, Oct 31, 2012 at 8:41 AM, Devin Austin devin.aus...@gmail.com wrote: On Wed, Oct 31, 2012 at 3:50 AM, Tim Anderson tja...@gmail.com wrote: I have a handful of java servlets that I would like to 'front-end' with my Catalyst application, essentially using Catalyst to provide authentication/authorization before passing along the browser requests to the servlet. Does anyone have experience with doing something like this? I'd appreciate any insight or direction. This would be fairly do-able if you used REST for inter-app communication. Or something like Message::Passing, which allows you to send a message to a queue, which could be subscribed to from both ends, thus allowing the apps to talk to each other. If the Catalyst app is acting as a proxy to the servlets, I would think you could do a pretty regular authentication/authorization/session set up with it and just pass along whatever other info you need to the servlets via the aforementioned means. Another approach worth considering is to wrap the servlets up in a model. This often takes a bit longer and more thinking in the set-up phase but will give you code that is easier to reuse in other places. I've done this kind of problem both ways and either is fine but I'd lean to the model. You would end up with something you could run with Catalyst/Flea/Mojolicious/in-line-plack-with-auth-middleware/command-line/whatever. ___ 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/
Re: [Catalyst] Plugin::Session lazy start
On Wed, May 23, 2012 at 1:58 AM, Dag-Erling Smørgrav d...@des.no wrote: As an alternate solution, is there a way to have it use a different file name every time it starts? Here's a snippet to do that: conf.yml -- Plugin::Session: storage: /tmp/some-prefix-__UID__.session MyApp.pm -- Plugin::ConfigLoader = { substitutions = { UID = sub { $ }, }, }, https://metacpan.org/module/Catalyst::Plugin::ConfigLoader ___ 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/
Re: [Catalyst] Plugin::Session lazy start
On Wed, May 23, 2012 at 7:42 AM, Alexander Hartmaier alexander.hartma...@t-systems.at wrote: Because I've just read perlvar: $REAL_USER_ID or $UID instead of $. I think this is generally excellent advice but I want to argue against it in this case. UID = sub { $ } is sufficiently semantic *and* edifying. E.g., Oh! That's the special var for UID. It finally makes sense. use English; UID = sub { $UID } is redundant to point of being annoying and even distracting (to me). ___ 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/
Re: [Catalyst] Model Instances vs. Model Classes - Round 2
On Wed, Jul 20, 2011 at 7:00 AM, Alejandro Imass alejandro.im...@gmail.com wrote: On Wed, Jul 20, 2011 at 2:25 AM, Alejandro Imass alejandro.im...@gmail.com wrote: On Thu, May 19, 2011 at 7:06 PM, Benjamin Hitz h...@stanford.edu wrote: [...] I tried to make it as practical as possible: http://wiki.catalystframework.org/wiki/best_practices/models_definitive_guide Maybe others can complement with more M Patterns The Catalyst Wiki seems to be having some problems so i posted it on PM as well: http://www.perlmonks.org/?node_id=915657 You probably never saw it but I did a bunch of this a couple years ago. It's a bit old but contains a lot of good stuff anyway: http://sedition.com/a/2733 And the code with a couple other pieces I didn't really cover in the articles is here: https://github.com/pangyre/p5-myapp-10in10 ___ 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/
Re: [Catalyst] Fatal errors in chained actions
On Fri, Apr 8, 2011 at 2:39 AM, Dami Laurent (PJ) laurent.d...@justice.ge.ch wrote: -Message d'origine- De : Ronald J Kimball [mailto:rkimb...@pangeamedia.com] Envoyé : jeudi, 7. avril 2011 20:11 À : The elegant MVC web framework Objet : [Catalyst] Fatal errors in chained actions I was surprised to discover that when a chained action throws a fatal error, Catalyst continues executing the remaining actions in the chain. Personally, I had assumed that each action in the chain could depend on the preceeding actions having been executed successfully. Hi Ronald, This point was discussed in 2008 : see http://lists.scsys.co.uk/pipermail/catalyst/2008-March/017748.html and the rest of the thread. It was actually discussed a year before that: http://lists.scsys.co.uk/pipermail/catalyst/2007-July/014507.html The idea suffered from similar lack of tuits at the time. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Unicode::Encoding - utf8 \xBA does not map to Unicode
On Sun, Mar 27, 2011 at 12:10 AM, Tomas Doran bobtf...@bobtfish.net wrote: On 13 Mar 2011, at 14:46, ryan lauterbach wrote: Even if the URL is inproperly formed I think Catalyst should handle it gracefully. I entirely agree with this. At the very least, we should serve a 400 (bad request) page in some way, rather than a 500 (internal server error). Can you log a bug in RT against the Unicode::Encoding plugin and reference this discussion? I think there's been an open ticket on this issue for a few months. I was a little surprised it hadn't got any attention but now I'm guessing you just never saw it: https://rt.cpan.org/Public/Bug/Display.html?id=62120 ___ 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/
Re: [Catalyst] Re: How to get uri_for something with a fragment?
On Tue, Mar 8, 2011 at 8:44 AM, Ronald J Kimball rkimb...@pangeamedia.com wrote: On Tue, Mar 8, 2011 at 11:27 AM, Ashley Pond V a...@sedition.com wrote: Well, the original message was: How do I call uri_for_action and pass it the '#id' part? It's not an arg and it's not part of the query string. This is called the fragment identifier in the final URL. uri_for_action makes it implicit that he was seeking a server side use of the fragment. No, it does not. He was simply creating a URL, with a fragment, that will be included in the body of the response so the user can click on it in the browser. Oh. That's completely different. Never mind. ___ 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/
Re: [Catalyst] Best form library?
On Mon, Mar 7, 2011 at 8:15 AM, Devin Austin devin.aus...@gmail.com wrote: On Sun, Mar 6, 2011 at 2:52 PM, Roger Horne ro...@hrothgar.co.uk wrote: On Sunday 06 March 2011 20:52:04 Devin Austin wrote: FormFu is pretty awful in my opinion. Rose::HTML stuff isn't much better. As an amateur I would be interested to know why. When I started learning about Catalyst about a year ago, the Tutorial at FormFu doesn't make it easy to do a lot of things. Things like modifying the form after it's been created aren't very easy, and there were quite a few instances I had to add these sort of ludicrous call backs (recommended in the documentation) to get the functionality I wanted (populate a select box from the db, etc.) It's kludgy, and there are just better options out there. I'd like to see a start to finish example of the better options. Your criticism seems contradictory. You dislike callbacks because you prefer to write the form in code. I use FormFu and have no problem with it and there is ultimately no difference between doing things in config or in code, it's all code and rendering in the end and HTML forms and form processing is just a messy business no matter what you do. I find config files a very clean way to reuse parts of forms and fieldsets and such. Doing that with Roles or inheritance seems messier to me. The *only* thing I'm dissatisfied with in FormFu is the speed but since forms are such a small part of regular app traffic, it hasn't stopped me from using it. Carl's fast and caring responses to questions and bugfixes on the FormFu list are part of why I like it. I have been very curious about other approaches, including FormHandler but a casual read of the docs gives no compelling reason to switch and critiquing FormFu (FormFu is pretty awful in my opinion) without some kind of comparison/contrast and real examples is not really helpful. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] How to get uri_for something with a fragment?
On Mon, Mar 7, 2011 at 10:05 AM, John M. Dlugosz wxju46g...@snkmail.com wrote: On 3/7/2011 9:34 AM, Ronald J Kimball rkimball-at-pangeamedia.com |Catalyst/Allow to home| wrote: On Sun, Mar 6, 2011 at 6:46 AM, John M. Dlugoszwxju46g...@snkmail.com wrote: On 3/6/2011 5:28 AM, Andrew Rodland andrew-at-cleverdomain.org |Catalyst/Allow to home| wrote: Or, since you know that what it generates *doesn't* have a fragment you could always just $c-uri_for_action(...) . '#id' which will be perfectly valid (although no longer a URI object). I considered that a hack until I knew better, since it won't work if there are query arguments. Why won't it work if there are query arguments? Seems correct to me. Using the fragment is probably a bad idea. It's not supported by all servers so it can end up lost on the backend depending on your setup. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] How to get uri_for something with a fragment?
On Mon, Mar 7, 2011 at 12:34 PM, Ronald J Kimball rkimb...@pangeamedia.com wrote: On Mon, Mar 7, 2011 at 3:25 PM, John M. Dlugosz wxju46g...@snkmail.com wrote: On 3/7/2011 1:35 PM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to home| wrote: Using the fragment is probably a bad idea. It's not supported by all servers so it can end up lost on the backend depending on your setup. I've never heard of a web server that didn't have fragments. I link to anchors all the time! No, really, that's meaningless. Fragments are handled by the user agent, not by the server. What Ronald said + the #fragment is not passed along in the available ENV with some servers and setups. In these cases it doesn't exist as far as the backend is concerned. If you rely on it for dispatch, you may get burned. ___ 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/
Re: [Catalyst] Re: How to get uri_for something with a fragment?
2011/3/7 Adam Sjøgren a...@koldfront.dk: On Mon, 7 Mar 2011 13:01:42 -0800, Ashley wrote: What Ronald said + the #fragment is not passed along in the available ENV with some servers and setups. In these cases it doesn't exist as far as the backend is concerned. If you rely on it for dispatch, you may get burned. Uhm, the _browser_ handles fragments. Browsers don't send them to the server _at all_. Nice. I didn't want to blanket it with a 100% of the time in all clients/servers this won't work because I was not sure. ___ 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/
Re: [Catalyst] What text editor to use?
Let's end this thread; 23 messages is enough and the topic is barely more relevant to Catalyst than What kind of lunch should I have? ___ 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/
Re: [Catalyst] Simple literal Model
On Fri, Feb 25, 2011 at 9:22 PM, John M. Dlugosz wxju46g...@snkmail.com wrote: On 2/25/2011 9:30 AM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to home| wrote: What t0m suggested is perfectly fine but if you want to mimic the DBIC API with a different engine, this example does that (superficially and as a tutorial only): http://sedition.com/a/2739 Log file model–Apache access log. The reason that example makes sense is because the underlying model/data is similar: searchable, sortable rows. If you're trying to shoehorn in something dissimilar, you might be making a mistake. -Ashley I'm not sure to what extent it is wise or correct. The whole point of models is that it abstracts the model and I can change where the data comes from later, right? So don't they all have an underlying abstract interface regardless of how they are sourced? Well, models just differ. DOM, relational, even hash and array with all their similarity need some minor acrobatics if they are to be treated alike. You can make an API to attempt to unify all the possible data models but that would create an artificial complexity much harder to track and work with. This hits a sore spot for me. I've seen what I take to be a sort of purity of MVC just about kill projects and make them incredibly painful to work on. The layers are to make work easier, testable, quicker, delegated, etc, not to achieve some fantasy where the templates from a Cat app can be plugged into Rails or Django without modification. The examples I've read using DBIC use [% WHILE ( item = list.next) %] and I can imagine that in general we don't have efficient random access to the rows; in C++ I would characterize this as a forward iterator or even weaker, if I can't make a copy of the earlier state and go forward a second time. I would have hoped that the TT [% FOREACH %] directive would work here. That seems like the natural means of abstracting the list. That is, the controller can set anything into the stash that FOREACH knows how to handle, including a plain Perl array. The API for that in DBIC+TT would look like [% FOR record IN list.all() %] or list.search({contraints...},{rows=max_rows}) or list.search_related() etc, etc. The idioms are mostly the same in TT as plain Perl. for can't recursively call an iterator any more than while can unroll a list. ___ 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/
Re: [Catalyst] Simple literal Model
On Fri, Feb 25, 2011 at 2:27 AM, John M. Dlugosz wxju46g...@snkmail.com wrote: On 2/25/2011 4:06 AM, Tomas Doran bobtfish-at-bobtfish.net |Catalyst/Allow to home| wrote: __PACKAGE__-meta-make_immutable; 1; And you then call $c-model('Foo')-data; The implementation of the 'data' method could then later be replaced by an attribute (i.e. has data = ( is = 'ro', isa = 'HashRef' );), and would then get the data from config, or something more complex (e.g. to get the data out of DBI, or another model, or whatever). HTH Cheers t0m Thanks. Is '$c-model('Foo')-data' what something like DBIC gives us, too? That is, is a method named 'data' the convention? That is, if code was given a result set (I think that is the right term) of a query that was made on one of the main standard model types, what would the list of records look like? What t0m suggested is perfectly fine but if you want to mimic the DBIC API with a different engine, this example does that (superficially and as a tutorial only): http://sedition.com/a/2739 Log file model–Apache access log. The reason that example makes sense is because the underlying model/data is similar: searchable, sortable rows. If you're trying to shoehorn in something dissimilar, you might be making a mistake. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Making secure session cookies (or, how do we make Explorer stop complaining about nonsecure content on a secure page?)
On Mon, Feb 21, 2011 at 6:11 AM, will trillich will.trill...@serensoft.com wrote: That's a neat trick -- hadn't heard of that one before. But the javascript isn't our nonsecure-items problem. Protocol free // isn't a javascript specific technique while we're on it. It simply means use the protocol that's currently in action. It will work for images and such as well as long as your server can send them secured. This technique was gaining traction 10 years ago but doesn't seem to get much use today. ___ 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/
Re: [Catalyst] Transferring control via root/auto
On Wed, Dec 8, 2010 at 6:59 AM, Larry Leszczynski lar...@emailplus.org wrote: In situations like this I find this flow diagram helpful: http://dev.catalystframework.org/attachment/wiki/WikiStart/catalyst-flow.png but I admit I am also not totally clear about how detach/go fit in... Maybe someone has an updated diagram (or can update this one)? I did that diagram a loong time ago (2006?). I'd be glad to amend it and I can see obvious changes it needs but I'd probably need input from core devs to round it out perfectly. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Which Form Validation Libs?
HTML::FormHandler Chiming in: FormHandler has been getting the most questions lately, IIRC, but I suspect FormFu is more often used. It has its own excellent mailing list (made excellent by the main dev, Carl Franks, who is very responsive and helpful) so the questions don't tend to end up here. Except for speed (it's quite slow) I like it very well and it has excellent hooks/extensions for DBIC. ___ 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/
Re: [Catalyst] C::E::HTTP::PreFork deployment
On Tue, Nov 30, 2010 at 7:04 AM, Edmund von der Burg e...@ecclestoad.co.uk wrote: Hello, Currently I run several Catalyst apps under lighttpd using fastcgi. I'd like to switch to them being HTTP::Prefork. A very incomplete answer but I'd suggest adding PSGI/Starman to the list of things you look at. It's HUPable for restarts though I don't think anyone has written a file-watcher style hook to do that (yet) and can have workers added and removed with signals. With things like Plack::Builder you can make all kinds of tremendously powerful deployment choices pretty simple. I have a stub git repo for a starman service script: https://github.com/pangyre/p5-cat-starman-daemon (there is nothing there now but I do have a good skeleton that isn't committed/pushed. I was hoping to round out / generalize it in time for an advent entry. As well as a P::Builder thing... anyone seen my tuits? They were round, once. -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Wrong Content-Length value
On Wed, Sep 8, 2010 at 2:30 PM, Bill Moseley mose...@hank.org wrote: On Wed, Sep 8, 2010 at 2:16 PM, Nicholas Wehr catal...@bionikchickens.com wrote: so which engine and version are you using? apache? built-in http? fastcgi? Apache, but that message is in Catalyst::Engine parent class. FWIW, this was plaguing me in FastCGI too. I got around it there by running the script with env, --unset=HTTP_CONTENT_LENGTH. It's been months though and whatever understanding of the issue I had gained, I've since lost. ___ 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/
Re: [Catalyst] TheSchwartz - Catalyst::Model::Adaptor
On Sat, Aug 7, 2010 at 9:26 AM, gor...@gorste.plus.com wrote: I am writing a job queuing system in catalyst. I have found an example of a job queuing examples that uses TheSchwartz and catalyst through Catalyst::Model::Adaptor. Currently it uses Sqlite, I need to use MySQL, for me to do this I need to create TheSchwartz with augments like I haven't played with your sample at all, or looked at the stuff much in a year, but MySQL should actually be easier than SQLite and you dropped the mange_args sub which is probably relevant. Try adding it– sub mangle_arguments { %{$_[1]} } http://sedition.com/a/2742 -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] rich ajax UI component libraries for Catalyst?
On Mon, Jul 26, 2010 at 10:53 AM, Jason Kohles em...@jasonkohles.com wrote: Unless you are referring to the old licensing scheme (which went away some time ago) then discouraging ExtJS use because of it's license is absurd, as the license is GPL. They do have a commercial license available as an option, but you only need that if you want to distribute ExtJS as part of your application and are not prepared to do it under the terms of the GPL. Not wanting to distribute under the GPL is not uncommon and while one might argue it's not the Right Way(tm), I don't think there is a good argument for it being absurd. ___ 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/
Re: [Catalyst] Catalyst::Authentication::Credentials::OpenID, extensions and Config::General
On Thu, Jul 8, 2010 at 2:22 PM, Adam Sjøgren a...@koldfront.dk wrote: The example given in Config::General format in the CONFIGURATION section of the Catalyst::Authentication::Credentials::OpenID doesn't seem to yield the structure that is expected by the module. If you, or anyone, provides a better example, I'll gladly add it. I'm not familiar with Config::General (the example config is from a patch). -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: [Dbix-class] Re: utf8 / pg double encoding problem
This may or may not be germane: try installing JSON::XS and updating your JSON and JSON::Any. JSON::XS is one of, if not the, fastest serializers in all data classes and its utf8 handling is better. JSON now, IIRC, calls it if it's present instead of its older Perl version. -Ashley On Jan 7, 2008, at 7:57 AM, Daniel McBrearty wrote: Data is actually sent in URI encoded utf8 (looks like ab%C3%A7 ), which is fine. The string is then picked up, decoded and stored in the db just fine. The problem is that what gets sent back the other way (via Catalyst::View::JSON ) is not getting encoded. I don't know quite why just now (according to the docs it should do). Manually adding the Encode::encode_utf8( $result ) step fixes it for now. I may try peeking to see why it doesn't get handled by the View. ___ 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/
Best practice for relative URIs (was: [Catalyst] Does uri_for() respect https?)
Turns out this is probably being caused by a proxy/SSL-config issue. But it leads to another question. What's the best practice for relative URIs so that this sort of problem becomes irrelevant? This seems like the right choice: [% c.uri_for(/my/path).path_query %] Any say otherwise? -Ashley On Dec 31, 2007, at 8:25 PM, Ashley Pond V wrote: I'm sorry if this is a stupid question but I'm not in a position to test it myself at the moment. Does uri_for respect https/http? I have some that are coming up http when the requested resource is https. I know I have a rewrite rule problem too so it might be my own problem. So, this is really just a sanity check. Given a request to https://mysite.com/myapp [% c.uri_for(/whatever) %] will produce https://mysite.com/myapp/whatever; and not http://mysite.com/myapp/whatever; Yes? -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Best Practices for wizards, steps?
On Jan 1, 2008, at 9:40 AM, Aristotle Pagaltzis wrote: * Dennis Daupert [EMAIL PROTECTED] [2008-01-01 17:45]: I'm curious what people consider best practices for developing widgets that involve a series of steps, funtions that involve clicking thru a series of pages. Don’t break the web: make sure each step has its own URI, as opposed to using the session to store the user’s position. That’s all I can think of right now. I just completed a submission process where the user does a regular form and then is taken to a legal authorization doc (instead of the regular old I read and agree checkbox). I was a little stumped at first too but then I just implemented like its own page which if arrived at without a doc, 404s or sends you to submit a doc and if arrived at when authorization is already done, flashes you to that effect on the view page. It felt foreign to do it that way at first. Instead of session and param juggling but once it was done, it was amazing how much more straightforward it is. Just as Aristotleleleslsles[1] suggests. With roles, chaining, captures, and flash messages you can make an extremely convoluted logic tree pretty straightforward to code. -Ashley -- 1 Oh, go read his post about A. Pagaltzis. ___ 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/
[Catalyst] Does uri_for() respect https?
I'm sorry if this is a stupid question but I'm not in a position to test it myself at the moment. Does uri_for respect https/http? I have some that are coming up http when the requested resource is https. I know I have a rewrite rule problem too so it might be my own problem. So, this is really just a sanity check. Given a request to https://mysite.com/myapp [% c.uri_for(/whatever) %] will produce https://mysite.com/myapp/whatever; and not http://mysite.com/myapp/whatever; Yes? -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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Legacy porting to auto-authenticate a logged in user
You've hit it. You are better than my Teddy bear lately. I wasn't thinking straight. Since the password is coming from the DB instead of a user form, it's already in SHA1 so it should be treated for the sake of authentication as clear since SHA1 != SHA1(SHA1). Thanks and to Peter for the other ideas for future debuggery, so to speak! -Ashley On Dec 23, 2007, at 10:29 AM, Jay K wrote: Hi Ashley, My guess is that your password hashing type in the db is different from the password hashing type you defined for the Password credential. Since your database does store the password in plaintext - why not set password type to 'clear' - and set the password_field to password. This should cause authentication to happen against your unencrypted password and should work. Jay On Dec 23, 2007, at 10:10 AM, Ashley Pond V wrote: Thanks for the idea. Didn't work. After following the code trail back through a few namespaces and lots of config v class_data v eyes glaze over, I fixed it by setting the password_type to none and merely authenticating on the username. This is fine in this case but it's obviously less than ideal. If anyone has insight into what I'm doing wrong with my original version, I'd love to hear it. WORKING VERSION (username isn't guaranteed unique so I went with the Id instead): $c-authenticate({ acctid = $user-acctid }) or die RC_403: . $user-username . : . $user-acctid . failed to authenticate; authentication: default_realm: users realms: users: credential: class: Password password_type: none #password_hash_type: SHA-1 #password_field: crypt_passwd store: class: DBIx::Class user_class: DB::User id_field: acctid On Dec 22, 2007, at 3:44 AM, Peter Edwards wrote: Try $c-authenticate({ acctid = $user-username, password = $user-password }) or die RC_403: . $user-username . failed to authenticate; Regards, Peter -Original Message- From: Ashley Pond V [mailto:[EMAIL PROTECTED] Sent: 22 December 2007 08:08 To: The elegant MVC web framework Subject: [Catalyst] Legacy porting to auto-authenticate a logged in user I have what I first thought was a gimme (this is only tangentially related to the questions I asked a few days ago; same app, different DB and part). Legacy porting of a login with Authenticate where I already have the user id and everything verified. I have tried many permutations of arguments and setup. The user has already logged into the legacy part of the app. So this is the code that is not working but I think should. my $user_id = ...legacy fetch; working fine my $user = $c-model(DB::User)-find($user_id) or die RC_403: No such user for id $user_id; # also working fine # this dies, I've verified the $user, username, and password are correct $c-authenticate({ username = $user-username, password = $user-password }) or die RC_403: . $user-username . failed to authenticate; So. why? The legacy setup is a little strange so I think that must be it. The user table's DBIC looks like this (password is plaintext, legacy, and crypt_passwd is sha1 of it)- package MyApp::DB::User; use base qw/DBIx::Class/; __PACKAGE__-load_components(qw/PK::Auto Core/); __PACKAGE__-table('foo.account'); __PACKAGE__-add_columns(qw/ acctid email fname lname password crypt_passwd /); __PACKAGE__-set_primary_key('acctid'); sub username { +shift-email; }; My config looks like this- authentication: default_realm: users realms: users: credential: class: Password password_field: crypt_passwd password_type: hashed password_hash_type: SHA-1 store: class: DBIx::Class user_class: DB::User id_field: acctid Thanks for looking! -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/ ___ 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/ --- America will never be destroyed from the outside. If we falter and lose our freedoms, it will be because we destroyed ourselves. -- Abraham Lincoln ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
[Catalyst] Legacy porting to auto-authenticate a logged in user
I have what I first thought was a gimme (this is only tangentially related to the questions I asked a few days ago; same app, different DB and part). Legacy porting of a login with Authenticate where I already have the user id and everything verified. I have tried many permutations of arguments and setup. The user has already logged into the legacy part of the app. So this is the code that is not working but I think should. my $user_id = ...legacy fetch; working fine my $user = $c-model(DB::User)-find($user_id) or die RC_403: No such user for id $user_id; # also working fine # this dies, I've verified the $user, username, and password are correct $c-authenticate({ username = $user-username, password = $user-password }) or die RC_403: . $user-username . failed to authenticate; So… why? The legacy setup is a little strange so I think that must be it. The user table's DBIC looks like this (password is plaintext, legacy, and crypt_passwd is sha1 of it)- package MyApp::DB::User; use base qw/DBIx::Class/; __PACKAGE__-load_components(qw/PK::Auto Core/); __PACKAGE__-table('foo.account'); __PACKAGE__-add_columns(qw/ acctid email fname lname password crypt_passwd /); __PACKAGE__-set_primary_key('acctid'); sub username { +shift-email; }; My config looks like this- authentication: default_realm: users realms: users: credential: class: Password password_field: crypt_passwd password_type: hashed password_hash_type: SHA-1 store: class: DBIx::Class user_class: DB::User id_field: acctid Thanks for looking! -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/
Re: [Catalyst] no role configuration found -- authorization: dbic and DBI::Schema::Loader
I backed up to a simple test script, got easier to find errors, and found the trouble with what I was doing. __PACKAGE__-many_to_many(roles = 'user_roles', 'name'); needed to be __PACKAGE__-many_to_many(roles = 'user_roles', 'role'); and a corresponding many_to_many in Role.pm __PACKAGE__-many_to_many(users = 'user_roles', 'user'); So, I'm all good now but still a bit mystified about the silent failure(?). Thanks again, -Ashley On Dec 16, 2007, at 10:49 PM, Ashley Pond V wrote: 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
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] 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: http
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
Re: [Catalyst] Web hosting?
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/
Re: [Catalyst] backward compatibility problem with new C::P::Authentication (for info only)
I had exactly the same problem two days ago and found the same fix. On Dec 13, 2007, at 1:06 PM, Daniel McBrearty wrote: I still had -Authentication::Credential::Password -Authentication::Store::DBIC in the modules list, from the old setup. Removing these seems to have fixed the problem. ___ 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] Soundboard: Catalyst::Model::GoogleCalendar
Right on. I swear I tried a search for it. must have misspelled it. On Dec 9, 2007, at 5:05 PM, Steve Sabljak wrote: Using the existing Google Calendar perl api from CPAN (http://search.cpan.org/~simonw/Net-Google-Calendar-0.8/), would this do the trick? package Catalyst::Model::GoogleCalendar; use strict; use base 'Catalyst::Model'; use Class::C3; use Net::Google::Calendar; our $VERSION = '0.1'; sub new { my ( $self, $c, $arguments ) = @_; $self = $self-next::method(@_); return Net::Google::Calendar-new( { %$self } ); } 1; __END__ Kind Regards, Steve Sabljak On Dec 8, 2007 6:10 PM, Ashley Pond V [EMAIL PROTECTED] wrote: Yep. You have it right. Now the tuits… On Dec 7, 2007, at 10:29 PM, Jonathan Rockway wrote: On Fri, 2007-12-07 at 21:29 -0800, Ashley Pond V wrote: Catalyst::Model::GoogleCalendar Strikes me as good idea. Anyone already doing it? Also strikes me as a *lot* of code to write. It's a big API and date stuff is always fun. http://code.google.com/apis/calendar/developers_guide_protocol.html Making this a Catalyst::Model is a terrible idea. Just make it a regular Perl module, and glue it to Catalyst with 3 lines of code or Catalyst::Model::Adaptor. Regards, Jonathan Rockway ___ 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/ ___ 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/
[Catalyst] Soundboard: Catalyst::Model::GoogleCalendar
Catalyst::Model::GoogleCalendar Strikes me as good idea. Anyone already doing it? Also strikes me as a *lot* of code to write. It's a big API and date stuff is always fun. http://code.google.com/apis/calendar/developers_guide_protocol.html -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/
Re: [Catalyst] Session/Authentication/Authorization for legacy + Cat
On Nov 20, 2007, at 2:29 PM, Matt S Trout wrote: On Tue, Nov 20, 2007 at 08:41:02PM -, Peter Edwards wrote: On Mon, Nov 19, 2007 at 11:03:24PM -0800, Ashley Pond V wrote: Let Catalyst handle /login. Make legacy code get user out of session. That's a really good way so long as you can make the old app use a Catalyst session handler. Which in his case is true since he's sharing the sessions via CGI::Session. I do think this is the way to go. Nice. I also think we have have replaced mythology with popular culture, but that's OOT. In my prototype I found a pretty annoying interface transparency issue though. This is from an email I just sent the author of C::P:Session::CGISession. C::P:Session::CGISession, puts the data under our $SESSION_DATA_PARAMETER_NAME = '_catalyst_session'; for cross-compat with other Session hooks, but it hides it from the legacy store which is in the same level under _DATA. So the Cat manipulated session info is under $session-param(_catalyst_session) for the legacy code and the Cat code has no access to anything the legacy code sets in the session. # some data trimmed out for brevity '_DATA' = { 'rand_set_in_legacy' = '6.3108406432821', '_catalyst_session' = { 'rand_set_in_cat' = '16.4781763075979', }, '_SESSION_ID' = 'f15b8a17d0fc00a43601226837afd5e8', } So, this makes it pretty tricky to mix the two. I'd like to have the Cat::Plugin work at the same level as the vanilla CGI::Session; the _DATA store for all top level params. Of course for compatibility with other Cat stuff, the _catalyst_session would still work, it would just be a reference to the _DATA. So I have a patch, I think, which makes it work on the same internal data hash for both the Cat and vanilla versions so they can use the same session transparently. I've offered it to the author, if he thinks it's a good change. On unrelated and deeply buried points I would also like to add for the record (again), that I never start a new thread by replying to an old message even though the list threads make it look that way. Mail.app is either doing something squirrelly or my mail host is. Also the (this archive seems to be stuck in September: http://www.mail-archive.com/[EMAIL PROTECTED]/ This one is up to date: http://lists.scsys.co.uk/pipermail/catalyst/ Thanks! -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/
[Catalyst] Prior Art: Scheduling Application
I'm looking at doing a Cat App for my wife's green cleaning business to handle scheduling, reminder emails for cleaners/clients/managers, quote requests, billing tracking, display open times for cleans, and auto-assignment of jobs based on address of client + preference of cleaner. As long as I can keep the code clean enough to not be embarrassing I'd open source it. (I'd love name suggestions or to hear from anyone interested in a commit bit for app too.) While I enjoy writing stuff from scratch and don't even mind a little reinvention now and then I'd like to ask– 1. Has anyone already written a scheduling app with Cat (is it open source; would/can you share code otherwise)? 2. Is there something non-Cat I should be considering first; or at least stealing design? Thanks! -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/
Re: [Catalyst] PathPart help
That is really cool and answers something I've wanted to do for a long time (let the user define the URI to customize a package). I have a question. Using the PathPrefix seems to work as advertised but it does not replace the default path. So, in a test I just did, MyApp::Controller::Article with __PACKAGE__- config( path = 'a' ) gives the expected, new, result at path /a but also still responds at /article. Seems like this is not DWIW or M. (I'm using the sample sub in the post, not the trunk code). The others replace correctly though(?). /a == /article but /a/id works while /article/id fails as I'd like. -Ashley On Nov 15, 2007, at 12:07 PM, Christopher H. Laco wrote: http://use.perl.org/~LTjake/journal/31738 -=Chris I use this exact setup, and I assume most do. How is your create declared? sub create : Local {} ? ___ 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/
[Catalyst] DBIC v Cache: What are catalyst best practices for caching DBIC results (with relationships included)
I'm having trouble getting Plugin::Cache to handle DBIC objects correctly. Past instruction, and recent refresher, from MST shows that you have to reset/revive the result source and this works for a single object but blows up for prefetch. In this code my $article = $c-cache-get($id); if ( $article ) { $article-result_source($c-model(DB)-source (article)); } else { $article = $c-model(DB::article)-find($id) or die RC_404: no such article; $c-cache-set($id, $article); } No problem. But I really want to save the related object trips to the DB too. So, since articles may have comments I want to prefetch them as they will be used beneath an article. But then they are missing their result_source and resetting it does not seem to work(?). The following code produces an error when reloaded after first being cached. my $article = $c-cache-get($id); if ( $article ) { $article-result_source($c-model(DB)-source (article)); $_-result_source($c-model(DB)-source(comment)) for $article-comments(); } else { $article = $c-model(DB::article) -find($id, { prefetch = [qw/comments/] } ) or die RC_404: no such article; $c-cache-set($id, $article); } Caught exception in MyApp::Controller::Article-article Can't call method + source on an undefined value at + /Library/Perl/5.8.6/DBIx/Class/ResultSourceHandle.pm line + 62. What am I doing wrong? Can this be handled at all (resetting result_sources gets ugly fast when you bring in the other involved objects like user and document lineage)? What is the best practice regarding caching DBIC results in Catalyst? Thanks! -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/