[Catalyst] Re: How to forward to a specific path

2010-01-31 Thread Aristotle Pagaltzis
* Julien Sobrier jul...@sobrier.net [2010-01-26 06:30]:
 I have pages in /page/number/title

 I created a couple of categories: /ca1, /cat2, etc. Each of
 them map to a /page/number/title

 /page/1/some-title
 /cat1/page/1/some-title
 /cat2/page/1/some-title

 For cat1 and cat2, I wanted to set some variables. So
 I intercept the page in /cat1 and send it back to
 /page/1/some-title

 /cat1, /cat2 and /page reside in different controller.

OK, but that doesn’t explain why you need to forward to a URI
rather than an action. Why is that?

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.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] Re: Catalyst/C:M:Adaptor/Moose/Moosex::Declare bug?

2010-01-31 Thread iain hubbard
On 28 January 2010 11:22, iain iainhubb...@googlemail.com wrote:

 iain wrote:

 Hi all,

 This is probably going to end up being nothing to do with catalyst but as
 this is where I am seeing the problem its where im starting.

 I have a standalone set of objects that work as expected. When I wrap
 these with Catalyst::Model::Adaptor for use as a model they fail with the
 error. http://pastebin.com/m2e87571c (this is a simple test app to
 highlight the problem)

 The cat app that generates this error is here http://tinyurl.com/y9vyfmz.
 I have included two tests one that passes (standalone) and the normal
 01app.t test that fails. Just unzip and prove -l t.

 I am using the latest CPAN versions of Catalyst (5.80018),
 Catalyst::Model::Adaptor (0.06),  Moose (0.94), MooseX::Declare (0.32) and
 the Perl version is 5.10.0 on ubuntu.

 Hopefully somebody with more knowledge of the inner workings can shed some
 light on the problem.


 Now that i have finished reading all the responses to my first post :) I
 have had time to de MooseX::Declare my objects. This fixes the problem.

 So, this is a problem with Moosex::Decalre and
 Catalyst/Catalyst::Model::Adaptor.


For anybody thats interested this problem appears to be caused by
Catalyst::Plugin::Static::Simple specifically version 0.28. Removing this
plugin or rolling back to 0.26 makes the error go away.

So, if you have a MooseX::Declare style object that loads a class at runtime
and you wrap it as a catalyst model and you use C:P:Static::Simple it will
error :-)

Iain Hubbard.
___
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] jQuery gotcha

2010-01-31 Thread S.A. Kiehn
Found a change in the latest jQuery (1.4.1) from the previous release I used 
(1.3.2) that affected  a Catalyst app of mine.  Regarding form field 
submissions, jQuery now submits multiple checkbox (or select) values with the 
variable name followed by the array [] brackets (probably to appease PHP).  I 
had a problem with a previous working app and used firebug to look at my JSON 
post and found the brackets.

What used to be:

    tags  25
    tags  18
    tags  10

is now:

    tags[]  25
    tags[]  18
    tags[]  10

Changing:

    my $tags = $c-request-params-{tags};

to:

    my $tags = $c-request-params-{'tags[]'};

corrected it (the quotes are needed).  Hope this is helpful.

This was my first post, been reading forums for awhile and want to thank all of 
you for the skill and knowledge you offer.  I thank you for the forum posts, 
blogs, calendars and books.  I am not a trained programmer, but with your help 
I have been able to build a few production Catalyst apps.

Thanks,
Scott K.




  ___
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] Using Catalyst with mod_per or FastCGI on heavy traffic web application

2010-01-31 Thread Amit Jha
Let me tell you that I am going to deploy 3-tire architecture and
inbuilt application load balancer for my production environment. And In
future I may have h/w load balancer as well. So Its clear thal I am looking at
very fast and stable environment to deliver my content. So Please help me to 
identify the best better
option.

Amit
   

--- On Sat, 30/1/10, Adam Mackler nab...@mackler.org wrote:

From: Adam Mackler nab...@mackler.org
Subject: Re: [Catalyst] Using Catalyst with mod_per or FastCGI on heavy traffic 
web application
To: shanu_...@yahoo.co.in, The elegant MVC web framework 
catalyst@lists.scsys.co.uk
Date: Saturday, 30 January, 2010, 6:02 AM

Well, I'm sure no expert, but that doesn't stop me from having opinions.

The reasons I stopped using mod_perl are: safer when perl encounters
errors, easier for learning, easier for development, better error
messages when restarting production applications, and the ability to
have each application run as a different system user.

