[Catalyst] Catalyst @ Flourish Conference

2008-03-05 Thread Joshua McAdams
>From use.perl:

"The organizers of Flourish (http://www.flourishconf.com) are of
course looking for attendees for their conference, but they are also
looking for something else... top-notch Perl web developers. They are
having a web programming showdown using a variety of languages and
frameworks. Perl is on the list, but is currently under-represented.
They are looking to invite the best-of-the-best in each language,
preferably people who are noted contributors to the particular
language or platform that they'll be developing in. Because of this
demanding criteria, they are willing to talk about helping out with
travel, etc. Please contact me, Josh McAdams (joshua dot mcadams at
gmail dot com) if you are interested."

___
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] Base controllers and multiple inheritance

2008-03-05 Thread Peter Karman



Byron Young wrote on 3/5/08 4:29 PM:



Everything looks good, right?  My List actions work!  However, the CRUD
actions don't work because the FormConfig actions seem to have been
ignored -- $c->stash->{form} is undef :(


I wouldn't expect anything in stash() to persist from request to request. Don't 
do anything with stash during new(). new() is called once per app life, at 
startup. stash() is for each request.




Does anyone have any suggestions?  Should I just forego using new() and
do initial setup the first time auto() is called in each of my base
controllers?


depends on what kind of thing you are setting up. I have used multiple 
inheritance in my controllers to good effect (see CatalystX::CRUD::Controller 
and its descendents for example). In general, only set up things in new() (or 
its cousins) for stuff you want to set up once per app: config, persistent 
objects, etc. IME, there isn't much you want like that.


--
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

___
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] Push services with catalyst

2008-03-05 Thread Peter Edwards
Jay wrote:
>On Wed, Mar 5, 2008 at 11:48 AM, Moritz Onken <[EMAIL PROTECTED]>
wrote:
>> I'm combining ajax with push. So it's a real push service, the website  
>> is not pulling the data on a constant time rate.
>>
>>  A process per client is really bad. I'll need to serve hundreds of  
>> client at the same time. Seems like push is not an option...
>>
>
>Take a look at cometd: http://cometd.com/

Thanks for mentioning that, it looks interesting, particularly as it's
hooked up to perlbal.

Moritz, I've done something similar before using POE to handle many
connections more cheaply than Apache (thanks to Matt Trout for the
suggestion). It was to serve XML formatted requests though you could return
JSON formatted data just as easily
http://search.cpan.org/perldoc?POE::Component::Server::TCP

Regards, Peter
http://perl.dragonstaff.co.uk


___
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] Base controllers and multiple inheritance

2008-03-05 Thread Byron Young
Byron Young wrote:
> Hi,
> 
> I've been using Catalyst for a project and decided to make some base
> controllers for common functionality.  So far I've made two: CRUD, and
> List, for standard database operations and for sortable, paged
> listings 
> of data.  They work fine on their own but I'm running into trouble
> with multiple inheritance.  If I have a controller for some database
> table 
> that I want to inherit the actions from both CRUD and List, only the
> first one inherited will initialize properly.
> 
> The inheritance looks like this:
> 
>Catalyst::Controller
> /\
>/  \
>   /\
>  /Catalyst::Controller::HTML::FormFu
> /   |
> MyApp::Base::Controller::List   |
> \   |
>  \MyApp::Base::Controller::CRUD
>   \/
>\  /
> \/
>MyApp::Controller::SomeDatabaseTable
> 
> 
> Each of the controller base classes has a new() method which sets up
> config data and does error checking and whatnot.  If I inherit both of
> my base classes, only new() on the first inherited is called.  I've
> tried calling $class->NEXT::new(@_) in each, and I've also tried
> Class::C3's $class->maybe::next::method(@_), but new() is still not
> called down the second inheritance chain.  When I tried the Class::C3
> approach I called Class::C3::initialize() in MyApp.pm - I wasn't sure
> where to call it so I tried before and after MyApp->setup() - still no
> luck.
> 
> Can somebody tell me why new() isn't called down both paths?
> 

