Robert Rothenberg | 9 Feb 14:39
Picon
Gravatar

Setting rel_collision_map in myapp_create.pl

The application that I am working on uses myapp_create.pl to create the
model from the database schema.

The problem is that the DBIx::Schema::Loader is creating a relationship with
a name that is inappropriate, and conflicts with a relationship that I've
manually created.

In this case, there is a table of "group", "employee" and a third table
"employee_group" that links employees to groups. The group table has a
"leader" field that references an employee who is the group leader. DBIC has
decided to create a relationship on players called "groups" that basically
says what groups the employee is the leader of.  Not a very good name, and
of course conflicts with the "groups" relationship that I created, that
indicates what groups an employee is actually in. (Yes, there is an
"employee_groups" relation, but I added the "groups" relation to bridge that
indirection.)

Looking at the documentation for DBIx::Schema::Loader, there is an option
called rel_collision_map that can supposedly be used to fix this. I'm unsure
how it works, and even less sure how to pass a hash as an option to the
myapp_create.pl script.

If that option is supported, examples would be helpful.

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

(Continue reading)

James D Bearden | 8 Feb 05:07
Gravatar

Authentication Using self_check?

Hello, and thanks in advance. The short version is, how do I use the
self_check method to validate a user? I believe it involves extending
Catalyst::Authentication::User, and I am having trouble figuring out how
to do that.

The longer version is that I have an existing system I am trying to
convert over to Catalyst that has been running on MySQL for over a
decade. All the user passwords are stored using OLD_PASSWORD (not SHA1
like they are by default now), and making thousands of users change
their passwords is not an option. So I think my approach should be to
somehow implement check_password to use the MySQL OLD_PASSWORD function
to authenticate the password.

