<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.web.catalyst.general">
    <title>gmane.comp.web.catalyst.general</title>
    <link>http://blog.gmane.org/gmane.comp.web.catalyst.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28091"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28088"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28082"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28076"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28070"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28067"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28065"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28064"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28043"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28039"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28038"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28032"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28024"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28019"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28014"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28012"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28005"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/28001"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/27994"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.catalyst.general/27974"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28091">
    <title>Using Action::REST and Controller::ActionRole together?</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28091</link>
    <description>&lt;pre&gt;Hi all,

I would like to mix in the same action some custom ActionRoles (via 
Catalyst::Controller::ActionRole) and Catalyst::Action::REST.

I gave it a try in a test application, but the action roles are getting 
applied to both the main action and the method-specific action:

# Main action
sub index :Path :Args(0) :Does('Role1') :Does('Role2') 
:ActionClass('REST') {
     ...
}

# GET specific action
sub index_GET {
     ...
}

In this scenario, I'm getting Role1 and Role2 functions executed twice, 
which is not desired.

I wonder if someone out there is using it (or another approach which 
provides the same features), and if there is a sane way to mix both 
functionalities without shoot myself in the foot

Maybe would be interesting to have a Catalyst::ActionRole::REST, 
providing the same features than Catalyst::Action::REST, but 
encapsulated in a role?

If I'm saying something silly, or if I'm missing some point which makes 
this impossible, please let me know.

Thanks in advance for your comments!

&lt;/pre&gt;</description>
    <dc:creator>Miquel Ruiz</dc:creator>
    <dc:date>2012-05-26T16:34:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28088">
    <title>Catalyst::Test Plack and HTTP Auth</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28088</link>
    <description>&lt;pre&gt;Hello,

Is it possible to set the auth headers with the Plack stuff w/o having
to do the base64 and set headers manually?
I.e. something like with mech:

$mech-&amp;gt;credentials( $username, $password );

But using the Catalyst::Test way...

Thanks!

&lt;/pre&gt;</description>
    <dc:creator>Alejandro Imass</dc:creator>
    <dc:date>2012-05-24T17:53:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28082">
    <title>Changing Formhandler field-type/widget based on Catalystuser-role</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28082</link>
    <description>&lt;pre&gt;Short version: How can we toggle field "X" from being a Select (popup) for
Admin users, to being a Hidden (nothing visible, but the value is
maintained) for Manager users?

Long version:

We have three levels of user-roles (*admins* can do everything,
*managers*can do a lot,
*readonly* can do very little). Admins get to specify user roles for all
users (even other admins), but managers (level two) only get to edit
readonly users and we don't want them to elevate any such users to being
managers (or worse, admins).

    package MyApp::Controller::Admin::Person;
    #...
    $self-&amp;gt;form( MyApp::Form::Admin::Person-&amp;gt;new( ctx =&amp;gt; $c ) );

    package MyApp::Form::Admin::Person;
    #....
    sub set_active {
        my $self = shift;
        $self-&amp;gt;inactive(['role'])
            unless $self-&amp;gt;ctx-&amp;gt;user-&amp;gt;is_admin;
    }

Trying to use ctx so we could pass $c and later test it in the form's
"set_active" method throws an exception because of ctx being undefined.

    package MyApp::Controller::Admin::Person;
    #...
    unless ( $c-&amp;gt;user-&amp;gt;is_admin ) {
#       $self-&amp;gt;form-&amp;gt;inactive(['role']);
#       $self-&amp;gt;form-&amp;gt;field('role')-&amp;gt;widget('hidden');
#       $self-&amp;gt;form-&amp;gt;field('role')-&amp;gt;type('Hidden');
    }

So instead we've tried making the field inactive (no apparent effect at
all), switching to a different widget (field completely disappears) or
different type (field completely disappears).

Pointers?

&lt;/pre&gt;</description>
    <dc:creator>will trillich</dc:creator>
    <dc:date>2012-05-24T04:24:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28076">
    <title>Role problems, Still</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28076</link>
    <description>&lt;pre&gt;I am having difficulty in getting my user to authenticate against the 
second realm. After successfully authenticating against the ldap server, I 
want to authenticate against the dbic realm as well as that is where the 
roles are stored. It seems to ignore a second call to $c-.authenticate.

I tried removing the "default_realm =&amp;gt; 'ldap'" entry but it complained 
with an error of not find the user in the realm "default". 