Sorry for the pestering, but allow me to provide some more info.  I was
hoping to have my controllers inherit a number of base controllers that
I've got planned, but maybe I'm taking the wrong approach?  Seems like
this is probably a pretty common thing, but I haven't found anything
about it in the email list backlogs or anywhere else, except a comment
from jrockaway saying that you can inherit multiple base classes.

Here are my new() methods in the various classes:

---
package MyApp::Controller::SomeController;
use base qw/
MyApp::Base::Controller::CRUD
MyApp::Base::Controller::List
   /;

use Class::C3;

sub new {
my $class = shift;
my ($c) = @_;
my $self = $class->maybe::next::method(@_);

$c->log->debug("in SomeController::new");

return $self;
}


---
package MyApp::Base::Controller::List;
use base qw( Catalyst::Controller Class::Accessor::Fast );

use Class::C3;

__PACKAGE__->mk_accessors(qw( _list_config ));

sub new {
my $class = shift;
my ($c) = @_;
my $self = $class->maybe::next::method(@_);

$c->log->debug("in List::new");

$self->_list_setup( $c );

return $self;
}

---
package MyApp::Base::Controller::CRUD;
use base qw( Catalyst::Controller::HTML::FormFu );

use Class::C3;

__PACKAGE__->mk_accessors(qw( _crud_config ));

sub new {
my $class = shift;
my ($c) = @_;
my $self = $class->maybe::next::method(@_);

$c->log->debug("in CRUD::new");

$self->_crud_setup( $c );

return $self;
}



I also added a $c->log->debug("in FormFu::new") in
Catalyst::Controller::HTML::FormFu::new().  Here's the output:

[debug] in FormFu::new
[debug] in CRUD::new
[debug] in CRUD::_crud_setup
[debug] in SomeController::new

List's new() is not called in that case.

Here's what happens when I inherit List before CRUD in SomeController:

[debug] in FormFu::new
[debug] in CRUD::new
[debug] in CRUD::_crud_setup
[debug] in List::new
[debug] in List::_list_setup
[debug] in TestModule::new

Everything looks good, right?  My List actions work!  However, the CRUD
actions don't work because the FormConfig actions seem to have been
ignored -- $c->stash->{form} is undef :(

Does anyone have any suggestions?  Should I just forego using new() and
do initial setup the first time auto() is called in each of my base
controllers?

Thanks,
Byron

___
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] installing authentication modules

2008-03-05 Thread Jay K

You are correct.

Catalyst::Authentication::Store::DBIx::Class is correct.  There are
older modules that use the Plugin style naming - and Catalyst will
attempt to load using the Plugin naming if it can't find the
Catalyst::Authentication:: version.  If you look at your logs you
should see a warning regarding 'trying Deprecated naming'  or
something similar.

I've added a more detailed message for this situation.  It will be
present in the next release.

Jay

On Mar 5, 2008, at 8:33 AM, Andreas Marienborg wrote:



On Mar 4, 2008, at 4:01 PM, rahed wrote:


Hi,

I installed Catalyst and other additional modules. When starting
myapp_fastcgi.pl I got the message:

Can't locate Catalyst/Plugin/Authentication/Store/DBIx/Class in @INC.
Actually I had to install
Catalyst::Authentication::Store::DBIx::Class
to fix it.

I am a bit perplexed by the docs about authentication/authorization
modules - which should be installed and which are deprecated.



I think its like this.

Catalyst::Plugin::Authentication is good.

Anything else (Store,  Credential etc) should be without Plugin::-part
and you should only load the Catalyst::Plugin::Authentication from
your application
and then the rest is loaded based on the config

- andreas


___
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/


---
"Those who can make you believe absurdities can make you commit
atrocities." --Voltaire



___
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] uri_for problem

2008-03-05 Thread Richard Thomas



Moritz Onken wrote:

[%- ourl = Catalyst.uri_for('/search') _ "?stype=seqid&query=" -%] ?

Am 05.03.2008 um 10:50 schrieb Emmanuel Quevillon:

Thanks! That did the work.


Well, it might work, but it does seem a messy way to do it.

 [%- ourl = Catalyst.uri_for('/search', { stype => seqid, query  
=> '' }) -%]


