Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST
AJAX call myJSON = $.parseJSON(json); } This is working fine, what shift in paradigm are you trying to create and how would it affect / alter what I currently do, or indeed make it any easier / simpler, I can't see it getting much simpler than the few lines of code I already have, can it? Or am I doing something wrong? Cheers, Craig Chant. -Original Message- From: John Napiorkowski [mailto:jjn1...@yahoo.com] Sent: 12 August 2013 21:27 To: The elegant MVC web framework Subject: Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST On Monday, August 12, 2013 2:33 PM, Alexander Hartmaier alexander.hartma...@t-systems.at wrote: On 2013-08-12 16:58, John Napiorkowski wrote: Hey Bill (and the rest of you lurkers!) I just updated the spec over at https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNeg otiation/blob/master/README.pod I decided to remove regular expression matching from the body parser stuff, which I think resolves the merging questions (since now there will not be a possibility that more that one can match the request). I think we can add this back eventually using some standard request content negotiation, using mime type patterns and quality settings, so that we can have some rules that dictate what is the best match, rather than try to invent our own. For example: https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotia tion The idea would be to not reinvent. I think we could instead of doing an equality match here we just use something like this to figure out what the best match is works pretty well. Thoughts? jnap Hi John, I thought about it for the last few days and wonder why the, lets call it rendering, of the data isn't left to the view as defined by the MVC pattern? I'd expect that a different view is used depending on the negotiated content-type. How do other MVC frameworks choose the view to use? Should a single action be able to limit the output format or is controller level granular enough? Best regards, Alex Alex, I think you put your finger on one of the major uneasiness I (and others) have around the idea of having in the global application model all these registered formatters. Yes, in theory it feels like we are cheating on the View side of MVC. I have personally always thought that Catalyst doesn't exactly get it right the way it is (I think C and V are actually a little too detached for one thing) and that leads to odd code sometimes. The commonly used Catalyst::Action::Renderview is a bit too detached for my taste. And what we call a View tends to mostly just be a View handler (or factory I guess). On the other hand the basic idea of separation of concerns is sound. I think the main thing is that this is not intended to replace view, but for the simple cases where people just want to quickly serialize data (like for all those ajax endpoints you need to do nowadays, not full on RESTful APIs but quick and dirty communication between the back and front end. Maybe that's not a great thing for Catalyst (and honestly I put this out there in the hopes of provocation some strong reactions. Personally I prefer to use templates even for creating JSON output, I think you get cleaner separation that is easier to maintain over time (I really don't like when I see something like -body (json_encode $sql-run-get_all_rows). That feels fragile to me. On the other hand I see the attraction of some of the more lightweight web frameworks where they make it easy to just spew out JSON. This is partly why I sketched out an action/controller level alternative, with the proposed response-body_format thing and the proposed new action subroutine attributes (just to recap) sub myaction :Local { My ($self, $c) = @_; # ... # ... $c-response-format( 'application/json' = sub { json_encode $stuff }, # ... # ... ); } I think this approach feels similar to how some other frameworks operate. Some offer more sugary syntax for the common stuff, perhaps $c-response -json( sub { ... } ) -html ( sub { ... } ). - ... - ... ; and I guess we could say there's a shortcut to forward to a View instead $c-response -json(JSON) -html (TTHTML). - ... - ... ; But that can all be worked out after the basic thought is in place. and again, some other frameworks (some java system) they use annotations similar to our action level subroutine attributes. I think we also try to hit that with the proposed Provides/Consumes attributes. The main thing is I can't see a way to properly do content negotiatin with ssubroutine attributes given the exiting catalyst dispatcher (basically the system is mostly a first match win) Perhaps
Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST
On 2013-08-12 16:58, John Napiorkowski wrote: Hey Bill (and the rest of you lurkers!) I just updated the spec over at https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNegotiation/blob/master/README.pod I decided to remove regular expression matching from the body parser stuff, which I think resolves the merging questions (since now there will not be a possibility that more that one can match the request). I think we can add this back eventually using some standard request content negotiation, using mime type patterns and quality settings, so that we can have some rules that dictate what is the best match, rather than try to invent our own. For example: https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotiation The idea would be to not reinvent. I think we could instead of doing an equality match here we just use something like this to figure out what the best match is works pretty well. Thoughts? jnap Hi John, I thought about it for the last few days and wonder why the, lets call it rendering, of the data isn't left to the view as defined by the MVC pattern? I'd expect that a different view is used depending on the negotiated content-type. How do other MVC frameworks choose the view to use? Should a single action be able to limit the output format or is controller level granular enough? Best regards, Alex On Friday, August 9, 2013 5:38 PM, John Napiorkowski jjn1...@yahoo.com wrote: On Friday, August 9, 2013 4:52 PM, Bill Moseley mose...@hank.org wrote: On Fri, Aug 9, 2013 at 12:11 PM, John Napiorkowski jjn1...@yahoo.com wrote: What's the use case you have in mind? Something like first check for something like 'application/vnd.mycompany.user+json' and then fall back to 'application/(?:vmd.*+)?json' if you don't find it? Is that an actual case you've come across? Ya, that's kind of what I was thinking. Or also having a final fallback parser that tries to figure out the type by other means than just looking at the Content type provided in the request. Or even a '.' final match-anything that does some special logging. It would be easy enough to find out if application/json was in the array more than once by mistake. Seems like a reasonable use case then, although I would encourage future development to aim at putting more specificity in the controller, rather than rely on the global application. The primary reason to have anything here at all is to have a base people can build on. I do fear the globalness of it, but it seems not an unreasonable compromise based on how Catalyst actually works today. We've spoken before about the parsing larger incoming and chunked data thing before. I would love to address this, but right now it seems like something we need better agreement on in the psgi level. For example, since star man already buffers incoming input, it feels silly to me to have catalyst then try to re-stream that. You've already paid the full price of buffering in terms of memory, and performance right? Or am I not understanding? I added a Plack middleware to handle chunked encoded requests -- I needed it for the Catalyst dev server and for Apache/mod_perl. Yes, Starman already de-chunks and buffers and works perfectly. Apache actually de-chunks the request, but doesn't update the Content-Length header and leaves on the Transfer-Encoding: chunked header. So, sadly, I do flush this to a temporary file only to get the content-length to make Catalyst happy. Right, so I think in the end we all agreed it was psgi that should be responsible for dealing with chunks or whatever (based on the http level support of the server). The only think would be could there be some sane approach that exposed the input stream as a non blockable file handle that has not already been read into a buffer (memory or otherwise). I do see the possible advantage there for processing efficiently large POST or PUT. However again this needs to be done at the PSGI level, something like input.stream or similar. That would smooth over chucked versus non chunked and expose a readable stream of the input that has not yet been buffered. I'd really like to have something at the Catalyst level that sanely acheives this end, but I think part of the price we paid when going to PSGi at the core, is that most of the popular plack handlers are pre loading and buffering input, even large request input. This seems to be an area where it might behoove us to work with the psgi group to find something stable. Even the optional psgix.io isn't always going to work out, since some people don't want to support that in the handler (its a somewhat vague definition I guess and makes people uncomfortable). Until them, or until someone helps me understand that my thinking is totally wrong on this score, it seems the best thing to do is to put this out of scope for now. That
Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST
On 2013-08-12 22:26, John Napiorkowski wrote: On Monday, August 12, 2013 2:33 PM, Alexander Hartmaier alexander.hartma...@t-systems.at wrote: On 2013-08-12 16:58, John Napiorkowski wrote: Hey Bill (and the rest of you lurkers!) I just updated the spec over at https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNegotiation/blob/master/README.pod I decided to remove regular expression matching from the body parser stuff, which I think resolves the merging questions (since now there will not be a possibility that more that one can match the request). I think we can add this back eventually using some standard request content negotiation, using mime type patterns and quality settings, so that we can have some rules that dictate what is the best match, rather than try to invent our own. For example: https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotiation The idea would be to not reinvent. I think we could instead of doing an equality match here we just use something like this to figure out what the best match is works pretty well. Thoughts? jnap Hi John, I thought about it for the last few days and wonder why the, lets call it rendering, of the data isn't left to the view as defined by the MVC pattern? I'd expect that a different view is used depending on the negotiated content-type. How do other MVC frameworks choose the view to use? Should a single action be able to limit the output format or is controller level granular enough? Best regards, Alex Alex, First thanks for the extensive and quick answer! I think you put your finger on one of the major uneasiness I (and others) have around the idea of having in the global application model all these registered formatters. Yes, in theory it feels like we are cheating on the View side of MVC. I have personally always thought that Catalyst doesn't exactly get it right the way it is (I think C and V are actually a little too detached for one thing) and that leads to odd code sometimes. The commonly used Catalyst::Action::Renderview is a bit too detached for my taste. And what we call a View tends to mostly just be a View handler (or factory I guess). On the other hand the basic idea of separation of concerns is sound. I think the main thing is that this is not intended to replace view, but for the simple cases where people just want to quickly serialize data (like for all those ajax endpoints you need to do nowadays, not full on RESTful APIs but quick and dirty communication between the back and front end. Maybe that's not a great thing for Catalyst (and honestly I put this out there in the hopes of provocation some strong reactions. Personally I prefer to use templates even for creating JSON output, I think you get cleaner separation that is easier to maintain over time (I really don't like when I see something like -body (json_encode $sql-run-get_all_rows). That feels fragile to me. On the other hand I see the attraction of some of the more lightweight web frameworks where they make it easy to just spew out JSON. What I have done in my largest Catalyst app, that feeds data to ExtJS using Catalyst::Controler::DBIC::API, is a custom DBIC ResultClass that transforms the values in the HRI-like data structure before it gets serialized to JSON. That extra step of transforming data before serializing it belongs imho into the View, not the controller, because different output formats might need different transformations e.g. datetime format. If content negotiation is the feature to add I'd define which View is responsible for which mime-type. The View class would then become more than a mere glue for e.g. JSON encoding. That should be definable per app, overridden by the Controller config which can be overridden by an action too by e.g. setting a stash or other config var. This is partly why I sketched out an action/controller level alternative, with the proposed response-body_format thing and the proposed new action subroutine attributes (just to recap) sub myaction :Local { My ($self, $c) = @_; # ... # ... $c-response-format( 'application/json' = sub { json_encode $stuff }, # ... # ... ); } I think this approach feels similar to how some other frameworks operate. Some offer more sugary syntax for the common stuff, perhaps $c-response -json( sub { ... } ) -html ( sub { ... } ). - ... - ... ; and I guess we could say there's a shortcut to forward to a View instead $c-response -json(JSON) -html (TTHTML). - ... - ... ; That isn't introspect-able which might be handy for the debug screen to see which action takes what content-type. But that can all be worked out after the basic thought is in place. and again, some other frameworks (some java system) they use annotations similar to our action level subroutine attributes. I think we also try
Re: [Catalyst] How to avoid repeating methods in controllers ?
Hi, generally if you have some classes that have a common number of attributes and/or methods you'd move those in a base class or in more recent time construct it out of roles which are like lego blocks. For your specific case https://metacpan.org/module/CatalystX::Resource looks to be the solution you are looking for. BR Alex On 2013-07-17 04:05, cc loo wrote: Hi all, i'm a network engineer by trade and is picking up perl/catalyst to upgrade my skills :) I have a couple of controllers each having same methods, chaining off their respective 'base' methods. I build my controllers off this guide here: http://search.cpan.org/~ether/Catalyst-Manual-5.9007/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod#Refactor_to_Use_a_'base'_Method_to_Start_the_Chainshttp://search.cpan.org/%7Eether/Catalyst-Manual-5.9007/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod#Refactor_to_Use_a_%27base%27_Method_to_Start_the_Chains So, i have controller_a with a method 'list' , chaining off 'base' controller_b with a method 'list', chaining off' 'base' Is there a more graceful manner of inheriting this method instead of copy/paste on every controller i have ? ___ List: Catalyst@lists.scsys.co.ukmailto: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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Missing Catalyst/Plugin/Authentication/Roles.pm
It might be a mistake in the book, the module's name is Catalyst::Plugin::Authorization::Roles. BR Alex On 2013-07-09 11:59, Drew Poulin wrote: Hello Catalyst mavens, I'm working through the SneakyCat tutorial in chapter 8 of the The Definitive Guide to Catalyst. I've created and edited the files as described in the book, but when I start the development server, it complains that it can't find Catalyst::Plugin::Authentication::Roles.pm: jsocial@linux-b0go:‾/SneakyCat script/sneakycat_server.pl -r -d Can't locate Catalyst/Plugin/Authentication/Roles.pm in @INC (@INC contains: /home/jsocial/SneakyCat/script/../lib /home/jsocial/perl5/lib/perl5/i586-linux-thread-multi /home/jsocial/perl5/lib/perl5 /usr/lib/perl5/site_perl/5.14.2/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.14.2 /usr/lib/perl5/vendor_perl/5.14.2/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.14.2 /usr/lib/perl5/5.14.2/i586-linux-thread-multi /usr/lib/perl5/5.14.2 /usr/lib/perl5/site_perl .) at /usr/lib/perl5/site_perl/5.14.2/Class/Load.pm line 177. Compilation failed in require at /home/jsocial/perl5/lib/perl5/Catalyst/Restarter/Forking.pm line 20. Sure enough, it seems not to be on my machine: jsocial@linux-b0go:‾/perl5/lib/perl5/Catalyst/Plugin/Authentication ls Credential Internals.pod Store User User.pm But when I try to install it, CPAN says it doesn't know anything about it: jsocial@linux-b0go:~ cpan Catalyst::Plugin::Authentication::Roles Reading '/home/jsocial/.cpan/Metadata' Database was generated on Sun, 07 Jul 2013 16:41:02 GMT Warning: Cannot install Catalyst::Plugin::Authentication::Roles, don't know what it is. I haven't been able to find anything indicating there's been a relevant change in the distribution since the book was published. I'm running Perl 5.14.2 and Catalyst 5.9. I would appreciate any suggestions. DP ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] CSV / UTF-8 / Unicode
On 2013-07-02 13:45, Craig Chant wrote: Hi Mike, The data is coming from MS SQL 2008 R2, I have checked the DB and the column is defined as data type nvarchar(max) , so is set to Unicode and when viewing data via SQL Studio Manager, the Unicode characters display fine. I am accessing the DB via DBI and have set on the connection string.. {'RaiseError' = 1, 'mysql_enable_utf8' = 1} MSSQL != MySQL Though I'm not sure if the utf8 setting has any affect when using an MS ODBC driver as the flag implies it's for mysql ? No it doesn't, read your DBD's docs. I tried to apply my $chars = decode('UTF-8', $xls); and I got an error saying you cannot decode a string with wide characters. I don't know what the string is, but when you try to decode you get a wide character error and when you try to encode you get a wide character error. If I don't do anything to it and just output it, no error, but the data is full of junk chars. Where do I go from here? Ensure that the data coming out from your database is properly decoded, then make sure it's properly encoded when outputting it. Never mess with Perls' internal representation of the data by dis-/enabling the utf-8 bit. Thanks, Craig. -Original Message- From: Mike Whitaker [mailto:m...@altrion.org] Sent: 02 July 2013 12:27 To: The elegant MVC web framework Subject: Re: [Catalyst] CSV / UTF-8 / Unicode # encode UTF8 octet use Encode qw(decode encode); my $octets = encode('UTF-8', $xls); OUt of curiousity, where's the data in $xls come from, and what do you know about its encoding and bytes vs characters status? ___ 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/ This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Conduct Authority. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] CSV / UTF-8 / Unicode
On 2013-07-02 14:20, Craig Chant wrote: Hi Alexander, I have read the DBD::ODBC docs and it seems Unicode is ON by default Enabling and Disabling Unicode support On Windows Unicode support is enabled by default So do I assume the data coming from the DB is Unicode encoded already? if so , why does decode fall over? I don't seem able to decode or encode without the app crashing? Do I have non-Unicode chars perhaps? Craig. I'd suggest to test it outside of Catalyst with a simple standalone script. I have neither experience with Perl on Windows nor with ODBC and MSSQL. Ask on the DBIC list or on IRC, some guys use MSSQL successfully there. BR Alex -Original Message- From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at] Sent: 02 July 2013 12:53 To: catalyst@lists.scsys.co.uk Subject: Re: [Catalyst] CSV / UTF-8 / Unicode On 2013-07-02 13:45, Craig Chant wrote: Hi Mike, The data is coming from MS SQL 2008 R2, I have checked the DB and the column is defined as data type nvarchar(max) , so is set to Unicode and when viewing data via SQL Studio Manager, the Unicode characters display fine. I am accessing the DB via DBI and have set on the connection string.. {'RaiseError' = 1, 'mysql_enable_utf8' = 1} MSSQL != MySQL Though I'm not sure if the utf8 setting has any affect when using an MS ODBC driver as the flag implies it's for mysql ? No it doesn't, read your DBD's docs. I tried to apply my $chars = decode('UTF-8', $xls); and I got an error saying you cannot decode a string with wide characters. I don't know what the string is, but when you try to decode you get a wide character error and when you try to encode you get a wide character error. If I don't do anything to it and just output it, no error, but the data is full of junk chars. Where do I go from here? Ensure that the data coming out from your database is properly decoded, then make sure it's properly encoded when outputting it. Never mess with Perls' internal representation of the data by dis-/enabling the utf-8 bit. Thanks, Craig. -Original Message- From: Mike Whitaker [mailto:m...@altrion.org] Sent: 02 July 2013 12:27 To: The elegant MVC web framework Subject: Re: [Catalyst] CSV / UTF-8 / Unicode # encode UTF8 octet use Encode qw(decode encode); my $octets = encode('UTF-8', $xls); OUt of curiousity, where's the data in $xls come from, and what do you know about its encoding and bytes vs characters status? ___ 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/ This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Conduct Authority. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk
Re: [Catalyst] Log::Log4perl::Catalyst
On 2013-05-15 17:54, Duncan Garland wrote: Hi, Has anybody got some examples about how to use this. It looks like you just have to put the following lines in the main package before __PACKAGE__-setup(): use Log::Log4perl::Catalyst; __PACKAGE__-log(Log::Log4perl::Catalyst-new('/path/to/log4perl.conf')); That works up to a point in that the log messages are formatted as I want. However they always go to the STDERR and not to the file given in log4perl.conf. I've used the conf file in a test, so I know it works outside Catalyst. I'm using the Catalyst development server, does that over-ride the logger? The other thing is that I don't really want to hardcode the filename. It should be in the application's conf file. However, if I just stick it in there as so: Log4perl conf_file /var/www/mymercedesservice.co.uk/fcgi/catalyst/mbfl2/lib/mbfl2/log4perl.conf /Log4perl I can't access it via __PACKAGE__-config-{Log4perl}-{conf_file}; until after setup() has run. Does that matter? Thanks Duncan That's how I do it in all of our Catalyst apps: In My::App: =item finalize_config Initializes the logger after the config file merging and loading is done. =cut sub finalize_config { my $class = shift; $class-next::method(@_); $class-log(Log::Log4perl::Catalyst-new($class-config-{log})); } # Start the application __PACKAGE__-setup; around 'prepare' = sub { my $orig = shift; my $self = shift; Log::Log4perl::MDC-remove(); my $c = $self-$orig(@_); Log::Log4perl::MDC-put( username, $c-user-username ) if $c-user_exists; return $c; }; This assumes that the l4p config is in the app config file under 'log' e.g. from one of my Config::General config files: log log4perl.logger WARN, FILE, MAIL log4perl.appender.FILE Log::Log4perl::Appender::File log4perl.appender.FILE.filename /home/nac/log/nac-web-request.log log4perl.appender.FILE.utf8 1 log4perl.appender.FILE.syswrite 1 log4perl.appender.FILE.layout Log::Log4perl::Layout::PatternLayout log4perl.appender.FILE.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n log4perl.appender.MAIL Log::Dispatch::Email::MailSend log4perl.appender.MAIL.ThresholdERROR log4perl.appender.MAIL.from a...@t-systems.atmailto:a...@t-systems.at log4perl.appender.MAIL.to poor.bastard-aka...@ourcompany.commailto:poor.bastard-aka...@ourcompany.com log4perl.appender.MAIL.subject [NAC::Web::Request] errors log4perl.appender.MAIL.buffered 0 log4perl.appender.MAIL.layout PatternLayout log4perl.appender.MAIL.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n /log ___ List: Catalyst@lists.scsys.co.ukmailto: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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Out of Memory - File delivery issue
On 2013-05-02 16:04, Lukas Thiemeier wrote: Hi again, FIRST: Your Controller Code looks good. I would use build-in functionality whenever possible. In this case, using $c-res-content_type instead of setting the content type by hand. But your code should work just fine. Your are right. You have to set the headers before using $c-res-print (or write). But this does not mean that you have to do this in the model. You can set the headers in your Controller before running the model code. SECOND: IMO you are right about your concerns regarding the MVC architecture. The Model should provide the data and not deal with HTTP responses. On the other hand, the data has to be provided in some format. XML is a well known standard format for textual data presentation. Providing the data as XML is as good or as bad as providing the data as DBIC objects. (Well, not really. But close enough for this explanation). The cleanest (most MVC conform) way to do this would be to fetch the raw data from your model and create your XML in a special view. There are several ways to do this. You can create XML using a TT view. ( I have done this before, it works fine). Or you can use existing XML views like Catalyst::View::XML::Generator or Catalyst::View::XML::Hash::LX. (I have not used any of them, but the names are promising). I guess there are even more ways to do it... In your Case, you already have a Model which provides the XML Data (which is fine, as I said before). IMO, one of the great things about Catalyst is that it allows you to get the job done quickly. It makes reusing existing code easy. There is no reason to abandon your existing XML-creation code just because it doesn't fit the MVC layout. Doing so would be contra-productive. So, what can be done to re-use your XML Model and still fit into the MVC architecture? I see two ways: The first one would be to update your model that it writes its data to any IO::Handle compatible object. You can pass $c-res to your Model, which is IO::Handle compatible. Your model uses a Catalyst independent API to write out the data. Catalyst streams the data to the client. Your Model Code is still Catalyst independent and does not know that it is writing to a Catalyst::Response object. No tight coupling. You can reuse your model in non-catalyst applications and easily test its functionality using Test::More or any other test suite. ( I think this is more or less the way proposed by Neil) The second way (which I would prefer, since it is even more MVC conform) is the following: Update your Model to return an IO::Handle-style object instead of a string. You can fetch this object from the model in your controller, and pass it to $c-res-body. Catalyst will take care of streaming the data to the client in small chunks. You don't have to pass any Catalyst related objects to the model anymore. Your model returns the data as a well known standard object which happens to be suitable for streaming large amounts data with catalyst. No tight coupling at all. Problem solved. Have a Tea and celebrate. This is my opinion on this topic. I hope it helps you to find a way which fits your needs, and reduces your confusion about Models, Views and controllers in this specific case. Lukas *Very great* content, thanks Lukas! ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst with HTTP authentication
On 2013-03-11 16:37, Lukas Thiemeier wrote: From reading the docs, I don't see why Catalyst::Authentication::Store::Htpasswd and Catalyst::Authentication::Credential::HTTP do not work together, but I have not used any of them. I am using Catalyst::Authentication::Credential::Remote in a current project. It lets the webserver do all the authentication. You can use any authentication method and storage which is supported by your webserver, including htpasswd files. Having the webserver do the authentication means you are depending on it to support the type of authentication you want to use. I'd prefer having the authentication in the app with the exact same code for production and testing over ::Remote. I am using Catalyst::Authentication::Credential::Testing for authentication when the webserver is not available (when running the catalyst test-server during development). Maybe this is an option for you... cheers, Lukas On 03/11/2013 03:10 PM, Robert Rothenberg wrote: I have a project that requires using HTTP authentication. There is a Catalyst::Authentication::Credential::HTTP module, but from the documentation, it does not seem to support using htpasswd files, which I need, because a separate web site will be using that file. There is Catalyst::Authentication::Store::Htpasswd, but it does not work with Catalyst::Authentication::Credential::HTTP. I'm not clear on how to do this, without having to write my own handlers for HTTP authentication. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst Actions precedence
On 2013-02-28 10:53, Kieren Diment wrote: On 28/02/2013, at 8:25 PM, Nick Anderson wrote: Hi Trevor, Many thanks for clarifying that. I guess I was hoping for some reliable and predictable outcome for ambiguous requests but it seems the statement Don't do this in the URL Path handling section does indeed sum it up! And although it does not explicitly mention chained actions, I presume any URL path ambiguity should/must be avoided. I think making it clear(er?) in the docs that if you're using Chained in a controller you shouldn't use any other dispatch type would be useful. Where is the correct place for that to go? What I was trying to achieve was a catch-all facility for requests other than application defined actions, up to root level (i.e. for user-specified URLs which are then looked up in a database). For the life of me I can't remember why I avoided using the default action to achieve this, probably because I thought being more specific (even just by using a wildcard chain) was the most appropriate way to approach it and more structured. My preference is to keep Controller::Root very bare, but keep a default (i.e. 404) handler in there, and an index type action. I'd suggest adding actions for those errors to the generated root controller when creating new apps. I presume then, that having a /*/... wildcard action to catch everything else is not advisable? Is using the default action the preferred method then to allow for unknown/dynamic URLs where an application defined action is unavailable? The usual thing to do with default is to catch 404 errors. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] [ANNOUNCE] Catalyst-Runtime 5.90020
The Catalyst team is proud to announce the latest version of Catalyst::Runtime. John Napiorkowski wrote a great blog post [1] about its new features and asks for your comments and suggestions for upcoming features. ! Catalyst::Action now defines 'match_captures' so it is no long considered an optional method. This might break you code if you have made custom action roles/classes where you define 'match_captures'. You must change your code to use a method modifier (such as 'around'). - New match method Method($HTTP_METHOD) where $HTTP_METHOD in (GET, POST, PUT, HEAD, DELETE, OPTION) and shortcuts in controllers called GET, POST PUT, HEAD, DELETE, OPTION). Tests and documentation. Please note if you are currently using Catalyst::ActionRole::MatchRequestMethods there may be compatibility issues. You should remove that actionrole since the built in behavior is compatible on its own. - Initial debug screen now shows HTTP Method Match info - security fixes in the way we handle redirects - Make Catalyst::Engine and Catalyst::Base immutable - Some test and documentation improvements [1] http://jjnapiorkowski.typepad.com/modern-perl/2013/02/catalyst-built-in-support-for-http-method-dispatching-and-whats-next.html -- Cheers, Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst::Controller::REST and Serializer/Deserializer
On 2013-02-25 08:44, Francisco Obispo wrote: This is what I usually do: 1) install Catalyst::View::JSON 2) Add the view to your app: ./script/myapp_create.pl view JSON JSON 3) in the .conf file add: View::JSON allow_callback 0 expose_stash data /View::JSON 4) in the controller: If the whole controller (.pm) will return JSON data, just add this to the end: sub end : Private { my ( $self, $c ) = @_; if ( $c-stash-{data} ) { $c-forward('View::JSON'); return 1; } return; } if you want to selectively send it in a method: sub hello : Local { my ($self,$c) = @_; my $data={ hello = 'world!'}; $c-stash-{data} = $data; $c-forward('View::JSON'); return 1; }; Hope this helps You missed his point, he isn't for a different way to implement his webservice but a way to use it in his browser. On Feb 24, 2013, at 11:13 PM, Jean-Marc Choulet jm130...@gmail.com wrote: Hello, I'm new to Catalyst and I've certainly a stupid question... I use a Catalyst::Controller::REST to implement a web service. My question is : How can I force a application/json content-type response when I ask my ws with FF or Chrome... ? Thanks Jean-Marc You have to do a background request mostly known as AJAX. The technical correct term is XMLHTTPRequest [1]. jQuery has a method for it [2]. If you're using Firefox I recommend installing the Firebug addon which can be used to easily view the request and response. [1] http://www.w3.org/TR/XMLHttpRequest/ [2] http://api.jquery.com/jQuery.get/ ___ 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/ Francisco Obispo Director of Applications and Services - ISC email: fobi...@isc.org Phone: +1 650 423 1374 || INOC-DBA *3557* NOC PGP KeyID = B38DB1BE ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] DB values that change very rarely
On 2013-01-11 19:05, Francisco Obispo wrote: You really don't want this in DBIx::Class, you want fine grain control of when to fetch from the database, etc. Anyone can build their layer on top of DBIx::Class to implement caching. Using something like memcached would save you some database hits, you can either set the values to expire at a specified time / number of seconds, or you can set/delete keys as part of the procedures at insert/update/delete on the database. If you you Postgresql, you can actually take advantage of PgPool, which will give you the option to enable a caching layer… Francisco Please don't top post! I *do* want this in DBIC so that a prefetch specified in some query doesn't hit the database if the table is cached schema-wide. Any other caching technique would mean changing every piece of code whereas this would be transparent. I do know DBIx::Class quite well and don't think that's possible with a component. On Jan 11, 2013, at 4:01 AM, Alexander Hartmaier alexander.hartma...@t-systems.at wrote: On 2013-01-10 16:15, Jesse Sheidlower wrote: In one of my apps, I have a number of tables that contain values that change very rarely. Think of something like a category table in an e-commerce app--they're mostly static, but every now and then you need to change or add or delete a category. These occasional changes do, however, need to be made by a (privileged) user, rather than a developer, so I can't just put them in the config file and edit this and restart the app when necessary. Since I don't know when they might change, I don't know how I could cache them, because when a change is made it needs to take effect immediately. These tables are used on almost every request. The result is that most of my controllers end up looking something like this, or having something like this at the end of them: sub add : Local { my ( $self, $c ) = @_; $c-stash-{title} = 'Add a new lemma'; $c-stash-{batches} = $c-model('WordsDB::Batch')-search(); $c-stash-{statuses} = $c-model('WordsDB::Status')-search(); $c-stash-{regions} = $c-model('WordsDB::Region')-search(); $c-stash-{subjects} = $c-model('WordsDB::Subject')-search(); $c-stash-{template} = 'add.tt'; } This means that almost every page generation hits the database a whole bunch of unnecessary times, and that all of my controllers are cluttered. This must be a fairly common problem. What's the best way to deal with it--both the desire to persist what is mostly static data, and to keep my controllers clean? Thanks. Jesse Sheidlower ___ 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/ I'd LOVE to see that functionality in DBIx::Class::Schema so prefetches use the cached values to populate the related data instead of hitting the database. -- Best regards, Alexander Hartmaier *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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/ Francisco Obispo Director of Applications and Services - ISC email: fobi...@isc.org Phone: +1 650 423 1374 || INOC-DBA *3557* NOC PGP KeyID = B38DB1BE ___ 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/ -- LG Alex ___ 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] DB values that change very rarely
On 2013-01-10 16:15, Jesse Sheidlower wrote: In one of my apps, I have a number of tables that contain values that change very rarely. Think of something like a category table in an e-commerce app--they're mostly static, but every now and then you need to change or add or delete a category. These occasional changes do, however, need to be made by a (privileged) user, rather than a developer, so I can't just put them in the config file and edit this and restart the app when necessary. Since I don't know when they might change, I don't know how I could cache them, because when a change is made it needs to take effect immediately. These tables are used on almost every request. The result is that most of my controllers end up looking something like this, or having something like this at the end of them: sub add : Local { my ( $self, $c ) = @_; $c-stash-{title} = 'Add a new lemma'; $c-stash-{batches} = $c-model('WordsDB::Batch')-search(); $c-stash-{statuses} = $c-model('WordsDB::Status')-search(); $c-stash-{regions} = $c-model('WordsDB::Region')-search(); $c-stash-{subjects} = $c-model('WordsDB::Subject')-search(); $c-stash-{template} = 'add.tt'; } This means that almost every page generation hits the database a whole bunch of unnecessary times, and that all of my controllers are cluttered. This must be a fairly common problem. What's the best way to deal with it--both the desire to persist what is mostly static data, and to keep my controllers clean? Thanks. Jesse Sheidlower ___ 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/ I'd LOVE to see that functionality in DBIx::Class::Schema so prefetches use the cached values to populate the related data instead of hitting the database. -- Best regards, Alexander Hartmaier *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst IIS7 Wiki Instructions
On 2012-11-09 12:03, Craig Chant wrote: Hi, Don't know if this is the correct usage of the mailing list so I apologise now if it isn't. As a thank you to the Catalyst community for all the help and support I have thus far received and as I promised to T0m as well as to help out MST, I have updated the Catalyst IIS7 Wiki page. http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi Not only have I replaced all the missing screen shots with new ones but also added additional information, made it more generic rather than 'Strawberry' Perl centric plus added sub categories with further configuration information. This will hopefully help others not struggle, as I did, when first setting up Catalyst on IIS7 Windows 2008 R2 environment and reduce the potential of stupid questions being asked on the mailing list or IRC. Should you find any errors, omissions, inaccuracies or feel it could be improved in some way, please feel free to let me know and I will make any appropriate changes necessary. I hope this helps the Catalyst community as well as others who wish to implement Catalyst over Windows / IIS7. Thanks Craig! I can't talk about its accuracy though because I don't have a Windows server here. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Can't get view / template to work ?
On 2012-10-31 13:28, Will Crawford wrote: On 31 October 2012 09:31, Craig Chant cr...@homeloanpartnership.com wrote: You're misread what I put where? It clearly states Edit lib/MyApp/View/HTML.pm and you should see something similar to the following: __PACKAGE__-config( TEMPLATE_EXTENSION = '.tt', render_die = 1, ); And that's where I put the extension setting? Yet you claimed in your first message in this thread, to have added: TEMPLATE_EXTENSION = '.tp', 'View::HTML' = { #Set the location for templates files INCLUDE_PATH = [ __PACKAGE__-path_to( 'root', 'src' ), ], }, ... to the config section of MyApp.pm, and you're being told that's wrong. Guys, Craig is on IRC now and I'm helping him to resolve the issue. He is using Catalyst::View::HTML::Template not ::TT so the options are different. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Access Catalyst context object from script
On 2012-10-31 13:30, Anthony Gladdish wrote: -Original Message- From: Ian Docherty [mailto:catal...@iandocherty.com] Sent: 31 October 2012 11:29 To: The elegant MVC web framework Subject: Re: [Catalyst] Access Catalyst context object from script On 31 October 2012 10:41, Anthony Gladdish anthony.gladd...@newcastle.ac.uk wrote: Hi, Got a lot of code in a controller that should be moved out and into an external script (that's called by a cronjob) which calls stuff from the Model and then emails it. The script can access the model fine and re-use a Template::Toolkit template already written fine (I'm using MIME::Lite::TT). However, in the template itself there's a lot of calls to the Catalyst context object, in the form of: [% Catalyst.uri_for( ... ) %] ... which aren't displaying anything. I don't really want to hard code the URIs, so is there a way to get access to the Catalyst context object of a running app, in a separate external script? I can understand the reluctance to hard-code URIs, however i would be reluctant to suggest that you bring in the whole of Catalyst just to satisfy this one requirement. What is the template? I presume it is an email, and that you are putting links to locations within your Catalyst application into the email? Correct. It's a bog standard .tt file printing text to be sent as an email, containing links to actions within the Cat app. What form of uri_for are you using? If it is just to capture the applications root then could you replace it with your own convenience routine that just implemented that aspect of what uri_for is doing without bringing in the whole of Catalyst? [% Catalyst.uri_for(Catalyst.controller('MyController').action_for('myaction'), [ some_id ] ) %] Could you offer an example, based on my uri_for example above? I suggest to load your Catalyst app with a config that doesn't load unnecessary stuff like the models and views, just the controllers and use $c-uri_for_action. Take a look at how Catalyst::Test::ctx_request does it or even use Catalyst::Test... Thanks, Anthony ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Two questions about caching
On 2012-10-19 09:57, Hugh Barnard wrote: Hi folks The first question is a little 'simple' but I need to be sure anyway: 1. If I go $c-cache-set(key, $value); is that available to all other users within the catalyst instance or just for that user session? Sorry! As you see the cache is on the $c catalyst app instance so it's the same regardless of other plugins like session. You can create a special key that contains the user id if you need per user caching, but you are responsible for the security of the implementation. 2. FastMmap vs Memcached [something I know 'outside' Catalyst]. It looks as though Memcached has better performance for more complex structures? Any comments or [better] benchmarks welcome, I seem to only have forum anecdotes that suggest this. I'm using FastMmap since years without problems for our company apps but performance isn't critical because they have not much traffic. Are you talking about using it for caching or session storage? If session storage and you have your app balanced over multiple servers you need a common session storage anyways. Thanks, in advance Hugh Barnard -- http://www.hughbarnard.org http://www.twitter.com/hughbarnard http://www.big-wave-heuristics.com/ ___ List: Catalyst@lists.scsys.co.ukmailto: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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Trapping added errors with the correct caller
On 2012-10-16 00:04, Kieren Diment wrote: I've had a lot of luck with Log::Contextual recently. It's nice for easily getting logging into model classes. I'm going to use Log::Any for that in the future. On 16/10/2012, at 1:21 AM, Alexander Hartmaier wrote: I recommend to use a logging module like Log::Log4perl::Catalyst and do all your app logging there. My log package for NAC::Web:NAC looks like this: package NAC::Web::NAC::Log; use Moose; use Catalyst::Log; use namespace::autoclean; BEGIN { extends 'Log::Log4perl::Catalyst'; } =head1 NAME NAC::Web::NAC::Log - Logger for NAC::Web::NAC =cut # import _dump method from Catalyst::Log *_dump = \Catalyst::Log::_dump; 1; My app uses it with: =item finalize_config Initializes the logger after the config file merging and loading is done. =cut sub finalize_config { my $class = shift; $class-next::method(@_); $class-log(NAC::Web::NAC::Log-new($class-config-{log})); } # Start the application __PACKAGE__-setup(); around 'prepare' = sub { my $orig = shift; my $self = shift; Log::Log4perl::MDC-remove(); my $c = $self-$orig(@_); Log::Log4perl::MDC-put( username, $c-user-username ) if $c-user_exists; return $c; }; And this is how the app's prod config file looks like: log log4perl.logger WARN, FILE, MAIL log4perl.appender.FILE Log::Log4perl::Appender::File log4perl.appender.FILE.filename /home/nac/log/nac-web-nac.log log4perl.appender.FILE.utf8 1 log4perl.appender.FILE.syswrite 1 log4perl.appender.FILE.layout Log::Log4perl::Layout::PatternLayout log4perl.appender.FILE.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n log4perl.appender.MAIL Log::Dispatch::Email::MailSend log4perl.appender.MAIL.ThresholdERROR log4perl.appender.MAIL.from n...@domain.com log4perl.appender.MAIL.to app-err...@domain.com log4perl.appender.MAIL.subject [NAC::Web::NAC] errors log4perl.appender.MAIL.buffered 0 log4perl.appender.MAIL.layout PatternLayout log4perl.appender.MAIL.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n /log Best regards, Alex (abraxxa) On 2012-10-11 14:38, Robert Rothenberg wrote: I would like to trap every error added to $c-error() and log it, noting the caller (filename, line number) in the logs. I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own plugin that overrides $c-error with the following method: use MRO::Compat; use namespace::autoclean; sub error { my ($c, @args) = @_; foreach my $arg (@args) { if ($arg) { $c-log-error($arg); } } return $c-next::method(@args); } But this only logs errors as coming from my plugin. Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work. I also tried writing the plugin as a Moose::Role that adds my trap before error, but then it claims to be from one of the internal Moose classes in my logs. I can manually get the caller using caller(0) and add them to the log messages, but that's a bit clumsy (and overrides log formats that don't include the information). So... what is the best practice for trapping errors in a way that preserves caller information? ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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/ ___ 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
Re: [Catalyst] Trapping added errors with the correct caller
On 2012-10-15 18:55, Robert Rothenberg wrote: On 15/10/12 17:49 Alexander Hartmaier wrote: On 2012-10-15 18:03, Robert Rothenberg wrote: On 15/10/12 15:21 Alexander Hartmaier wrote: I recommend to use a logging module like Log::Log4perl::Catalyst and do all your app logging there. I use Log::Dispatch. (The application is already deployed, and it's not feasible to change it to Log4perl now.) If you're already using a logger but the default Catalyst one that's fine. I don't see where in your code you trap calls to $c-error() and log them. All log messages are going to your logger object, Log::Dispatch in your case, not just errors. Just configure Log::Dispatch to do with them what you want it to do (log to a separate file, mail them, etc. ). You don't seem to understand my original question. The end method of the Root controller looks for errors in $c-error() and logs them, then displays a custom error page. The problem with doing that is that it does not say where the error occurred. So I want to modify $c-error() to log it every time something is added, which is actually quite easy. But I want to use something like Sub::Uplevel so that the logger does not say the wrapper module triggered the error. You mean *your* end action code? You haven't showed it and my crystal ball is broken. Does it make a difference for you if the error is logged when it occurred instead of the end of the request? My apps normally die on the first error which gets logged. The die error message includes the filename and line number which is sufficient for me. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Trapping added errors with the correct caller
I recommend to use a logging module like Log::Log4perl::Catalyst and do all your app logging there. My log package for NAC::Web:NAC looks like this: package NAC::Web::NAC::Log; use Moose; use Catalyst::Log; use namespace::autoclean; BEGIN { extends 'Log::Log4perl::Catalyst'; } =head1 NAME NAC::Web::NAC::Log - Logger for NAC::Web::NAC =cut # import _dump method from Catalyst::Log *_dump = \Catalyst::Log::_dump; 1; My app uses it with: =item finalize_config Initializes the logger after the config file merging and loading is done. =cut sub finalize_config { my $class = shift; $class-next::method(@_); $class-log(NAC::Web::NAC::Log-new($class-config-{log})); } # Start the application __PACKAGE__-setup(); around 'prepare' = sub { my $orig = shift; my $self = shift; Log::Log4perl::MDC-remove(); my $c = $self-$orig(@_); Log::Log4perl::MDC-put( username, $c-user-username ) if $c-user_exists; return $c; }; And this is how the app's prod config file looks like: log log4perl.logger WARN, FILE, MAIL log4perl.appender.FILE Log::Log4perl::Appender::File log4perl.appender.FILE.filename /home/nac/log/nac-web-nac.log log4perl.appender.FILE.utf8 1 log4perl.appender.FILE.syswrite 1 log4perl.appender.FILE.layout Log::Log4perl::Layout::PatternLayout log4perl.appender.FILE.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n log4perl.appender.MAIL Log::Dispatch::Email::MailSend log4perl.appender.MAIL.ThresholdERROR log4perl.appender.MAIL.from n...@domain.com log4perl.appender.MAIL.to app-err...@domain.com log4perl.appender.MAIL.subject [NAC::Web::NAC] errors log4perl.appender.MAIL.buffered 0 log4perl.appender.MAIL.layout PatternLayout log4perl.appender.MAIL.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n /log Best regards, Alex (abraxxa) On 2012-10-11 14:38, Robert Rothenberg wrote: I would like to trap every error added to $c-error() and log it, noting the caller (filename, line number) in the logs. I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own plugin that overrides $c-error with the following method: use MRO::Compat; use namespace::autoclean; sub error { my ($c, @args) = @_; foreach my $arg (@args) { if ($arg) { $c-log-error($arg); } } return $c-next::method(@args); } But this only logs errors as coming from my plugin. Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work. I also tried writing the plugin as a Moose::Role that adds my trap before error, but then it claims to be from one of the internal Moose classes in my logs. I can manually get the caller using caller(0) and add them to the log messages, but that's a bit clumsy (and overrides log formats that don't include the information). So... what is the best practice for trapping errors in a way that preserves caller information? ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Trapping added errors with the correct caller
On 2012-10-15 18:03, Robert Rothenberg wrote: On 15/10/12 15:21 Alexander Hartmaier wrote: I recommend to use a logging module like Log::Log4perl::Catalyst and do all your app logging there. I use Log::Dispatch. (The application is already deployed, and it's not feasible to change it to Log4perl now.) If you're already using a logger but the default Catalyst one that's fine. I don't see where in your code you trap calls to $c-error() and log them. All log messages are going to your logger object, Log::Dispatch in your case, not just errors. Just configure Log::Dispatch to do with them what you want it to do (log to a separate file, mail them, etc. ). My log package for NAC::Web:NAC looks like this: package NAC::Web::NAC::Log; use Moose; use Catalyst::Log; use namespace::autoclean; BEGIN { extends 'Log::Log4perl::Catalyst'; } =head1 NAME NAC::Web::NAC::Log - Logger for NAC::Web::NAC =cut # import _dump method from Catalyst::Log *_dump = \Catalyst::Log::_dump; 1; My app uses it with: =item finalize_config Initializes the logger after the config file merging and loading is done. =cut sub finalize_config { my $class = shift; $class-next::method(@_); $class-log(NAC::Web::NAC::Log-new($class-config-{log})); } # Start the application __PACKAGE__-setup(); around 'prepare' = sub { my $orig = shift; my $self = shift; Log::Log4perl::MDC-remove(); my $c = $self-$orig(@_); Log::Log4perl::MDC-put( username, $c-user-username ) if $c-user_exists; return $c; }; And this is how the app's prod config file looks like: log log4perl.logger WARN, FILE, MAIL log4perl.appender.FILE Log::Log4perl::Appender::File log4perl.appender.FILE.filename /home/nac/log/nac-web-nac.log log4perl.appender.FILE.utf8 1 log4perl.appender.FILE.syswrite 1 log4perl.appender.FILE.layout Log::Log4perl::Layout::PatternLayout log4perl.appender.FILE.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n log4perl.appender.MAIL Log::Dispatch::Email::MailSend log4perl.appender.MAIL.ThresholdERROR log4perl.appender.MAIL.from n...@domain.com log4perl.appender.MAIL.to app-err...@domain.com log4perl.appender.MAIL.subject [NAC::Web::NAC] errors log4perl.appender.MAIL.buffered 0 log4perl.appender.MAIL.layout PatternLayout log4perl.appender.MAIL.layout.ConversionPattern %d{-MM-dd HH:mm:ss} %-5p %X{username} %m%n /log Best regards, Alex (abraxxa) On 2012-10-11 14:38, Robert Rothenberg wrote: I would like to trap every error added to $c-error() and log it, noting the caller (filename, line number) in the logs. I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own plugin that overrides $c-error with the following method: use MRO::Compat; use namespace::autoclean; sub error { my ($c, @args) = @_; foreach my $arg (@args) { if ($arg) { $c-log-error($arg); } } return $c-next::method(@args); } But this only logs errors as coming from my plugin. Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work. I also tried writing the plugin as a Moose::Role that adds my trap before error, but then it claims to be from one of the internal Moose classes in my logs. I can manually get the caller using caller(0) and add them to the log messages, but that's a bit clumsy (and overrides log formats that don't include the information). So... what is the best practice for trapping errors in a way that preserves caller information? ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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
Re: [Catalyst] Plugin::Session lazy start
Because I've just read perlvar: $REAL_USER_ID or $UID instead of $. - Alex Am 2012-05-23 15:54, schrieb Ashley Pond V: On Wed, May 23, 2012 at 1:58 AM, Dag-Erling Smørgrav d...@des.no wrote: As an alternate solution, is there a way to have it use a different file name every time it starts? Here's a snippet to do that: conf.yml -- Plugin::Session: storage: /tmp/some-prefix-__UID__.session MyApp.pm -- Plugin::ConfigLoader = { substitutions = { UID = sub { $ }, }, }, https://metacpan.org/module/Catalyst::Plugin::ConfigLoader ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Getting hashref instead of value
Am 2012-05-08 17:25, schrieb Ari Constancio: On Tue, May 8, 2012 at 4:13 PM, Kenneth S Mclane ksmcl...@us.ibm.com wrote: My template that cretaes the uri: tda href=[% c.uri_for('/accountdetails/detail/') %][% account.account_id %][% account.account_code %]/a/td If someone could point me in the right direction, Ive been fighting this for days. Hi Kenneth, I suppose you mean to use [% c.uri_for('/accountdetails/detail/', account.account_id) %] instead of [% c.uri_for('/accountdetails/detail/') %][% account.account_id %] No he doesn't because he isn't using Chained but Local where the dispatcher knows nothing about the number of args. I assume that you have defined a relationship on the account_id column without giving it a different name. This makes DBIx::Class inflate the related row into an object. Two solutions: - use a different accessors for your relationships (that's what I'm doing) - use acount.get_column('account_id') when you can to get the column value instead of the related row Also note that it's a common problem that Template Toolkit calls everything in list context. search_rs was added to DBIx::Class to make sure you always get a resultset object and not a list of row objects. Regards, *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Getting hashref instead of value
Am 2012-05-08 17:46, schrieb Kenneth S Mclane: In checking through docs on line I find that prefetch is a better way to go so I have changed ny sub thusly: sub list :Local { my ($self, $c, $page) = @_; $page = $c-req-param('page') || 1; my $rs = $c-model('ORANGES::Account')-search({}, { prefetch = 'progress', prefetch = 'compliance', prefetch = 'department_id', prefetch = 'metrics', order_by = 'account_code', rows = 15, page = $page, }); $c-stash(accounts = $rs); $c-stash(pager = $rs-pager()); $c-stash-{'template'}='accountview/list'; } {} is a hashref in Perl. You're defining four values for the key 'prefetch', the last one overwrites the three previous ones. As already noted you need to specify the prefetch value as arrayref in your case: prefetch = [qw( progress compliance department_id metrics )], FYI: qw() does nothing but saving you to quote every element of the list. It's equal to prefetch = ['progress', 'compliance', 'department_id', 'metrics'], Note that this is all basic Perl and nothing specific of Catalyst or DBIx::Class. From: Frank Schwach f...@sanger.ac.ukmailto:f...@sanger.ac.uk To: catalyst@lists.scsys.co.ukmailto:catalyst@lists.scsys.co.uk Date: 05/08/2012 10:36 AM Subject:Re: [Catalyst] Getting hashref instead of value not sure if this is a problem but you should also collapse your joins, selects and as' into ArrayRefs, as in join = [ qw( progress compliance department_id ...)] actually the last one looks suspicious. the relationships should be called something like departments, not department_ids. If you have the same naming for accounts then an account_id is the name (presumably) of a field in accounts and also a relationship Frank On 08/05/12 16:25, Steve wrote: The 'account.account_id' referenced in your template I believe is being interpreted as an object. Try 'account.account_id.id' instead. I am presuming that your DBIC relationship is called 'account_id', and that is what you are referencing currently in your template. On 5/8/2012 11:13 AM, Kenneth S Mclane wrote: I am having a problem with my code and I cannot figure out why it is doing what it is doing. I have this sub: sub list :Local { my ($self, $c, $page) = @_; $page = $c-req-param('page') || 1; my $rs = $c-model('ORANGES::Account')-search({}, { join = 'progress', '+select' = ['progress.percent_complete'], '+as' = ['progress.percent_complete'], join = 'compliance', '+select' = ['compliance.percent_compliant'], '+as' = ['compliance.percent_compliant'], join = 'department_id', '+select' = ['department_id.department_id'], '+as' = ['department_id.department_id'], join = 'metrics', '+select' = ['metrics.num_servers','metrics.num_subsystems'], '+as' = ['metrics.num_servers','metrics.num_subsystems'], order_by = 'account_code', rows = 15, page = $page, }); $c-stash(accounts = $rs); $c-stash(pager = $rs-pager()); $c-stash-{'template'}='accountview/list'; } Which I have tried in several different ways to fix this problem, but none have worked so far. In my template file all my fields come up with the valyes expected, except, I am trying to use the account_id field value as part of a uri to take the user to a details page for the row. Where I am expecting a uri such as 'http://127.0.0.1:3000/accountdetails/detail/170' I instead get a uri like this: http://127.0.0.1:3000/accountdetails/detail/dbms::Model::ORANGES::Account=HASH%280x5496460%29 This used to work when I was using a view as the basis for my list page. When I run the page I can see in the sub-queries that it runs that it has the account_id value as it uses it, but when I try to access it in my template I get the hash ref. None of the other fields do this. one of the sub queries using the account_id value: SELECT me.account_id, me.account_code, me.percent_compliant FROM HCDB_TEST.COMPLIANCE me WHERE ( me.account_id = ? ): '321' My template that cretaes the uri: tda href=[% c.uri_for('/accountdetails/detail/') %][% account.account_id %][% account.account_code %]/a/td If someone could point me in the right direction, Ive been fighting this for days. ___ List: Catalyst@lists.scsys.co.ukmailto: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.ukmailto: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/ -- The Wellcome Trust Sanger
Re: [Catalyst] Getting hashref instead of value
Am 2012-05-08 18:15, schrieb Kenneth S Mclane: Yes, in changing things back and forth I forgot about that. I got that fixed and changed the relationship names. I have tried with search and search_rs and still have the same result of getting the object instead of the value. Can I use get_column in TT? Yes, you only have to use . instead of - for method calls. From: Alexander Hartmaier alexander.hartma...@t-systems.at To: catalyst@lists.scsys.co.uk Date: 05/08/2012 11:07 AM Subject: Re: [Catalyst] Getting hashref instead of value Am 2012-05-08 17:46, schrieb Kenneth S Mclane: In checking through docs on line I find that prefetch is a better way to go so I have changed ny sub thusly: sub list :Local { my ($self, $c, $page) = @_; $page = $c-req-param('page') || 1; my $rs = $c-model('ORANGES::Account')-search({}, { prefetch = 'progress', prefetch = 'compliance', prefetch = 'department_id', prefetch = 'metrics', order_by = 'account_code', rows = 15, page = $page, }); $c-stash(accounts = $rs); $c-stash(pager = $rs-pager()); $c-stash-{'template'}='accountview/list'; } {} is a hashref in Perl. You're defining four values for the key 'prefetch', the last one overwrites the three previous ones. As already noted you need to specify the prefetch value as arrayref in your case: prefetch = [qw( progress compliance department_id metrics )], FYI: qw() does nothing but saving you to quote every element of the list. It's equal to prefetch = ['progress', 'compliance', 'department_id', 'metrics'], Note that this is all basic Perl and nothing specific of Catalyst or DBIx::Class. From: Frank Schwach _f...@sanger.ac.uk_ mailto:f...@sanger.ac.uk To: _catal...@lists.scsys.co.uk_ mailto:catalyst@lists.scsys.co.uk Date: 05/08/2012 10:36 AM Subject: Re: [Catalyst] Getting hashref instead of value not sure if this is a problem but you should also collapse your joins, selects and as' into ArrayRefs, as in join = [ qw( progress compliance department_id ...)] actually the last one looks suspicious. the relationships should be called something like departments, not department_ids. If you have the same naming for accounts then an account_id is the name (presumably) of a field in accounts and also a relationship Frank On 08/05/12 16:25, Steve wrote: The 'account.account_id' referenced in your template I believe is being interpreted as an object. Try 'account.account_id.id' instead. I am presuming that your DBIC relationship is called 'account_id', and that is what you are referencing currently in your template. On 5/8/2012 11:13 AM, Kenneth S Mclane wrote: I am having a problem with my code and I cannot figure out why it is doing what it is doing. I have this sub: sub list :Local { my ($self, $c, $page) = @_; $page = $c-req-param('page') || 1; my $rs = $c-model('ORANGES::Account')-search({}, { join = 'progress', '+select' = ['progress.percent_complete'], '+as' = ['progress.percent_complete'], join = 'compliance', '+select' = ['compliance.percent_compliant'], '+as' = ['compliance.percent_compliant'], join = 'department_id', '+select' = ['department_id.department_id'], '+as' = ['department_id.department_id'], join = 'metrics', '+select' = ['metrics.num_servers','metrics.num_subsystems'], '+as' = ['metrics.num_servers','metrics.num_subsystems'], order_by = 'account_code', rows = 15, page = $page, }); $c-stash(accounts = $rs); $c-stash(pager = $rs-pager()); $c-stash-{'template'}='accountview/list'; } Which I have tried in several different ways to fix this problem, but none have worked so far. In my template file all my fields come up with the valyes expected, except, I am trying to use the account_id field value as part of a uri to take the user to a details page for the row. Where I am expecting a uri such as '_http://127.0.0.1:3000/accountdetails/detail/170_' I instead get a uri like this: _http://127.0.0.1:3000/accountdetails/detail/dbms::Model::ORANGES::Account=HASH%280x5496460%29_ This used to work when I was using a view as the basis for my list page. When I run the page I can see in the sub-queries that it runs that it has the account_id value as it uses it, but when I try to access it in my template I get the hash ref. None of the other fields do this. one of the sub queries using the account_id value: SELECT me.account_id, me.account_code, me.percent_compliant FROM HCDB_TEST.COMPLIANCE me WHERE ( me.account_id = ? ): '321' My template that cretaes the uri: tda href=[% c.uri_for('/accountdetails/detail
Re: [Catalyst] What are the best practices for using phrasebooks in Catalyst applications?
Sounds like something similiar to what I18N does. Your solution looks good to me. Am 2012-01-27 14:19, schrieb Robert Rothenberg: I am working on a project where the terminology we are using for objects in the system is diverging from terminology that the client is using for those things. And it also seems that other clients may use different names for these objects. (And this is just for English-language interfaces.) So I would like to use some kind of phrasebook, so that the source code can use the same, consistent terminology, but the clients see their terminology in the UI. I'd prefer not to maintain a separate set of templates for each client, since that requires keeping changes to templates consistent across sets, and requires keeping changes to terminology consistent in a set. So... is there an existing plugin that is used for such things? Otherwise, I am thinking of writing a plugin that makes use of Data::Phrasebook (or something similar), allows for configuration of the phrasebook in the configuration file, and adds a new method to the Catalyst context variable for querying the phrasebook, e.g. the template may have something like h1[% c.phrase('widgets') | html %]/h1 Does this make sense, or is there a better way to do this? Thanks, 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Running multiple test servers together as the same app
Mount them with Plack? Am 2012-01-26 04:49, schrieb Bill Moseley: A quick questions for the the collective wisdom here. We have an app that is just getting too big and we are splitting it up into separate Catalyst apps (mostly based on feature) to allow groups of developers to work on features independently, develop tests independently and release independently. Hopefully it will be a more scalable approach. So, /foo and /bar might be on different apps, but all under the same domain in production. But, if using the development servers they would be on different ports. In production we can use the load balancer (or the web server) to direct requests to the right app. But, I need suggestions for development. Currently, the developers start up a proxy server that points to their development instances (one or more Catalyst apps). But, that has its own problems (like Apache blocking for some amount of time when a Catalyst dev server is restarted and Apache thinks the server died.) One option I was kicking around was wrapping uri_for to map requests to different paths to different development servers running on different ports. That would simply be per-developer configuration -- meaning each developer has their own port pool to use in the case of developers working on the same dev machine. Any other suggestions how to let developers work with related Catalyst apps (that need to link to each other) using the Catalyst development server? Thanks, -- Bill Moseley mose...@hank.orgmailto:mose...@hank.org ___ List: Catalyst@lists.scsys.co.ukmailto: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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Setting the COMPILE_DIR for TT templates in the configuration file
Yes it should and does. Can you come on irc.perl.org to quicker fix your problem? Am 2012-01-23 20:35, schrieb Robert Rothenberg: On 23/01/12 17:39 André Walker wrote: On 01/22/2012 06:16 PM, Robert Rothenberg wrote: It doesn't quite look like what I expect. Excerpts: Plugin::Session = { storage = /tmp/myapp/session, }, View::TT= { COMPILE_DIR = /tmp/myapp/template_cache, }, Those are the defaults that are set in the module. I want to override them in the conf file. Hold on. Does it mean that you're setting COMPILE_DIR to /tmp/myapp/template_cache on MyApp::View::TT and you're trying to override it on the config file? Can you show us View/TT.pm please? I'm pretty sure that changing the config in the component module overrides the *.conf file, but couldn't find it in the docs. According to what I read in the docs, setting it in the conf file should override the module. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Setting the COMPILE_DIR for TT templates in the configuration file
Hi Robert, what config format are you using? If the file has the extension .conf Config::General is used and your example should work. Am 2012-01-22 21:16, schrieb Robert Rothenberg: On 22/01/12 19:58 Tomas Doran wrote: On 22 Jan 2012, at 18:54, Robert Rothenberg wrote: View::TT COMPILE_DIR /var/opt/myapp/template_cache /View::TT where MyApp::View::TT is the name of the view module. None of them work. How do I do this? This should work. http://localhost:3000/?dump_info=1 will dump the config that the app has actually read in and merged (assuming you've got debug mode on and you're using the standard RenderView plugin). Does the config dumped look like you expect? Can you show us? It doesn't quite look like what I expect. Excerpts: Plugin::Session = { storage = /tmp/myapp/session, }, View::TT= { COMPILE_DIR = /tmp/myapp/template_cache, }, Those are the defaults that are set in the module. I want to override them in the conf file. But setting in the conf file: Plugin::Session storage /var/opt/myapp/session /PLugin::Session or similarly forView::TT does not change those values. (I know setting other things such as the DSN in the conf works, so it's the right file). Rob Are you customising your TT view in any way (i.e. adding extra code yourself - specifically to the constructor). Do you have a make_immutable in there? (Can you show us the whole file?) 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/ ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Setting the COMPILE_DIR for TT templates in the configuration file
Have you loaded Catalyst::Plugin::ConfigLoader? Am 2012-01-23 10:29, schrieb Robert Rothenberg: On 23/01/12 09:14 Alexander Hartmaier wrote: Hi Robert, what config format are you using? If the file has the extension .conf Config::General is used and your example should work. I am using the general format, but it doesn't work. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] post-deployment custom fields in application
I'd use a nosql database or the xml feature of PostgreSQL/Oracle/... or just have a large column that takes JSON. Am 2011-12-22 20:01, schrieb bill hauck: Hi. I'm building an application--project management system--that I'd like to have the application administrators to be able to create custom fields for various tables after deployment. For instance, instead of including a hard-coded field for every possible IM or chat system out there, I'd like the admins to be able to decide they only care about AIM and Skype, so they'd add aim_name and skype_name fields. Other installations and admins might decide they only care about gtalk and facebook so they'd add those fields. The other issue is that I don't want to simply add 10 extra fields and give the admins control of the display name. I'd like to essentially have a secondary table that holds the custom fields for that table's primary table. So ... The person table has a person_custom table to hold the custom fields and data. The project table has a project_custom table to hold the custom fields and data. Etc. So my question really is what's the best approach? A secondary table for every table I want custom fields for? Or a set of static tables where the first holds the field information and the second holds the data related to those fields? or is there a completely different way I'm not thinking of? For the first way, custom table per table, how do I make DBIx::Class work with that? I don't want to have to run the model creation script after adding or modifying a custom field; I'd like to have the field available on the fly. Do I have to give up DBIC for the custom tables? Any info is greatly appreciated. Thanks, bill ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Recommended caching back-ends
Hi Toby, note that you can still use Cache::FastMmap with Catalyst::Plugin::Cache (Config::General config file section): Plugin::Cache backend class Cache::FastMmap expires 3600 cache_size 8m /backend /Plugin::Cache It took me also some time to find out which module is the 'old' and which the 'new' one, docs need improvement for that. I'm using it since years without a single segfault. You shouldn't use it as a session *store* because it is a *cache* which means it can drop a stored entry anytime if it runs out of memory for a new entry. Cheers, Alex Am 2011-10-07 03:52, schrieb Toby Corkindale: Hey all, I noticed today that Catalyst::Plugin::Cache::FastMmap has been DEPRECATED for some now. (With dire warnings about it segfaulting or discarding data randomly) I just wondered what the recommended caching backend is now, to use with Catalyst::Plugin::Cache. (In my case, cached data doesn't need to be consistent between app servers.. it's more just for performance so simple local-disk is fine for caching, rather than memcached or database based solutions.) Cheers, Toby *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] RE: DBIC - JSON conversion for AJAX
Catalyst::Controller::DBIC::API was written for exactly that use case. Cheers, Alex Am 2011-09-12 16:38, schrieb Roland Philibert: Thanks all for your suggestions so far. I was I guess on the right track with JSON:XS but I had also seen REST but so far I am still unsure as what the best way to go. Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12 2XT. Registered in England No. 06570543. This e-mail and any attachments contain confidential information and are solely for the review and use of the intended recipient. If you have received this e-mail in error, please notify the sender and destroy this e-mail and any copies. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] fastcgi script returns 404
Static files should be in /root/static and configured to be served static. Am 2011-09-26 08:32, schrieb Jorge Gonzalez: El 24/09/11 13:23, Richard Thomas escribió: On 24/09/2011, at 5:41 PM, Jorge Gonzalez wrote: And this is my apache configuration for reverse proxying to Starman: ProxyPass / http://localhost:3000/ ProxyPassReverse/ http://localhost:3000/ Directory /home/myapp/MyApp/root Options FollowSymLinks AllowOverride None /Directory Alias /css/ /home/myapp/MyApp/root/css/ Alias /img/ /home/myapp/MyApp/root/img/ Alias /js//home/myapp/MyApp/root/js/ (I know this could be better :-) For running the app from the main app directory: starman -Ilib script/myapp.psgi -p 3000 --workers 3 No problems so far, using the same configuration in 4 applications in heavy production use. Regards J. There must be some Rewrite Rules in the mix here as well, surely? I'm trying to get this set-up going, but am having two issues: - All generated links refer to localhost:3000 You can avoid this by using Plugin::SmartURI in relative mode, AND assuring ALL of your URLs in your app are generated via uri_for method. No need for rewrite rules in Apache. - The Catalyst app is still attempting to serve all the static content Sorry, I pasted some prior Apache configuration version by mistake! These are my real Alias sections for Apache: Alias /css/ /home/myapp/MyApp/root/css/ Location /css SetHandler default-handler /Location Alias /img/ /home/myapp/MyApp/root/img/ Location /img SetHandler default-handler /Location Alias /js//home/myapp/MyApp/root/js/ Location /js SetHandler default-handler /Location Hope it works for you. Regards J. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] announcing DBICx::Generator::ExtJS::Model
As a followup on SQL::Translator::Producer::ExtJS::Model::File (which I won't develop further) I've finally found time to write DBICx::Generator::ExtJS::Model which does the same but works on a DBIx::Class instead of a SQL::Translator schema. This has the advantage of knowing the relationship names. What's missing is the serialization of the generated ExtJS models and the output to one file per model as the ExtJS 4 docs suggest (http://docs.sencha.com/ext-js/4-0/#/guide/application_architecture). The code is hosted on github: https://github.com/abraxxa/DBICx-Generator-ExtJS-Model If you're interested get in touch with me via this list or irc #catalyst or #dbix-class. -- Alex (abraxxa) *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] announcing SQL::Translator::Producer::ExtJS::Model::File
I'm cross-posting this to the DBIx::Class and the Catalyst mailing list as both users might be interested in it. I wanted to do this as soon as I've read the first blog post about the ExtJS 4 data model and last Friday evening I've finally started writing it. After a short discussion on #dbix-class on Friday I chose to implement it as a SQL::Translator Producer so other ORM frameworks could just write a SQL::T::Parser and use it too. Personally I'll use the generated ExtJS classes with Catalyst::Controller::DBIC::API in the backend. The one drawback of making it a sqlt producer is that the dbic parser loses the relationship names when creating the sqlt constraints. This means that for using the resulting ExtJS classes with DBIC::API the user has to change all relationship names. What's your opinion on this issue? Should it be a different module that directly parses dbic resultsources instead of using sqlt? The code is hosted on github: https://github.com/abraxxa/SQL-Translator-Producer-ExtJS-Model-File Best regards, Alex (abraxxa) *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Job Queue recommendation
t0m created CatalystX::JobServer which is currently only available on github: https://github.com/bobtfish/CatalystX-JobServer -- Best regards, Alex On Fri, 2011-01-21 at 15:49 +0100, Bill Moseley wrote: 2011/1/21 Octavian Rasnita orasn...@gmail.com Hello, Can you recommend a job queue system that works under Windows (and which works with Oracle if it needs a database)? Have you looked at AMQP implementations? RabbitMQ seems to have a Windows download. But normally you would run the queue on its on machine (or machines) so might as well use Linux for that. I suspect the Windows RabbitMQ is not as well used, but that's just a guess. http://www.rabbitmq.com/server.html http://qpid.apache.org/download.cgi It seems like there's some discussion around about if a database makes a good queue. Grated, on the RabbitMQ site, so with a bias, but here's one: http://www.rabbitmq.com/resources/RabbitMQ_Oxford_Geek_Night.pdf A bit dated, but this is often cited when someone is comparing options: http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes -- Bill Moseley mose...@hank.org *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] In HTML::FormHandler search form (no DB schema) -- how to populate a SELECT field via DBIx::Class?
Why not solve it the exact same way? Defined a schema attribute an pass your schema when constructing the form object. Maybe you only want to pass the country rs instead, whatever fits your needs best. Also note that HFH will automatically detect a belongs_to and populate the Select without a need for the options_country sub! Come to #formhandler if you have more questions. -- Best regards, Alex On Sun, 2011-01-16 at 16:41 +0100, will trillich wrote: Short version: If you have a HTML::FormHandler search form without a has_field '+item_class' (there's no data-base row corresponding to its contents) how to you reach your DBIx::Class schemas to populate a drop-down menu? Long version: This is in the context of a Catalyst app -- however, I do know this is either FormHandler question or a DBIC question, and not intrinsically a Catalyst question, but... hoping the wise folks here can nudge me in the right direction... We have several DBIC resultsets including Incident and Country. The Incident record has this relationship: __PACKAGE__-belongs_to( 'country' = 'Incident::Schema::DB::Result::Country' ); (And the country schema has_many incidents, of course) For the CRUD form related to the actual incident table, we have a matching HTML::FormHandler package with its has '+item_class' as expected. This makes it easy to create a sub options_country { my $self = shift; return unless $self-schema; my $rs = $self-schema-resultset('Country'); #... } subroutine for the form, for populating a country drop-down menu in the HTML. But! For the SEARCH form, we are not interested in CRUD, plus we have extra fields (for example, we want the user to be able to bracket dates with a start-field and an end-field) so there's no one-to-one correlation with the database table -- meaning there's no item_class for the search form. And hence no schema to rely on. What we're looking for now -- unless there's a better more obvious paradigm -- is a way to get from an instance of the schema-object, back to the resultset, for searching. sub options_country { my $self = shift; # note $c is not available here :( # $self-schema will be UNDEF here my $obj = Spill::Schema::DB::Result::Country-new; # Hard-wired, yes, is there a better way? my $rs = $obj-??? # ? } I've looked at - $obj-result_source (Can't call method resolve on an undefined valued in DBIx/Class/Row) - $obj-result_source_instance-resultset (Can't call method default_resultset_attributes on an undef value in DBIx/Class/ResultSource) - $obj-result_source_instance-resultset_class-search({},{}) (Can't use string as a HASH ref in DBIx/Class/ResultSet) and a couple other dead ends. It's likely to be something obvious I've overlooked. :( Suggestions? -- The first step towards getting somewhere is to decide that you are not going to stay where you are. -- J.P.Morgan *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Re: Trying out FormHandler, running into maketext error
Perl is case sensitive. Also you should not have any non Catalyst::Controller subclasses in the Controller namespace of your app. Move you forms to My::App::Form for example. -- Best regards, Alex On Mon, 2010-11-22 at 18:25 +0100, will trillich wrote: Ooh, very nice! Thanks so much, that's lots better now. Woo hoo! Yes indeed, the undef error - Unable to do maketext on: at /usr/local/share/perl/5.10.0/HTML/FormHandler/I18N.pm line 15. error has gone away thanks to tweaks to the SUBMIT button on the FormHandler definition. Was there something in the Catalyst/FormHanlder intro that we missed? On Mon, Nov 22, 2010 at 5:16 PM, Hernan Lopes hernanlo...@gmail.com wrote: will trillich, that error happens when i use has_field 'submit' = ( widget = 'submit' ) can you test your form with this instead: has_field 'submit' = (type = 'Submit', label = 'Submit', value='Submit', required = 0, ) i bet your error will go away On Mon, Nov 22, 2010 at 12:19 PM, will trillich will.trill...@serensoft.com wrote: Our form-class includes has_field 'submit' = ( widget = 'submit' ) Do you mean type='submit' instead of widget='submit'? Interesting that you'd think of this as a suspect. What's the rationale? On Mon, Nov 22, 2010 at 9:16 AM, Hernan Lopes hernanlo...@gmail.com wrote: will trilich, are you using widget type submit ? try to replace with type = 'Submit' Hernan Lopes On Mon, Nov 22, 2010 at 1:38 AM, John Anderson geneh...@genehack.org wrote: On Nov 21, 2010, at 10:26 PM, will trillich wrote: Pooh. Still no luck. When we try a more more Moose-y approach, we do get updated database records (stuffing the URL with arguments to affect a form-submit) but still can't render, with the same error as before: Have you looked at the docs for HTML::FormHandler::TraitFor::I18N? Based on that, you may want to see if you have something in $ENV{LANGUAGE_HANDLE} or try passing in a language handle to your form constructor -- or may try push_errors instead of add_errors, as that documentation suggests. j. ___ 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/ -- Failure is not important. How you overcome it, is. -- Nick Vujicic ___ 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/ -- Failure is not important. How you overcome it, is. -- Nick Vujicic *** T-Systems Austria GesmbH Rennweg 97-99, 1030
Re: [Catalyst] Forward on to other actions after removing first path segment?
Have you thought about making the date a parameter instead of part of the uri? -- Best regards, Alex On Mon, 2010-11-15 at 20:10 +0100, Dorian Taylor (Lists) wrote: Hi Larry, On 15-Nov-10, at 10:55 AM, Larry Leszczynski wrote: Hi Dorian - OK, but the part that confuses me is why /foo doesn't resolve to MyApp::Foo::index with -go or -visit. Maybe this will help (I think in this case index works like default): http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath According to your wiki page, my solution is thus: package MyApp; sub _date :Regex('^(\d{4}-\d{2}-\d{2})(.*)$') { my ($self, $c) = @_; my ($date, $rest) = @{$c-req-captures}; $c-req-path($rest); $c-dispatcher-prepare_action($c); $c-go($c-action, $c-req-args); } This exhibits exactly the behaviour I was looking for. Thanks, -- Dorian Taylor Make things. Make sense. http://doriantaylor.com ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Re: Organizing link generators
To me company, lot and vin in the url look like arguments, not PathParts. -- Best regards, Alex On Thu, 2010-11-11 at 11:48 +0100, Aristotle Pagaltzis wrote: * Alexander Hartmaier alexander.hartma...@t-systems.at [2010-11-11 09:00]: I strongly advise to use $c-controller('Auth')-action_for('edit') instead of '/auth/company/lot/vin/edit' to not let Catalyst guess what you mean. The string can fail if you have a typo in it and will be hard to spot. No, that would be `$c-controller('Auth::Company::Lot::Vin')`. I use the action paths in our app and haven’t had any serious trouble. You can always wrap `uri_for_action` or `uri_for` in your application class to throw an error if it’s a real issue, anyway. Regards, *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Organizing link generators
I strongly advise to use $c-controller('Auth')-action_for('edit') instead of '/auth/company/lot/vin/edit' to not let Catalyst guess what you mean. The string can fail if you have a typo in it and will be hard to spot. -- Best regards, Alex On Sat, 2010-10-23 at 18:57 +0200, Eden Cardim wrote: Evan == Evan Carroll m...@evancarroll.com writes: Evan My view often needs to generate complex links for chained Evan actions. Does anyone have a better way of doing this then Evan recreating the link generators in the controller? $c-stash-{generate_link_edit} = sub { my $vin = shift; $c-uri_for_action( '/auth/company/lot/vin/edit' , [ $c-stash-{chained_company_id} , $c-stash-{chained_lot_id} , $vin ] , () ); }; $c-stash-{generate_link_vehicle_add} = sub { $c-uri_for_action( '/auth/company/lot/inventory/add' , [ $c-stash-{chained_company_id} , $c-stash-{chained_lot_id} ] , () ); }; You should weaken the $c since that code will leak memory without it. And yes, that's currently the best way to generate urls (that I can think of anyway), although you can save some typing by using hash slices instead. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Defining ARRAY in Config::General config
If you're referring to Catalyst::Plugin::Email you shouldn't use that any more as mailing doesn't need to be a plugin but a view. Try Catalyst::View::Email(::Template) -- Best regards, Alex Am Dienstag, den 21.09.2010, 06:29 +0200 schrieb Pavel A. Karoukin: Hello, I am using Catalyst::Plugin::Mail and want to define email config in myapp.conf. But C::P::Mail expects email config variable to be array ref. How I can assign array value to config variable in myapp.conf? Regards, Pavel *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Make the money format macro globally available.
Or use the awesome expose_methods config param introduced in version 0.35: http://search.cpan.org/~bobtfish/Catalyst-View-TT-0.35/lib/Catalyst/View/TT.pm#expose_methods -- Best regards, Alex Am Mittwoch, den 22.09.2010, 12:47 +0200 schrieb Duncan Garland: Works like a charm. Thanks. -Original Message- From: Larry Leszczynski [mailto:lar...@emailplus.org] Sent: 21 September 2010 18:05 To: The elegant MVC web framework; catalyst@lists.scsys.co.uk Subject: Re: [Catalyst] Make the money format macro globally available. Hi Duncan - On Tue, 21 Sep 2010 17:52 +0100, Duncan Garland duncan.garl...@motortrak.com wrote: How do you make the money macro available in all templates? [% USE money=format('%.2f') -%] Presumably something goes in here: __PACKAGE__-config( TEMPLATE_EXTENSION = '.tt', render_die = 1, WRAPPER = 'wrapper.tt', ); You can put commonly used macros, formats, etc. in a file named e.g. pre_process_config.tt in your main templates directory, then add PRE_PROCESS to your config: __PACKAGE__-config( TEMPLATE_EXTENSION = '.tt', render_die = 1, WRAPPER = 'wrapper.tt', PRE_PROCESS = 'pre_process_config.tt'. ); HTH, Larry ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] best practices for handling forms?
Take a look at HFH, especially this pod: http://search.cpan.org/~gshank/HTML-FormHandler-0.32002/lib/HTML/FormHandler/Manual/Cookbook.pod I tried both FormFu and FormHandler and the later is much cleaner code and also a lot faster although it uses Moose. -- Best regards, Alex Am Montag, den 20.09.2010, 23:48 +0200 schrieb E R: Hi, I am curious what everyone thinks as being the best practices for handling forms in Catalyst. Are there any Catalyst applications you have run across which are good examples of how to use Catalyst's features to handle forms? To illustrate what I am getting at, below is typical Rails (v2) controller code which implements updating the attributes of an object: def edit @book = Book.find(params[:id]) @subjects = Subject.find(:all) end def update @book = Book.find(params[:id]) if @book.update_attributes(params[:book]) flash[:notice] = 'Book successfully updated.' redirect_to :action = 'show', :id = @book else @subjects = Subject.find(:all) render :action = 'edit' end end In Catalyst, this would be appear something like (and please correct me if I have made any errors here): sub edit :Args(1) { my ($self, $c, $id) = @_; ... set up $c-stash for template 'edit' ... # no need to set $c-stash-{template} - will be set from the current action } sub update :Args(1) { my ($self, $c, $id) = @_; ...process form... if (form is valid) { ...perform updates... $c-flash-{notice} = 'Book successfully updated.'; $c-res-redirect('show', $id); } else { ... set up $c-stash for 'edit' template ... $c-stash-{template} = 'edit'; } } Any comments on this architecture? Is there a better way? My main problems are: 1. The code ... set up $c-stash for 'edit' template ... is duplicated in both edit and update (which is also true for the Rails code). 2. Having the template name defaulted from the current action is nice, but that means we have to explicitly set it in the update method. Is it better to always explicitly set the template name in a controller method? Then update could perform a $c-detach('edit', $id) or would you use $c-go('edit', $id)? Thanks, ER ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] working with strange port setups
Please talk to your firewall admins (I'm one myself) to allow tcp/443. I can't think of a reason they would deny that request. Everything else is just sick and might hurt you later if an IPS tries to verify that its http and can't decode it. -- Best regards, Alex Am Samstag, den 21.08.2010, 11:51 +0200 schrieb Darren Duncan: Hello, For context, I'm currently deploying/demoing a Catalyst app on a client machine where it uses a contrived base url scheme to work around a restrictive firewall setup. To be specific, the Firewall blocks all ports except port 80 (plus a few admin ports like SSH etc) and I want to run through HTTPS, so I've currently got the machine's Apache running HTTPS through port 80 rather than 443. (My development machine isn't contrived at all, so no issue there.) The contrived url for my Catalyst app looks like this: https://example.com:80/MyApp/some/page My app initially works fine here using the FastCGI or CGI server script and the urls produced by uri_for() are mostly what is needed here but not quite. An invocation of: https://example.com:80/MyApp/some/page ... would have page urls going to the likes of: https://example.com/MyApp/other/page ... which is correct except for the missing :80, because the result alone implies port 443 which isn't correct here. Now from running the first url with ?dump_info=1 shows that the FastCGI/CGI program, namely Catalyst, *does* receive the necessary information to produce correct base urls. Here's a relevant subset of Request details from dump_info: bless({ base = bless(do{\(my $o = https://example.com/MyApp/;)}, URI::https), headers = bless({ host = example.com:80, https = on, }, HTTP::Headers), uri = bless(do{\(my $o = https://example.com/MyApp/some/page?dump_info=1;)}, URI::https), }, Catalyst::Request) The base and uri reflect the incorrect output, but the headers records the fact that both port 80 was invoked and https is on. Using the latter 2 bits of information, Catalyst should be able to construct https://example.com:80; urls. Therefore, can anyone tell me how to configure Catalyst so that it builds the urls I need, or alternately where in the Catalyst source I should look in order to create a patch to enable this? Ideally this added smarts could make it into a CPAN release, if code changes are needed, but I would like to have this working quite soon, so if I knew what to patch in the meantime to get this to work, I would appreciate it. Undoubtedly, Catalyst should simply handle this situation, but I'm not surprised that it doesn't yet, considering this is an edge case that the developers may not have encountered before. Thank you. -- Darren Duncan ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] C::V::Email::Template does not render
As you can see in the docs of C::View::Email::Template the view you configure has to be TT, Web in your case, not Email::Template itself. The rendered template looks fine to me besides the localize. Does this work with your View::Web when generating a html page for the browser? -- Best regards, Alex Am Mittwoch, den 15.09.2010, 22:23 +0200 schrieb Ekki Plicht (DF4OR): Sorry to be a PITA, but I can't make heads nor tails of this view thing. When I started my app I created a view like this $ script/wshop_create.pl view Web TT Since then Cat renders my web templates fine. Now I have followed the cookbook example, later the example from C::V::Email::Template docs to send mails: $ script/wshop_create.pl view Email::Template Email::Template So I have two view instances, as debug output shows: | wshop::View::Email::Template | instance | | wshop::View::Web | instance | Configured like this (the relevant part only): View::Email::Template default content_type text/plain charset utf-8 view Email::Template /default /View::Email::Template Now when I want to use the Email::Template like this: $c-stash-{digest} = $newuser-get_column('digest'); $c-stash-{email} = { to = $c-req-params-{'email'}, from = $c-config-{mailfrom}, subject = $c-localize( 'mm_registersubject' ), template = 'registermail.tt' }; $c-forward( $c-view( 'Email::Template' )); return $c-res-redirect( $c-uri_for('/user/registerdone') ); I get an error: Caught exception in wshop::View::Email::Template-process C::V::Email::Template's configured view 'wshop::View::Email::Template=HASH(0x9c00890)' doesn't have a render method! at /usr/lib/perl5/site_perl/5.12.2/i686-linux/Class/MOP/Method/Wrapped.pm line 159 Now that's most surprising. wshop::V::Email::Template doesn't have a render method? Hm. That's where I get lost... If I change the configuration to 'default view Web' (my other view), the email does get sent, but not rendered. A template like this [% c.localize('mm_reghello') %] [% c.localize('mm_regsent') %] [% c.uri_for('/user/registration') %][% c.digest %] [% c.localize('mm_regfinal') %] [% PROCESS mailsig.tt %] Context is [% c %] Base is [% base %] Name is [% name %] is turned into this: mm_reghello mm_regsent http://localhost:3000/user/registration mm_regfinal -- Signature as intended (i.e. PROCESS works) Context is wshop=HASH(0xa229bc0) Base is http://localhost:3000/ Name is wshop Any help is greatly appreciated, as I am really lost at the moment. TIA. Cheers, Ekki *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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 share a database connection across multiple Catalyst apps?
I guess the DBA's don't like it because Oracle starts one process per connection unless you use connection pooling. I think that's a listener setting, your DBA's should know. -- Best regards, Alex Am Mittwoch, den 08.09.2010, 16:54 +0200 schrieb Simon Miner: Thanks for the responses, Jason, I don't think reducing the number of database connections will hurt responsiveness. Even though there are 3 separate Catalyst apps, each HTTP request will only involve one of them (since they all run out of the same web server), so there should never be contention between the apps for the shared database connection. Does this make sense? Tom and Nicholas, I wish this was premature optimization, but my organization has experienced serious performance issues in the past related to multiple (Oracle) database connections per HTTP server process. Extra Oracle connections are expensive to maintain, particularly on the database server, and so we've tried to ensure that a single server process only has a single connection to a given database (since that's all it should need at any given time). I've attached a Devel::NYTProf screenshot for one of the server processes I profiled this morning. Looks like it confirms the multiple database connections. So back to initial question -- How do I update the models of my three Catalyst apps to share a single Oracle database connection? Thanks again. I really appreciate your feedback. Simon On Tue, Sep 7, 2010 at 11:40 PM, Nicholas Wehr catal...@bionikchickens.com wrote: I'm with Tom on this one. Unless you've narrowed all optimization efforts and this is all you have left - it could be worth a try.. but as Jason points out, you may not gain a thing. I'd recommend profiling your code and tracking down performance issues from that base level. Please post your results - I've very curious! -nw On Tue, Sep 7, 2010 at 7:21 PM, Tomas Doran bobtf...@bobtfish.net wrote: On 7 Sep 2010, at 18:59, Simon Miner wrote: All three of these apps run under a single Apache 1.3.42/mod_perl 1.31 server. Wow, mod_perl 1 Ok then :) It appears that each server process creates a unique database connection variable for each of these apps. Although these database connections get reused from request to request, I would like to make things even more efficient by having a single database connection variable per server process which gets shared across all 3 Catalyst apps. Why do you think that this will help or affect anything? I.e. is this not premature optimisation? 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/ ___ 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/ -- -- Simon *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst::Controller::DBIC::API::REST warnings
Moose::Role::BuildInstanceOf 0.07 fixes the problem so you can upgrade again. -- Best regards, Alex Am Dienstag, den 10.08.2010, 19:06 +0200 schrieb Thiago Yukio Kikuchi Oliveira: Thanks Florian and Alexander! I just downgrade my Moose version to 1.08 and everthing works! /Thiago Yukio Kikuchi Oliveira (=\ \=) Faculdade de Medicina de Ribeirão Preto / Laboratório de Genética Molecular e Bioinformática /=) - (=/ Centro de Terapia Celular/CEPID/FAPESP - Hemocentro de Rib. Preto /Rua Tenente Catão Roxo, 2501 CEP 14151-140 (=\ Ribeirão Preto - São Paulo \=) Fone: 55 16 2101-9300 Ramal: 9603 / E-mail: stra...@lgmb.fmrp.usp.br /=)strat...@gmail.com (=/ /Bioinformatic Team - BiT: http://lgmb.fmrp.usp.br (=\ Hemocentro de Ribeirão Preto: http://pegasus.fmrp.usp.br \=) / - On Tue, Aug 10, 2010 at 12:58 PM, Alexander Hartmaier alexander.hartma...@t-systems.at wrote: Awesome, my module does have users! I'm improving test code coverage since YAPC and will upload the next version in a couple of days (yes the very first test found a bug in RPC). Like rafl explained just downgrade Moose to 1.08 for the moment and you're fine. -- Best regards, Alex Am Dienstag, den 10.08.2010, 17:09 +0200 schrieb Florian Ragwitz: Thiago Yukio Kikuchi Oliveira strat...@gmail.com writes: I installed the last Catalyst::Controller::DBIC::API::REST from CPAN but when I try to use it, the same shows the warning below. I update all my Moose and MooseX modules but seems not work too. That's a bug in MooseX::Role::BuildInstanceOf, which is now exposed by Moose being stricter about attributes that should coerce. How to solve this? Either wait a couple of days for a new Moose::Role::BuildInstanceOf version to appear on CPAN, or downgrade Moose to a version which is less strict about those things. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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/ ___ 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] DBIC custom SQL hack stopped working after upgrading Catalyst
Hi Tobias, I've added a My::Model::Constants namespace which several modules containing constants for different parts of my schema and include those in my result(set) classes if needed and the cat apps using the model. -- Best regards, Alex Am Montag, den 09.08.2010, 17:04 +0200 schrieb Tobias Kremer: On Mon, Aug 9, 2010 at 12:24 PM, Tobias Kremer tobias.kre...@gmail.com wrote: Couldn't load class (MyApp) because: DBIx::Class::Row::throw_exception(): Can't locate object method register_source via package MyApp::Schema at xxx/MyApp/Schema/User.pm line 357 (see line below). Can you load Devel::SimpleTrace and get a full stack trace of the failure? Is it possible that this has got something to do with me explicitly use'ing some Schema classes in controllers because they have some constants defined that I need to access? My suspicion was right: After removing all use MyApp::Schema::* occurrences from our controllers the app started. Nevertheless, I'm not sure if this is expected behaviour. I skimmed through the mailing list archive and found a thread about how best to arrange constants and the recommendation was to create a separate MyApp::Constants class. But to me it sounds more rational to store, say different role IDs as constants in the corresponding MyApp::Schema::Role model class... Any thoughts? --Tobias ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst::Controller::DBIC::API::REST warnings
Awesome, my module does have users! I'm improving test code coverage since YAPC and will upload the next version in a couple of days (yes the very first test found a bug in RPC). Like rafl explained just downgrade Moose to 1.08 for the moment and you're fine. -- Best regards, Alex Am Dienstag, den 10.08.2010, 17:09 +0200 schrieb Florian Ragwitz: Thiago Yukio Kikuchi Oliveira strat...@gmail.com writes: I installed the last Catalyst::Controller::DBIC::API::REST from CPAN but when I try to use it, the same shows the warning below. I update all my Moose and MooseX modules but seems not work too. That's a bug in MooseX::Role::BuildInstanceOf, which is now exposed by Moose being stricter about attributes that should coerce. How to solve this? Either wait a couple of days for a new Moose::Role::BuildInstanceOf version to appear on CPAN, or downgrade Moose to a version which is less strict about those things. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] rich ajax UI component libraries for Catalyst?
I'm one of the guys using ExtJS with DBIC::API. I tried Dojo about two years ago and docs didn't exist for it, don't know if that has changed. jQuery UI is lacking a *lot* of widgets compared to ExtJS which is really awesome when it comes to subclassing components to build your own. -- Best regards, Alex Am Samstag, den 24.07.2010, 18:31 +0200 schrieb Nick Perez: On Sat, 24 Jul 2010 16:43:58 +0200 Leandro Hermida soft...@leandrohermida.com wrote: Hi everyone, Are there any rich ajax UI component libraries out there that would interoperate well with Catalyst? thanks, Leandro I've had success both with jquery-ui and also with extjs. A number of people I know that use Catalyst::Controller:DBIC::API also use those tools and report favorable experiences. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Best practice for setting up database in a complex project?
SQL::Translator generates constraints, indexes, ... Deploying my test db was quite easy using it after I've fixed some Oracle specific bugs. -- Best regards, Alex Am Freitag, den 16.07.2010, 20:07 +0200 schrieb Dave Rolsky: On Fri, 16 Jul 2010, Matija Grabnar wrote: Do you write the database definition mysql/postgresql format, and then dump schema to get the Perl classes, or do you write Perl class definitions and use something else to output the table creation statements for the database of your choice? Personally, I like to write the schema in SQL. My _reason_ for this is that I actually intend to fully use the database. That means defining custom types, adding table constraints, triggers, etc. The SQL schema file is the primary definition for the database. And what do you do when the structure of the database changes (new tables, new columns, new indexes or foreign keys) - do you use a DB versioning thing, or do you do it by hand? If you do use a DB versioning tool, which do you recommend? If you're using things like constraints, triggers, etc., then you'll almost certainly need to do this stuff by hand. I've written some tools to help with this as part of a wiki I'm working on. You can see it on CPAN (http://search.cpan.org/dist/Silki) or in my mercurial repo (http://hg.urth.org/hg/Silki). I'm pretty happy with how this works, and I've even written a framework to do automated tests of my migrations, which is very helpful. It's very easy to make mistakes when writing migrations, so tests are pretty valuable here. -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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Contributing code
I'd prefer *much* more inline comments as well to make it easier to work on code parts I've never touched before when debugging or adding features as it's very hard to figure out what the methods do and how they interact. -- Best regards, Alex Am Montag, den 21.06.2010, 16:55 +0200 schrieb J. Shirley: On Mon, Jun 21, 2010 at 7:43 AM, iain iainhubb...@googlemail.com wrote: Ævar Arnfjörð Bjarmason wrote: It depends on what sort of comments you're making. Comments that explain tricky code that help with maintenance down the road are welcome everywhere. If you're just making comments that help someone completely unfamiliar with Catalyst to read the code it'll probably be more distracting than helpful to core devs. Surely the core devs can work with comments? Would having more comments not encourage more developers to contribute by lowering the barrier for entry? I don't think I can count as a core developer anymore, but really the more comments the better (provided they aren't there so you can practice your buddy career as a novelist). If you can't write sane comments, though, I don't think you can write sane code :) ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Chained actions with can't terminate with :PathPart('') ?
Trevors example might overwhelm you a bit if you're not already that familiar with chained. The thing to understand is, every endpoint needs to end with an action that uses Args, every part in the chain CaptureArgs, both might be (0). So in your example you need a middle chain part for lot with two endpoints, one with Args(0) to match just /lot and another one with Args(1) that captures the lot id and matches /lot/5. HTH -- Best regards, Alex Am Freitag, den 07.05.2010, 19:12 +0200 schrieb Evan Carroll: I have two destinations in my Catalyst app /auth/company/5/lot /auth/company/5/lot/5 This works and is often seen in Catalyst apps to achive this effect. sub lot :Chained('/auth/company') :CaptureArgs(1) { sub view_lot :Chained('/auth/company') :PathPart('') :Args(1) { However, I would also expect the below to work; but, it seems it doesn't. I can only formulate the effect I want the above way. This is unfortunate because if all chained descendants of `lot` utilize a check provided here in the chain, then shouldn't `view_lot` also get to utilize that code? It would certainly be nice to eliminate redundant code here. sub lot :Chained('/auth/company') :CaptureArgs(1) { sub view_lot :Chained('/auth/company/lot') :PathPart('') :Args(0) { I think it is also confusing to those that first encounter it. I always know that I could just call it /view, and be done with it, but still. /auth/company/5/lot/5/view rather than, /auth/company/5/lot/5 But, I just wanted to know what others thought of this. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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 Jquery UI Autocomplete widget with Catalyst::View::JSON
HRI will return prefetched rels too, get_columns won't. -- Best regards, Alex Am Montag, den 26.04.2010, 17:23 +0200 schrieb Ben van Staveren: Used it but at the same time, doing my $hashref = { $row-get_columns } got me more or less the same effect for a lot less hassle :) I actually do this for most my DB objects that get serialised to JSON, quite simple case of $c-stash-{json} = [ map { $_-get_columns } $rs-all ]; In a similar vein, I haven't yet really seen/heard any sort of best practices when it comes to Catalyst and JSON, so maybe I'm going about it all wrong but eh :) Lee Aylward wrote: On Mon, 26 Apr 2010 16:33:31 +0700 Ben van Staveren benvanstave...@gmail.com wrote: Probably not the most pretty one but: Given you have a resultset obtained with, say, my $result_set = $c-model('DB::Somedata')-search_rs({...}, {...}); $c-stash-{json} = [ map { id = $_-id, label = $_-name } ($result_set-all) ]; Or a bit more verbose: foreach my $result ($result_set-all) { push(@{$c-stash-{json}}, { id = $result-id, label = $result-name }); } ` I've also had good luck using DBIx::Class::RsultClass::HashRefInflator in the past. It doesn't give you quite as much control, but it may be enough for your needs. http://search.cpan.org/~frew/DBIx-Class/lib/DBIx/Class/ResultClass/HashRefInflator.pm -- Ben van Staveren phone: +62 81 70777529 email: benvanstave...@gmail.com *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Check is session is expired
You have to $c-detach() right after the redirect to stop further execution of the current action. If you're doing the redirect in an auto method you might also return a false value. -- Best regards, Alex Am Freitag, den 16.04.2010, 11:51 +0200 schrieb David: Regarding session expiring, I am having a little problem. I want to redirecto to login page whenever session is expired. It works allright, but when I do the redirect in a Controller index method ( sub index :Path :Args(0){} ), I always get next error message: Caught exception in engine Can't call method as_string on an undefined value at /usr/local/share/perl/5.8.8/Catalyst/Engine.pm line 95. Browser gets 404 HTTP Error, because instead of being redirect to login page, it is redirect to the same page, the page which is served int the index method. I have made tests, and the redirect doesn't seem to be working right in this case. Code is executed after redirect, instead of stopping executing. Redirect looks like: $c-response-redirect($c-uri_for('/')); David __ De: Ben Hitz h...@genome.stanford.edu Para: The elegant MVC web framework catalyst@lists.scsys.co.uk Enviado: jue,15 abril, 2010 18:59 Asunto: Re: [Catalyst] Check is session is expired $c-session-session_expires) returns 0 when the session is expired (and deletes the session). Caveat: I am brand new - never installed the sw, but I was JUST reading this in the docs. Ben On Apr 15, 2010, at 8:33 AM, David wrote: Hi, Is there any method in order to check if user session has expired, so that user is redirect to login page? Something like $c-session-is_expired which returns true or false? I've checked Catalyst Session Plugin, but I havem't found any method to check if session has expired. David ___ 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/ -- Ben Hitz Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium Stanford University ** h...@genome.stanford.edu ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] [ANNOUNCE] Call for testers: Compound Primary Key support in Catalyst::Authentication::Store::DBIx::Class
Installed and tested on my notebook (Ubuntu 9.10 64bit) successfully. -- Best regards, Alex Am Montag, den 29.03.2010, 18:40 +0200 schrieb Florian Ragwitz: Short version: If you're using Catalyst::Authentication::Store::DBIx::Class, install FLORA/Catalyst-Authentication-Store-DBIx-Class-0.1100-TRIAL.tar.gz and report any problems. Long version: I just uploaded a development release of Catalyst::Authentication::Store::DBIx::Class to CPAN. It adds support for authenticating against a user table with a compound primary key. In order to add that feature, a couple of internal changes had to be made. Those changes also affect the usage of the module with a single-column primary key in the user table. Therefore, it's important that you test your existing applications using the DBIx::Class auth store against the above development release, even if you don't care about the new feature at all. Please tell us about the results of your testing, both success and failure, on the mailing list or in #catalyst-dev on irc. Thanks in advance *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Picking template type based on input
Sounds like you want Catalyst::Action::Serialize. -- Best regards, Alex Am Freitag, den 26.03.2010, 10:43 +0100 schrieb Jon mailinglists: Hi all, I'm making a small catalyst application and I want to be able to serve different types of content based on parameters and/or request headers. I'm curious about where the correct location for that kind of code is, my current sollution is in the Root end like this: sub end : ActionClass('RenderView') { ... if ($c-stash-{json} || $c-request-params-{json} || $c-req-header('accept') =~ /json/) { $c-stash-{template} = $c-action.'_json.tt'; $c-res-headers-content_type( 'Application/json; charset=utf-8' ); } ... } but it feels wrong to put it in the Root controller rather than the view. Is this really the place where I'm supposed to have that kind of logic? Would that also be the place if I want to add pdf out to pick another View to forward to? Thanks in advance 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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Making a hash available across the application
Am Donnerstag, den 18.03.2010, 00:08 +0100 schrieb Tomas Doran: In fact, generally - you don't want to be calling the generic -search method in your controllers _at all_. The specific search functionality should instead be pushed down into your ResultSet classes, so that you say: $c-model('DB::Books')-find_all_books_by_author($author_name); Rather than $c-model('DB::Books')- search({ %stuff_including_author_name }, { %ordering_stuff }); The former is your controller declaratively asking the domain model for what it wants. The latter is for controller manipulating the domain model directly by having knowledge of it's implementation. Which tables you join (and how you join / sort / order / filter them) to get a set of data _IS NOT_ something controller code should know or care about, as that takes away your ability to alter the data representation (e.g. changing the table structure) without changing every place that knows about that representation... When you need to change your schema (and this will happen!), then only having to change the implementation details in the model is significantly less work (and testing), especially when you have dozens of controllers! Cheers t0m We should add that somewhere at the very top of some DBIC doc! ( no, I don't wanna hear a 'well volunteered' this time! ) -- Best regards, Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Socket error when launching Catalyst server
This means that another process is already listening on the tcp port the catalyst server wants to use (default 3000). Maybe you have already an instance of the cat webserver running. If you need to run multiple cat apps at the same time specify the port number by using the command line option -p(ort). -- Best regards, Alex Am Montag, den 15.03.2010, 16:32 +0100 schrieb David: Hello, recently I am getting next error message once I have launched Catalyst server: Couldn't create daemon: IO::Socket::INET: Address already in use at /usr/local/share/perl/5.8.8/Catalyst/Engine/HTTP.pm line 211. I never got this error message before. I don't know how to fix it. It is like if there where other server instances running, because my website works even if I shut down the server. I can't neither see server activity, as it seems website is running in another server instance. David *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Check session expiry without extending it
My solution is to return an error message which includes the link to the login form with Catalyst::Controller::DBIC::API. My ExtJS store class has an exception handler that shows a MessageBox with the error text: exception:function(sender, type, action, options, response, arg) { switch (type) { case 'remote': var errortext = 'server error occurred'; if (response.raw.errors.generic) { errortext = response.raw.errors.generic.join('br /'); } Ext.Msg.alert('Error', errortext); break; case 'response': if (response.isTimeout) { Ext.Msg.alert('Error', 'the request timed out'); } else { Ext.Msg.alert('Error', response.statusText); } break; // that should never happen according to extjs docs default: Ext.Msg.alert('Error', 'unknown error occurred'); break; } } -- Best regards, Alex Am Donnerstag, den 04.03.2010, 16:05 +0100 schrieb Peter Karman: Bill Moseley wrote on 03/04/2010 08:39 AM: The developer explained that the AJAX session check was needed to prevent a user from making a lot of changes in the client that could not be saved due to a an expires session. Not sure I see the logic there. I've been solving that session-has-expired-so-ajax-call-fails problem by having a global listener on my ajax class that checks whether the session cookie has expired before every xhr request. I'm not completely happy with how this works (it feels kludgy; it assumes the cookie expiration time == session expiration time; and it relies on an alert() to halt the browser's progress (effectively making an async call synchronous)), but so far it's the most effective way I've found of preventing user meltdown when their carefully crafted request will be lost because the session has expired on the server end. // make sure we are logged in before every xhr request Ext.Ajax.on('beforerequest', function(conn, opts) { if (!AIR.Auth.isAuthenticated()) { AIR.Auth.login(); return false; } return true; }); // get session cookie. Returns false if the cookie is expired. AIR.Auth.isAuthenticated = function() { var auth_tkt = Ext.util.Cookies.get('auth_tkt'); return auth_tkt; } // spawn a popup window to the login page, halting the browser's // XHR call with an alert() AIR.Auth.login = function() { // open a popup panel var winOpts = 'height=400,width=400,resizable=yes,scrollbars=yes,menubar=yes'; // the closeWindow param tells the login script to generate // local page js on success that will close the popup window. var url = 'https://my.sso.url/login?back=closeWindow'; AIR.Auth.window = window.open(url,'login-window',winOpts); if (window.focus) { AIR.Auth.window.focus(); } // the alert is necessary to keep the browser from proceeding // with whatever request it was making. alert(Your session has expired. Login again and then click Ok.); } *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Check session expiry without extending it
Why not return the datetime when the session expires with every page and have a client-side js that does the redirect without hammering the server? -- Best regards, Alex Am Dienstag, den 02.03.2010, 21:43 +0100 schrieb Steve Kleiman: Using Catalyst::Plugin::Session with Session::State::Cookie. Would like to be able to poll server if the user's session has expired WITHOUT extending the session itself. The objective is to have a javascript periodical executor check if a session is expired and redirect user to a Your session has expired page if appropriate. Could do it in javascript but would prefer doing it on server. Anyone tried this? Thanks in advance. -Steve Kleiman ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] mod_fcgid on win32
Is it still valid? Copyright (c) 1995-1996 Open Market, Inc. -- Best regards, Alex Am Donnerstag, den 28.01.2010, 15:45 +0100 schrieb Hans Dieter Pearcey: Excerpts from Alexander Hartmaier's message of Thu Jan 28 09:29:42 -0500 2010: I've looked *multiple* times for it, but not in the non-free repo. Do you know why it is there? Probably because it has a weird license: http://packages.debian.org/changelogs/pool/non-free/liba/libapache-mod-fastcgi/libapache-mod-fastcgi_2.4.6-1/copyright hdp. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] mod_fcgid on win32
I'm running mod_fcgid on debian because it comes as a distro package while mod_fastcgi doesn't. Note that it took some time for me too to get it working. I can mail or paste my setup if that helps you on win32. -- Best regards, Alex Am Donnerstag, den 28.01.2010, 13:19 +0100 schrieb Will Hawes: On 28 January 2010 09:44, Tomas Doran bobtf...@bobtfish.net wrote: On 28 Jan 2010, at 08:33, fREW Schmidt wrote: I'm afraid this might be a win32 issue :-/ Anyway, does anyone have any input on this? I'd really like to get this working. Google suggests that use mod_fastcgi is the correct fix :) I'd second that, I've tried both mod_fastcgi and mod_fcgid pretty exhaustively on various versions of Apache on Win32 and only ever managed to get the former working. Not to say that mod_fcgid won't work of course, but mod_fastcgi is certainly the path of least resistance ;) ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] mod_fcgid on win32
ARGH I've looked *multiple* times for it, but not in the non-free repo. Do you know why it is there? -- Best regards, Alex Am Donnerstag, den 28.01.2010, 15:14 +0100 schrieb Hans Dieter Pearcey: Excerpts from Alexander Hartmaier's message of Thu Jan 28 09:00:28 -0500 2010: I'm running mod_fcgid on debian because it comes as a distro package while mod_fastcgi doesn't. Yes it does: http://packages.debian.org/search?keywords=libapache2-mod-fastcgi hdp. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] UTF-8 and mails
Before testing end-to-end figure out if the chars from your database are *really* utf-8. I forgot to set an env var for the oracle client library to tell it I want unicode which broke my app under fcgid. If you're using DBIx::Class to access your database see http://www.perlmonks.org/?node_id=736234. -- Best regards, Alex Am Montag, den 25.01.2010, 13:43 +0100 schrieb Jens Schwarz: Hi, first of all: I have read http://dev.catalystframework.org/wiki/tutorialsandhowtos/Using_Unicode (especially the Tips for Troubleshooting Unicode in Perl Web Applications) Nevertheless I have a strange UTF-8 problem that I need help with: Concerning UTF-8 everything in my App seems to work correct - except my mail action (I use Mail::Sender::Easy) in my Root controller: code (...) use Mail::Sender::Easy qw(email); use utf8; (...) sub mail :Private { (...) $mail_return = email({ (...) 'subject'= (... something from the database ...), '_text_info' = { charset = 'utf-8', encoding = 'quoted-printable', }, '_text' = (... some text with literal UTF-8 characters NOT from the database ...), (...) }); (...) } /code This produces mails that have messed up UTF-8 characters although the charset is set in the mail header, and the clients (right now tested with Thunderbird 3 and Outlook 2003) are configured to treat incoming mails as utf-8 encoded text. Strange: If I switch to ISO8859-1 in Thunderbird, the mails look alright. Outlook however simply drops the UTF-8 characters, so that p.ex. the German sentence Nachricht für Herrn Müller results in Nachricht fr Herrn Mller. If I remove the use utf8, the UTF-8 characters that do NOT come from the database look fine (in the example above: everything in '_text'), the ones from the database are messed up (in the example above: everything in 'subject'). Removing the charset = 'utf-8' flag of the mail subroutine results in fine mails if I set the charset to ISO8859-1 in the clients. To summerize: I have UTF-8-tifized everything that I am aware of - i.e.: - Editor where the source code is produced - source code itself - in the MySQL database every table is set-up with UTF-8 Unicode charset and utf8_general_ci collation. - the webbrowsers - the email clients - Catalyst (use utf8, UTF8Columns) - Template Toolkit (View::TT = {ENCODING = 'UTF-8'} ) - FormFu (tt_args = {ENCODING = 'UTF-8'}) Any hints on where the problem might be? Thanks Jens *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Limit Catalyst::Helper::Model::DBIC::Schema to a single table ...
Why not do it the other way round? Write the new class and deploy it to your db. -- Best regards, Alex Am Freitag, den 25.12.2009, 15:51 +0100 schrieb Kiffin Gish: Normally myapp_create.pl is run with the whole database given on the command line, e.g. script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \ create=static dbi:SQLite:myapp.db Can I restrict this to a single table or tables only? For example, I have an existing application and I add a new table I don't want to recreate Schema/Results with a bunch of .new files and have to delete them after-wards. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] subclassing model classes
DBIx::Class::Helper::SubClass fixes the relationships too! I've spoken about the problem that rels stop working when subclassing a result class in the irc channel but at that time there wasn't a solution for it. Thanks for the hint, I will try it out soon! -- Best regards, Alex Am Mittwoch, den 16.12.2009, 13:42 +0100 schrieb matthew couchman (JIC): I've just discovered DBIx::Class::Helper::SubClass which seems to have done the trick. Thanks again for all your help. -Original Message- From: matthew couchman (JIC) [mailto:matthew.couch...@bbsrc.ac.uk] Sent: 16 December 2009 10:54 To: The elegant MVC web framework Subject: RE: [Catalyst] subclassing model classes Hi Wallace, Thanks for your reply. I'm using the perl debugger: Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A ntSpec/script/../lib/AntSpec/Schema/Result/Placemark.pm:10): 10: __PACKAGE__- resultset_class('AntSpec::Schema::ResultSet::Placemark'); DB1 n Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A ntSpec/script/../lib/AntSpec/Schema/Result/Placemark.pm:12): 12: 1; DB1 x __PACKAGE__ 0 'AntSpec::Schema::Result::Placemark' DB2 x __PACKAGE__-resultset_class 0 'AntSpec::Schema::ResultSet::Placemark' DB3 c Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A ntSpec/script/../lib/AntSpec/Schema/Result/Vertex.pm:10): 10: __PACKAGE__- resultset_class('AntSpec::Schema::ResultSet::Vertex'); DB3 n Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A ntSpec/script/../lib/AntSpec/Schema/Result/Vertex.pm:12): 12: 1; DB3 x __PACKAGE__ 0 'AntSpec::Schema::Result::Vertex' DB4 x __PACKAGE__-resultset_class 0 'AntSpec::Schema::ResultSet::Vertex' DB5 x AntSpec::Schema::Result::Placemark-resultset_class 0 'AntSpec::Schema::ResultSet::Vertex' DB6 x AntSpec::Schema::Result::Point-resultset_class 0 'AntSpec::Schema::ResultSet::Vertex' Thanks again, Matt. -Original Message- From: Wallace Reis [mailto:wall...@reis.org.br] Sent: 15 December 2009 23:13 To: The elegant MVC web framework Subject: Re: [Catalyst] subclassing model classes On 15/12/2009, at 14:58, matthew couchman (JIC) wrote: I now have a couple of subclasses of Point called Vertex and Placemark. I'm trying to associate them with my new ResultSet subclasses. In MyApp::Schema::Result::Vertex: use base 'MyApp::Schema::Result::Point'; __PACKAGE__-resultset_class('MyApp::Schema::ResultSet::Vertex'); And in MyApp::Schema::Result::Placemark: use base 'MyApp::Schema::Result::Point'; __PACKAGE__- resultset_class('MyApp::Schema::ResultSet::Placemark'); I think __PACKAGE__-resultset_class is calling the parent class MyApp::Schema::Result::Point-resultset_class in both cases so the second call overwrites the first. How do I avoid this? How are you identifying this behaviour? It shouldn't be like that. What does print $schema-source($_)-resultset_class for qw(Vertex Placemark) output? -- wallace reis/wreis Catalyst and DBIx::Class consultancy with a clue Software Engineer and a commit bit: http://shadowcat.co.uk/catalyst/ Shadowcat Systems Limited http://www.shadowcat.co.uk http://www.linkedin.com/in/wallacereis ___ 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/ ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] subclassing model classes
Hi Matt! You might want to take a look at DBIx::Class::Schema::RestrictWithObject. Normally I add a method to the ResultSet class of that Result class: in ResultSet::Device: =item search_active Returns a resultset with all active devices. =cut sub search_active { my $self = shift; return $self-search_rs({ 'me.fk_monitor' = { '!=' = 3 }, }); } In Result::Device: __PACKAGE__-resultset_class('NAC::Model::DBIC::ResultSet::Device'); -- Best regards, Alex Am Dienstag, den 15.12.2009, 12:32 +0100 schrieb matthew couchman (JIC): Hi, I’m trying to subclass a model class so that when I search it only pulls out rows of a certain type. I thought that perhaps I could achieve that by overriding the search() function and adding a condition to the list of arguments as below: package MyApp::Schema::Result::Vertex; use strict; use warnings; use base 'MyApp::Schema::Result::Point'; # override search sub search { my $self = shift; my $condition = { type = 'vertex' }; return $self-next::method($condition, @_); } 1; I don’t think that my new search function is ever called though. Do I need to override anything else or am I just barking up the wrong tree completely? Thanks for your help, Matt. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] [ANNOUNCE] Catalyst-Runtime 5.80016
All app errors result in this cat error with the new version for me: [error] Caught exception in engine Can't use string (508706d1a94648443fa31ffc8b2b5ccb) as a HASH ref while strict refs in use at /home/ahartmai/perl5/lib/perl5/Catalyst/Engine.pm line 117. Changing line 117 fixes the problem but I don't know if something else is going wrong which changes $val so it isn't a hash. local $val-{'__MOP__'} = Stringified: . $val-{'__MOP__'} if ref $val eq 'HASH' exists $val-{'__MOP__'}; -- Best regards, Alex Am Samstag, den 12.12.2009, 00:41 +0100 schrieb Tomas Doran: Evening (or insert relevant time zone here). I'm happy to announce the next release of Catalyst-Runtime (5.80016). This release mainly fixes regressions introduced with the new script system. Upgrading to the new scripts requires the latest Catalyst- Devel package (1.24), and choosing to regenerate your scripts. This release cures all issues reported with upgraded scripts (or applications generated with the latest release of Catalyst::Devel) and fixes Win32 issues introduced with the tests for encoding issues fixed in 5.80015. Full changelog included below as always. Cheers t0m -- 5.80016 2009-12-11 23:23:33 Bug fixes: - Fix slurping a file to work correctly with binary on Win32 in the encoding test controller. Bug fixes in the new scripts (for applications which have been upgraded): - Allow --restartdirectory as an option for the Server script, for backwards compatibility. (Dave Rolsky) - The --host option for the server script defaulted to localhost, rather than listening on all interfaces, which was the previous default. (Dave Rolsky) - Restore -p option for pid file in the FastCGI server script. - Fix the script environment variables MYAPP_PORT and MYAPP_RELOAD RT#52604 - Fix aliasing applications under non-root paths with mod_rewrite in some apache versions where %ENV{SCRIPT_NAME} is set to the real name of the script, by using $ENV{REDIRECT_URL} which contains the non- rewritten URI. - Fix usage display when myapp_create.pl is run with no arguments. RT#52630 New features: - The __MOP__ hash element is suppressed from being dumped fully (and instead stringified) when dumping the error screen to be less packed with information of no use. Documentation: - Fix Pod nits (RT#52370) ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Accessing config parameters from Schema?
I've needed that too and added it as an example to the Catalyst::Model::DBIC::Schema docs on Friday. You can find it under the following link until it's applied: http://paste.scsys.co.uk/32786 Thanks @mst for the help with the schema accessor! Am Freitag, den 21.08.2009, 22:43 +0200 schrieb fREW Schmidt: You probably shouldn't really be doing that. Pass the path into the schema or something like that, but schema should be able to exist outside of a catalyst application. If you really do want to read the conf check out Config::JFDI. You can use it to parse the config. On Thu, Aug 20, 2009 at 5:01 PM, Kevin Monceaux ke...@rawfeddogs.net wrote: Catalyst Fans, NewbieAlert I've Googled and searched the list message archives but am having trouble zeroing in on the info I need. I'm sure in all that searching the answer has been staring me right in the face somewhere. How does one access parameters stored in myapp.conf from a schema, for example if I wanted to configure a path in myapp.conf for saving uploaded photos? /NewbieAlert -- Kevin http://www.RawFedDogs.net http://www.WacoAgilityGroup.org Bruceville, TX Si hoc legere scis nimium eruditionis habes. Longum iter est per praecepta, breve et efficax per exempla!!! ___ 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/ -- fREW Schmidt http://blog.afoolishmanifesto.com -- BR Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Recommended OS for Catalyst?
I'm using debian stable since 3.0 after being pissed by RedHat shipping unicode-horror perl 5.8.0 with custom + backported patches instead of 5.8.6 which was the newest stable version available at that time. Never regretted it! Am Donnerstag, den 06.08.2009, 12:50 +0200 schrieb Octavian Rasnita: Hi, Can you recommend a Linux distribution for production for Catalyst apps? ...and a version of Perl? Thanks. -- Octavian -- Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Multiple Chain Actions
Why not use the same uri and check the Accept header? Am Donnerstag, den 16.07.2009, 21:22 +0200 schrieb Tomas Doran: On 16 Jul 2009, at 16:30, Derek Wueppelmann wrote: sub json : Chained('/') ChainedArgs(0) { my ($self, $c) = @_; Is this something that is possible? Should I even be using Chaining for this? Any help would be appreciated. Call your top level path part root, then inherit (or apply as a role) the rest of the chain parts. e.g. package MyApp::Stuff; use Moose::Role -traits = 'MethodAttributes'; sub thingie : Chained('root') PathPart('thingie') Args(0) {} package MyApp::Controller::Root; with 'MyApp::Stuff'; sub root : Chained('/') PathPart('') CaptureArgs(0) {} package MyApp::Controller::JSON; with 'MyApp::Stuff'; sub root : Chained('/') PathPart('json') CaptureArgs(0) {} Will give you: /thingie and /json/thingie 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/ -- LG Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Error in subclassing Catalyst::Controller::DBIC::API::REST
Please provide us with the debug output of your cat app at startup. Have you tried removing sub create? Also look at the RestTest app used for the tests to find possible bugs in your code. Am Mittwoch, den 24.06.2009, 02:39 +0200 schrieb Amiri Barksdale: I have a controller inheriting from a ControllerBase class that contains the following: package RestTest::ControllerBase::REST; use strict; use warnings; use base qw/Catalyst::Controller::DBIC::API::REST/; sub create :Private { my ($self, $c) = @_; $self-next::method($c); if ($c-stash-{created_object}) { %{$c-stash-{response}-{new_object}} = %$c-stash-{created_object}-get_columns; } } 1; All the ControllerBase does is stash that object on create requests. I was following lukes's example at http://search.cpan.org/~lsaunders/Catalyst-Controller-DBIC-API-1.003000/lib/Catalyst/Controller/DBIC/API.pm#EXTENDING. The relevant part of the controller is: package RestTest::Controller::API::REST::Artist; use strict; use warnings; use base qw/RestTest::ControllerBase::REST/; use JSON::Syck; __PACKAGE__-config( action = { setup = { PathPart = 'artist', Chained = '/api/rest/rest_base' } }, ... ); Now for the problem. When I go to test this: my $mech = Test::WWW::Mechanize::Catalyst-new; ok(my $schema = DBICTest-init_schema(), 'got schema'); my $req = GET(http://localhost/api/rest/artist/list;, { }, 'Accept' = 'text/x-json' ); $mech-request($req); cmp_ok( $mech-status, '==', 200, 'open attempt okay' ); I get the error: 'Method GET not implemented for http' = '//localhost/api/rest/artist/api/rest/artist/object' Somehow my request path gets all messed up. I dumped out the $mech, and it tells me that $mech-base is indeed what I put. So is $mech-redirected_uri. Amiri ___ 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/ -- LG Alex *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Final RFC for Press Release!
Am Dienstag, den 28.04.2009, 17:44 +0200 schrieb Edmund von der Burg: I like that press release - it is short enough to get read and sufficiently light on detail not to make people feel that the learning curve will be too steep. 2009/4/28 John Napiorkowski jjn1...@yahoo.com: and add their personal advocacy or howto stuff in the, Blogs and third party discussions section, which is looking thin. At the risk of showing my age I've always been a fan of the Be.com press releases: http://web.archive.org/web/20010106174100/www2.be.com/aboutbe/pressinfo.html Those pages are from 2001 - the company subsequently folded. Anyhoo - I think that they set a good example of haw to do press. I especially like that at the end of each press release they had a 'About Be' section that set the scene. Perhaps we should add something similar to our press releases: - About Catalyst Catalyst is a framework for building web applications of all sizes. It allows clean separation of all the components and embodies most current best practices. Developed and maintained by a worldwide group of enthusiasts and professionals it is continually evolving. Written in Perl it is easy to work with and extend using code available on CPAN. It is stable and widely used in business critical applications. It is open source and free to use. Enjoy. - That paragraph is awesome! I vote for including it! Cheers, Alex tweak at will :) Cheers, Edmund. *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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 reuse Catalyst Schema for non-web purposes?
I have a MyNamespace::Model::DBIC module containing all ResultSet, ResultSource and Table classes. This module is a requirement for my Cat apps and is used in the apps schema: package MyNamespace::Web::AppName::Schema::AppName; use base qw/DBIx::Class::Schema/; # load subclassed tables __PACKAGE__-load_classes(qw/ Table3 /); __PACKAGE__-load_classes({ 'MyNamespace::Model::DBIC::Table' = [qw/ Table1 Table2 /]} ); 1; -- BR Alex Am Mittwoch, den 22.04.2009, 16:30 +0200 schrieb Simon Wilcox: On 22/4/09 14:52, Matt S Trout wrote: On Wed, Apr 22, 2009 at 02:41:34PM +1000, kakim...@tpg.com.au wrote: I just looked at my app and found that I need to reuse the Schema files found in my 'Schema' directory. Your DBIC classes aren't connected to the Catalyst app at all. Unless you've fallen into the trap of putting business logic in your Controller classes. See this as a good opportunity to refactor the logic back into the Schema classes where it belongs (or to a set of business objects if that suits your application better). Your code will be better for it :-) S. ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Application stallling problem
The test server can only process one request per time! Maybe your first request blocks the server cause a e.g. database query takes long so the second query isn't handles by the server. - BR Alex Am Donnerstag, den 26.03.2009, 14:17 +0100 schrieb Tomas Doran: kakim...@tpg.com.au wrote: sorry, guys, some bad character encodings from my mail client. Here's the mail again: Any ideas?? Not sure, but I think its something between the server you're using and the browser - if you're getting the request table, then as far as the Catalyst server is aware, then it has passed a page to your browser, and your browser hasn't requested another one.. Probably trying to use tcpdump or a capturing proxy (parosproxy.org) to try and take apart the requests/responses to work out whats going on would be helpful? 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] Catalyst - any good AJAX tutes?
I'd suggest ExtJS if you want something pretty good looking with great out-of-the-box features or YUI/jQuery if you like to stick with JS-enhanced HTML. The Dojo features + docs sucked *very* much when I used it about a year ago... On the Catalyst side I use Catalyst::Controller::DBIC::API which will support the full DBIC API for searches, pagination and prefetch in the next version which should be on CPAN in 2-4 weeks if lukes and I find time to finish it. trunk already contains my json-style search and pagination patches but lacks prefetch support cause we need to find a way to restrict/validate the user input to prevent huge queries killing the DB and/or revealing data that shouldn't be revealed. Help welcome ;-) (yes, I mean you Matt! that json in cgi param idea of yours just rocks!) - Alex Am Freitag, den 06.03.2009, 06:43 +0100 schrieb kakim...@tpg.com.au: hello there, I would like to use AJAX in my catalyst app. Any good references/tutes to recommend? thanks. 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] New version of InstantCRUD
I've already done a module I load in the ResultSource class of all my table classes which consists of a 'sub get_fvs_profile' which uses the dbic metadata to generate a FormValidator::Simple profile for use with DBIx::Class::Validation. I'd say that should go into DBIx::Class::Validation. - Alex Am Montag, den 23.02.2009, 11:33 +0100 schrieb Moritz Onken: Am 23.02.2009 um 10:53 schrieb Alexander Hartmaier: I'm currently patching the hell out of Controller::DBIC::API. Search by passing a json string and pagination is already in the repo, prefetch support is done but needs some sort of controller side restriction so that someone can't fetch the contents of the whole db by using the rels (api for that welcome). This should/could be the basis for ajax based LFB modules to load data instead of relying on an LFB internal API. What I'd like to see is a more split up LFB so I could use the (extjs) form generation on a per table (=controller) basis wherever I need it (for tables where a customized form isn't needed). - Alex Hi all, I'm following a different approach. My current project uses HTML::FormFu config files for both validating user input and generating json which contains the data of a resultset or result row. I do not use the html generation capabilities of FormFu, just validation, filters, transformers, inflators and deflators. I wrote http://search.cpan.org/~perler/DBIx-Class-AsObject-0.09_01/ which is far from being stable. But it generates a perl object from a result row using a HTML::FormFu configuration file. I think Controller::DBIC::API lacks of the ability to do proper validation. Maybe we can join forces on that one and add a configuration file to each controller. moritz ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] New version of InstantCRUD
I'm currently patching the hell out of Controller::DBIC::API. Search by passing a json string and pagination is already in the repo, prefetch support is done but needs some sort of controller side restriction so that someone can't fetch the contents of the whole db by using the rels (api for that welcome). This should/could be the basis for ajax based LFB modules to load data instead of relying on an LFB internal API. What I'd like to see is a more split up LFB so I could use the (extjs) form generation on a per table (=controller) basis wherever I need it (for tables where a customized form isn't needed). - Alex Am Samstag, den 21.02.2009, 10:08 +0100 schrieb Oliver Gorwits: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Zbigniew, Zbigniew Lukasiak wrote: In short I am open for collaboration - but I found it difficult to express my expectations for the library without writing my own code. I (author of the ListFramework Builder CRUD - LFB) couldn't agree more. All these CRUD systems are lovely and go a great job but it is painful to see everyone developing in different directions. This is what has kept me from working on re-engineering LFB (I've done some bug fixes only, in the last six months). I know what needs factoring out, where there needs to be an API etc, but to be honest I suck at API design, I thought I'd better wait for someone else's DBIC API :-) And as an aside... At the moment I am happy with the niche LFB fills (i.e. not a scaffolder) and am working on a new user interface in something more lightweight than ExtJS. It might also get renamed to something like Catalyst::Plugin::AutoCRUD (well, or...?). If you are not familiar with LFB, see here (feedback welcome): http://tinyurl.com/listframework http://dragonstaff.co.uk/oliverg/ - -- Oliver Gorwits, Network and Telecommunications Group, Oxford University Computing Services -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJn8Sk2NPq7pwWBt4RAjGTAKC6wZwRm/JlLXioXGwBSScd319BWQCbBZVQ irNs/whuX90LqvKDvgJDYPI= =Wzug -END PGP 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/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] New version of InstantCRUD
Would be great if we could combine our efforts instead of creating even more choices for the users of cat in form of InstantCRUD, Controller::DBIC::API and so on (http://dev.catalyst.perl.org/wiki/crud). - Alex aka abraxxa Am Montag, den 16.02.2009, 21:44 +0100 schrieb Zbigniew Lukasiak: Looks like we are again discussing CRUD in Catalyst - so I decided to finally update InstantCRUD and release it to CPAN. It is still experimental. It is a 'scaffolding' - like the Rails one - it generates a CRUD application for a given dsn. Some more random thoughs: http://dev.catalystframework.org/wiki/crud/instantcrud and http://dev.catalystframework.org/wiki/crud/crud_and_rest (one caveat I completely disagree with the Preliminary URI naming guidelines). -- Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/ ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] RFC: The paradox of choice in web development
I thought you refer to youporn.com ;-) - Alex Am Sonntag, den 15.02.2009, 13:39 +0100 schrieb Dan Dascalescu: Aye, that it is: http://www.bbc.co.uk/blogs/bbcinternet/2008/12/iplayer_day_performance_tricks.html Thanks for the link. I added it as a support URL to http://www.appliedstacks.com/website/Bbc_Iplayer ___ 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/ *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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] [Announce] Catalyst::Runtime 5.7099_04. IMPORTANT; PLEASE TEST!
Seems to work great for my three catalyst apps. Regards, Alex Am Montag, den 12.01.2009, 21:36 +0100 schrieb Marcus Ramberg: Since we're spending some extra time making sure the 5.8 version is backwards compatible with 5.7, we've decided to do another release in the 5.7 series, version 5.71000. Since this is a new point release, it contains new features as well as bug fixes. Please test it with your apps to make sure everything works, and report back here. If we don't hear anything about problems by the end of this week we'll be pushing the release. To test, you can get the development release here. http://search.cpan.org/CPAN/authors/id/M/MR/MRAMBERG/Catalyst-Runtime-5.7099_04.tar.gz Below is the changelog since the latest stable release, note that 5.7015's bugfix already was in the development releases. 5.7099_04 2009-01-12 13:06:00 - Add environment hack for FastCGI under IIS (Simon Bertrang) - Test for this and preexisting Lighty hack (Simon Bertrang) - Change streaming test to serve itself rather than 01use.t, making test sync for engines easier (t0m) - Workaround change in LWP that broke a cookie test (RT #40037) - Backport go() from 5.8 branch. - Fix some Win32 test failures - Add pt translation of error message (wreis) - Make :Chained('../action') work (Florian Ragwitz) - Fix forwarding to action object. - Handle leading CRLF in HTTP requests sometimes sent by IE6 in keep-alive requests. 5.7099_03 2008-07-20 10:10:00 - Fix regressions for regexp fallback in model(), view() and controller() - Added the supplied argument to the regexp fallback warning for easier debugging - Ensure ACCEPT_CONTEXT is called for results from component() 5.7099_02 2008-07-16 19:10:00 - Added PathPrefix attribute - Removed Catalyst::Build; we've long since moved to Module::Install - Updated Catalyst::Test docs to mention the use of HTTP::Request objects (Rafael Kitover) 5.7099_01 2008-06-25 22:36:00 - Refactored component resolution (component(), models(), model(), et al). We now throw warnings for two reasons: 1) model() or view() was called with no arguments, and two results are returned -- set default_(model|view), current_(model|view) or current_(model|view)_instance instead 2) you call a component resolution method with a string, and it resorts to a regexp fallback wherein a result is returned -- if you really want to search, call the method with a regex as the argument - remove 0-length query string components so warnings aren't thrown (RT #36428) - Update HTTP::Body dep so that the uploadtmp config value will work (RT #22540) - Fix for LocalRegex when used in the Root controller - Get some of the optional_* tests working from dirs with spaces (RT #26455) - Fix Catalyst::Utils::home() when application .pm is in the current dir (RT #34437) - Added the ability to remove parameters in req-uri_with() by passing in an undef value (RT #34782) - Added $c-go, to do an internal redispatch to another action, while retaining the contents of the stash With regards Marcus Ramberg *** T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *** Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *** ___ 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/