I looked at the "Progressive" module, but it seems to me that it stops as 
soon as the user authenticates.

I also have had no luck doing a find_or_create. Do I need to consolidate 
the roles into the users table? 

I even tried just creating a user in the user table figuring I could do a 
second step of updateing the users_to_roles table after that. I keep 
getting "me.user is not valid in the context it is being used"

Once again I can find no help in the docs. They simply do not address this 
situation. I have found that other people have solved this, but they don't 
seem to post the code that solved it, just something along the lines of "I 
fixed it". That isn't of much help to us new folks.


Any help is appreciated._______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Kenneth S Mclane</dc:creator>
    <dc:date>2012-05-23T15:37:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28070">
    <title>sort %hash  in  TT with Catalyst</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28070</link>
    <description>&lt;pre&gt;Hello,
how can I sort hash reference by values, I found some solution:
http://mail.template-toolkit.org/pipermail/templates/2005-June/007501.html
But I  don't know where can I add virtual method.

3) Similar to 2. Add a virtual method to your hashes. Just add this above your process call. (Note: You might need to add: 'use Template::Stash;') :
$Template::Stash::HASH_OPS-&amp;gt;{ sort_keys_by } = sub {
   my ($hash, $sort_field) = &amp;lt; at &amp;gt;_;
     return sort {
        $hash-&amp;gt;{$a}-&amp;gt;{$sort_field}&amp;lt;=&amp;gt;  $hash-&amp;gt;{$b}-&amp;gt;{$sort_field}
     } keys %$hash
};

then you can do:
[% FOREACH r = ref.sort_keys_by('number') %]
&amp;lt;a href="/program?id=[% r %]"&amp;gt;[% ref.$r.title _ " " _ ref.$r.number %]&amp;lt;/a&amp;gt;
[% END %]


I try to add virtual method to  View  but i get error:

|Couldn't render template "stats.tt: undef error - Can't use string ("1") as a HASH ref while "strict refs" in use at View/HTML.pm line 15.|




_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Tomasz Gromowski</dc:creator>
    <dc:date>2012-05-23T13:53:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28067">
    <title>Module::Install::Catalyst and Test::Prereqs conflict?</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28067</link>
    <description>&lt;pre&gt;I think that there is a problem using the Makefile.PL with Test::Prereqs and
similar modules.

When I run prereqs_ok(), I get the following error:

_get_prereqs: Error loading Makefile.PL: Can't call method
"load_all_extensions" on an undefined value at
/usr/local/share/perl/5.10.1/Module/Install.pm line 206, &amp;lt;DATA&amp;gt; line 4267.
BEGIN failed--compilation aborted at ./Makefile.PL line 4, &amp;lt;DATA&amp;gt; line 4267.

not ok 1 - Makefile.PL did not return a true value.
#

#   Failed test 'Makefile.PL did not return a true value.
# '
#   at /usr/local/share/perl/5.10.1/Test/Prereq.pm line 220.
#
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests




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

&lt;/pre&gt;</description>
    <dc:creator>Robert Rothenberg</dc:creator>
    <dc:date>2012-05-23T10:26:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28065">
    <title>Plugin::Session lazy start</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28065</link>
    <description>&lt;pre&gt;I have an application that uses sessions with a FastMmap store.  This
application also includes a custom script (using Catalyst::ScriptRole)
used to perform certain administrative tasks from the command line.

The problem is that Catalyst tries to unlink and recreate the session
cache every time it starts (somewhere in the bowels of MyApp-&amp;gt;setup(), I
imagine).  This is obviously a bad idea if the application is running,
but it is a problem even if the application isn't running if the session
cache is owned by a different user (e.g. www) than the one that runs the
script (e.g. des).

Is there a way to have C::Plugin::Session (or C::P::S::Store::FastMmap)
initialize the cache on first use instead of at startup?

As an alternate solution, is there a way to have it use a different file
name every time it starts?

DES
&lt;/pre&gt;</description>
    <dc:creator>Dag-Erling Smørgrav</dc:creator>
    <dc:date>2012-05-23T08:58:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28064">
    <title>Authorixation on LDAP, Roles in DB?</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28064</link>
    <description>&lt;pre&gt;I have succeeded in getting my LDAP Auth working. I setup three tables in 
