Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

reserved words

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


orasnita at gmail

Mar 6, 2007, 9:02 AM

Post #1 of 9 (337 views)
Permalink
reserved words

Hi,

Please tell me how can I find the list of reserved words that cannot be used
as names for views, controllers, models, $c->stash elements...

For example I have seen that the name of the application is also found in
$c->stash->{name}. $c->stash->{template} is also special.

I have also tried to create a view with the name "Show", and I have received
the following error in the browser:

Caught exception in TranzactiiBursiere::View::Show->process
"TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You
need to
inherit from a subclass like Catalyst::View::TT instead.

If I changed the name of that view to "Html", it worked fine, with no
errors...

Thank you.

Octavian


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


jjn1056 at yahoo

Mar 6, 2007, 10:46 AM

Post #2 of 9 (307 views)
Permalink
Re: reserved words [In reply to]

----- Original Message ----
From: Octavian Rasnita <orasnita [at] gmail>
To: catalyst [at] lists
Sent: Tuesday, March 6, 2007 12:02:39 PM
Subject: [Catalyst] reserved words

Hi,

Please tell me how can I find the list of reserved words that cannot be used
as names for views, controllers, models, $c->stash elements...

For example I have seen that the name of the application is also found in
$c->stash->{name}. $c->stash->{template} is also special.

I have also tried to create a view with the name "Show", and I have received
the following error in the browser:

Caught exception in TranzactiiBursiere::View::Show->process
"TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You
need to
inherit from a subclass like Catalyst::View::TT instead.

If I changed the name of that view to "Html", it worked fine, with no
errors...

Thank you.

Octavian

I didn't know about the "Show" issue that you mentioned but AFAIK there are not really global reserved stuff. 'template' is used by the TT view to set the path to the template so you have to be careful with that. I think the 'template' think bit me once as well. That's really the only stash key I can think of that's special, but if you use something other than TT you should check the docs.

--john


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/






____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


email at jasonkohles

Mar 7, 2007, 8:00 AM

Post #3 of 9 (304 views)
Permalink
Re: reserved words [In reply to]

On Mar 6, 2007, at 12:02 PM, Octavian Rasnita wrote:

> Hi,
>
> Please tell me how can I find the list of reserved words that
> cannot be used as names for views, controllers, models, $c->stash
> elements...
>
> For example I have seen that the name of the application is also
> found in $c->stash->{name}. $c->stash->{template} is also special.
>
> I have also tried to create a view with the name "Show", and I have
> received the following error in the browser:
>
> Caught exception in TranzactiiBursiere::View::Show->process
> "TranzactiiBursiere::View::Show directly inherits from
> Catalyst::View. You need to
> inherit from a subclass like Catalyst::View::TT instead.
>
> If I changed the name of that view to "Html", it worked fine, with
> no errors...
>

This is the error message you get if you create a subclass of
Catalyst::View that doesn't implement a process() method. It
probably doesn't have anything to do with the name of the module...

--
Jason Kohles
email [at] jasonkohles
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire


orasnita at gmail

Mar 7, 2007, 9:05 AM

Post #4 of 9 (316 views)
Permalink
Re: reserved words [In reply to]

From: Jason Kohles


Hi,


Please tell me how can I find the list of reserved words that cannot be used as names for views, controllers, models, $c->stash elements...


For example I have seen that the name of the application is also found in $c->stash->{name}. $c->stash->{template} is also special.


I have also tried to create a view with the name "Show", and I have received the following error in the browser:


Caught exception in TranzactiiBursiere::View::Show->process "TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You need to
inherit from a subclass like Catalyst::View::TT instead.


If I changed the name of that view to "Html", it worked fine, with no errors...




This is the error message you get if you create a subclass of Catalyst::View that doesn't implement a process() method. It probably doesn't have anything to do with the name of the module...

I have tried:

perl script/myapp_create.pl view Show

After restarting the application, it gives that error. If I do instead:

perl script/myapp_create.pl view Html

The application works fine after restarting it. Am I doing something wrong?

Thanks.

Octavian


jjn1056 at yahoo

Mar 7, 2007, 9:35 AM

Post #5 of 9 (320 views)
Permalink
Re: reserved words [In reply to]

----- Original Message ----
From: Octavian Rasnita <orasnita [at] gmail>
To: The elegant MVC web framework <catalyst [at] lists>
Sent: Wednesday, March 7, 2007 12:05:35 PM
Subject: Re: [Catalyst] reserved words







