Re: [Catalyst] [OT] ASP.NET MVC

2007-12-12 Thread Kieren Diment


On 13 Dec 2007, at 17:07, Charlie Garrison wrote:


Good afternoon,

On 12/12/07 at 2:42 AM -0600, Jonathan Rockway <[EMAIL PROTECTED]> wrote:


On Wed, 2007-12-12 at 09:18 +0200, Octavian Rasnita wrote:


I haven't read anywhere that : Local is deprecated, and I use it  
very often.
Why is it deprecated? I found it works very well, and it is the  
most simple

solution.


Who told you this?  It's not.


On 11/12/07 at 7:59 AM -0800, John Napiorkowski <[EMAIL PROTECTED]>  
wrote:



Then we also have :Local, which is also considered
somewhat deprecated in favor of :Path, :Default which


I was confused too and wondered why I should stop using :Local.



I too was briefly confused, but then decided that It Just Seemed to  
Work And Play Nicely With Everything Else so I determined to ignore  
the advice and keep on doing what I was doing before.


I guess the problem is that if you want to change the uri that  
triggers an action, you're a bit screwed with : Local because it may  
require changing calls in your code i.e. $c->forward('foo');


Someone needs to write up a "what kind of dispatch to use when"  
guide.  Advent calendar volunteers anyone, we still have a few slots.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [OT] ASP.NET MVC

2007-12-12 Thread Charlie Garrison
Good afternoon,

On 12/12/07 at 2:42 AM -0600, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

>On Wed, 2007-12-12 at 09:18 +0200, Octavian Rasnita wrote:
>> 
>> I haven't read anywhere that : Local is deprecated, and I use it very often. 
>> Why is it deprecated? I found it works very well, and it is the most simple 
>> solution.
>
>Who told you this?  It's not.

On 11/12/07 at 7:59 AM -0800, John Napiorkowski <[EMAIL PROTECTED]> wrote:

>Then we also have :Local, which is also considered
>somewhat deprecated in favor of :Path, :Default which

I was confused too and wondered why I should stop using :Local.


Charlie

-- 
   Charlie Garrison  <[EMAIL PROTECTED]>
   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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [OT] ASP.NET MVC

2007-12-12 Thread John Napiorkowski

--- Jonathan Rockway <[EMAIL PROTECTED]> wrote:

> 
> On Wed, 2007-12-12 at 09:18 +0200, Octavian Rasnita
> wrote:
> > Hi,
> > 
> > I haven't read anywhere that : Local is
> deprecated, and I use it very often. 
> > Why is it deprecated? I found it works very well,
> and it is the most simple 
> > solution.
> 
> Who told you this?  It's not.
> 
> Local is theoretically a special case of chained
> (not implemented that
> way, but it could be)...  Feel free to use Local if
> it meets your needs.
> 
> Regards,
> Jonathan Rockway

The error originate with me, I saw on IRC sometime ago
a poster being told to stay away from :Local and to
prefer :Path instead.  Maybe it was for a particular
usage, but the impression I received was that although
not official deprecate it was not considered a good
practice.  Thank you for correcting the error.

As to your comment about :Local being a special case
of Chaining, if you could talk to that I'd appreciate
it.   I didn't understand that :Local would dispatch
through multiple controllers... but maybe I didn't get
the gist of your thought.  Could you clarify what you
meant my that?  Because when I encounter people new to
Catalyst and getting interested, it seems like the
confusion about what type of Action Attribute to use
and how to arrange controllers is a big barrier.  I
know it might seem like a bit of a silly thing to get
stuck on, but I know of two people that gave up on
Catalyst because it seemed to them to be too many ways
to do a very straightforward and simple thing, such as
map a URI to a controller, while potentially capturing
path arguments.

My original comment that started this was how I
noticed the Microsoft MVC framework they are
distributing is using a standalone dispatching class
to build up a URI dispatcher.  I've noticed in all my
MVC research over the past year that this model is
very common.  Catalyst is doing things a little
different here and I think there is power to our
model, but confusion as well.  So I was hoping to
generate some discussion about that and maybe it could
lead to a wiki page or POD or something to give
newbies a little guidance as well as offer some
general advantages to the Catalyst system.

--john


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Custom error handling

2007-12-12 Thread Wade . Stuart

"Dmitriy S. Sinyavskiy" <[EMAIL PROTECTED]> wrote on 12/12/2007 04:12:45 PM:

