Re: [Catalyst] Using a model class from other class
perhaps a simple way: my $rs = $c-model(DB::Group)-all; while (my $group = $rs-next) { for my $user ($ group-users ) { # do stuff } } On Thu, Sep 29, 2011 at 10:04 AM, linuxsupport lin.supp...@gmail.comwrote: Hi, I have a model called DB where I have 3 classes, User, Group, UserGroup Now, I have created a resultset for Group ie. Myapp::Schema::ResultSet::Group How can I call User class from Myapp::Schema::ResultSet::Group ? For example In Group resultset I am working with some groups and want to fetch all the users, is it possible? ___ 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] Open Source CMS
I forgot to mention I used a corporate mediawiki as a backend for creating catalyst TT pages. worked out excellent, supported 7 international (utf-8) languages! utilized the power of categories, variables, etc to organize - users had an easy syntax for wiki inclined or toolbar editing (wysiwyg). I wrote a deployment tool w/ mechanize and I seem to recall mediawiki cpan module too. good luck! -n On Thu, Apr 28, 2011 at 11:42 PM, Mike Raynham catal...@mikeraynham.co.ukwrote: On 29/04/11 05:22, Peter Edwards wrote: Alfresco leaks memory in practice. Drupal is a better bet. There are plenty of other CMS choices for small simple sites - I used CMS Made Simple a few years back as it had a lot of self-service plugins you could install through the admin UI, used Smarty templates, decently separated CSS themes and a sane pluggable module approach that made it easy to write extensions. I run DTC control panel on AWS and integrated a perl script so customers can set up new sites on the fly. Check out the Wikipedia page that compares features of CMSes. A hosted software as service may be the best fit for you. Regards, Peter http://perl.dragonstaff.co.uk Hi Peter, Thanks for the recommendations. I like the look of CMS made simple, and will definitely download and test it. I've used Smarty for quite a few websites, so that's a bonus. I've been using the Wikipedia page, but with so many systems available, it's a very time consuming job reading about each system and trying it out. It's good to narrow the selection down first with the help of a few recommendations. Regards, Mike ___ 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] Open Source CMS
drupal and alfresco were both leading candidates after a long and expensive outside evaluation that included commercial cms... drupal won in the end. I don't think you could go wrong w/ drupal. cheers, -nw On Thu, Apr 28, 2011 at 9:40 AM, Mike Raynham catal...@mikeraynham.co.ukwrote: I know that this is not a Catalyst question, but I hope to get the opinions of those that use Catalyst. I develop web sites for small businesses, and really like using Perl and Catalyst. However, there are times when developing a custom CMS is not really appropriate - usually because it takes too much time (and hence money) to develop, and because there are lots of ready made systems out there already that will do the job. I've started to look into some of these systems, including Drupal and Bricolage. For my sins, I have spent a lot of time working with PHP, so whilst I'd prefer a Perl framework, using a PHP system wouldn't really be a problem. Drupal is looking quite interesting, and it supports Pg, which is definitely a bonus. Bricolage also looks good, but most of the information that I can find about it is now quite old - although there was a new release in February 2011. Bricolage is written in Perl and it supports Pg. Does anyone have any experiences with open source CMS frameworks that they are able to share? Regards, Mike ___ 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] building 'local' lib with dependencies for shipping
a local::lib alternative is Shipwright; created by Best Practical the makers of RT defect tracker. its worth checking out as it does exactly what you're trying to do. On Tue, Apr 26, 2011 at 3:40 AM, Bernhard Bauch ba...@zsi.at wrote: just saw on the dbix::class list they're discussing the same thing: http://lists.scsys.co.uk/pipermail/dbix-class/2011-April/thread.html see [Dbix-class] Module versioning Begin forwarded message: From: Bernhard Bauch ba...@zsi.at Date: 26. April 2011 12:33:08 MESZ To: The elegant MVC web framework catalyst@lists.scsys.co.uk Subject: Re: [Catalyst] building 'local' lib with dependencies for shipping Reply-To: The elegant MVC web framework catalyst@lists.scsys.co.uk hey, i've also been hanging around with the same question/problem. local::lib in combination with perl-brew is super, to bundle perl and all modules needed to run cataylst independant from your systems perl installation. i thought just copying the complete local::lib tree would solve the problem to have the exactly the same module-versions on all maschines (development boxes and production) but than i figured out, if the maschine-architecture is different then just copying the local::lib dir would not work. using cpans Bundle system puts modulename + versions into the bundle file, but installing from this bundle also installs new-versions of modules if they are installed as a depenceny. any ideas, how to solve this issue ? byyee, bernhard On 25.04.2011, at 15:32, Miquel Ruiz wrote: On 25/04/2011 15:03, Fernan Aguero wrote: My question is: apart from a 'hit and miss' approach (or a 'put everything and the kitchen sink') ... is there a smart way of building a list of the dependencies for any one app? Hi, You could give a try to lib::xi . It will install directly the dependencies using cpanm, though. Hope it helps. -- Miquel Ruiz ___ 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/ -- Bernhard Bauch, Webdevelopment ZSI - Zentrum für soziale Innovation ba...@zsi.at ___ 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/ -- Bernhard Bauch, Webdevelopment ZSI - Zentrum für soziale Innovation ba...@zsi.at ___ 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] building 'local' lib with dependencies for shipping
Shipwright is not a silver bullet - it has issues of its own. For catalyst projects I created a dependency finder that issues shipwright import commands. on top of that, shipwright is not forgiving with regards to build errors, for example - a non-uniform Makefile.PL of a CPAN dependency might break it... there are ways to tweak a known dependency - but is a pain with fully automated build systems. for the error you listed - I see this when I try to add a module to an existing shipyard and then rebuild an existing vessel. when this error happens - I think it means that the shipwright_builder is failing because its required cache of in-memory-references-in-the-vessel has been lost from the previous vessel build-up. I don't have a good solution here except to delete the whole vessel and issue another build command (keep the shipyard though). anyone else using shipwright for catalyst? any other dep management solutions? how about a higher level solution like Apache Ivy? I'm a fan of CPAN - but its not exactly a configuration management dream, is it? -n On Tue, Apr 26, 2011 at 1:30 PM, Fernan Aguero fernan.agu...@gmail.comwrote: On Tue, Apr 26, 2011 at 11:43 AM, Nicholas Wehr catal...@bionikchickens.com wrote: a local::lib alternative is Shipwright; created by Best Practical the makers of RT defect tracker. its worth checking out as it does exactly what you're trying to do. Nicholas, thanks for your suggestion. I installed Shipwright and followed the docs, and got started: shipwright imported my sources, identified dependencies (not all of them, though) and downloaded the corresponding packages from CPAN. After that I ran the shipwright-builder script, and this went OK through all the identified dependencies, but failed at the last step, when attempting to build my catalyst app. I'm clearly missing something. The 2 things I can see are: i) I need to tell Shipwright what other dependencies are required by my app. Currently the dependencies identified are a minimal list of what I'd call 'base' dependencies. They do not include all the more specific Catalyst subcomponents (plugins), nor DBIx::Class and its subclasses, Template Toolkit, etc. Where do I specify these? In my app Makefile? In a Shipwright config file? ii) it seems like I need to first create a Makefile for my app? I never did that ... I have a very basic skeleton created by the catalyst.pl helper script, but after that initial skeleton, I started coding away and using the 'lib' within my app 'as is' without taking care of creating tests, or editing the Makefile.PL file. Is this the reason of Shipwright failing to build my app? What should I do to fix this? Thanks in advance for any further help, Cheers, -- fernan PS: last lines of output from shipwright-builder [...] Use of uninitialized value in string at ./bin/shipwright-builder line 560. build tdrtargets test part failed, last output of build.log is: Non-zero exit status: 1 t/controller_user.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 1 t/controller_userinput.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 1 t/model_mesh.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/model_targets.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/model_weightmodel.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=12, Tests=21, 26 wallclock secs ( 0.09 usr 0.02 sys + 17.78 cusr 1.14 csys = 19.03 CPU) Result: FAIL Failed 9/12 test programs. 9/21 subtests failed. make: *** [test_dynamic] Error 1 at ./bin/shipwright-builder line 573 main::_install('tdrtargets', 'GLOB(0x93606d8)') called at ./bin/shipwright-builder line 412 main::install() called at ./bin/shipwright-builder line 276 exit Script done, file is shipwright-builder.out -- fernan ___ 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] Caching SQL results for speed...?
From what I recall - the caching trait doesn't play with joins. From what I can tell - neither does H::FH; Can anyone confirm this? It might make more sense for your queries to always specify a deep join/prefetch option to reduce the number of queries. I see this statement as well: This feature is new. It doesn't handle relationships yet, and the interfaces are still subject to change. ... which leads me to believe that efficient joins aren't implemented http://search.cpan.org/~gshank/HTML-FormHandler-Model-DBIC-0.14/lib/HTML/FormHandler/TraitFor/DBICFields.pm http://search.cpan.org/~gshank/HTML-FormHandler-Model-DBIC-0.14/lib/HTML/FormHandler/TraitFor/DBICFields.pm cheers, -nw On Thu, Apr 14, 2011 at 10:53 AM, Hernan Lopes hernanlo...@gmail.comwrote: i remember you mentioned something about many to many select options, try disabling those.. and then does the form works faster? if so, then the problem is mostly like in there ... try populating your options manually On Thu, Apr 14, 2011 at 1:15 PM, will trillich will.trill...@serensoft.com wrote: On Wed, Apr 13, 2011 at 1:19 AM, Darren Duncan dar...@darrenduncan.netwrote: will trillich wrote: 70% of the time is taken up in five modules: 1) SQL::Abstract 2) DBIx::Class::ResultSet 3) Class::Accessor::Grouped 4) DBIx::Class::Storage::DBI 5) HTML::FormHandler::Field ...because in 200 iterations they were called millions of times each. (The form requested has several select/option menus.) So, several 5000s (millions / 200) of calls for a single screen? That sounds like a lot for one screen. Do you need that much? -- Darren Duncan My question is similar -- why five thousand or more calls for rendering one page? The code does simple things like my $form = $self-form; # parse_form_for_numerics(): # change any $1,234 to 1234, parse 12-apr-09 to a date 2009-04-12, etc # and stuff results into $c-req-params parse_form_for_numerics( $c, $form ); my $processed = $form-process( item = $item, params = $c-req-params, ); if ( $form-has_errors) { ... } return unless $processed; # since we're testing rendering a fresh page there's no processing, that's it So why would this simple code generate 5,000+ calls to SQL::Abstract methods or to DBIx::Class::Resultset methods? Even commenting-out #parse_form_for_numerics() it's about the same. Still looking into this. -- 11 cheers for binary! ___ 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] Validation of entered content
I've used this before - perhaps it will work for you: http://ckeditor.com/ cheers -nw On Mon, Apr 11, 2011 at 5:28 AM, John M. Dlugosz wxju46g...@snkmail.comwrote: I have a form where an admin can change a part of the content on a page. The form lets someone do it without having to update the files on the server in a more traditional manner; BUT, it must be correct XHTML. If the admin types a p or a stray '' for that matter, it will render the resulting page not well-formed. Combine that with the feature of serving XHTML to browsers that accept it, and the site breaks on browsers other than IE. What's a good way to validate something programmatically before committing it? Better yet, is there a rich editor or wiki- or phpbbs-like translator that I might use for soliciting the input that I might use instead? The current content has a couple paragraphs and a bulleted list. So it's not just a simple blank, but must allow an amount of rich content. ___ 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] What text editor to use?
futher vim reading: http://vimdoc.sourceforge.net/htmldoc/arabic.html http://vimdoc.sourceforge.net/htmldoc/arabic.html http://vimdoc.sourceforge.net/htmldoc/hebrew.html http://vimdoc.sourceforge.net/htmldoc/hebrew.htmlbasically: vim -A arabic_file_to_edit.txt vim -H hebrew_file_to_edit.txt you can checkout your compiled time flags with: vim --version hope this is helpful. -nw On Wed, Mar 9, 2011 at 1:12 PM, Shlomi Fish shlo...@iglu.org.il wrote: Hi Thomas and all, On Thursday 03 Mar 2011 04:50:08 Thomas L. Shinnick wrote: At 08:13 PM 3/2/2011, gvim wrote: On 02/03/2011 11:10, John M. Dlugosz wrote: What's a good text editor to use for Catalyst/TT development? The editor I really like for C++ doesn't handle XML well. I've been using Notepad++ for windows, but the syntax highlighting doesn't understand mixing TT inside the base language, and it has tabs only instead of multiple visible windows. I would entertain both Windows and Linux solutions. TIA, --John Vim does everything you will ever need if you're dealing with text :-). Try MacVim if you're on OS X: http://code.google.com/p/macvim/ gvim I second the nomination for Vim, for another important reason. I hate switching editors. So, er... huh? Vim runs everywhere. I can wander from platform to platform and not have to worry whether something capable is available. That was really something I needed back when (15+ years) when Windows was so badly served. Still using it, even on Solaris! ;-) Now if you like learning new editors, or having 2 or 3 in your pocket, fine. But I've not yet found something I couldn't do in Vim. Hey I rarely need to edit in binary, but it can do it. And hacking Unicode isn't so revolutionary now, but was possible with Vim before some other editors. Good pedigree, barks on command, etc., etc. One reason why I'm not fully using Vim for all my needs as an editor is the fact it does not display Bidirectional text (e.g: mixed Latin and Arabic or in my case mixed Latin and Hebrew) in a Bidirectional way (even though it handles the Hebrew and Arabic Unicode glyphs fine). This is not a big issue with most code out there (whether Perl or otherwise), but is a major issue with Hebrew emails, works of fiction, blog entries or comments, notes, MediaWiki entries, etc. For that I've been using either KDE's Kate or katepart, the Mozilla built-in text editor which has a decent support for Bidi and similar editors like that and there are some specialised Unicode editors (and relatively primitive by Vim's or even Kate's standards such as http://projects.arabeyes.org/project.php?proj=Katoob or http://www.yudit.org/ ). If you don't know a language whose glyph system is written from right to left, consider your ignorance a bliss - :-D - and furthermore some Vim and BiDi users are happy with the fact it displays text consistently only in one direction (either L-R or R-L). I should also note that I've worked on some custom formats to facilitate editing text primarily in Hebrew: http://www.shlomifish.org/open-source/projects/XML-Grammar/Fiction/ While having XML, I've also written a parser for two custom well-formed plain text-but-XML-based formats, which I nicknamed Fiction-Text and Screenplay- Text. The parser is a highly-Moosey spaghetti code that was used to replace something written in the now (in)famous Parse-RecDescent which may have been even worse. I now hope to convert it to Parser-MGC ( http://search.cpan.org/dist/Parser-MGC/ ) , but hope that its author will document it a bit better, and this will require a rewrite and incrementally breaking tests. I've looked into projects providing similar functionality such as http://www.methods.co.nz/asciidoc/ and http://celtx.com/ , but I have found some technical or philosophical issues with them (that listing them is out of the scope of this E-mail.). Regards, Shlomi Fish -- - Shlomi Fish http://www.shlomifish.org/ Best Introductory Programming Language - http://shlom.in/intro-lang In Soviet Russia, every time you kill a kitten, god masturbates. -- http://linux.slashdot.org/comments.pl?sid=195378cid=16009070 Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ 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] Wide (Unicode) character problem?
which platform are you testing on? windows mac linux? On Wed, Mar 23, 2011 at 7:49 AM, John M. Dlugosz wxju46g...@snkmail.comwrote: On 3/23/2011 8:58 AM, Bill Moseley moseley-at-hank.org |Catalyst/Allow to home| wrote: Post the smallest possible example (20 lines?) that clearly shows the problem. OK, I verified that it still chokes if I strip it down to the bare essentials. If the view produces a stream that includes a wide character, I get the exception. Here is my Controller: package LEDft::Controller::Root; use Moose; use namespace::autoclean; use Mail::Builder::Simple; use Try::Tiny; BEGIN { extends 'Catalyst::Controller::HTML::FormFu' } # # Sets the actions in this controller to be registered with no prefix # so they function identically to actions created in MyApp.pm # __PACKAGE__-config(namespace = ''); my %Data= ( priceline = 10\x{2032} poll, ); sub index :Path :Args(0) { my ( $self, $c ) = @_; $c-{stash}-{AdminContent}= \%Data; } sub end : ActionClass('RenderView') {} __PACKAGE__-meta-make_immutable; 1; Here is the index.tt file: p[% AdminContent.priceline %]/p Also, the app's config states: default_view = 'Alloy', So the tt file is being processed using Alloy. I get the same result if I use 'TT', the more common choice. = So, if the template produces a result that includes a wide character, I get the exception. ___ 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] Basic help with deployment
a local::lib alternative is Shipwright; created by Best Practical the makers of RT defect tracker On Wed, Mar 16, 2011 at 6:15 AM, will trillich will.trill...@serensoft.comwrote: On Wed, Mar 16, 2011 at 4:21 AM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 da...@cpan.org wrote: I found that I need to run cpan -i Module as root This is not a good idea. Instead configure the cpan options `make_install_make_command` and `mbuild_install_build_command` to employ sudo. http://p3rl.org/CPAN#Config_Variables Does that mean that this 'make' step needs to be done as root? No, normally only the `make install` step of each dist needs elevated privileges. If distributions try to create directories in system locations during other steps, then this is a bug. Probably you've already run this as root (or via sudo) and paths have been created with root ownership. Your normal user isn't allowed to frob those. Our process is: - hg fetch = get latest from repository - script/*server.pl -d = test localhost:3000 - perl Makefile.PL make manifest = build into blib - make make test = confirm - sudo make install = let 'er rip We too had done sudo in the wrong spots a few times but a sudo make distclean made it all sparkly again. You can sidestep the difficulties coming from the need to install to system locations by using local::lib. http://p3rl.org/local::lib For a possible bootstrapping approach to getting your own private CPAN library up and running: http://search.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm#The_bootstrapping_technique You may need to download an older version of the library if you run into dependency-build errors tho. -- The first step towards getting somewhere is to decide that you are not going to stay where you are. -- J.P.Morgan ___ 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] debug prints
use the log method of $c: $c-log-debug(my message); cheers, -nw On Sat, Mar 5, 2011 at 2:21 PM, John M. Dlugosz wxju46g...@snkmail.comwrote: How do I send stuff to the console running the script/Appname_server.pl -d from a component method? ___ 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/
[Catalyst] Configuration Management in Continuous Integration environments
Hello everyone, First off, beware, I'm a bit nutty when it comes to configuration management. I've recently deployed a Hudson instance and wanted to move some Catalyst projects into it. What I'd like to solicit feedback on here is: *how are you managing your Perl dependencies in these build systems? *Here's some goals I have: - do not assume any non-core modules are installed on the build platform - use specific version of modules in the built product - product is a Catalyst website for example (@inc or use lib) - need to archive specific version of CPAN dependencies offline; this means we can recreate a product without an internet connection - allow for the rebuild of dependencies when the build platform has changed; this is meant to address a platform change from 32bit to 64bit What I'm looking at is either using local::lib or PREFIX LIB w/ cpan. What do you think? Thanks in advance, -nicholas ___ 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] Suggestions on how to handle 12 page form
I did the same as Mark, saving the form in progress was a product requirement but also a good user experience. I used extjs to make a pretty slick wizard, with questions dynamically created based on previous answers. Caveat: significant learning curve - http://dev.sencha.com/deploy/ext/examples/ cheers, -nw On Tue, Nov 16, 2010 at 11:36 PM, Mike Raynham catal...@mikeraynham.co.ukwrote: On 16/11/10 22:01, Hauck, William B. wrote: Hi. I'm working on the project request section of our new project tracking system. The request form is broken up into 12 pages-yes, lots and lots of data to be submitted. Anyone have any experience / advice on how to handle that many fields? Should I use a single subroutine to handle it all based on a page variable? Or, should I simply have a subroutine per page? How about going back to correct something the user messed up during initial entry-we want to show a summary of the data before final submission. Any help is appreciated. Thanks, bill CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance ___ 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/ In the UK, HMRC tax self assessment forms can be completed online. The process comprises many pages - essentially one big form that has been split into logical sections. I last completed this a few months ago, so what follows may not be entirely accurate... The user is able to advance through the form one page at a time. At the end of each page there is an option to save the current page, and an option to continue to the next page. I think it is possible to partially complete pages (where, for example, the user doesn't have all the information to hand), and return to them later. The save option allows the user to save the form in its current state, logout, and return at a later date. Each page is validated in real time using JS and also when the page is submitted. There is a vertical menu which shows all the sections. Completed sections are highlighted, and it is possible to return to these at any time to make amendments. Once the whole form has been completed, you have the option to finalise and submit it. After this final submission, it is not possible to go back and make any changes. From my experiences, the system works quite well. Completing the whole form can be a lengthy process, so being able to move around between the pages, and complete the form over multiple sessions is very useful. ___ 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] I18N
also consider: http://search.cpan.org/~wehr/Catalyst-Plugin-Localize-Simple-1.1/lib/Catalyst/Plugin/Localize/Simple.pm On Wed, Oct 13, 2010 at 2:25 PM, Ekki Plicht (DF4OR) e...@plicht.de wrote: Am Dienstag 12 Oktober 2010, 22:04:23 schrieb Stuart Watt: Quick question: I'm currently using Catalyst::Plugin::I18N. Should I be planning to move to CatalystX::I18N? Any thoughts...? Stuart, I am in no way a Catalyst expert, just a mere beginner. And facing the same question :-) I played around with C::P::I18N, and it does perfectly what is says it does - l10n. But I want (need) more, like localized paths, for example. So I looked at C::P::I18N::Request which is perfect for that, but decides only on the browser header setting of accept-language, AFAICS. Which renders it useless for me. Then there is C::P::I18N::PathPrefix, which is a helpful and different approach. It comes in handy when path names are the same even for different languages, a situation which I have here in my current project. I haven't used CX::I18N yet, but looking at the docs it also looks promising. I will certainly give it a try and play around with it to see if it matches my needs. As always with Perl, there are several ways... which is good. Cheers, Ekki ___ 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] Wrong Content-Length value
so which engine and version are you using? apache? built-in http? fastcgi? On Wed, Sep 8, 2010 at 2:08 PM, Bill Moseley mose...@hank.org wrote: The problem I have with this code is that requests can trigger an error on demand. Errors eventually trigger an email to a bunch of people. But it's for an error nobody can fix. # paranoia against wrong Content-Length header my $remaining = $length - $self-read_position; if ( $remaining 0 ) { $self-finalize_read($c); Catalyst::Exception-throw( Wrong Content-Length value: $length ); } Shouldn't that just return 411, 413, or just a 400? And then there's: eval { }; if ( my $error = $@ ) { chomp $error; $class-log-error(qq/Caught exception in engine $error/); } Should check return value from eval instead. -- Bill Moseley mose...@hank.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] Wrong Content-Length value
interesting problem. so the client is making byte-range requests on dynamic content? if it's static - I'd recommend you defer this functionality to apache. On Wed, Sep 8, 2010 at 2:30 PM, Bill Moseley mose...@hank.org wrote: On Wed, Sep 8, 2010 at 2:16 PM, Nicholas Wehr catal...@bionikchickens.com wrote: so which engine and version are you using? apache? built-in http? fastcgi? Apache, but that message is in Catalyst::Engine parent class. -- Bill Moseley mose...@hank.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] Wrong Content-Length value
okay - in this context I can understand your original message. I think catalyst is behaving okay. In your example, the client is disconnected so it cannot receive a response code. in my test telnet where I ran your example, I fed more data in than was expected - but since I left the client connected I got a response. the server went ahead and detected the content-length and failed gracefully, though cryptically... POST /foo HTTP/1.1 Host: localhost:3000 Content-Type: application/octet-stream Content-Length: 4 asdfgasdfasdf HTTP/1.0 404 Not Found Connection: close Date: Wed, 08 Sep 2010 23:09:47 GMT Content-Length: 14 Content-Type: text/html; charset=utf-8 Status: 404 X-Catalyst: 5.80024 Page not found On Wed, Sep 8, 2010 at 3:16 PM, Bill Moseley mose...@hank.org wrote: On Wed, Sep 8, 2010 at 2:38 PM, Nicholas Wehr catal...@bionikchickens.com wrote: interesting problem. so the client is making byte-range requests on dynamic content? if it's static - I'd recommend you defer this functionality to apache. No, it's not that. It's simply that the client is sending a content-length header and after Catalyst / HTTP::Body slurps in the body Catalyst does a sanity check to see if the length of the body really was the length specified in the header. Watch: mose...@bumby2:~$ catalyst.pl Length mose...@bumby2:~$ CATALYST_DEBUG=0 Length/script/length_server.pl You can connect to your server at http://bumby2:3000 mose...@bumby2:~$ telnet localhost 3000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. POST /foo HTTP/1.1 Host: localhost:3000 Content-Type: application/octet-stream Content-Length: 40 just some stuff ^] telnet quit Connection closed. Results in: [error] Caught exception in engine Wrong Content-Length value: 40 -- Bill Moseley mose...@hank.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] Wrong Content-Length value
agree - seems to warrant more of a 'warn' than 'error'. On Wed, Sep 8, 2010 at 4:59 PM, Bill Moseley mose...@hank.org wrote: On Wed, Sep 8, 2010 at 4:13 PM, Nicholas Wehr catal...@bionikchickens.com wrote: okay - in this context I can understand your original message. I think catalyst is behaving okay. In your example, the client is disconnected so it cannot receive a response code. in my test telnet where I ran your example, I fed more data in than was expected - but since I left the client connected I got a response. the server went ahead and detected the content-length and failed gracefully, though cryptically... Correct, because it only checks: if ( $remaining 0 ) { Not sure why it's ok for the Content-Length to be less than the actual content and not the other way around. Regardless, my question was just is this the level of an error? Do we really care if a request is disconnected? I can downgrade the message to a warn in my logging code to avoid getting emails about it every few hours. -- Bill Moseley mose...@hank.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] How to share a database connection across multiple Catalyst apps?
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/
Re: [Catalyst] [Absolute Beginner] Navigation Q Part II i18n and URIs
again I shamelessly plug this module; works like a champ (proven w/ it,ja,en,br,de,fr,es,zh)! ;) Catalyst::Plugin::Localize::Simple http://search.cpan.org/~wehr/Catalyst-Plugin-Localize-Simple-1.1/lib/Catalyst/Plugin/Localize/Simple.pm cheers, -nw On Sun, Aug 22, 2010 at 12:54 PM, Ekki Plicht (DF4OR) e...@plicht.de wrote: Thanks Mike, that looks promising. But as of now I have problems getting I18N to work at all. See other message. Cheers, Ekki Am Samstag 21 August 2010, 16:43:09 schrieb Mike Raynham: Hi Ekki, I'm quite new to Catalyst too, and purely out of curiosity, I have recently been looking into I18N. I thought that you might find Catalyst::Plugin::I18N::Request useful - it might be just what you are after. Regards, Mike Ekki Plicht (DF4OR) wrote: Hi Robert, your comments were most helpful, many thanks! As it is so often - after sending the message I did some more thinking and started to realize that my approach - starting with the controller - is probably not the best way to design this app. And your comments encourage me that I have to think about the model much more and probably first. What do you charge for a day of consulting? :-) It's time that I visit Hamburg again... Some details from your reply: Am Samstag 21 August 2010, 00:46:14 schrieben Sie: Some things to consider: · Should the user be able to override the language? Of course. · Do you want to separate language by domain or URI part? URI part or parameter, undecided. I have never done this until now, but I want to extract the preferred language from the header, if set and if supported. If not an app wide default kicks in, which the user can override later on, this override value is persistent by a cookie, session racking or some such. What would happen if someone who only accepts DE as language requests the EN page? Customer is king, she gets what she wants. Browser language detection is pretty easy with the I18N plugin, but the implementation of the language logic is dependent on what you want to happen. I will look at that, tnx. Both the language and the article to display are variables in the process of displaying the page. The language can come from a cookie, the browser language setting, a query parameter, the domain name, a part of the URI, or multiple of those using the first it can find. I'd always advise to build the actual business logic of the application outside of the web front-end. Absolutely, that's why I decided to go with Catalyst :-) What I am envisioning is a central file where I (somehow, XML?, database?) maintain a navigation tree (ok, 5 or more), mapping menu entries to URIs. Some process then maps these entries to actions. But how? As a model. Look at Config::Any (already used by Cat) for loading of configuration files. For a database model I'd point you towards DBIx::Class, but mostly because of community-size and personal preference. There are other solutions, but I feel it is a good start. Yes, I am already working through some light weight examples with DBIx::Class, that's most likely the way to go. [...] And all the rest, as I said helpful. Many thanks. Gruß, Ekki ___ 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/ ___ 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] [Absolute Beginner] Navigation Q Part II i18n and URIs
fyi - yaml is much like an .ini file and almost exactly javascript or json structures... good luck! On Mon, Aug 23, 2010 at 2:26 PM, Ekki Plicht (DF4OR) e...@plicht.de wrote: Am Montag 23 August 2010, 22:13:51 schrieb Nicholas Wehr: again I shamelessly plug this module; works like a champ (proven w/ it,ja,en,br,de,fr,es,zh)! ;) Catalyst::Plugin::Localize::Simple Hi Nate, thanks for the hint. But I have already started to learn gettext tools and wrote some mo/po files. As my learning curve(s) are pretty steep and multiple at the moment, I am not much inclined now to lear how .yaml files work. Sorry :) But I like the feature of Localize::Simple that you don't need a restart of the server to include recent changes in the .yaml files. Maybe that will get me interested in the long term. Cheers, Ekki On Sun, Aug 22, 2010 at 12:54 PM, Ekki Plicht (DF4OR) e...@plicht.de wrote: Thanks Mike, that looks promising. But as of now I have problems getting I18N to work at all. See other message. Cheers, Ekki Am Samstag 21 August 2010, 16:43:09 schrieb Mike Raynham: Hi Ekki, I'm quite new to Catalyst too, and purely out of curiosity, I have recently been looking into I18N. I thought that you might find Catalyst::Plugin::I18N::Request useful - it might be just what you are after. Regards, Mike Ekki Plicht (DF4OR) wrote: Hi Robert, your comments were most helpful, many thanks! As it is so often - after sending the message I did some more thinking and started to realize that my approach - starting with the controller - is probably not the best way to design this app. And your comments encourage me that I have to think about the model much more and probably first. What do you charge for a day of consulting? :-) It's time that I visit Hamburg again... Some details from your reply: Am Samstag 21 August 2010, 00:46:14 schrieben Sie: Some things to consider: · Should the user be able to override the language? Of course. · Do you want to separate language by domain or URI part? URI part or parameter, undecided. I have never done this until now, but I want to extract the preferred language from the header, if set and if supported. If not an app wide default kicks in, which the user can override later on, this override value is persistent by a cookie, session racking or some such. What would happen if someone who only accepts DE as language requests the EN page? Customer is king, she gets what she wants. Browser language detection is pretty easy with the I18N plugin, but the implementation of the language logic is dependent on what you want to happen. I will look at that, tnx. Both the language and the article to display are variables in the process of displaying the page. The language can come from a cookie, the browser language setting, a query parameter, the domain name, a part of the URI, or multiple of those using the first it can find. I'd always advise to build the actual business logic of the application outside of the web front-end. Absolutely, that's why I decided to go with Catalyst :-) What I am envisioning is a central file where I (somehow, XML?, database?) maintain a navigation tree (ok, 5 or more), mapping menu entries to URIs. Some process then maps these entries to actions. But how? As a model. Look at Config::Any (already used by Cat) for loading of configuration files. For a database model I'd point you towards DBIx::Class, but mostly because of community-size and personal preference. There are other solutions, but I feel it is a good start. Yes, I am already working through some light weight examples with DBIx::Class, that's most likely the way to go. [...] And all the rest, as I said helpful. Many thanks. Gruß, Ekki ___ 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
Re: [Catalyst] Instruction for SSL configuration for Apache and fastcgi
you should consider using mod_rewrite rules for this check out: (ideahttp://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#relative ) -nw On Thu, Aug 5, 2010 at 2:26 PM, Kutbuddin Doctor ksdoc...@sanfordburnham.org wrote: I currently run Catalyst via myapp_fastcgi.pl without SSL Is there an explicit instruction set (copy/paste code) with advice on how to make parts (most) of this run through SSL. From reading the docs, it looks like I will start with: # in MyApp.pm use Catalyst qw/ StaticSimple Authentication Session Session::Store::FastmMap Session::State::Cookie /; MyApp-setup( qw/RequireSSL/ ); MyApp-config-{require_ssl} = { https = 'secure.mydomain.com', http = 'www.mydomain.com', remain_in_ssl = 0, no_cache = 0, }; # in any controller methods that should be secured $c-require_ssl; Then in my Apache httpd.conf I currently have (static mode): FastCgiServer /path/to/myapp/script/myapp_fastcgi.pl -processes 3 Alias / /path/to/myapp/script/script/myapp_fastcgi.pl/ I hope to run this on the same machine and have 2 Apache Virtual Hosts for 'secure.mydomain.com' and 'mydomain.com' . Can someone provide apache config scripts for this situation? Do I need Port 443 for the FastCgiServer command in Apache? Will these 2 VH's use separate Session FastMmap files? Log files? thanks, KSD ___ 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] I18N with variables
Check out Catalyst::Plugin::Localize::Simple http://search.cpan.org/~wehr/Catalyst-Plugin-Localize-Simple-1.1/lib/Catalyst/Plugin/Localize/Simple.pm I made it to overcome the learning curve of i18n, and it works very well. Used it to translate English to Spanish, French, Japanese, Italian, Portuguese, and Chinese Simplified. I provided a CMS for the translation team to create and modify these translation files. Very simple and straight forward. Let me know if you have questions on usage. -nw On Wed, Aug 4, 2010 at 1:04 AM, Ton Voon ton.v...@opsera.com wrote: On 2 Aug 2010, at 06:08, Julien Sobrier wrote: Hello, I've started to translate my website using Catalyst::Plugin::I18N. It works fine for static text. Bu I can't make it work for variables. For example, I need to a translation for [% foo %] where for can take a set of values defined in a database. I'm sot sure what is the best way to translate such variables, and what is possible: * add a msgid for each possible value in messages.po = those gets removed every time I run xgettext.pl * Make the translation in my Database layer = unfortunately I use the old Class::DBI, and could not find a plugin for it * any other option? What I do is use the variable to work out the dynamic name, and then in a dummy template file, have the possible options. Eg: [% menu_name=Configuration; c.loc(menu_name) %] Then in a dummy template file, have: [% c.loc(Configuration) %] This way xgettext.pl will always find it to put into messages.po. It means having to write in the dummy template all the possibilities, but it would have to be captured somewhere, so it might as well be in something that xgettext.pl can process. Ton ___ 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] C::P::Unicode::Encoding and C::P::Compress
are you using the built-in perl http server for your production deployment? if not, consider apache's mod_deflate for your gzip content. I ran into a similar issue with dynamic tar file output; using a temp file barfed (from utf8) - streamed was fine. good luck -nw On Wed, Jul 28, 2010 at 10:25 PM, Octavian Rasnita orasn...@gmail.comwrote: Hi, I have been using Catalyst::Plugin::Unicode but I read in its POD that Catalyst::Plugin::Unicode::Encoding is now recommended. Can C::P::Unicode::Encoding be used with C::P::Compress::Gzip or C::P::Compress? I've seen that the HTTP headers seem to be correctly generated, but no page content is sent if I use these 2 plugins. I have used the following settings in the configuration file: encoding UTF-8 compression_format gzip Thanks. Octavian ___ 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] Forcing charset=utf-8 on all Content-Types for Catalyst::Controller::REST
notice that by default - C::V::JSON will detect utf8 perl flagged scalars and automatically output the utf8 header. I've ran into issues where I was pulling in file system data via YAML, which was *not* utf8 by default, and ultimately caused my issue with utf8 display to an extjs javascript panel. hope this helps. -nw On Mon, Jul 26, 2010 at 8:36 AM, Larry Leszczynski lar...@emailplus.orgwrote: Hi Dave - After searching google, and reading through all of the relevant documentation, and a considerable portion of the code, we have been unable to locate the correct place to set or override the Content-Type header to append a charset=utf-8 string, required by our caching proxy to properly handle the encoding. We would like a place to handle all mimetypes, so that our JSON, JSONP, and XML interfaces all get the correct charset set. If you're sure all your content actually is utf-8, one way is to subclass Catalyst::View and do something like: after process = sub { my ($self, $c) = @_; my $ct = $c-response-content_type; if ($ct) { $ct =~ s/;\s*charset=.*//i; $ct .= '; charset=utf-8'; } else { $ct = 'text/html; charset=utf-8'; } $c-response-content_type($ct); }; Thanks! 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/
Re: [Catalyst] rich ajax UI component libraries for Catalyst?
agreed - extjs will cost money if: eval { ($site_not_open_source $site_is_public) }; but it's still a great product - and if you can afford it, it's well worth supporting the project with a support subscription/license fee. I've used scriptalicious and jquery both and ultimately settled into extjs as it has the most comprehensive and consistent api documentation and great community support. -nw On Mon, Jul 26, 2010 at 1:30 AM, Peter Edwards pe...@dragonstaff.co.ukwrote: I used to use ExtJS - see Catalyst advent calendar article I wrote 3 years ago. However, there was some difficulty when they changed the terms of the open source licence and I switched to JQuery. I would recommend that for most uses. It's straightforward to use and has some good GUI widgets. In fact we're using it for BBC international sites now that Glow library has moved to maintenance only. I'm supporting Dojo on a CMS for $day_job but it's rather heavyweight. Regards, Peter http://perl.dragonstaff.co.uk On Jul 26, 2010 7:35 AM, Leandro Hermida soft...@leandrohermida.com wrote: Hi Nicolas, Thanks for the excellent advice, this is very good to know for us new users! If I may ask everyone another question, what are peoples opinions about which libraries are best? most straightforward to use? The only time I've ever used one was to do a drop-down menu ajax auto-suggest on a text box, I tried Scriptaculous and jQuery's and I found Scriptaculous to be much better, jQuery seemed overly complicated to achieve the same goal. jQuery and jQuery UI ExtJS YUI Dojo Scriptaculous/Prototype others? best, Leandro On Sun, Jul 25, 2010 at 10:40 PM, Nicholas Wehr catal...@bionikchickens.com wrote: I don't thin... ___ 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] rich ajax UI component libraries for Catalyst?
I don't think you gain anything by using the ExtJS perl module. Since perl data structures can be serialized to JSON *(extjs objects/code) then having the JSON view is all you need for easy integration. Once you have the hang of extjs - it's pretty consistent and clean. No doubt whichever javascript widget library you use will have you spending equal amounts of time designing and working in javascript (the UI); perl won't save you here! ;) -nw On Sat, Jul 24, 2010 at 1:13 PM, Leandro Hermida soft...@leandrohermida.com wrote: Hi, Thanks very much, I see now that there is a CatalystX::ExtJS distro on CPAN and found some tutorials posted on the web showing how to get going with Catalyst + jQuery UI! -L On Sat, Jul 24, 2010 at 6:31 PM, Nick Perez n...@nickandperla.net wrote: 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. -- Nicholas Perez XMPP/Email: n...@nickandperla.net http://search.cpan.org/~nperez/ http://search.cpan.org/%7Enperez/ http://github.com/nperez ___ 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] Repeatedly creating sessions
I used charles proxy as well until I discovered how awesome the mozilla addon firebug is. unbeatable json (xhdr) and network activity analyzer. handles ssl too check it out! jim, is there a charles feature that stands out above firebug? I only used for one project until I re-discovered firebug... -nw On Thu, Jun 24, 2010 at 5:42 AM, James Spath jsp...@pangeamedia.com wrote: On Thu, Jun 24, 2010 at 5:30 AM, Paul Makepeace pa...@paulm.com wrote: I admit this is going to be epicly vague but... we've seen very intermittent (every couple of weeks) reports of users not being able to log in: they click login are returned to the homepage (symptomatic of no cookie/session). I finally caught one happening and it seems Cat is creating a new session on each request. Unfortunately our remote desktop app failed and I couldn't see what Firefox was doing. My next attack is to watch with LiveHTTPHeaders over the wire. Any tips or suggestions on what this might be? Anyone else seen it? Debug tips next time we catch it? Try http://www.charlesproxy.com/ instead ... it's worth the money (and even has a free trial). - Jim ___ 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] Repeatedly creating sessions
I see - sounds really cool and I fell into using firebug before I really got a chance to use it to it's fullest. firebug also allows for javascript debugging which was pretty critical for me, since I'm kind of a debugger junkie ;) On Thu, Jun 24, 2010 at 12:56 PM, James Spath jsp...@pangeamedia.comwrote: On Thu, Jun 24, 2010 at 3:51 PM, Matthias Dietrich mdietr...@cpan.org wrote: Nicholas, Am 24.06.2010 um 18:54 schrieb Nicholas Wehr: I used charles proxy as well until I discovered how awesome the mozilla addon firebug is. unbeatable json (xhdr) and network activity analyzer. handles ssl too check it out! jim, is there a charles feature that stands out above firebug? I only used for one project until I re-discovered firebug... I haven't bought Charles yet but used it for a longer time. A big plus is that you can display the content depending on its type (eg. JSON and AMF as collapsable tree, but doesn't has a display mode for every type, I guess). And it's browser independent so you can test with Safari and other clients (like native apps!), too. You can record transferred data, stop recording, open new sessions while the old ones are still present. If FF crashes or you navigate to a different page, Charles is still there and showing the recorded and opened sessions. Firebug is nice for single request tracking (yes, you can let the requests be sticky, but that's not the same and a bit ugly, even sometimes it doesn't show the content if there's some), CSS, Javascript and HTML, but if you need to debug more intensive and longer I would prefer something like Charles. What Matthias said :) The biggest features for me are a full history beyond the current page load ... and also the ability to redirect requests to different servers or even to a local file on your machine. Don't get me wrong, I use Firebug all the time, but Charles definitely has its uses. - Jim ___ 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/