the DB I am working with for Users, Roles, and Users_to_Roles. I setup 
some rudimentary role checking, but the Authorization module is 
complaining about needing to configure rolebasedn. I can't use the LDAP 
server for this as I do not have any control to set roles/groups there. 
How do I set this to check my table? Do I need to setup  a realm and point 
it at the tables? I'd also like to make it so when a user logs on for the 
first time the system will add them to the users table and assign the 
"user" role to them. _______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Kenneth S Mclane</dc:creator>
    <dc:date>2012-05-22T16:50:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28043">
    <title>Do not save session under certain conditions</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28043</link>
    <description>&lt;pre&gt;Hi,

We've got some monitoring software installed which is accessing the home page of my catalyst app every couple of seconds and flooding the sessions table.

I can recognise the monitor based on the user agent, so I'd like to stop it saving the session. Something like:

if ($c-&amp;gt;request-&amp;gt;user_agent =~ m/HTTP-Monitor/ ) {
  Don't save the session.
}

What's the best way to do this?

Thanks

Duncan
_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Duncan Garland</dc:creator>
    <dc:date>2012-05-21T15:49:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28039">
    <title>LDAP question</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28039</link>
    <description>&lt;pre&gt;I am continuing on my journey to duplicate a web app for administering a 
db. I have all my pages up and running, as well as search functionality. I 
decided to attack authentication next. I am using a php pages from a 
different web app to get the settings for our LDAP server.