> Hello, catalyst.
>
> I've found some problem during developing Catalyst application.
> When app can't connect to database it shows error full stack info
> together  with db_username and db_password. I just want to handle
> error in other way - may be localized error message and a part of
> stack data.
>
> How can I handle errors custom may be you know some FAQ?

Turn off debug on your live site?

http://search.cpan.org/dist/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Debugging.pod

-Wade


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Custom error handling

2007-12-12 Thread Thomas L. Shinnick

At 04:12 PM 12/12/2007, Dmitriy S. Sinyavskiy wrote:

Hello, catalyst.

I've found some problem during developing Catalyst application.
When app can't connect to database it shows error full stack info
together  with db_username and db_password. I just want to handle
error in other way - may be localized error message and a part of
stack data.

How can I handle errors custom may be you know some FAQ?


Catalyst::Manual::Cookbook - very first item
http://search.cpan.org/~jrockway/Catalyst-Manual-5.701003/lib/Catalyst/Manual/Cookbook.pod#Delivering_a_Custom_Error_Page


--
 dreelmailto:[EMAIL PROTECTED]
 Dmitriy S. Sinyavskiy
 Web-developerPerl, Catalyst, MSSQL
 FGUE EZANTelecommunication, data transfer networks 
and devices.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Custom error handling

2007-12-12 Thread Dmitriy S. Sinyavskiy
Hello, catalyst.

I've found some problem during developing Catalyst application.
When app can't connect to database it shows error full stack info
together  with db_username and db_password. I just want to handle
error in other way - may be localized error message and a part of
stack data.

How can I handle errors custom may be you know some FAQ?

-- 
 dreelmailto:[EMAIL PROTECTED]
 Dmitriy S. Sinyavskiy
 Web-developerPerl, Catalyst, MSSQL
 FGUE EZANTelecommunication, data transfer networks and 
devices.  


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Handel missing a forward to a view?

2007-12-12 Thread Christopher H. Laco
Collin Condray wrote:
> Hi, I'm a new user of Catalyst (5.701) and I'm trying to incorporate Handel
> (1.5) into my existing app which is based loosely on the Catalyst
> tutorial. I've run the Handel scaffold and set up the associated tables in
> the database. However, when I try to go to myapp.domainname.com/cart/add I
> get the following error.

Welcome to Catalyst, and Handel.
A better place for your questions is probably:

http://search.cpan.org/~claco/Handel-1.6/lib/Handel/Manual/About.pod#MAILING_LIST

> 
> Couldn't render template "file error - cart/default: not found"
> 
> I checked the permissions of my files and they are correct. The default
> Handel templates are located where they're supposed to in the root/cart
> directory. I do have other controllers that render TT templates correctly as
> well so TT is working. I finally got the cart to appear when I added the
> following code to the end of sub default in Cart.pm :
> 
> $c->forward( $c->view('TToolkit') );
> 
> and the cart worked normally. When I proceed to the checkout catalyst dies
> on line 240 of Checkout.pm :
> 
> $c->forward('render');
> 
> and I get the following error:
> 
> Couldn't render template "file error - checkout/default: not found"
> 
> I obviously have something wrong with the way my views are set up and I
> could use a clearer understanding of how the view mechanism works. I've also
> found references to similar problems (
> http://grokbase.com/topic/2006/08/04/handel-couldn-t-render-template-file-error-cart-add-not-found/UVdMM_5zEb2fAvFXgnmWt7tx5vM,
> http://www.perl.com/pub/a/2005/11/17/handel.html?page=last) but don't think
> they apply to this problem.
> 
> If I can provide any further information on my problem, please let me know
> and I'll be happy to provide it.
> 
> Thanks,

First, a disclaimer. The Helper generated code is old, and not that
bright. It was written long before some of the latest TT and Cat updates
that changed defaults, like TEMPLATE_EXTENSION, default_view and other
goodies. Some things to check:

Make sure TT and Cat are up to date. Make sure you have a default_view
set to TToolkit and no TEMPLATE_EXTENSION set. Make sure RenderView is
installed. I'd assume that some of this is caused by code assuming that
you're using TT instead of TTolkit, and possibly that you have
RenderView action installed.

How many views do you have, and what are they named?

The Handel Helper generates a TT view on it's own anyways:

$helper->mk_component($app, 'view', 'TT', 'TT');

Did you run the helper against a new Cat app, or an existing one with
other code in it?

-=Chris



signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] utf-8 problems