-or (and this is a lot easier to work with in many circumstances,  
especially if you're conditionally manipulating the parameters)


 [%- params = { stype => seqid, query => ''} -%]
 ...
 [%- ourl = Catalyst.uri_for('/search', params) -%]

Hope that helps,

RET

___
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] Push services with catalyst

2008-03-05 Thread Brian Kirkbride

Moritz Onken wrote:
I'm combining ajax with push. So it's a real push service, the website 
is not pulling the data on a constant time rate.


A process per client is really bad. I'll need to serve hundreds of 
client at the same time. Seems like push is not an option...




Ah... after I clicked send I thought "what if it is a true PUSH using 
Ajax to listen?"  Most people think of Ajax polling as a push, though 
it's just looks like push with some granularity.  My apologies for 
assuming...


Have you checked out COMET?  See http://cometd.com/ for discussion of 
all the issues with push.  I haven't looked at it in a long time, but 
it was an attempt to deal with your issue.  The Lighttpd developers 
are working on something similar called mod_mailbox.  I don't pretend 
to understand anything about either :)


___
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] Push services with catalyst

2008-03-05 Thread J. Shirley
On Wed, Mar 5, 2008 at 11:48 AM, Moritz Onken <[EMAIL PROTECTED]> wrote:
> I'm combining ajax with push. So it's a real push service, the website
>  is not pulling the data on a constant time rate.
>
>  A process per client is really bad. I'll need to serve hundreds of
>  client at the same time. Seems like push is not an option...
>

Take a look at cometd: http://cometd.com/

___
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] Push services with catalyst

2008-03-05 Thread Moritz Onken
I'm combining ajax with push. So it's a real push service, the website  
is not pulling the data on a constant time rate.


A process per client is really bad. I'll need to serve hundreds of  
client at the same time. Seems like push is not an option...


Am 05.03.2008 um 19:39 schrieb Brian Kirkbride:


Moritz Onken wrote:

Hi,
I consider offering a push service for real-time data. It's AJAX  
based and requires a consistent connection.
I'm not sure about the memory usage of this. I plan to run the  
catalyst app as fastcgi server. Does every consistent connection  
create an extra fastcgi process? Which means an additional ~30mb  
(if that's the size of a fastcgi process)?

moritz


If it's AJAX then you are really polling as opposed to pushing.  In  
this case Lighttpd or Nginx are your friends.  They can handle all  
of the connections (with a long KeepAlive) and only talk to the  
backend FastCGI when a poll request comes through from the AJAX  
client.


If you're really pushing with a constantly connected client, you'll  
need a FastCGI process per client.  The difference is who initiates  
communication over the channel.  If the server can send to the  
client at any moment, that's true push.  Most people get along with  
a rapidly polling client that says "Anything for me?" every so often.


In general polling is wasteful of bandwidth, while push is wasteful  
of server-side resources.


Best,
Brian

___
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] Push services with catalyst

2008-03-05 Thread Brian Kirkbride

Moritz Onken wrote:

Hi,

I consider offering a push service for real-time data. It's AJAX based 
and requires a consistent connection.
I'm not sure about the memory usage of this. I plan to run the catalyst 
app as fastcgi server. Does every consistent connection create an extra 
fastcgi process? Which means an additional ~30mb (if that's the size of 
a fastcgi process)?


moritz


If it's AJAX then you are really polling as opposed to pushing.  In 
this case Lighttpd or Nginx are your friends.  They can handle all of 
the connections (with a long KeepAlive) and only talk to the backend 
FastCGI when a poll request comes through from the AJAX client.


If you're really pushing with a constantly connected client, you'll 
need a FastCGI process per client.  The difference is who initiates 
communication over the channel.  If the server can send to the client 
at any moment, that's true push.  Most people get along with a rapidly 
polling client that says "Anything for me?" every so often.


In general polling is wasteful of bandwidth, while push is wasteful of 
server-side resources.


Best,
Brian

___
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] Push services with catalyst

2008-03-05 Thread Moritz Onken

Hi,

I consider offering a push service for real-time data. It's AJAX based  
and requires a consistent connection.
I'm not sure about the memory usage of this. I plan to run the  
catalyst app as fastcgi server. Does every consistent connection  
create an extra fastcgi process? Which means an additional ~30mb (if  
that's the size of a fastcgi process)?


moritz


___
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] installing authentication modules

