Re: [Catalyst] Shoot out -- Catalyst / RoR / Other MVC apps --
> Does anybody know of a place where creating your own model is documented > in more detail? I'd like to read it. Not yet. I suspect there'll be a chainsawblues series on it at some point if nobody else gets a good explanation together first. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Please, yes! It would be very useful to see more examples of current best-practice. - Chris ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] New catalyst site - gardenate.com
> It also served as an interesting exercise in getting a Cat site to run > under fastcgi on a host who don't really know how to support fastcgi, > using mod_rewrite to invoke the fastcgi server script. Wife says "That's very useful" which is praise indeed. Can you write up a short deployment scenario re the mod_rewrite and post it here please? Kieren, my thanks to your wife for the kind words, and also to everyone else who responded through the contact page on the site. I hope your wife signs up for the email reminders when I get them implemented next week :-) Re mod_rewrite: The ISP said that they had installed and configured mod_fcgi at our request, so we battled for a while to work out why a basic .fcgi script wouldn't work. Turned out that they hadn't mapped any suffixes to the fastcgi handlers, despite protestations to the contrary. Finally this incantation did the trick with a copy of the script/fastcgi.pl renamed to .fcgi and copied to the htdocs, together with a 'use lib' to set up pathing to where the app files actually live. The 'static' dir is sym-linked to the root/static dir to make deployment simple and easy to maintain using rsync. My final .htaccess file: AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_URI} !^/static RewriteCond %{REQUEST_FILENAME} !gardenate.fcgi RewriteRule ^(.*)$ gardenate.fcgi/$1 [PT,L] Hope this is useful. Comments and improvements welcomed. - Chris ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] New catalyst site - gardenate.com
Hi, I'd just like to announce that a new Catalyst site, http://www.gardenate.com, has been launched on the unsuspecting world. Catalyst/DBIx::Class/Mysql/Fastcgi - it's served as a useful learning exercise about Chained handlers. I hope to use them again in future projects. Kudos to the Catalyst development team for making such a usable framework. It also served as an interesting exercise in getting a Cat site to run under fastcgi on a host who don't really know how to support fastcgi, using mod_rewrite to invoke the fastcgi server script. - Chris ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Chained, slashes, and escaping
On 3/6/07, Jim Spath <[EMAIL PROTECTED]> wrote: I'm implementing tagging under Catalyst and want to be as unrestrictive as possible on the tag text. As such, I allow slashes in the tag text. To view information on a given tag, you hit the following path: /tag/URI_ESCAPED_TAG Which uses the following action in the Tag controller: sub view : PathPart('tag') Chained('/') Args { my ($self, $c, $tag) = @_; To test and make sure the escaping is working properly I created the following tag: sl/ashes When I access the following URI: /tag/sl%2Fashes $tag gets set to sl instead of sl/ashes. Chained appears to be using the unescaped path when it looks for the separator instead of the actual path. Is this a bug or a feature? How can I work around it? - Jim I cheated and replace '/' with '_' when outputting links when confronted with a similar issue, then s/_/\//og in the handler. Don't know if that will work for you? - Chris ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] "You have been automatically logged out."
On 2/21/07, J. Shirley <[EMAIL PROTECTED]> wrote: The meta refresh is a good idea, although I avoid it because an inadvertent escape cancels the timeout in some browsers (Firefox being one). This means if the user hits escape for whatever reason, the feature is just disabled without warning; with a javascript method it tends to be more consistent for the user. Good point! I like Javascript, but I don't like relying on it -- as with many of these things, there are plenty of ways to do things, none of them ideal. :-) I think as long as an opportunity to log back in and continue with whatever it was you were doing (in the case of the 'you have been logged out' screen not being displayed for whatever reason) combined with one of the approaches above covers most situations though. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] "You have been automatically logged out."
On 2/20/07, J. Shirley <[EMAIL PROTECTED]> wrote: If you aren't doing any AJAX interactions, the simple approach is to add a JavaScript listener to the onload event that calls the following (untested) function: var activityTimer; function setActivityTimeout(time) { if ( activityTimer ) clearTimeout(activityTimer); activityTimer = window.setTimeout( function() { alert("You have been logged out."); document.location = "/"; }, time || 600); } On each page unload, this timer will be canceled. If you do any AJAX loads that count as activity, simply call setActivityTimeout() on the initiation of the remote event. And, of course, expire the session on the server to match whatever is your client side time out as well. Why not simply add a meta refresh tag to the top of the template header? e.g.: ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Question on serving files
You can set the header information to give mime hints to the browser: $c->res->headers->content_type('application/octet-stream'); $c->res->headers->content_length( $stat->size ); $c->res->headers->last_modified( $stat->mtime ); $c->response->headers->header( 'Content-disposition:' => "attachment; filename=$filename" ); $c->res->headers->expires( time() ); $c->res->headers->header( 'Pragma'=> 'no-cache' ); $c->res->headers->header( 'Cache-Control' => 'no-cache' ); Interestingly, if you set 'no-cache' on file downloads over an SSL (https) connection where IE has a mime-handler defined (word/xls/pdf), will throw spurious errors about being unable to cache the file, even when trying to 'save target as'. This isn't a catalyst issue, but an IE 'feature'- might be useful to know before it bites, though. - Chris ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/