Also, the application has a decade worth of battle hardened SQL queries,
so I am not going to be using any standard ORM like DBIx or DBIC,
therefore I am trying to use Catalyst::Model::DBI for authentication. My
configuration is below, and any help would be greatly appreciated.

  authentication => {
    default_realm => 'users',
    realms        => {
      users => {
	credential => {
	  class          => 'Password',
	  password_field => 'Password',
	  password_type  => 'self_check',
	},
        store => {
	  class         => 'DBI',
	  user_class    => 'MyApp::DAO::User',
(Continue reading)

Seth Daniel | 8 Feb 00:55

--background clobbers log

Hello,

I'm still working on a small program that demonstrates this, but here is
a problem I am seeing:

Catalyst 5.90007
Log::Log4perl 1.35 
CatalystX::Script::Server::Starman 0.01

I setup logging in my app as suggested in the Catalyst::Log perldoc:

  __PACKAGE__->log( Log::Log4perl::Catalyst->new('log.conf') );
  __PACKAGE__->setup;

I then start the server with a script that looks like:

  BEGIN {
    $ENV{CATALYST_SCRIPT_GEN} = 40;
  }

  use Catalyst::ScriptRunner;
  Catalyst::ScriptRunner->run('MyApp', 'Server');

And that script load another module that loads
CatalystX::Script::Server::Starman and eventually starman starts.

  package MyApp::Script::Server;
  use Moose;
  extends 'CatalystX::Script::Server::Starman';
  1;
(Continue reading)

Duncan Garland | 7 Feb 13:24
Favicon

Using Catalyst Instead of Rewrite Rules

Hi,

 

We’ve got a little process which is mostly php scripts.

 

However, there’s a requirement to do some url re-writing. The user should see www.site/user/london and www.site/user/glasgow instead of www.site/user.php?site=london etc.

 

Re-write rules in a webservers are error prone and difficult to maintain. It seems to me that we should get Catalyst to field the original calls and pass the appropriate parameters to the php scripts.

 

However, it’s not as obvious as I thought because a simple redirect will display the GET parameters in the browser address bar which is what we are trying to avoid. How should it be done? It’s calling the PHP which is bothering me, not the interpreting of the URL by Catalyst.

 

(I don’t have the option of re-writing the project as a proper Catalyst app.)

 

Thanks

 

Duncan  

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Tomas Doran | 6 Feb 22:12
Gravatar

ANNOUNCE TRIAL Catalyst release - PLEASE TEST!

Hi

The latest Catalyst TRIAL release (5.90008) has a significant amount  
of cleanup and refactoring to enable asynchronous applications.

It shouldn't break anything, and works for me - but I need people to  
try this out with their real apps and the plugins you're using -  
please have a quick go with it, or even better run the tests for your  
apps against it and tell me if I broke your app!

A full changelog, with details of the specific changes in the release  
is included below as always.

Cheers
t0m

--

5.90008 - TRIAL 2012-02-06 20:49:00

  New features and refactoring:
   - Much of the Catalyst::Engine code has been moved into  
Catalyst::Request
     and Catalyst::Response, to be able to better support asynchronous  
web
     servers such as Twiggy, by making the application engine more  
reenterant.

     This change is as a prequel to full asynchronous support inside  
Catalyst
     for AnyEvent and IO::Async backends, which allow highly scaleable  
streaming
     (for applications such as multi-part XML HTTPRequests, and  
Websockets).

  Deprecations:
   - This means that the $c->engine->env method to access the PSGI  
environment
     is now deprecated. The accessor for the PSGI env is now on  
Catalyst::Request
     as per applications which were using Catalyst::Engine::PSGI

     Catalyst::Engine::PSGI is now considered fully deprecated.

   - The private _dump method in Catalyst::Log is now deprecated. The  
dumper is
     not pluggable and which dumper to use should be a user choice.  
Using
     an imported Dump() or Dumper() function is less typing than $c- 
 >log->_dump
     and as this method is unused anywhere else in Catalyst, it has  
been scheduled
     for removal as a cleanup. Calling this method will now emit a  
stack trace
     on first call (but not on subsequent calls).

  Back compatibility fixes:
   - Applications still using Catalyst::Engine::PSGI as they rely on
     $c->request->env - this is now the provided (and recommended) way  
of
     accessing the raw PSGI environment.

  Tests:
   - Spurious warnings have been removed from the test suite

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Rob Brown | 5 Feb 12:43
Favicon
Gravatar

Basic Background Question, DBIx::Class

Hi,

I've recently jumped into Catalyst and DBIx::Class, and after following
some tutorials, I am left with some controllers and a view which I'm
completely happy with.

The lib/Schema and lib/Model directories have me a little confused
however.

I have a single class in lib/Model, inheriting from
Catalyst::Model::DBIC::Schema with some db connection details.

Then the lib/Schema.pm class and dir, and Result classes for my db
tables.

I understand what they're all doing, but...

Shouldn't I have classes in lib/Model/ for each of my tables/models?  Is
this what the Schema/ classes should be doing?

I'm used to creating set classes for each model in my apps, so just
having the DBIx::Class ones is a little odd right now, with no REAL
logic in them to model my app logic.

I would have expected some basic wrapper model classes in lib/Model/ for
each Schema/Result.

Maybe a single class in lib/Model/ is correct, to model the entire DB,
it just threw me a little.

some feedback/direction would be great.

Thanks,
Rob  

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Riju Royson | 2 Feb 04:37
Picon
Gravatar

fcgid configuration for catalyst

Hi,

My team owns a dedicated catalyst application which is working on
mod_perl and apache. The application is for generating several reports
and is used by a huge number of employees in our organization. Now we
need to move out of mod_perl because our organization stopped
supporting it. After some research work, we decided to go with fcgid.
We did the configuration with the help of available documents, and
discussion threads in this mailing lists. With fcgid, we are able to
bring up our application main page.

When we did some testing, we came to know that all links from main
page is broken. It seems, $c->uri_for() is not returning any value. We
are using this for navigating to different controllers.We tried to
find out a solution for this, but nothing seems to work. Also
$c->req->user, $c->response->redirect etc seems to be failing.

Any pointers to this issue will be very helpful.

Thanks in advance,
Riju Royson

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Rippl, Steve | 2 Feb 00:37
Favicon

Pointing to different app.psgi when running tests

I have a bunch of debug stuff turned on in app.psgi on the development machine, but it seems this breaks during a redirect when using Test::WWW::Mechanize


[error] Caught exception in engine "Bad Content-Length: maybe client disconnect? (67 bytes remaining) at /usr/local/share/perl/5.10.1/Plack/Middleware/Debug/Parameters.pm line 20"
Can't call method "request" on an undefined value at /usr/local/share/perl/5.10.1/Plack/Test/MockHTTP.pm line 29.

This is fixed by just using the default app.psgi settings.  Is there something else I should be doing, or can I point to a different .psgi file on startup according to an environment variable I could easily set for running tests?

Thanks,
Steve

--
Steve Rippl
Technology Director
Woodland Public Schools
360 841 2730
_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Picon
Gravatar

Plat_Forms 2012 programming contest

Crossposted: catalyst <at> lists.scsys.co.uk, dancer-users <at> perldancer.org,
mojolicious <at> googlegroups.com, psgi-plack <at> googlegroups.com,
https://www.perl-community.de/bat/poard/thread/17120

Hello Perl web programmers,

the organisers of the [Plat_Forms
contest](http://plat-forms.org/platforms-2012) have published the call
for application. See the [announcement
overview](http://plat-forms.org/platforms-2012-announcement#overview)
for why this contest is very important for the community as a whole.

Once again, Perl's esteem is at stake. ☺ Up to 4 teams comprised of 3
members each are needed to represent our favourite programming
language. Like in the preceding contests in 2007 and 2011, the Perl
teams are likely self-organised and not company-backed. To facilitate
that, I have set up [a page on the official Perl 5
wiki](https://www.socialtext.net/perl5/events_2012_plat_forms).

Action required:

1. Communicate as you see fit and form more teams.
2. Post summaries to the wiki page to keep everyone updated.
3. Fill in the [application Web
form](http://plat-forms.org/platforms-2012-application).
_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Robert Rothenberg | 27 Jan 14:19
Picon
Gravatar

What are the best practices for using phrasebooks in Catalyst applications?


I am working on a project where the terminology we are using for "objects"
in the system is diverging from terminology that the client is using for
those things.  And it also seems that other clients may use different names
for these objects. (And this is just for English-language interfaces.)

So I would like to use some kind of phrasebook, so that the source code can
use the same, consistent terminology, but the clients see their terminology
in the UI.

I'd prefer not to maintain a separate set of templates for each client,
since that requires keeping changes to templates consistent across sets, and
requires keeping changes to terminology consistent in a set.

So... is there an existing plugin that is used for such things?

Otherwise, I am thinking of writing a plugin that makes use of
Data::Phrasebook (or something similar), allows for configuration of the
phrasebook in the configuration file, and adds a new method to the Catalyst
context variable for querying the phrasebook, e.g. the template may have
something like

  <h1>[% c.phrase('widgets') | html %]</h1>

Does this make sense, or is there a better way to do this?

Thanks,
Rob

_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Bill Moseley | 26 Jan 04:49

Running multiple test servers together as the same app

A quick questions for the the collective wisdom here.


We have an app that is just getting too big and we are splitting it up into separate Catalyst apps (mostly based on feature) to allow groups of developers to work on features independently, develop tests independently and release independently.   Hopefully it will be a more scalable approach.

So, /foo and /bar might be on different apps, but all under the same domain in production.   But, if using the development servers they would be on different ports.

In production we can use the load balancer (or the web server) to direct requests to the right app.  But, I need suggestions for development.  Currently, the developers start up a proxy server that "points" to their development instances (one or more Catalyst apps).  But, that has its own problems (like Apache blocking for some amount of time when a Catalyst dev server is restarted and Apache thinks the server died.)

One option I was kicking around was wrapping uri_for to map requests to different paths to different development servers running on different ports.  That would simply be per-developer configuration -- meaning each developer has their own "port pool" to use in the case of developers working on the same dev machine.

Any other suggestions how to let developers work with related Catalyst apps (that need to link to each other) using the Catalyst development server?


Thanks,


--
Bill Moseley
moseley <at> hank.org
_______________________________________________
List: Catalyst <at> lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst <at> lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Gmane