2008-03-05 Thread Andreas Marienborg


On Mar 4, 2008, at 4:01 PM, rahed wrote:


Hi,

I installed Catalyst and other additional modules. When starting
myapp_fastcgi.pl I got the message:

Can't locate Catalyst/Plugin/Authentication/Store/DBIx/Class in @INC.
Actually I had to install Catalyst::Authentication::Store::DBIx::Class
to fix it.

I am a bit perplexed by the docs about authentication/authorization
modules - which should be installed and which are deprecated.



I think its like this.

Catalyst::Plugin::Authentication is good.

Anything else (Store,  Credential etc) should be without Plugin::-part
and you should only load the Catalyst::Plugin::Authentication from  
your application

and then the rest is loaded based on the config

- andreas


___
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] On HTML::FormFu rendering

2008-03-05 Thread Andreas Marienborg


On Mar 5, 2008, at 4:03 PM, Alex Povolotsky wrote:


Hello!

I'm trying to use Catalyst::Controller::HTML::FormFu

Code is quite simple for this time
=== from controller ===
sub add : Local FormConfig {
  my ($self, $c) = @_;
  my $form : Stashed;
}
=== cut ===

=== TT template ===
[% META title = 'Add user' %]
[% Form.render %]
=== cut ===

=== YML template ===
---
elements:
- type: Text
  name: login
  label: 'Login:'
- type: Password
  name: pass1
  label: 'Password:'
- type: Password
  name: pass2
  label: 'Repeat password:'
- type: Submit

=== cut ===

However, form does not get rendered. form.render works, but should  
Form.render be better?


And can I produce much nicer forms as FormBuilder do by default?



Catalyst::Controller::HTML::FormFu puts the form-object in the stash  
variable 'form' by default. Form is not something  
Catalyst::Controller::HTML::FormFu puts in your stash, so unless you  
do that yourself, your problem with Form.render is probably that Form  
is undefined. TT silently ignores undefined.


http://code.google.com/p/html-formfu/source/browse/trunk/HTML-FormFu/examples/

Here are two examples, with CSS, that might help you get started.  
HTML::FormFu attempts to output html that can be flexibly styled using  
CSS.



- andreas


___
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] On HTML::FormFu rendering

2008-03-05 Thread Carl Franks
On 05/03/2008, Alex Povolotsky <[EMAIL PROTECTED]> wrote:
> Hello!
>
>  I'm trying to use Catalyst::Controller::HTML::FormFu
>
>  Code is quite simple for this time
>  === from controller ===
>  sub add : Local FormConfig {
> my ($self, $c) = @_;
> my $form : Stashed;
>  }
>  === cut ===
>
>  === TT template ===
>  [% META title = 'Add user' %]
>  [% Form.render %]
>  === cut ===
>
>  === YML template ===
>  ---
>  elements:
>   - type: Text
> name: login
> label: 'Login:'
>   - type: Password
> name: pass1
> label: 'Password:'
>   - type: Password
> name: pass2
> label: 'Repeat password:'
>   - type: Submit
>
>  === cut ===
>
>  However, form does not get rendered. form.render works, but should
>  Form.render be better?

HTML::FormFu is not FormBuilder

If you want "Form" instead of "form", you need to set "form_stash" in
your Controller::HTML::FormFu config

see - 
http://search.cpan.org/~cfranks/Catalyst-Controller-HTML-FormFu-0.02000/lib/Catalyst/Controller/HTML/FormFu.pm#form_stash

I'd guess that if you do that, you'll need to change:
my $form : Stashed;
to
my $Form : Stashed;

(I'm not entirely sure, having never used that plugin)

>  And can I produce much nicer forms as FormBuilder do by default?

Can you be more specific?

Have you checked out the css in examples/vertically-aligned-css/ ?

Carl

___
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] On HTML::FormFu rendering

2008-03-05 Thread Brian Cassidy

Alex Povolotsky wrote:
However, form does not get rendered. form.render works, but should 
Form.render be better?