From: Jason Kohles







Hi,




Please tell me how can I find the list of reserved
words that cannot be used as names for views, controllers, models,
$c->stash elements...




For example I have seen that the name of the
application is also found in $c->stash->{name}.
$c->stash->{template} is also special.




I have also tried to create a view with the name
"Show", and I have received the following error in the browser:




Caught exception in
TranzactiiBursiere::View::Show->process "TranzactiiBursiere::View::Show
directly inherits from Catalyst::View. You need to

inherit from a subclass like Catalyst::View::TT
instead.




If I changed the name of that view to "Html", it
worked fine, with no errors...








This is the error message you get if you create a subclass of
Catalyst::View that doesn't implement a process() method. It probably
doesn't have anything to do with the name of the module...



I have tried:



perl script/myapp_create.pl view
Show



After restarting the application, it gives that
error. If I do instead:




perl script/myapp_create.pl view
Html




The application works fine after restarting it.
Am I doing something wrong?



Thanks.



Octavian


I'd personally be interested in seeing what the generated files look like. Could you attach them in your response (or post them someplace we can see?)

--John

_________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/








____________________________________________________________________________________
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/


orasnita at gmail

Mar 7, 2007, 11:09 AM

Post #6 of 9 (318 views)
Permalink
Re: reserved words [In reply to]

From: John Napiorkowski
This is the error message you get if you create a subclass of Catalyst::View that doesn't implement a process() method. It probably doesn't have anything to do with the name of the module...

I have tried:

perl script/myapp_create.pl view Show

After restarting the application, it gives that error. If I do instead:

perl script/myapp_create.pl view Html

The application works fine after restarting it. Am I doing something wrong?

Thanks.

Octavian

I'd personally be interested in seeing what the generated files look like. Could you attach them in your response (or post them someplace we can see?)

Hi,

Here is the first one (Show.pm):

package TranzactiiBursiere::View::Show;

use strict;
use warnings;
use base 'Catalyst::View';

=head1 NAME

TranzactiiBursiere::View::Show - Catalyst View

=head1 DESCRIPTION

Catalyst View.

=head1 AUTHOR

A clever guy

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;

And here it is the second one that works (Html.pm):

package TranzactiiBursiere::View::Html;

use strict;
use warnings;
use base 'Catalyst::View';

=head1 NAME

TranzactiiBursiere::View::Html - Catalyst View

=head1 DESCRIPTION

Catalyst View.

=head1 AUTHOR

A clever guy

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;


If I just delete the file Show.pm and restart the server, the program works fine, but if I put it back and restart, it gives that error.
I have seen the same thing under Linux and Windows.

Thanks.


edencardim at gmail

Mar 7, 2007, 11:51 AM

Post #7 of 9 (307 views)
Permalink
Re: reserved words [In reply to]

On 3/7/07, Octavian Rasnita <orasnita [at] gmail> wrote:
> If I just delete the file Show.pm and restart the server, the program works
> fine, but if I put it back and restart, it gives that error.
> I have seen the same thing under Linux and Windows.

You'd get along a lot better if you actually read the docs and error messages.
You can't forward to a Catalyst View that doesn't implement a
process() method or it'll throw an exception, which was just what
happened in your case.

You probably need to run:

script/myapp_create.pl view MyView TT

To create a TT view that has a process() method implemented. Or just
change TT to whatever type of view you want. Either that or implement
a process() method yourself.

--
Eden Cardim
Instituto Baiano de Biotecnologia
Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas
Laboratório de Bioinformática
--
"you seem to think that 'close enough' is close enough...
please learn to be 'literal' around programming."
merlyn - on irc.freenode.net#perl

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


jjn1056 at yahoo

Mar 7, 2007, 1:23 PM

Post #8 of 9 (303 views)
Permalink
Re: reserved words [In reply to]

DIV {
MARGIN:0px;}



From: John Napiorkowski


This is the error message you get if you create
a subclass of Catalyst::View that doesn't implement a process() method.
It probably doesn't have anything to do with the name of the module...







I have tried:



perl script/myapp_create.pl view
Show



After restarting the application, it gives that
error. If I do instead:




perl script/myapp_create.pl view
Html




The application works fine after restarting it.
Am I doing something wrong?



Thanks.



Octavian



I'd personally be interested in seeing what the generated files look
like. Could you attach them in your response (or post them someplace we
can see?)


