Re: [Catalyst] [Announce] Catalyst::View::PDF::Reuse released
JJ schrieb: Hi, I've just released Catalyst::View::PDF::Reuse to CPAN. [1] This is a module we developed at Penny's Arcade [2] to produce receipts and shipping labels - I gave a lighting talk about it [3] at Milton Keynes Perl Mongers which went down well, so here it is for everyone to use. The purpose of the module is to allow PDF files to be created from Template Toolkit so that nothing needs to be hard-coded in your View, the layout can all be controlled via templates. When using View::PDF::Reuse, TT is given a 'pdf' object which has methods corresponding to all the functions of PDF::Reuse. So by taking advantage of PDF::Reuse's [4] ability to modify existing PDF documents (such as a blank order form created in Word), it becomes possible to generate quite complex PDF files without writing much code. As an example, this is all you need in your controller (having already stashed an 'order' object): $c-stash-{pdf_template} = 'order_pdf.tt'; $c-forward('View::PDF::Reuse'); then the layout commands are in order_pdf.tt, allowing all of TT's facilities - loops, filters, and so on - to be used: [% pdf.prForm('customer_receipt.pdf') %] [% pdf.prText(123,643,order.number) %] [% pdf.prText(299,643,order.date) %] If anyone has any suggestions for improvement, please let me know. We dont use direct pdf anymore ... LaTeX! and then convert to pdf works very good! Cheers, JJ [1] http://search.cpan.org/dist/Catalyst-View-PDF-Reuse [2] http://www.pennysarcade.co.uk [3] http://www.pennysarcade.co.uk/files/Creating_PDF_files_with_Catalyst.pdf [4] http://search.cpan.org/dist/PDF-Reuse -- Mit freundlichen Grüßen Felix Antonius Wilhelm Ostmann -- Websuche Search Technology GmbH Co. KG Martinistraße 3 - D-49080 Osnabrück - Germany Tel.: +49 541 40666-0 - Fax:+49 541 40666-22 Email: i...@websuche.de - Website: www.websuche.de -- AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310 Komplementärin: Websuche Search Technology Verwaltungs GmbH - AG Osnabrück - HRB 200359 Geschäftsführer: Diplom Kaufmann Martin Steinkamp -- ___ 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] bug? in t/view_TT.t
Hello, I am using catalyst on ubuntu with perl 5.8.8. The script t/view_TT.t generated by default fails: *%prove -l lib t/view_TT.t* t/view_TT1/1 # Failed test 'use My::App::View::TT;' # at t/view_TT.t line 5. # Tried to use 'My::App::View::TT'. # Error: Can't locate object method *path_to* via package My::App at x/lib/My/App/View/TT.pm line 6. The script has only one line: BEGIN { use_ok 'MyApp::View::TT' } If you take a look at *MyApp/My/App/View/TT.pm*, the problem seems to be this line: Serono::Gecko-path_to( 'root/src' ), If you put 'use My::App' just before the BEGIN, it runs fine but launches the whole catalyst server stuff. So I suspect this is a bug. P.S - my version of catalyst .. | Catalyst::Plugin::ConfigLoader 0.17 | | Catalyst::Plugin::Static::Simple 0.20 | | CatalystX::ListFramework::Builder 0.39 | '' ___ 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::Plugin::Session::Store::CHI
Actually, replying to myself already; and top posting to boot. Alternatively: would it be a good idea to make the ::Store automatically discover the cache if it's there already? I might try a patch for that but I doubt it's as easy as a new store. I'd like it better though. On Feb 9, 2009, at 6:02 PM, Ashley wrote: Has anyone written Catalyst::Plugin::Session::Store::CHI for personal use yet? I haven't use CHI but it strikes me as vastly superior to the regular cache interfaces (having code refs for errors and checks on things that are still within their expiry). Unless there is some negative feedback about CHI or someone volunteers some code for this, I'll try to bat it out. http://search.cpan.org/~jswartz/CHI-0.091/ http://search.cpan.org/~jswartz/CHI-0.091/lib/CHI.pm http://search.cpan.org/~fayland/Catalyst-Plugin-CHI-0.03/lib/ Catalyst/Plugin/CHI.pm -Ashley ___ 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] Catalyst::Plugin::Session::Store::CHI
Has anyone written Catalyst::Plugin::Session::Store::CHI for personal use yet? I haven't use CHI but it strikes me as vastly superior to the regular cache interfaces (having code refs for errors and checks on things that are still within their expiry). Unless there is some negative feedback about CHI or someone volunteers some code for this, I'll try to bat it out. http://search.cpan.org/~jswartz/CHI-0.091/ http://search.cpan.org/~jswartz/CHI-0.091/lib/CHI.pm http://search.cpan.org/~fayland/Catalyst-Plugin-CHI-0.03/lib/ Catalyst/Plugin/CHI.pm -Ashley ___ 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::Plugin::Session::Store::CHI
On Tue, Feb 10, 2009 at 3:05 AM, Ashley a...@sedition.com wrote: Actually, replying to myself already; and top posting to boot. Alternatively: would it be a good idea to make the ::Store automatically discover the cache if it's there already? I might try a patch for that but I doubt it's as easy as a new store. I'd like it better though. There's always my slightly flawed Catalyst::Plugin::Session::Store::Cache? Flawed, since it doesn't update session-expiry on read. I expect to solve this for memcached when I get some tuits, maybe CHI supports something similar to memcached's cas? -- Lars Balker RasmussenConsult::Perl ___ 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/