The keys in the stash are case sensitive. 'Form' ne 'form'. Your code 
says "$form : Stashed" -- thus 'form' would be the correct, uh, form.


-Brian

___
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] On authentication

2008-03-05 Thread Alex Povolotsky

Felix Antonius Wilhelm Ostmann wrote:

i asked for that yesterday in the channel ... you must install

Catalyst::Authentication::Store::DBIx::Class (without Plugin)


Cool... maybe you'd explain me a bit configuration options? Role-related 
ones are just mentioned in docs, not explained at all


Alex.


___
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] On HTML::FormFu rendering

2008-03-05 Thread Alex Povolotsky

Hello!

I'm trying to use Catalyst::Controller::HTML::FormFu

Code is quite simple for this time
=== from controller ===
sub add : Local FormConfig {
   my ($self, $c) = @_;
   my $form : Stashed;
}
=== cut ===

=== TT template ===
[% META title = 'Add user' %]
[% Form.render %]
=== cut ===

=== YML template ===
---
elements:
 - type: Text
   name: login
   label: 'Login:'
 - type: Password
   name: pass1
   label: 'Password:'
 - type: Password
   name: pass2
   label: 'Repeat password:'
 - type: Submit

=== cut ===

However, form does not get rendered. form.render works, but should 
Form.render be better?


And can I produce much nicer forms as FormBuilder do by default?

Alex.


___
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] shared hosting

2008-03-05 Thread KH
Here is an example mod_perl apache config.  I run a different apache process
for every mod_perl cat application I run, and just configure them to work as
v-host's - then configure squid to look inward from port 80 and handle the
proxy traffic so it's seamless to users.  I think at the moment I've got
about 15~20 cat apps running on a single xen virtual machine running debian
w/ no problems - but it's not under high load so YMMV.


ServerAdmin [EMAIL PROTECTED]
ServerName  www.mydomain.tld
Alias /static /var/www/www.mydomain.tld/root/static
PerlOptions +Parent
PerlSwitches -Mlib=/var/www/www.mydomain.tld/lib
PerlSwitches -I/var/www/www.mydomain.tld/lib
PerlModule CatApp

SetHandler modperl
PerlResponseHandler CatApp
Order allow,deny
allow from all

DocumentRoot /var/www/www.mydomain.tld/root/static
ErrorLog /var/www/www.mydomain.tld/log/error.log
LogLevel warn
CustomLog /var/www/www.mydomain.tld/log/access.log combined
ServerSignature On



On Tue, Mar 4, 2008 at 6:45 PM, Peter Edwards <[EMAIL PROTECTED]> wrote:

> > From: Jennifer Ahn [mailto:[EMAIL PROTECTED]
> >
> >If my catalyst application is not a stand alone application and contains
> features to my non-catalyst application.  Would >that still considered as
> shared hosting?
> >
> >If I would like to host my catalyst application on the same server as my
> non-catalyst app, is fast-cgi the best way to do this?
>
> The main problem with using mod_perl under Apache is that it's a shared
> environment.
> So to run shared hosting you would need one Apache parent per user running
> either on a different port number or different virtual host. That's one
> option.
>
> Another option, which is easier for development, is to run one FastCGI
> instance per application area from a single master Apache configuration.
> In
> that option, each FastCGI instance has a separate memory space so there's
> no
> overlap.
>
> For live hosting, I've found that FastCGI goes haywire about once a month
> and eats CPU until I restart the main Apache server (not been able to
> track
> down why), so for production I prefer to use separate Apache instances.
>
> Regards, Peter
> http://perl.dragonstaff.co.uk
>
>
> ___
> 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/
>



-- 
do() || do_not(); // try()

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane
mittam

http://www.kylehultman.com
___
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] On authentication

2008-03-05 Thread Felix Antonius Wilhelm Ostmann

i asked for that yesterday in the channel ... you must install

Catalyst::Authentication::Store::DBIx::Class (without Plugin)

somewhere in die manual you cant read about it ... i dont find it too ;)



Alex Povolotsky schrieb:

Hello!

Comparing tutorial/book and perldoc Catalyst::Plugin::Authentication, 
I've found completely different ways to configure 
authentication/authorization. Looks like Catalyst::Plugin::Authentication
is much richer, but much worse documented and, say, there is no 
Catalyst::Plugin::Authentication::Store::DBIx::Class mentioned in 
C::P::A manual.