2007-12-12 Thread Jon
On Dec 12, 2007 11:27 AM, Jonas Alves <[EMAIL PROTECTED]> wrote:
>
> Is it possible that the broken machine has an old TT version that doesn't
> support the ENCODING => 'UTF-8' parameter?
>
> --
> Jonas
>
>
That was the problem! Debian stable uses  TT 2.14 and unstable 2.19, doing
"aptitude -t unstable install libtemplate-perl" solved the problem.

Thanks a lot! I was blaming my code since I think utf is a bit voodooish and
just figured I had done something wierd. Updating TT would have been far
down on my list when trying to figure this out.

/Jon
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] utf-8 problems

2007-12-12 Thread Jonas Alves
On Dec 12, 2007 10:08 AM, Jon <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm having some problems with utf-8 and was hoping someone could point me
> in the right direction. I've two machines and I just copied (scp:ed) from
> the one I've been playing around with to my other and then all my umlaut
> characters, when being inserted to the template by perl, like
> $c->stash->{umlaut} = 'ö' or when fetching data from the database containing
> ö. The ö itself is displayed correctly but all ö:s in the template gets
> garbled. If I don't do anything ö-related in the code the templates looks
> just fine, including their own ö:s.
>
> The thing that really confuse me is that it works fine on the machine I
> copied it all from. It's two different debian versions, stable on the
> non-working and unstable on the working. I've got the same catalyst packages
> though and both have the same locales installed. I've also tried the same
> data source on the broken I'm using on the working and it's giving the same
> result.
>
> I've been really careful trying to have the utf-8 work so I:
> In V::TT: ENCODING => 'UTF-8'
>
> in M::DB
> mysql_enable_utf8 => 1,
> on_connect_do   => [
> "SET NAMES 'utf8'",
> "SET CHARACTER SET 'utf8'",
> ],
> in MyApp.pm:
> use Catalyst qw/
> ..
> Unicode
> /;
> and I've tried with and without
> use encoding 'utf8';
>
>
> All my modules are utf-8 encoded and use utf8 if they have strings with
> umlauts in them, all my templates are utf-8, the mysql-data is too and the
> response headers from apache says "Content-Typetext/html; charset=utf-8".
>
> Anyone got a clue what could be the problem?
>
> Thanks
> Jon
>

Is it possible that the broken machine has an old TT version that doesn't
support the ENCODING => 'UTF-8' parameter?

-- 
Jonas
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] utf-8 problems

2007-12-12 Thread Jon
Hi,

I'm having some problems with utf-8 and was hoping someone could point me in
the right direction. I've two machines and I just copied (scp:ed) from the
one I've been playing around with to my other and then all my umlaut
characters, when being inserted to the template by perl, like
$c->stash->{umlaut} = 'ö' or when fetching data from the database containing
ö. The ö itself is displayed correctly but all ö:s in the template gets
garbled. If I don't do anything ö-related in the code the templates looks
just fine, including their own ö:s.

The thing that really confuse me is that it works fine on the machine I
copied it all from. It's two different debian versions, stable on the
non-working and unstable on the working. I've got the same catalyst packages
though and both have the same locales installed. I've also tried the same
data source on the broken I'm using on the working and it's giving the same
result.

I've been really careful trying to have the utf-8 work so I:
In V::TT: ENCODING => 'UTF-8'

in M::DB
mysql_enable_utf8 => 1,
on_connect_do   => [
"SET NAMES 'utf8'",
"SET CHARACTER SET 'utf8'",
],
in MyApp.pm:
use Catalyst qw/
..
Unicode
/;
and I've tried with and without
use encoding 'utf8';


All my modules are utf-8 encoded and use utf8 if they have strings with
umlauts in them, all my templates are utf-8, the mysql-data is too and the
response headers from apache says "Content-Typetext/html; charset=utf-8".

Anyone got a clue what could be the problem?

Thanks
Jon
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [OT] ASP.NET MVC

2007-12-12 Thread Jonathan Rockway

On Wed, 2007-12-12 at 09:18 +0200, Octavian Rasnita wrote:
> Hi,
> 
> I haven't read anywhere that : Local is deprecated, and I use it very often. 
> Why is it deprecated? I found it works very well, and it is the most simple 
> solution.

Who told you this?  It's not.

Local is theoretically a special case of chained (not implemented that
way, but it could be)...  Feel free to use Local if it meets your needs.

Regards,
Jonathan Rockway





signature.asc
Description: This is a digitally signed message part
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/