//Connect to ldap server
        $ds=ldap_connect("xxx.xxx.xxx.xxx");
        if ($ds) { 
        //Get ID for intranet user
                $sr=ldap_search($ds, "ou=ldap.server, o=domain.com", 
"mail=$username"); 
                $info = ldap_get_entries($ds, $sr);
                for ($i=0; $i&amp;lt;$info["count"]; $i++) {
                        $uid=$info[$i]["dn"];
                }
                if (strpos($uid,'uid') !== false)
                {
        //Bind to ldap server with $uid and $password to verify 
                $bind_results=ldap_bind($ds, "$uid", "$password") or 
die("Could not log you in please check your UserName and Password and try 
again."); 
                if ( $bind_results == "1" )
                        $sr=ldap_search($ds, "ou=bluepages, o=ibm.com", 
"mail=$username"); 
                        $info = ldap_get_entries($ds, $sr);
                        for ($i=0; $i&amp;lt;$info["count"]; $i++) {
                                $fullname=$info[$i]["cn"][0];
                        }

It then goes on to create session stuff, but I want to use the built-in 
LDAP authentication. I have this in my Login.pm:

sub index :Path :Args(0) {
    my ( $self, $c ) = &amp;lt; at &amp;gt;_;
        # Get the username and password from form
        my $username = $c-&amp;gt;request-&amp;gt;params-&amp;gt;{username};
        my $password = $c-&amp;gt;request-&amp;gt;params-&amp;gt;{password};
        # If the username and password values were found in form
        if ($username &amp;amp;&amp;amp; $password) {
            # Attempt to log the user in
            if ($c-&amp;gt;authenticate({ username =&amp;gt; $username,
                                   password =&amp;gt; $password  } )) {
                # If successful, then let them use the application
                $c-&amp;gt;response-&amp;gt;redirect($c-&amp;gt;uri_for(
                    $c-&amp;gt;controller('Search')-&amp;gt;action_for('search')));
                return;
            } else {
                # Set an error message
                $c-&amp;gt;stash(error_msg =&amp;gt; "Bad username or password.");
            }
        } else {
            # Set an error message
            $c-&amp;gt;stash(error_msg =&amp;gt; "Empty username or password.")
                unless ($c-&amp;gt;user_exists);
        }
         # If either of above don't work out, send to the login page
        $c-&amp;gt;stash(template =&amp;gt; 'login.tt2'); 
}

and this code in my Root.pm:

sub auto :Private {
    my ($self, $c) = &amp;lt; at &amp;gt;_;
    # Allow unauthenticated users to reach the login page.  This
    # allows unauthenticated users to reach any action in the Login
    # controller.  To lock it down to a single action, we could use:
    # if ($c-&amp;gt;action eq $c-&amp;gt;controller('Login')-&amp;gt;action_for('index'))
    # to only allow unauthenticated access to the 'index' action we
    # added above.
    if ($c-&amp;gt;controller eq $c-&amp;gt;controller('Login')) {
        return 1;
    }
    # If a user doesn't exist, force login
    if (!$c-&amp;gt;user_exists) {
        # Dump a log message to the development server debug output
        $c-&amp;gt;log-&amp;gt;debug('***Root::auto User not found, forwarding to 
/login');
        # Redirect the user to the login page
        $c-&amp;gt;response-&amp;gt;redirect($c-&amp;gt;uri_for('/login'));
        # Return 0 to cancel 'post-auto' processing and prevent use of 
application
        return 0;
    }
    # User found, so return 1 to continue with processing after this 
'auto'
    return 1;
}

And in MyApp.pm:

__PACKAGE__-&amp;gt;config(
        'authentication' =&amp;gt; {
                default_realm =&amp;gt; 'ldap',
                realms =&amp;gt; {
                        ldap =&amp;gt; {
                                credential =&amp;gt; {
                                        class =&amp;gt; 'Password',
                                        password_field =&amp;gt; 'password',
                                        password_type =&amp;gt; 'self_check',
                                },
                                store =&amp;gt; {
                                        binddn  =&amp;gt; "username",
                                                bindpw  =&amp;gt; "password",
                                        class =&amp;gt; 'LDAP',
                                        ldap_server =&amp;gt; '9.17.186.253',
                                        ldap_server_options =&amp;gt; { timeout 
=&amp;gt; 30 },
                                        user_basedn =&amp;gt; 'o=domain, o=com',
                                        user_field =&amp;gt; 'mail',
                                        user_filter =&amp;gt; 
'(&amp;amp;(mail=%s)(objectclass=person))',
                                        user_scope =&amp;gt; 'sub', 
                                },
                        },
                },
        },
);

They are apparently doing the initial bind with the credentials submitted 
by the user, I am getting invalid credentials the way I have it above, if 
I change it to anonymous I get a "LDAP Error while searching for user: No 
such object".  I could use some suggestions.
_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Kenneth S Mclane</dc:creator>
    <dc:date>2012-05-21T14:20:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28038">
    <title>[ANNOUNCE] Catalyst-Runtime 5.90012</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28038</link>
    <description>&lt;pre&gt;Hi

I'm pleased to announce the latest maintenance release of Catalyst::Runtime, 5.90012.

This release fixes issues with the upcoming perl 5.16.0, and has various other small fixes and documentation improvements.

Full change log is below as always.

Cheers
t0m

5.90012 - 2012-05-16 09:59:00

 Distribution META.yml changes:
  - author key is now correct, rather than what Module::Install
    mis-parses from the documentation.
  - x_authority key added.

 Bug fixes:
  - Fix request body parameters being multiply rebuilt. Fixes both
    RT#75607 and CatalystX::DebugFilter

  - Make plugin de-duplication work as intended originally, as whilst
    duplicate plugins are totally unwise, the C3 error given to the user
    is less than helpful.

  - Remove dependence on obscure behaviour in B::Hooks::EndOfScope
    for backward compatibility. This fixes issues with behaviour changes
    in bleadperl. RT#76437

  - Work around Moose bug RT#7536 which breaks
    Catalyst::Controller::DBIC::API.

 Documentation:
  - Fix documentation in Catalyst::Component to show attributes and
    calling readers, rather than accessing elements in the $self-&amp;gt;{} hash
    directly.
  - Add note in Catalyst::Component to strongly disrecommend $self-&amp;gt;config
  - Fix vague 'checkout' wording in Catalyst::Utils. RT#77000
  - Fix documentation for the 'secure' method in Catalyst:Request. RT#76710


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

&lt;/pre&gt;</description>
    <dc:creator>Tomas Doran</dc:creator>
    <dc:date>2012-05-19T07:12:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28032">
    <title>Best practice for configuration file placement</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28032</link>
    <description>&lt;pre&gt;Hi there,

I've failed in locating this question as a FAQ, so I would appreciate some guidance.

I've written a Catalyst application that will be deployed in Debian. We want to keep config files under /etc/some_app/ so naturally, I would like to add this path to the ones to be searched by ConfigLoader. The application's main .pm contains:

  use Catalyst ( qw/
    ConfigLoader
  # ...
    /
  );

We'll want to run the application under nginx/FastCGI. I realize that I can simply set the environment appropriately in the startup rc script but before doing that, I was wondering what would be the "best practice" way to achieve this?

Best regards.

-lem


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

&lt;/pre&gt;</description>
    <dc:creator>Luis Muñoz</dc:creator>
    <dc:date>2012-05-16T21:45:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28024">
    <title>Authentication in a Many Database Scenario (again)</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28024</link>
    <description>&lt;pre&gt;Dear All,

 

I'd like to offer users their own database (so that their own data is
separate from other users) but use the same MVC code for all the user
databases. Following some helpful advice from this forum I have found the
documentation for ACCEPT_CONTEXT but unfortunately I don't have the smarts
to understand the documentation, could someone please explain some things to
me?

Essentially I reckon I want to change the __PACKAGE__-&amp;gt;config in my model on
a per transaction basis.  My current model looks like this

package EasyAC::Model::DB;

 

use strict;

use base 'Catalyst::Model::DBIC::Schema';

 

__PACKAGE__-&amp;gt;config(

    schema_class =&amp;gt; 'EasyAC::Schema',

    

    connect_info =&amp;gt; {

        dsn =&amp;gt; 'dbi:mysql:easyac01',

        user =&amp;gt; 'me',

        password =&amp;gt; 'mypass',

        AutoCommit =&amp;gt; q{1},

    }

);

The ACCEPT_CONTEXT documentation suggests:

 

Add a field to $c, like my_model_instance. Then write your ACCEPT_CONTEXT
method to look like this:

sub ACCEPT_CONTEXT { 

  my ( $self, $c ) = &amp;lt; at &amp;gt;_; 

 

  if ( my $per_request = $c-&amp;gt;my_model_instance ) { 

    return $per_request; 

  } else { 

    my $new_instance = bless { %$self, c =&amp;gt; $c }, ref($self); 

    Scalar::Util::weaken($new_instance-&amp;gt;{c}); # or we have a circular
reference 

    $c-&amp;gt;my_model_instance( $new_instance ); 

    return $new_instance; 

  } 

}

 

Question 1: how do I add a field like my_model_instance and from which
component do I add it?  I did try obvious things like $c-&amp;gt;my_model_instance
= {}.  

 

Question 2:  How do I replace the static connect_info with the per request
info (I have dsn, user and password in the stash).  I'm guessing that I put
the connect_info into the hashref which I pass to ACCEPT_CONTEXT (i.e. the
hashref which becomes $self) and that Catalyst just magically resolves all
my worries?

 

I've also looked at the documentation for
&amp;lt;https://metacpan.org/module/Catalyst::Component::InstancePerContext&amp;gt;
Catalyst::Component::InstancePerContext.  Which I cannot understand either:

 

Question 3:  when the InstancePerContext documentation says # ... do your
thing here , I take it this means that I create a hash with my connect info
and return MyApp::Model::DB-&amp;gt;new(%args).  Does this then replace the
connect_info in MyApp::Model::DB?

 

Question 4:  Should I give up as none of the above are remotely correct and
I obviously lack the intelligence to use a sophisticated tool like Catalyst?

 

Regards,

Scott

_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>scott&lt; at &gt;simpzoid.com</dc:creator>
    <dc:date>2012-05-15T19:11:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28019">
    <title>Deploying with Perlbrew</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28019</link>
    <description>&lt;pre&gt;Is anyone creating an RPM out of their Perlbrew install?   I'm looking for
pointers and examples.

At work we currently build separate RPMs for all our in-house dependencies
and the catalyst apps (as well as for any CPAN distributions that existing
RPMs don't exist or are ouf date).  It's a pretty time-consuming
and tedious process -- or at least has turned out that way in practice.

In contrast, (assuming we have our in-house distributions in a
private/local CPAN), it's pretty painless to install Perl with Perlbrew and
use "cpan" to install the app and all dependences and run the app from this
local installation.

My question is about bundling up this as one big fat (1/2GB) RPM.   Anyone
doing this, and if so, can you share the spec file you use?


The other issues I'd like to ask about are pushing out crontabs at the
right time (with the app because the cron might depend on the app's
version), and the startup script, although upstart was discussed recently
in another thread.

Thanks,

&lt;/pre&gt;</description>
    <dc:creator>Bill Moseley</dc:creator>
    <dc:date>2012-05-15T13:05:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28014">
    <title>OpenID authentication just redirects back to the loginpage</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28014</link>
    <description>&lt;pre&gt;I am trying to add OpenID logins to my site. I've looked at several examples
of this, but whenever I run

  if ($c-&amp;gt;authenticate({ openid_identifier =&amp;gt; $openid_url }, 'openid')) {

  ...

  }


It redirects to the OpenID provider, and then redirects back to the login
page with added URL paramaters (oic.time, openid-check, openid.assoc_handle,
openid.claimed_id, openid.identity, etc.)

This doesn't seem like it's doing what it's supposed to be.

Any idea's what's happening?


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

&lt;/pre&gt;</description>
    <dc:creator>Robert Rothenberg</dc:creator>
    <dc:date>2012-05-14T15:37:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28012">
    <title>Vagrant / Developing with VM / NFS performance</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28012</link>
    <description>&lt;pre&gt;I'm playing around with Vagrant[1] to manage my development VMs and
I'm running into some NFS-troubles and just wanted to hear if and how
you guys are developing with a guest OS.

The thing is that Vagrant by default configures the VM to export a
shared directory (where my Catalyst app lives) from the host OS (OS X
in my case) to the guest VM (Debian). I'm using the alternative NFS
mount option because VirtualBox's shared folder support is known to be
super slow. Problem is, Catalyst::Restarter doesn't pick up changes to
my files. I suppose this is due to NFS doing attribute caching. If I
turn this off (with "noac" in the NFS mount options), the Catalyst
server picks up the changes more quickly but it also takes a full
minute to start (as opposed to 3-4 seconds when the files are local).

Having the app locally on my host and exporting it into the VM feels
more natural to me, but the performance issues really make this a
deal-breaker. Does anyone have any advice on how to improve things?
How do you share your files between your VM and your host system?

Thanks a lot!
--Toby


[1] http://vagrantup.com/

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

&lt;/pre&gt;</description>
    <dc:creator>Tobias Kremer</dc:creator>
    <dc:date>2012-05-14T11:53:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28005">
    <title>How to "sudo" using the Authentication plugin</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28005</link>
    <description>&lt;pre&gt;We're working on an application with a lot of users, and where the passwords
are encrypted (and future versions may also allow OpenID logins).

Developers would like the ability for the "root" user to be able to become
another user, for the purposes of debugging problems that real users might
be having on a live system.

How does one do this using the Authentication plugin?

Obvious things to try like the $c-&amp;gt;user($new_user) doesn't work, not does
the (internal) $c-&amp;gt;set_authenticated($user, $real) method.



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

&lt;/pre&gt;</description>
    <dc:creator>Robert Rothenberg</dc:creator>
    <dc:date>2012-05-11T16:45:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/28001">
    <title>Query not working</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/28001</link>
    <description>&lt;pre&gt;I am trying to port this query to Catalyst:

SELECT
             s.server_id, 
             a.account_code,
             s.server_name,
             s.server_type,
             s.os_name,
             (select count(*) from server ss, subsystem sb 
                    where ss.server_id = sb.server_id 
                    and ss.server_id = s.server_id) as num_subsystems   
            FROM 
             account a,
             server s
            WHERE a.account_id = s.account_id
            order by a.account_code, s.server_name

This is what I have so far:

sub list :Local {
        my ($self, $c, $page) = &amp;lt; at &amp;gt;_;
        $page = $c-&amp;gt;req-&amp;gt;param('page') || 1;
        my $rs = $c-&amp;gt;model('ORANGES::Server')-&amp;gt;search_rs(undef, { 
                prefetch =&amp;gt; ['account','subs'],
                rows =&amp;gt; 15,
                page =&amp;gt; $page,
                '+select' =&amp;gt; [{count =&amp;gt; 'subs.subsystem.id'}],
                '+as' =&amp;gt; [qw/num_subs/], 
                order_by =&amp;gt; ['account.account_code', 'server_name'],
         });
        $c-&amp;gt;stash(rows =&amp;gt; $rs);
        $c-&amp;gt;stash(pager =&amp;gt; $rs-&amp;gt;pager());
        $c-&amp;gt;stash-&amp;gt;{'template'}=&amp;gt;'server/list';
}

I haven't figured out the count statement as yet. I am currently getting 
my "as" added to the sql twice, i.e. "AS num_subs AS num_subs".

I can only find examples counting one field, let alone 2 tables and since 
I can't get it to return any results I can't even tell if it is counting 
correctly.

_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Kenneth S Mclane</dc:creator>
    <dc:date>2012-05-10T14:17:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/27994">
    <title>Authentication in a Many Database Scenario</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/27994</link>
    <description>&lt;pre&gt;Dear All,

 

I'd like to offer users their own database (so that their own data is
separate from other users) but use the same MVC code for all the user
databases.  I was anticipating that I would have a database with the all the
user information including the name of each user's personal database and
then a single database per user.  The authentication would be done against
the user information database and then a connection to the individual user's
database used for CRUD using DBIC.

 

Does anyone have any hints on how to arrange the authorization and
subsequent connections?  I'm happy to work out the details myself but could
do with a few hints to get started.

 

Regards,

Scott

 

_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Scott Simpson</dc:creator>
    <dc:date>2012-05-09T20:09:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/27974">
    <title>Getting hashref instead of value</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/27974</link>
    <description>&lt;pre&gt;I am having a problem with my code and I cannot figure out why it is doing 
what it is doing. I have this sub:

sub list :Local {
        my ($self, $c, $page) = &amp;lt; at &amp;gt;_;
        $page = $c-&amp;gt;req-&amp;gt;param('page') || 1;
        my $rs = $c-&amp;gt;model('ORANGES::Account')-&amp;gt;search({}, { 
                join =&amp;gt; 'progress',
                '+select' =&amp;gt; ['progress.percent_complete'],
                '+as' =&amp;gt; ['progress.percent_complete'],
                join =&amp;gt; 'compliance',
                '+select' =&amp;gt; ['compliance.percent_compliant'],
                '+as' =&amp;gt; ['compliance.percent_compliant'],
                join =&amp;gt; 'department_id',
                '+select' =&amp;gt; ['department_id.department_id'],
                '+as' =&amp;gt; ['department_id.department_id'],
                join =&amp;gt; 'metrics',
                '+select' =&amp;gt; 
['metrics.num_servers','metrics.num_subsystems'],
                '+as' =&amp;gt; ['metrics.num_servers','metrics.num_subsystems'], 
 
                order_by =&amp;gt; 'account_code',
                rows =&amp;gt; 15,
                page =&amp;gt; $page,
         });
        $c-&amp;gt;stash(accounts =&amp;gt; $rs);
        $c-&amp;gt;stash(pager =&amp;gt; $rs-&amp;gt;pager());
        $c-&amp;gt;stash-&amp;gt;{'template'}=&amp;gt;'accountview/list';
 
}
Which I have tried in several different ways to fix this problem, but none 
have worked so far. In my template file all my fields come up with the 
valyes expected, except, I am trying to use the account_id field value as 
part of a uri to take the user to a details page for the row. Where I am 
expecting a uri such as 'http://127.0.0.1:3000/accountdetails/detail/170' 
I instead get a uri like this:

http://127.0.0.1:3000/accountdetails/detail/dbms::Model::ORANGES::Account=HASH%280x5496460%29

This used to work when I was using a view as the basis for my list page. 

When I run the page I can see in the sub-queries that it runs that it has 
the "account_id" value as it uses it, but when I try to access it in my 
template I get the hash ref. None of the other fields do this. 

one of the sub queries using the account_id value:
SELECT me.account_id, me.account_code, me.percent_compliant FROM 
HCDB_TEST.COMPLIANCE me WHERE ( me.account_id = ? ): '321'


My template that cretaes the uri:

&amp;lt;td&amp;gt;&amp;lt;a href="[% c.uri_for('/accountdetails/detail/') %][% 
account.account_id %]"&amp;gt;[% account.account_code %]&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;

If someone could point me in the right direction, Ive been fighting this 
for days.

_______________________________________________
List: Catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst&amp;lt; at &amp;gt;lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
&lt;/pre&gt;</description>
    <dc:creator>Kenneth S Mclane</dc:creator>
    <dc:date>2012-05-08T15:13:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.catalyst.general/27963">
    <title>Catalyst Monthly: Plack tips and tricks please</title>
    <link>http://comments.gmane.org/gmane.comp.web.catalyst.general/27963</link>
    <description>&lt;pre&gt;HI everybody,

As you will no doubt have noticed, the April Catalyst Monthly is late.  To help rememdy this situation, I'd really appreciate your tips and tricks for using Plack and Catalyst together.  I'm particularly interested in smart things that can be done to streamline development, but any suggestions/examples you have would be more than welcome (and I'll credit where it's due).  Reply to the list, to me personally or grab me (kd) on #catalyst&amp;lt; at &amp;gt;irc.perl.org


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

&lt;/pre&gt;</description>
    <dc:creator>Kieren Diment</dc:creator>
    <dc:date>2012-05-03T23:28:37</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.web.catalyst.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.web.catalyst.general</link>
  </textinput>
</rdf:RDF>