Is tutorial/book way obsoleted? If yes, where can I find better 
explanation of C::P::A?


Alex.


___
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/





--
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--
Websuche   Search   Technology   GmbH   &   Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:+49 541 40666-22
Email: [EMAIL PROTECTED] - Website: www.websuche.de
--
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--


___
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] On authentication

2008-03-05 Thread Alex Povolotsky

Hello!

Comparing tutorial/book and perldoc Catalyst::Plugin::Authentication, 
I've found completely different ways to configure 
authentication/authorization. Looks like Catalyst::Plugin::Authentication
is much richer, but much worse documented and, say, there is no 
Catalyst::Plugin::Authentication::Store::DBIx::Class mentioned in 
C::P::A manual.


Is tutorial/book way obsoleted? If yes, where can I find better 
explanation of C::P::A?


Alex.


___
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/Controller logic separation - best practices?

2008-03-05 Thread Ian Sillitoe
Juan, thanks for taking the time to reply.

Perhaps there should be no need for the custom get_related_rows call
> (and doing in the template should be, in fact, breaking MVC
> principles, IMHO).  If your DBIC Classes representing TableA and
> TableB are properly related (master-detail, in this case, for what
> shows from the example, something like: TableA has_many TableB) with
> the method, say, gimme_b, something like the following should work:
>

There were a couple of reasons why I was using [% rows_b =
row_a.get_rows_b() %] rather than doing the query (and stashing the results)
in the controller:

- this operation will probably happen in several places in the web pages (
i.e. there could be several different instances of row_a) and it would be a
pain to have to do each of these queries and store them as separate stash
variables beforehand (the duplication leads to typos, etc)

- I'm trying to be modular with the way I'm writing my templates so I can
have discrete templates for each type of component (i.e. table row). I'm
using something like:

[% PROCESS table_a/brief_summary.tt2
 row = row_a
%]

I guess I could change this to:

[% PROCESS table_a/brief_summary.tt2
 row = row_a
 related_rows_b = rows_b_related_to_row_a
%]

But again, I'll then need to maintain the interface of "brief_summary" which
again leaves me open to typos, etc.  If I keep the select inside
"table_a/brief_summary.tt2" then I only need to pass the entity that is
being displayed and let the component worry about getting the information it
needs to display it.

I'm happy to be told there is a more sensible way of doing this, but this
seems to make sense to me.

Having said all that, I've just gone back through the mailing list (with
less caffeine and more sleep) and there are a couple of obvious threads that
I should've seen before writing my original email (
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg01827.html).
Apologies for the false alarm.

Ian

On Tue, Mar 4, 2008 at 9:13 PM, Juan Miguel Paredes <[EMAIL PROTECTED]>
wrote:

> On Wed, Mar 5, 2008 at 3:05 PM, Ian Sillitoe <[EMAIL PROTECTED]> wrote:
> >
> > Controller/TableA.pm:
> > $c->{stash}->{row_a} = $c->model('MyDBIC::TableA')->find('id');
> > $c->{stash}->{template} = 'view_a.tt2';
> > $c->forward('Catalyst::View::TT');
> >
> > /root/src/view_a.tt2:
> > [% rows_b = row_a.get_related_rows( optional => param ) %]
> > [% FOREACH row_b = rows_b %]
> >   [% DisplayRow(row_b) %]
> > [% END %]
> >
>
> Perhaps there should be no need for the custom get_related_rows call
> (and doing in the template should be, in fact, breaking MVC
> principles, IMHO).  If your DBIC Classes representing TableA and
> TableB are properly related (master-detail, in this case, for what
> shows from the example, something like: TableA has_many TableB) with
> the method, say, gimme_b, something like the following should work:
>
> /root/src/view_a.tt2:
> [% rows_b = row_a.gimme_b %]
> [% FOREACH row_b = rows_b %]
>  [% DisplayRow(row_b) %]
> [% END %]
>
> If, for some odd reason, the DBIC Relationships (a definite _must see_
> on the docs) are not enough for your needs, you could put all your
> related rows from TableB on the stash (calling the custom model method
> from your controller), so you don't make direct calls from your
> template to your models.
>
> Anyway, that's just an opinion. HTH.
>
> ___
> 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] debug mode or debug levels?

