Re: [Catalyst] Error: You requested a stash, but one does not exist
Hello John, On Monday, February 23, 2015, John Napiorkowski jjn1...@yahoo.com wrote: ...The likely reason is that about 9 months ago the stash was moved to the middleware layer, which makes it context bound and you are asking for the stash in application scope Yes - you are right. Completly forgot about this - while I stuck in developing on Perl 5.18/Catalyst 5.8 until yesterday. The error was indeed still using stash within application scope. After moving all stash access from application scope into the controller scope (root controller) everything works again as expected. Thanks for your valueable hint. Regards Johannes ___ 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] How to specify port of Catalyst::Scriptrunner permanently?
Hi there, Situation: I want to run my Catalyst app on a Windows-Server as a service (via script app_server.pl / Catalyst::Scriptrunner). Doing so, Im unfortunatly not able to specify the http-port via commandline. Question: Is there an alternative method to specify to port for Catalyst::Scriptrunner than specifying it via commandline? As the script app_server.pl to start the server only contains the lines BEGIN { ENV{CATALYST_SCRIPT_GEN} = 40; } use Catalyst::ScriptRunner; Catalyst::ScriptRunner-run(BDBInfo2, Server); 1; I dont understand how the commandline parameters are evaluated - and Im not able to manipulate the commandline parameters within the script therefore. Thanks in advance ... Johannes ___ 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] Error: You requested a stash, but one does not exist
Hi there, I just set up a new virtual machine with WinServer 2012. Ive installed Strawberry Perl 5.20.1 and installed all needed modules from CPAN. My Catalyst-Application starts up correctly (no error seen) as Catalyst Standalone Server. Trying to access via Webbrowser (http://localhost:3000) runs into an error: Caught exception in Engine: You requested a stash, but one does not exist at .sitelibCatalyst.pm line 517. The very same application runs without any complaints on my old VM (Win2003 Server, Strawberry Perl 5.18.0) Any ideas whats going wrong? Johannes ___ 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] Using external URLs?
Hi there, I've got a probably simple question, but cannot figure it out yet. I'm using Template::Toolkit and Catalyst - and I'm having problems with absolute URLs ... Within my Template I have the following absolute URL: a href=http:\\myserver1\test.htmlblabla/a After processing the Template (via Catalyst::View::TT) my previously correct URL is modified to: http:\\mycatalystserver\myserver1\test.html (where mycatalystserver is the server where catalyst runs ...) Who modifies my URL - Catalyst or Template::Toolkit? (I think it's catalyst - since within my template I do only have plain text in the eyes of Template::Toolkit ...) And most important How can I suppress this modification to be able to use the original URL? Thanks in advance Johannes -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ 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 external URLs?
Hi all, I don't dare to confress - but I have to ... ;-) Me idiot: I only had a singel forward-slash after http: instead of double forward slashes! Sometimes I'm really blind ... Mea culpa. Thanks anyway Johannes -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ 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] (no subject) - XML-Views: Using XML-Simple ...
Hi there, first of all: sorry for using no topic on my initial mail - I changed this now ... On 28 Feb 2012, at 13:03, Johannes Kilian wrote: Hi, I've got following question concerning views: I want to provide an XML-View which provides standard XML-Files using XML::Simple in almost any case. Just in some cases I want to provide specialized XML-Files. On 29 Feb 2012, at 1:32, Thomas Doran wrote: Erm, why are you not just sending your already rendered standard XML file? Within my controller in most cases the XML-structure generated by XML::Simple is sufficent. But certain URL should give a predefined XML-structure which I cannot achieve via XML::Simple ... My controller renders a few data structures - depending on the URL. With certain URL's I want a clearly defined XML-Structure - in other cases where I don't want/need to have a generic XML Structure the XML::Simple Output is sufficent ... On 28 Feb 2012, at 21:25, Kieren Diment wrote: I'd either use Catalyst::View;:Download::XML, or steal from it to create your own view: https://metacpan.org/module/Catalyst::View::Download::XML I'll have to look into this ... On 29 Feb 2012, at 11:35, Will Crawford wrote: $c-stash(current_view = '...'); Then override that either in an individual action or part of a chain ... ... and into this as well! Johannes -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ 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] (no subject)
Hi, I've got following question concerning views: I want to provide an XML-View which provides standard XML-Files using XML::Simple in almost any case. Just in some cases I want to provide specialized XML-Files. In other words: I want to use XML::Simple as default handler - which is overriden by a specialized XML Generator in some cases ... Within my controller I do have something like this: __PACKAGE__-config( 'default' = 'text/html', 'stash_key' = 'rest', 'map' = { 'text/html' = [ 'View', 'TT', ], 'text/xml' = [ 'View', 'XML', ], #'text/xml' = 'XML::Simple', } ); - I cannot figure out how to set XML::Simple as default handler and override this for certain URLs within the same controller whilst for other URLs within the same controller the default XML-Handler is used Is this possible at all? How can I do this? Thanks in advance Johannes -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ 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] Questions with Authentication/Authorization [FINAL SOLUTION]
Hello, just for completeness the final solution. Tomas Doran [bobtf...@bobtfish.net] wrote: The best solution is to subclass Catalyst::Authentication::Store::DBIx::Class::User in your application (as MyApp::User or whatever), then re-implement the 'roles' method to do the right thing for your Database.. Here my reimplementation of roles: -- package 'MyApp::User; use strict; use warnings; use base qw(Catalyst::Authentication::Store::DBIx::Class::User); sub roles { my ( $self ) = shift; ## this used to load @wantedroles - but that doesn't seem to be used by the roles plugin, so I dropped it. ## shortcut if we have already retrieved them if (ref $self-_roles eq 'ARRAY') { return(@{$self-_roles}); } my @roles = (); if (defined($self-_user)) { my $role_relation = $self-config-{'role_relation'}; my $role_field = $self-config-{'role_field'}; push @roles,$self-_user-$role_relation-$role_field; } $self-_roles(\@roles); return @{$self-_roles}; } --- Tomas Doran [bobtf...@bobtfish.net] wrote: You can then set the store_user_class config option to 'MyApp::User', and everything should work as expected.. Within my configuration I did the following: --- authentication: registered: store: class: DBIx::Class user_model: BDB::Userinfo user_field: userinfo_kuerzel role_relation: fk_bdbrolle_pk role_field: bdbrolle_name store_user_class: MyApp::User --- Voila - that was it. Everything works as expected (as Thomas predicted) Thank you for your support Johannes -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ 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] Questions with Authentication/Authorization
Hi, As a beginner with Catalyst authentication I've got a few questions on which I'm struggling at the moment: Starting situation: * I've got to authenticate the user against a database to get the role (each user only can have ONE role) In my database there are two tables: USERINFO - containig attributes for PK, USERNAME (attributename: userinfo_kuerzel) and foreign key to table ROLE (attribute name: fk_bdbrolle_pk) ROLE - containig attributes for PK and ROLE (attribute name: bdbrolle_name) Within my catalyst configuration I've the following realm configured: authentication: default_realm: db realms: db: credential: class: Password password_field: userinfo_password password_type: clear store: class: DBIx::Class user_model: BDB::Userinfo user_field: userinfo_kuerzel role_relation: fk_bdbrolle_pk role_field: bdbrolle_name I succeeded to authenticate against this realm: -- if ($c-authenticate({userinfo_kuerzel = $username, userinfo_password = ''}, db) ) { # Authenticate against realm ... # The username is available here via $c-user-userinfo_kuerzel; # so my realm seems to get data ... # The role is available here via $c-user-fk_bdbrolle_pk-bdbrolle_name; # so my realm seems to get data ... # $c-assert_user_roles( qw/Wizard/ ); # This fails!! but $c-user-fk_bdbrolle_pk-bdbrolle_name IS Wizard $c-stash-{template} = 'index.tt'; $c-forward( $c-view('TT') ); } * Within index.tt I try to access the username and role - which also works. I use something like this: [% IF c.user %]Willkommen, [% c.user.userinfo_kuerzel %]([% c.user.fk_bdbrolle_pk.bdbrolle_name %])[% ELSE %]Not logged in[% END %] -- Questions: * Isn't $c-user a persistent value within $c? When I try to access to c.user later (after successfull login) $c-user is undefined. What is neccessary to make it persistent? * When I try to check the user role for example via $c-assert_user_roles( qw/Wizard/ ); (c.user.fk_bdbrolle_pk.bdbrolle_name has been Wizard in my example) this fails completely: Caught exception in BDBInfo2::Controller::Root-login Can't locate object method search via package BDBInfo2::Model::BDB::Bdbrolle at .../Catalyst/Authentication/Store/DBIx/Class/User.pm line 144. What's wrong here? I tried several things - but cannot find any solution yet ... Any help welcome - Thanks in advance! Johannes -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ 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] [Beginner] How to get 'Chained' to work`?
Am 15.04.2010 14:56, schrieb Steve: Actually, I found the documentation in Catalyst::DispatchType::Chained to be fairly comprehensive. You might want to give it a once-over. You're right: reading the mentionend documentation is indeed fairly comprehensive. Am 15.04.2010 16:04, schrieb Tomas Doran: Johannes Kilian wrote: Thank you - that was the problem ... It's difficult to find a documented entry to this (Chained/Args/CaptureArgs ...) with (nearly) zero knowledge. Can you tell us where you tried to look for the info, and I'll make sure some helpful hints get added too the documentation? Cheers t0m My main error was (as a catalyst beginner): having an isolated view on the chained argument not recognizing that chained - args - PathPart - CaptureArgs are related so closely. Having understood the Chained-mechanism, it's clear that it has to be so - but the first barrier to get this understanding was too high. Mainly I used The definitive Guide to Catalyst-book as first approach - from which I assumed to be a step by step tutorial (which it is - but the steps are bigger than I realized in this case). I started the tutorial just in the middle (not having all prerequisites) and started testing it, without having all the comprehensive information - and run into the discussed questions ... (And most badly: I used a helpfile which don't have Args und CaptureArgs in the search index - but Chained was available, so I thought, there's no docu on those Arguments ...) After rereading everything - there's all information available. I just followed the old principle Engineers don't read manuals (or if they do, they only read small parts - which I did ... ;-) Cheers Jo ___ 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] [Beginner] How to get 'Chained' to work`?
Hi there, I'm pretty at the beginning of understanding how catalyst works - and have a problem to figure out the chaining mechanism ... I've got a simple basic catalyst project with only the root controller - containing the following code: --- sub base_method : Chained('/') PathPart('test') CaptureArgs(0) { my ( $self, $c ) = @_; $c-log-debug(Matched testIt::Controller::Root::base_method); } sub view : Chained('base_method') PathPart('') CaptureArgs(1) { my ( $self, $c, $id) = @_; $c-log-debug(Matched testIt::Controller::Root::view - id:$id); } --- (I just commented out the default-Function in the Root-Controller and put the above lines in ...) Starting my server (testIt_server.pl) gives the following output: --- ... .--+--. | Class| Type | +--+--+ | testIt::Controller::Root | instance | '--+--' [debug] Loaded Private actions: .--+---+--. | Private | Class | Method | +--+---+--+ | /base_method | testIt::Controller::Root | base_method | | /end | testIt::Controller::Root | end | | /view| testIt::Controller::Root | view | '--+---+--' [debug] Loaded Chained actions: .---+--. | Path Spec | Private | +---+--+ '---+--' ... --- Why are there no entries in the table [debug] Loaded Chained actions? Running the test-server using address http://pcjok:3000/test/1; (which I suppose to work) leads to Unknown resource test/1... What's wrong? (Running ActiveState Perl 5.8.8, Catalyst 5.80012 on WinXP SP2 - for some reasons I'm bound to this environment ...) Any help welcome! Thanks in advance .. Jo ___ 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] [Beginner] How to get 'Chained' to work`?
Thank you - that was the problem ... It's difficult to find a documented entry to this (Chained/Args/CaptureArgs ...) with (nearly) zero knowledge. Jo Am 15.04.2010 14:34, schrieb Steve: The final 'link' in the chain must have :Args(1) instead of CaptureArgs(1). This subtlety is what tells the dispatcher that this is the last link in the chain. Steve On 4/15/2010 8:24 AM, Johannes Kilian wrote: Hi there, I'm pretty at the beginning of understanding how catalyst works - and have a problem to figure out the chaining mechanism ... I've got a simple basic catalyst project with only the root controller - containing the following code: --- sub base_method : Chained('/') PathPart('test') CaptureArgs(0) { my ( $self, $c ) = @_; $c-log-debug(Matched testIt::Controller::Root::base_method); } sub view : Chained('base_method') PathPart('') CaptureArgs(1) { my ( $self, $c, $id) = @_; $c-log-debug(Matched testIt::Controller::Root::view - id:$id); } --- (I just commented out the default-Function in the Root-Controller and put the above lines in ...) Starting my server (testIt_server.pl) gives the following output: --- ... .--+--. | Class| Type | +--+--+ | testIt::Controller::Root | instance | '--+--' [debug] Loaded Private actions: .--+---+--. | Private | Class | Method | +--+---+--+ | /base_method | testIt::Controller::Root | base_method | | /end | testIt::Controller::Root | end | | /view| testIt::Controller::Root | view | '--+---+--' [debug] Loaded Chained actions: .---+--. | Path Spec | Private | +---+--+ '---+--' ... --- Why are there no entries in the table [debug] Loaded Chained actions? Running the test-server using address http://pcjok:3000/test/1; (which I suppose to work) leads to Unknown resource test/1... What's wrong? (Running ActiveState Perl 5.8.8, Catalyst 5.80012 on WinXP SP2 - for some reasons I'm bound to this environment ...) Any help welcome! Thanks in advance .. Jo ___ 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/ No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2811 - Release Date: 04/14/10 14:31:00 ___ 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/