Hi,



Here is the first one (Show.pm):



package
TranzactiiBursiere::View::Show;



use strict;
use warnings;
use base
'Catalyst::View';



=head1 NAME



TranzactiiBursiere::View::Show - Catalyst
View



=head1 DESCRIPTION



Catalyst View.



=head1 AUTHOR



A clever guy



=head1 LICENSE



This library is free software, you can
redistribute it and/or modify
it under the same terms as Perl
itself.



=cut



1;


And here it is the second one that works
(Html.pm):



package
TranzactiiBursiere::View::Html;



use strict;
use warnings;
use base
'Catalyst::View';



=head1 NAME



TranzactiiBursiere::View::Html - Catalyst
View



=head1 DESCRIPTION



Catalyst View.



=head1 AUTHOR



A clever guy



=head1 LICENSE



This library is free software, you can
redistribute it and/or modify
it under the same terms as Perl
itself.



=cut



1;




If I just delete the file Show.pm and restart the
server, the program works fine, but if I put it back and restart, it gives
that error.

I have seen the same thing under Linux and
Windows.



Thanks.







As others have pointed out, when you use $c->forward(...) that target needs a process method. I try to think of modules that I forward to as being implementations of the "Command" design pattern, or part of a Pipeline pattern, instead of a module that is actually instantiated and consumed. At least that's the way I try to make sense of all the different ways you can access Catalyst modules.

I'm guessing that the reason Html works is that you actually have a different Html modules or Action somewhere in the path that works correctly, and it is that module and not the new one you are creating that is getting called.

When I forward to a view I try to be very explicit like:

$c->forward($c->view('html')) || $c->log->error("Can't find the html view.");

I find this helps. So try looking in your list of installed components to see if Html is being matched someplace else. Also please let me know what you goal here is, that way maybe we can advise a bit better. Good Luck

--John





____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html


orasnita at gmail

Mar 7, 2007, 10:44 PM

Post #9 of 9 (307 views)
Permalink
Re: reserved words [In reply to]

Ok, thank you all for your help.

Octavian

----- Original Message -----
From: John Napiorkowski
To: The elegant MVC web framework
Sent: Wednesday, March 07, 2007 11:23 PM
Subject: Re: [Catalyst] reserved words




From: John Napiorkowski
This is the error message you get if you create a subclass of Catalyst::View that doesn't implement a process() method. It probably doesn't have anything to do with the name of the module...

I have tried:

perl script/myapp_create.pl view Show

After restarting the application, it gives that error. If I do instead:

perl script/myapp_create.pl view Html

The application works fine after restarting it. Am I doing something wrong?

Thanks.

Octavian

I'd personally be interested in seeing what the generated files look like. Could you attach them in your response (or post them someplace we can see?)

Hi,

Here is the first one (Show.pm):

package TranzactiiBursiere::View::Show;

use strict;
use warnings;
use base 'Catalyst::View';

=head1 NAME

TranzactiiBursiere::View::Show - Catalyst View

=head1 DESCRIPTION

Catalyst View.

=head1 AUTHOR

A clever guy

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;

And here it is the second one that works (Html.pm):

package TranzactiiBursiere::View::Html;

use strict;
use warnings;
use base 'Catalyst::View';

=head1 NAME

TranzactiiBursiere::View::Html - Catalyst View

=head1 DESCRIPTION

Catalyst View.

=head1 AUTHOR

A clever guy

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;


If I just delete the file Show.pm and restart the server, the program works fine, but if I put it back and restart, it gives that error.
I have seen the same thing under Linux and Windows.

Thanks.


As others have pointed out, when you use $c->forward(...) that target needs a process method. I try to think of modules that I forward to as being implementations of the "Command" design pattern, or part of a Pipeline pattern, instead of a module that is actually instantiated and consumed. At least that's the way I try to make sense of all the different ways you can access Catalyst modules.

I'm guessing that the reason Html works is that you actually have a different Html modules or Action somewhere in the path that works correctly, and it is that module and not the new one you are creating that is getting called.

When I forward to a view I try to be very explicit like:

$c->forward($c->view('html')) || $c->log->error("Can't find the html view.");

I find this helps. So try looking in your list of installed components to see if Html is being matched someplace else. Also please let me know what you goal here is, that way maybe we can advise a bit better. Good Luck

--John



------------------------------------------------------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.


------------------------------------------------------------------------------


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.