2008-03-05 Thread Matt Lawrence

Bill Moseley wrote:

On Tue, Mar 04, 2008 at 05:22:38PM +, Matt Lawrence wrote:
  

Tyler Bird wrote:

hi I want to only show certain log messages to my console based on the 
log level 'debug'
I believe catalyst supports log levels, but this doesn't seem to be 
working



if ( $c->is_debug() )
{
  $c->log("log message here..");
}


  

I believe that's spelt:

if ($c->log->is_debug) {
   $c->log->debug("log message here..");
}



Isn't that the same thing as simply:

$c->log->debug('log message here...');
  


Quite right, I was imagining the OP was going to do more heavy-duty 
debugging for which the sample code was a test case.




There's also:

$c->log->debug('message') if $c->debug;

which, IIRC, is set true if CATALYST_DEBUG is true (or, of course, if
you create a sub debug {1} in your app).
  

You can also use MYAPP_DEBUG to set debugging on an app-by-app basis.

Matt


___
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] uri_for problem

2008-03-05 Thread Emmanuel Quevillon

Moritz Onken wrote:

[%- ourl = Catalyst.uri_for('/search') _ "?stype=seqid&query=" -%] ?



Am 05.03.2008 um 10:50 schrieb Emmanuel Quevillon:


Thanks! That did the work.
-
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-

___
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] uri_for problem

2008-03-05 Thread Thomas Klausner
Hi!

On Wed, Mar 05, 2008 at 10:50:07AM +0100, Emmanuel Quevillon wrote:

> I am trying to build some url from TT using uri_for sub but I encounter 
> some problem with it.
>
> When in my tt I have :
> [%- ourl = Catalyst.uri_for('/search?stype=seqid&query=') -%]
>
> when I click on it, I get an url that looks like :
> search%5C%3Fstype=seqid&query=
>
> Is there a way to get the proper url produce in the HTML page without 
> '%5C%3F' ?

The docs say:
  $c->uri_for( $path, @args?, \%query_values? )

translated to TT that should read
  [%  Catalyst.uri_for('search', { stype=>'seqid' } ) %]
(I think, but I constantly mix up how to defines hashes in TT)


-- 
#!/usr/bin/perl  http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

___
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] uri_for problem

2008-03-05 Thread Moritz Onken

[%- ourl = Catalyst.uri_for('/search') _ "?stype=seqid&query=" -%] ?



Am 05.03.2008 um 10:50 schrieb Emmanuel Quevillon:


Hi,

I am trying to build some url from TT using uri_for sub but I  
encounter some problem with it.


When in my tt I have :
[%- ourl = Catalyst.uri_for('/search?stype=seqid&query=') -%]

when I click on it, I get an url that looks like :
search%5C%3Fstype=seqid&query=

Is there a way to get the proper url produce in the HTML page  
without '%5C%3F' ?
I tried quoting and double quoting the url and escaping the question  
mark but without success.


Thanks a lot.
--
-
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-

___
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/


[Catalyst] uri_for problem

2008-03-05 Thread Emmanuel Quevillon

Hi,

I am trying to build some url from TT using uri_for sub but 
I encounter some problem with it.


When in my tt I have :
[%- ourl = Catalyst.uri_for('/search?stype=seqid&query=') -%]

when I click on it, I get an url that looks like :
search%5C%3Fstype=seqid&query=

Is there a way to get the proper url produce in the HTML 
page without '%5C%3F' ?
I tried quoting and double quoting the url and escaping the 
question mark but without success.


Thanks a lot.
--
-
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-

___
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] Create tables on the fly using DBIC

2008-03-05 Thread Peter Sørensen
Hi,

Using Catalyst, DBIC and TT.

I need to create tables on the fly depending on the input I get.
Need them to save data for further processing.

It this possible with DBIC or do I need any additional extensions?


Regards

Peter Sorensen/University of Southern Denmark/mail: [EMAIL PROTECTED]

___
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/