catalyst

Is it feasible to learn Perl and Catalyst at the same time?

Is it feasible to learn Perl and Catalyst at the same time? If so, what would be the typical path? I am experienced .Net/C#/C++ developer but fairly new to Perl ...

How do I make a Catalyst action that matches a single file in the root directory?

Hello! I have trouble creating a Catalyst action that would match a single file in the root directory. I would like to match URLs that look like this: http://foo:3000/about.html I have written the following action in the root controller: sub static :Path :Args(1) { my ($self, $c, $file) = @_; … } But the action does not ma...

How can I define constants in a Template Tookit template in a Catalyst app?

I want to use a constant in my TT template. In HTML::Mason (my previous templating engine of choice) I could do: <%once> use MyApp::Constants qw(CONSTANT); </%once> How can I do this in Template Toolkit? As mentioned in the title this is a Catalyst app so I was thinking I could put the constants in the stash but that seems a bit awkwa...

Example for Catalyst::Plugin::Authentication::Store::DBIC and Class::DBI

I am trying to use Class::DBI with Catalyst::Plugin::Authentication::Store::DBIC. The example given on CPAN does not work with Class::DBI. For example, the config is incorrect: role_class => 'DB::Role' has to be replaced by role_class => 'MyApp::Model::DB::Role' I got Authentication working using plain DBI, but I would rather use Class...

What's wrong with using a framework that has a lot of dependencies?

Hi, all. I recently told a friend that I was starting to learn Catalyst (Perl) and he fairly strongly emphasized that because Catalyst has so freakin' many dependencies, I should use something like Rails instead. Isn't that a good thing that there are a lot of dependencies? Doesn't that indicate a lot of code re-use? I understand tha...

How can I start a long-running jobs in Catalyst with progress bar?

How would I start a long-running job from within a Catalyst app? I want a page from which the user can upload a list of URLs, and the application would then go and download these URLs. I need to implement an AJAX progress indicator that would then show the status of this job. ...

How can I abort a Catalyst upload based on Content-Length or MIME-Type?

I've tried to use parse_on_demand as shown in: http://search.cpan.org/~flora/Catalyst-Runtime-5.80007/lib/Catalyst.pm#ON-DEMAND_PARSER However, I can't seem to stop the upload. I'm testing this simply by creating an action that dies immediately, however the browser seems to upload the very large file I've selected before it ever reaches...

Where can I find 'more advanced web toolkit' for Template Toolkit?

I really like Template Toolkit and like how it works with Catalyst, but I would like more 'web advanced' toolkit. It could be just a package of *.tt files for Web objects like these: Selector, Selector_DateTime, Menu, Data_Table... Is there something like that somewhere on the Web? If not, why not? ...

How can I set the Cache-Control header for every response in Catalyst?

It seems that by default Catalyst does not output Cache-Control:, etc. headers. I know I can output them in a given controller method like this: $c->response->headers->last_modified(time); $c->response->headers->expires(time + $self->{cache_time}); $c->response->headers->header(cache_control => "public, max-age=$self->{cache_time}"); ...

How can I not send a cookie when I use the Cache-Control header in Catalyst?

I'm using sessions in my Catalyst app via Session, Session::Store::DBIC, and Session::State::Cookie. I have a few controllers and methods that send out data with a Cache-Control: public header, so its essential that the Set-Cookie: header not go out with those responses (otherwise, it'd be cached and sent to other clients, leading to p...

Why is my Catalyst application slow to restart?

Hello! Each time I build a Catalyst application I come to a point where the application gets painfully slow to (re)start, the delay is about 10 seconds. Today I figured the delay is caused by the following lines: use lib '/home/zoul/opt/lib/perl/5.8'; use lib '/home/zoul/opt/share/perl/5.8'; use lib '/home/zoul/opt/lib/perl/5.8.8'; use ...

Making Catalyst calls from the model?

I'm using Catalyst with Catalyst::Plugin::Authentication and Catalyst::Plugin::Authorization::Roles and am wondering if there is a better approach to adding an attribute to a model that I'm not seeing. Each user is permitted to access one or more companies, but there is always one primary (current) company at a time. The permitted list ...

How can I integrate parts of Catalyst into a legacy webapp?

I'm struggling with a classic legacy project: manual URL parsing and composition, manual routing etc. Knowing a bit of Catalyst I long for at least some of the concepts, for example proper (a.k.a. transparent) URL routing and parameter parsing for example. Ideally, I'd just use Catalyst and be done with it, but given it's a legacy projec...

Why can't my Catalyst application read my Template Toolkit files?

I am trying to get the Catalyst framework to work using Template Toolkit, and I'm having issues with Template::Provider. I've isolated the issue to calls to stat. In Template::Provider::_init, calls to stat work correctly, however in other functions calls to stat return []. It seems like Template::Provider is doing some weird caching stu...

How can I configure a Catalyst application for different servers?

I am planning a Catalyst application, that will be deployed over a number of servers. It will be used internally by support staff to control aspects of an operational system that runs on those servers. The application will run much in the same way on each server, save for a limited amount of site specific behaviours. Some actions will o...

Configuring form_path in Catalyst::Controller::Formbuilder

Using the Catalyst::Controller::FormBuilder module to handle forms in a Catalyst application. The documentation says you can set the form_path like this: form_path => File::Spec->catfile( $c->config->{home}, 'root', 'forms' ), But the call to config() in my application is at the top level of the base module. Therefore, $c is undefined...

How should I best structure my web application using job queues [and Perl/Catalyst]?

Hi, I'm writing a web application using the Catalyst framework. I'm also using a Job Queue called TheSchwartz. I'm wanting to use a job queue because I'm wanting as much of the application specific code decoupled from the web application interface code. Essentially the whole system consists of three main components: GUI (Catalyst ...

How do I use Catalyst's auto and begin?

I want two special methods: one that runs for all URLs one that runs only for a specific path (/admin) I thought the most general would be using begin, and the method for /admin would use auto. For example, in these two Catalyst controllers: package MyApp::Controller::Root; sub begin :Private { my ($self, $c) = @_; $c->log...

What are best practices for deploying a Catalyst application to a production server?

What is a good way to deploy Catalyst applications to a production server? Currently I simply have a FastCGI dispatch script in the root of the repository and when I want to update the server code, I push the branch to the server. This is quite simple, but not perfect. If the code fails the tests on the server machine (for example becaus...

Is there a way to force $c->uri_for in Catalyst to generate a URI that begins with https?

I've written a web application using Catalyst that has a lot of forms and needs to run over https. There are no hard-coded URLs, everything uses $c->uri_for or $c->req->uri. Everything worked great in the development environment using the dev server running over http. Today, when I went ahead and deployed the application, I noticed a pr...