Perhaps the most compelling reason that I stopped using mod_perl is
because with both perl and the web server combined in one executable,
a problem with perl can cause not only the whole website to go down,
but also all the other websites handled by that same webserver to go
down as well.

Second, setting up staging servers so you can develop without touching
your production site is easier using fastcgi.  Even having one staging
server with mod_perl is difficult.  Will you run two whole apaches
simultaneously?  What if you want to have more than one staging
server?  Adding more staging servers gets ridiculous fast.

(BTW, I know the Catalyst Book says that you're supposed to use the
myapp_server.pl for development, but I want to have SSL turned on all
the time.)

With fastcgi, I literally had dozens of different applications running
at once, and they can all crash and burn and the webserver keeps
running.  In fact, that's how I learned to use Catalyst.  For every
tutorial I found, I made its own fastcgi process, and then I set up
the web server to know about each one.  http://myhost.com/alpha was
the authorization tutorial, /beta was the CRUD totorial, etc.  I could
look at and play with any or all of them running at once; it made
learning from examples much easier.

In addition to making it easier to learn and to development, in the
production environment fastcgi has significant advantages as relates
to error messages, restarting, and security: I can have two levels of
error messages: one is the replacement for the Internal Server Error
that results from a problem with perl running--the same error you
arleady have, for example if your database server crashes, generated
by the perl application.  But with fastcgi I have another, separate
error page that is a nice-looking static page served by the web server
when the fasccgi server is not there.  So during the time when I am
restarting my fastcgi application, visitors see that nice static page
rather than getting a browser error message, which is what happens
when you restart a server with mod_perl.  And as your application(s)
grow in size (and number), restarting them takes longer and longer, so
that feature becomes more important.

Finally, a wonderful benefit of using fastcgi is that each one of my
fastcgi applications runs as a separate user, and none of those
fastcgi users is the user that the web server runs as.  I sleep that
much better at night knowing that the web server cannot read the files
that have database passwords in them, and so on.

Anyway, that's my conclusion after doing things both ways.  My current
setup is similar to yours:  FreeBSD, lighttpd, Catalyst, and
PostgreSQL.

Adam

PS, I'm curious why you're using mysql.  Is there a way in which its
better than Postgres?

On Fri, Jan 29, 2010 at 04:35:10PM +0530, Amit Jha wrote:
 Does anyone have any advice on what will the best option mod_perl or
 FastCGI or something else. if I have the following
 development/production environment for my web application which is a
 search engine.
 1. Linux(RHEL5)
 2. Apache 2.2.x
 3. Perl 5.10
 4. mod_perl 2.0.x
 5. mysql 5.1.x
 6. Catalyst 5.8.x
 ___
 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/




  Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/___
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] jQuery gotcha

2010-01-31 Thread Charlie Garrison

Good afternoon,

On 31/01/10 at 8:13 PM -0800, S.A. Kiehn keenli...@ymail.com wrote:

Found a change in the latest jQuery (1.4.1) from the previous 
release I used (1.3.2) that affected  a Catalyst app of mine.  
Regarding form field submissions, jQuery now submits multiple 
checkbox (or select) values with the variable name followed by 
the array [] brackets (probably to appease PHP).  I had a 
problem with a previous working app and used firebug to look at 
my JSON post and found the brackets.


In some of the info about the new version, they talk about the 
new feature:


http://jquery14.com/day-01

Nested param serialization (jQuery.param() Documentation, 
Commit 1, Commit 2)


jQuery 1.4 adds support for nested param serialization in 
jQuery.param, using the approach popularized by PHP, and 
supported by Ruby on Rails. For instance, {foo: [bar, baz]} 
will be serialized as “foo[]=barfoo[]=baz”.


In jQuery 1.3, {foo: [bar, baz]} was serialized as 
“foo=barfoo=baz”. However, there was no way to encode a 
single-element Array using this approach. If you need the old 
behavior, you can turn it back on by setting the traditional 
Ajax setting (globally via jQuery.ajaxSettings.traditional or on 
a case-by-case basis via the traditional flag).


So rather than changing the name of params you use, change the 
behaviour of jQuery instead:


http://api.jquery.com/jQuery.param/

jQuery.ajaxSettings.traditional = true;

Note, I haven't tried the above yet. But I think that's because 
MyApp uses Params::Nested which effectively normalizes the param 
names for $c-req, so the extra brackets haven't been an issue.


In either case, I had forgotten about that factoid in the 
release docco; thanks for the notice.



Charlie

--
   Ꮚ Charlie Garrison ♊ garri...@zeta.org.au
   〠 PO Box 141, Windsor, NSW 2756, Australia

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

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