Re: [Catalyst] Hangs in RenderView in end
On 6 Jul 2009, at 05:33, Gunnar Strand wrote: Wow, that's a fairly unexpected gotcha. Any chance of a doc patch to make it easier for the next poor soul who gets stuck on this? Sure. Where would you like it? A 'NOTES' or 'CAVEATS' section in the POD for Catalyst::View::TT is the best place I can think of right now. Write something and it can go somewhere else if anyone has a better idea? Cheers t0m ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On 6 Jul 2009, at 06:30, kakim...@tpg.com.au wrote: In the past, when I had to work with just DBI, I would manually start a transaction and commit it at the end if no exceptions occur. In the case of the latter, I will call a rollback. This is fairly easy to get wrong - txn_do forces you to have a block which comprises the transaction scope, or your code won't compile. It will start a transaction at the start of the block, and commit it at the end if an exception hasn't been encountered during the transaction How do I do it here in Catalyst/DbiX::Class land? I tried to read up the http://kobesearch.cpan.org/htdocs/DBIx-Class/DBIx/Class/ Storage.html#txn_do doc but I can't see how the example can apply to Catalyst. It says, $schema-txn_do($coderef) to get the schema but in catalyst, we access the database tables directly. For example, $c-model('myAppDB') gets the schema I'm a bit confused and have looked in a few places. Can anyone please educate me? $c-model('myAppDB')-txn_do( sub { my $rs = $c-model('myAppDB::Table')-search(..); # Etc etc die(Rollback) if $foo; # Exceptions cause rollback # Etc etc # If you get here, to the end, transaction is committed for you. }); Can you please supply a doc patch for one or two of the places you looked to find this information which will explain it more clearly for the next person? Cheers t0m ___ 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] Custom error handling
hello Tomas, thank you. I will look into fine tuning it in the future. Will read more. K. akimoto But throwing strings around is however a perfectly valid technique. ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
hello there, Tomas, Thank you :) Yes, you're quite right there:) Prior to receiving this reply, I actually wrapped my existing code in the subroutine within an sub for the txn_do. sub save_complete_records { ... eval { $c-model('myAppDB')-schema-txn_do( sub { ... $c-forward( '/subscriptions/_save_address', [ { 'policy_id' = $policy_id, } ] ); ... } if ($@) { $c-log-debug(' Exception manually trapped here : ' . $@ ); $c-model('myAppDB')-schema-txn_rollback or die Cannot ROLL BACK - Address module; $c-log-debug(' manually rolled back' ); $c-error( q{ An error has occured with the listing. If this problem } . q{persists please contact our helpdesk at helpd...@insuranceline.}. q{com.nz.} ); } } To test, I purposedly entered a very long string for one of the database attributes to make the transaction fail. I have the following questions: 1) I looked at the terminal with all the debug messages. I noticed that the exception was caught and eventhough the roll back was done, I do not see the print outs from the liens within the if ($@) (exception handling) section above. Why is that? 2) I noticed that whilst the rollback was successful. the sequence do not get rolled back. IS this desired behaviour of DBIx::Class? To illustrate, before the exception was caught, an entry was made in my User_Subscriptions database table. The ID was printed out and I took note of it. When the operation was complete, I queried my User_Subscriptions database table (using psql for postgresql for an entry of the noted ID). No entry of the noted ID was returned. I went back to the webpage and entered the form with valid attributes and yes, all necessary objects were created in the database backend and the sequence in the User_Subscriptions database table had increased by 1. Any ideas, Tomas and everyone? :) thank you :) k. akimoto On Mon, Jul 6th, 2009 at 6:18 PM, Tomas Doran bobtf...@bobtfish.net wrote: This is fairly easy to get wrong - txn_do forces you to have a block which comprises the transaction scope, or your code won't compile. It will start a transaction at the start of the block, and commit it at the end if an exception hasn't been encountered during the transaction ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
Tomas Doran wrote: $c-model('myAppDB')-txn_do( sub { my $rs = $c-model('myAppDB::Table')-search(..); # Etc etc die(Rollback) if $foo; # Exceptions cause rollback # Etc etc # If you get here, to the end, transaction is committed for you. }); And I'm crap. You need $c-model('myAppDB')-schema-txn_do( sub { Cheers t0m ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
hi Tomas and everyone:) I still have some questions as per my prev post. Can you please help me out? :) I have the following questions: 1) I looked at the terminal with all the debug messages. I noticed that the exception was caught and eventhough the roll back was done, I do not see the print outs from the liens within the if ($@) (exception handling) section above. Why is that? 2) I noticed that whilst the rollback was successful. the sequence do not get rolled back. IS this desired behaviour of DBIx::Class? To illustrate, before the exception was caught, an entry was made in my User_Subscriptions database table. The ID was printed out and I took note of it. When the operation was complete, I queried my User_Subscriptions database table (using psql for postgresql for an entry of the noted ID). No entry of the noted ID was returned. I went back to the webpage and entered the form with valid attributes and yes, all necessary objects were created in the database backend and the sequence in the User_Subscriptions database table had increased by 1. .snip. And I'm crap. You need $c-model('myAppDB')-schema-txn_do( sub { Cheers ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Can anyone confirm this? Thank you:) This is fairly easy to get wrong - txn_do forces you to have a block which comprises the transaction scope, or your code won't compile. It will start a transaction at the start of the block, and commit it at the end if an exception hasn't been encountered during the transaction ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On 6 Jul 2009, at 12:38, kakim...@tpg.com.au wrote: So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Did you look what the code does? http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/lib/DBIx/Class/Storage.pm and http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/t/81transactions.t See sub txn_do. It begins a transaction, runs your coderef inside an eval, rolls back the transaction if the eval raises an exception. However, this is NOT a Catalyst question. Please subscribe to the DBIx::Class users list at: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ and ask these questions there. Many of the subscribers are the same, but many Catalyst users don't use DBIx::Class, and many knowledgeable DBIC users are not subscribed here. It's just good hygiene to ask the questions in the appropriate places. Questions specific to Catalyst::Model::DBIC::Schema are fine here, but you must realise that everything after C $c-model(MyDBICSchema) or C $c-model(MyDBICSchema::MyResultSetClass) is handled by DBIx::Class and has nothing to do with Catalyst? Thanks, /joel ___ 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] default : Local v. default : Path
We just upgraded from 5.80005 to 5.80007 and default : Local is no longer matching $controller/ (i.e. requires $controller/default) I was curious what the difference is, and flagging it for anyone else. FWIW, IMO, http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Intro.pod#Built-in_special_actionsis a slightly odd place to be documenting in reference style the actions. Is there another place? This is one of those things I keep expecting has a home and then eventually finding back in the Manual's intro. Paul ___ 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] Integrating with ASP.NET sessions and authentication
I was wondering if anyone has integrated a Catalyst application with ASP.NET session and authentication (for single sign-on if possible). My company recently go acquired and we've been told to integrate our systems with theirs (ASP.NET). I know next to nothing about how .NET works and was hoping someone had already done the heavy lifting for me :-). Cheers, Rob ___ 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] default : Local v. default : Path
On 6 Jul 2009, at 18:14, Paul Makepeace wrote: We just upgraded from 5.80005 to 5.80007 and default : Local is no longer matching $controller/ (i.e. requires $controller/default) I was curious what the difference is, and flagging it for anyone else. Yes, sorry about that - it's a regression / correctness fix. 5.80005 considered anything called 'default' to be a default method, no matter what attributes you have it - which was a huge pile of fail.. The incorrect behavior was: sub default : Chained('/') PathPart('foobarbaz') Args(0) = became / mycontrollernamespace/.* The correct behavior is: sub default : Local = asking for mycontrollernamespace/default sub default : Private = asking to be last-case fallback for mycontrollernamespace/.* This is somewhat a regression on 5.7, and somewhat a fix - as we now correctly handle priorities in all cases with default / Path actions, allowing the most specific action to match in all cases. FWIW, IMO, http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/ lib/Catalyst/Manual/Intro.pod#Built-in_special_actions is a slightly odd place to be documenting in reference style the actions. Is there another place? This is one of those things I keep expecting has a home and then eventually finding back in the Manual's intro. I totally agree. Please nominate where it should be (where did you look hardest that it wasn't), and we'll put it there instead, with the clarifications to the expected behavior you're about to make if it isn't crystal as-is.. :) Cheers t0m ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On 6 Jul 2009, at 12:32, kakim...@tpg.com.au wrote: hi Tomas and everyone:) I still have some questions as per my prev post. Can you please help me out? :) Sorry, this is too far into DBIC land for this list IMO. Please ask on that list. Cheers t0m ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On 6 Jul 2009, at 12:38, kakim...@tpg.com.au wrote: So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Can anyone confirm this? Did you even look for this in the manual? http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/ Storage.pm#txn_do If not, why not. If so, how is this not clear? Cheers t0m ___ 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] Themes, skins, templates and componentized UI?
- Original Message From: Gunnar Strand gunnarstr...@yahoo.com To: catalyst@lists.scsys.co.uk Sent: Monday, July 6, 2009 3:55:27 PM Subject: [Catalyst] Themes, skins, templates and componentized UI? Hi, I am a little new in the web design area. I'm trying to design an application where the view part must be simple to replace by whomever installs it, with elements of their own design. This would work comparable to themes or skins. I've done some googling, but I haven't got any obvious hits on this. The closest I _think_ is CatalystX::Usul, but I haven't really understood if that's what I'm looking for :-) Also, I would also want the person installing the application to be able to restructure the visual parts using components, where a component could for instance be a result ticker, main menu, member table or such. Perhaps in the way that Joomla does, but the components will be application specific. It's much a matter of deciding what components are present in which views and where. I imagine, for instance, a collection of widgets (button, drop-down-list, text field etc) which are reused in the TT templates. A component would then use these widgets as building blocks, populating them using data from the stash. A view (webpage) would be a template including one or more of these components. A theme could then override any widgets of choice to change the look-and-feel of the whole application instantly. Am I approaching this from the right direction and does anyone know if there exists a framework similar to this to use with Catalyst? Or should I perhaps go barking up the TT tree? ;-) KR, Gunnar --- The closet think to something componentized on the UI side would be Reaction, http://search.cpan.org/~mstrout/Reaction-0.002000/ but that has very high development and I think you'd have to be willing to get your hands dirty with the code. Although someone actually using it may correct me :) John ___ 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] Polymorphism?
I'm just wondering if any Catalyst programmers have used polymorphism in the construction of their controller classes. Coming from a Java background I'd like to be a little more OOP about how I implement my controllers. i.e. I'd like to be able have a parent controller with common behavior and override that behavior as necessary in my child classes but still work with the generic parent class. However, I've gotten in the habit of using actions for my application flow. I know it's possible to use chained actions to carry behavior down and I've used that in certain situations but it's not truly polymorphic for generic coding. I'm not sure if I could be utilizing the NEXT library to more advantage. Any thoughts, comments, best practices, tips you've discovered, etc? -Eric ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
Did you look what the code does? http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/lib/DBIx/Class/Storage.pm and http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/t/81transactions.t If the API doc is written well, I suppose one doens't need to look at the source code (unless forced to). I must admit that I didn't fallback to looking at the regression test. I will do so next time:) See sub txn_do. It begins a transaction, runs your coderef inside an eval, rolls back the transaction if the eval raises an exception. Yes I did but at that point in time, the documentation on txn_do wasn't that clear. I think someone must have updated it since this question was raised. However, this is NOT a Catalyst question. Please subscribe to the DBIx::Class users list at: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ and ask these questions there. Many of the subscribers are the same, but many Catalyst users don't use DBIx::Class, and many knowledgeable DBIC users are not subscribed here. It's just good hygiene to ask the questions in the appropriate places. there's somethign wrong with the mailing list for Dbix::Class as I have not been able to get replies /mails. I have contacted the admin in the past and never got any reply. I will retry. Nevertheless, given that Dbix::Class is of the choice for catalyst, I figured the grey area here may see my questions lucky enough to have some replies from the many who use Dbix::Class for their Catalyst apps. ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
Did you even look for this in the manual? http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/ Storage.pm#txn_do If not, why not. If so, how is this not clear? Well, it's really clear now . I suppose someone has updated the documentation since I posted this thread up. ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On Monday 06 July 2009 05:37:49 pm kakim...@tpg.com.au wrote: Did you even look for this in the manual? http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/ Storage.pm#txn_do If not, why not. If so, how is this not clear? Well, it's really clear now . I suppose someone has updated the documentation since I posted this thread up. That's the same version of the same doc as you mentioned in the first post of the thread :) Andrew ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On Mon, Jul 6, 2009 at 3:36 PM, kakim...@tpg.com.au wrote: However, this is NOT a Catalyst question. Please subscribe to the DBIx::Class users list at: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ and ask these questions there. Many of the subscribers are the same, but many Catalyst users don't use DBIx::Class, and many knowledgeable DBIC users are not subscribed here. It's just good hygiene to ask the questions in the appropriate places. there's somethign wrong with the mailing list for Dbix::Class as I have not been able to get replies /mails. I have contacted the admin in the past and never got any reply. I will retry. Nevertheless, given that Dbix::Class is of the choice for catalyst, I figured the grey area here may see my questions lucky enough to have some replies from the many who use Dbix::Class for their Catalyst apps. Considering the same people/software/servers run both the DBIC list and the Catalyst list, I'm going to assume you're both lazy and inept. Doubly so for re-asking the question immediately on the Catalyst list. You are not entitled to get free help just because you can compose an email. あなたは怠け者。 ___ 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] how to implement Transactions (over different db tables) in a Catalyst project
On Tue, Jul 7th, 2009 at 8:54 AM, J. Shirley jshir...@gmail.com wrote: On Mon, Jul 6, 2009 at 3:36 PM, kakim...@tpg.com.au wrote: there's somethign wrong with the mailing list for Dbix::Class as I have not been able to get replies /mails. I have contacted the admin in the past and never got any reply. I will retry. Sorry if it caused any inconvenience , guys:( Considering the same people/software/servers run both the DBIC list and the Catalyst list, I'm going to assume you're both lazy and inept. Doubly so for re-asking the question immediately on the Catalyst list. You are not entitled to get free help just because you can compose an email. $B$$J$?$OBU$1T!#(B ___ 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] Parse errors: Tests out of sequence - any ideas?
hello, everyone, I jsut tried to run my regression tests to see if things were ok or not. I found that they fail due to Parse errors: Tests out of sequence. I took one of the regression test files and stripped down the tests to about 5 basic tests. Ran prove -v t/regression test file.t and still fails with this message: ok 4 - Successfully loaded sign_up page 1..4 Failed 1/4 subtests Test Summary Report --- t/controller_Agents.t (Wstat: 0 Tests: 3 Failed: 0) Parse errors: Tests out of sequence. Found (2) but expected (1) Tests out of sequence. Found (3) but expected (2) Tests out of sequence. Found (4) but expected (3) Bad plan. You planned 4 tests but ran 3. I tried searching on google but I just don't know what's causing this. Any ideas would be welcomed. Thank you K. akimoto ___ 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] Polymorphism?
On Mon, 6 Jul 2009, J. Shirley wrote: Moose method modifiers work just fine on Catalyst code, which I find to really help with using inheritance upstream. You'll probably want to As do Moose roles. I've found using roles in controllers incredibly helpful, since I often have similar/same process this data and invoke a -search method, where the only thing that varies is what is being searched and/or the way the results are being displayed. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */ ___ 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/