Re: [Catalyst] output to tt2 and pdf
thanks for helping, I'll try it now! Ulf. Matt S Trout schrieb: > On Wed, Aug 08, 2007 at 04:01:25PM +0200, Ulf Lenski wrote: > >> Hi, >> on http://www.catalystframework.org i found: >> "And in case you want PNG or PDF output, you'll need just a few lines..." >> where can I find an example for the PDF output? >> >> What I need: >> The HTML-ouput in 1:1 as pdf-download on the same page! >> >> Example: >> >> I create a list of names in the controller bla and bring this list to a >> web-page via TT: >> > > http://search.cpan.org/~andrewf/Template-Latex-2.17/lib/Template/Plugin/Latex.pm > > TT can make PDFs too. > > ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
Awesome, thanks. You certainly deserve benefitting from that, and thank you for the disclosure. Matt Rosin ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Catalyst Unicode woes ...
Following up on a conversion I started on the DateTime mailing-list I'd like to ask if it is really neccessary to use C::P::Unicode if a site uses utf8-encoding? I have the problem that up until now everything worked absolutely fine without C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any other unicode plugin because I believed that if everything is utf8 you don't really have to worry about it that much. Now I recently incorporated DateTime::Locale to get a list of localized month names. Spitting them out in my templates revealed a symbol instead of all german umlauts. I took a look at DateTime::Locale and everything seems to be correct (use utf8 at the top, etc) so this can't be the culprit. encode("utf8")-ing the month names makes them look correct. I asked about this on the DateTime mailing list and everybody suggested a truckload of plugins to incorporate in Catalyst which _ALL_ break everything else on my site except the month names which are displayed fine then. It looks like everything gets encoded twice when utilizing these plugins. So I must admit I'm stuck with this. What is the best-practice for dealing with Catalyst and utf8? Do I really need C::P::Unicode to make this work correctly? What about the various TT plugins? And why the heck is everything double utf8 encoded when using these plugins that everybody else seems to use? Thanks a lot for any input! --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On Thu, Aug 09, 2007 at 10:27:27AM +0200, Tobias Kremer wrote: > I have the problem that up until now everything worked absolutely fine without > C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any ForceUTF8 is a hack hack hack. If your program doesn't work without it, it's completely broken. C::P::Unicode is necessary though. If you don't know why, read the source and the various perl unicode manpages. There's a lot to understand, and I've explained it too many times to care anymore. Google it. The gist of it is this: -> Encode::decode(...) -> -> Encode::encode(...) -> If you do manipulation before you decode, your app will break. If you do manipulation after you encode, your app will break. Anyway, a whole article about unicode and Catalyst is here: http://www.catalystframework.org/calendar/2006/21 Learn and enjoy. Regards, Jonathan Rockway ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
Hi, On Aug 9, 2007, at 9:27 AM, Tobias Kremer wrote: Following up on a conversion I started on the DateTime mailing-list I'd like to ask if it is really neccessary to use C::P::Unicode if a site uses utf8-encoding? I have the problem that up until now everything worked absolutely fine without C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any other unicode plugin because I believed that if everything is utf8 you don't really have to worry about it that much. Now I recently incorporated DateTime::Locale to get a list of localized month names. Spitting them out in my templates revealed a symbol instead of all german umlauts. I took a look at DateTime::Locale and everything seems to be correct (use utf8 at the top, etc) so this can't be the culprit. encode("utf8")-ing the month names makes them look correct. I asked about this on the DateTime mailing list and everybody suggested a truckload of plugins to incorporate in Catalyst which _ALL_ break everything else on my site except the month names which are displayed fine then. It looks like everything gets encoded twice when utilizing these plugins. So I must admit I'm stuck with this. What is the best-practice for dealing with Catalyst and utf8? Do I really need C::P::Unicode to make this work correctly? What about the various TT plugins? And why the heck is everything double utf8 encoded when using these plugins that everybody else seems to use? I must admit that I'm in the "it works for me but don't ask me why"- camp at the moment. A combination of: * DBIC and making sure output from text fields is UTF8 (utf8_columns() is your friend, but depending on the DB, you might need more than that); * Catalyst::View::TT::ForceUTF8; * Catalyst::Plugin::Unicode with those three, and making sure my TT templates are in UTF8 (no BOM was injured) I haven't had any problems, even with DateTime with a PT_pt locale. Also if you use open(), make sure you use the three argument version, and stick '<:utf8' in the middle arg. This works for *me*, but I haven't had the time to understand it totally. And I would love someone to tell me that there is a simpler way. Sincerely I would hope Cat to be utf8-by-default around version 6... Best regards, -- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: [EMAIL PROTECTED] Use XMPP! ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On Thu, Aug 09, 2007 at 10:27:27AM +0200, Tobias Kremer wrote: > month names which are displayed fine then. It looks like everything gets > encoded twice when utilizing these plugins. OK, so I changed my mind and I'll be a bit nicer. :) This is exactly the problem. Currently, your "unicode" data is sitting in memory as a bunch of octets. If you read in octets and then spit those out, things will appear to work. The problem is that the Locale data you have is properly encoded as Perl characters. When you concatenate those characters with your octets, the octet data is treated as latin-1 and then converted to utf8. Since the data is utf8 and not latin-1, you get your double-encoded junk. This is why you need to decode() your data before you use it inside Perl. Try this: $ recode latin-1..utf8 You'll notice the familiar double-encoded junk. It turns out that this is exactly what Perl is doing, because that's what you're telling it to do. > So I must admit I'm stuck with this. What is the best-practice for dealing > with The best practice is to tell your program what you want it to do, rather than just type stuff and hope it works :) Regards, Jonathan Rockway ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On 8/9/07, Tobias Kremer <[EMAIL PROTECTED]> wrote: > I have the problem that up until now everything worked absolutely fine without > C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any > other unicode plugin because I believed that if everything is utf8 you don't > really have to worry about it that much. No, you need to. Because DateTime::Locale month_names are utf8-flagged (meaning Perl knows that it's a string properly decoded to Unicode) but Catalyst request parameters are from HTTP request which Catalyst doesn't know which encoding it's encoded in, until you use modules like C::P::Unicode. Similarly even if your templates are encoded in utf-8, Template-Toolkit doesn't know which encoding they are in, until you set BOM to your templates or use Template::Provider::Encoding to explicitly specify the encoding to decode the template. Concatinating utf-8 flagged variables with utf-8 encoded byte string causes automatic SV upgrade, which causes double utf-8 encoded string. You might want to look at the manpages of encoding::warnings and perlunitut. I have a couple of hacks to workaround that, like Template::Stash::ForceUTF8 that you mentioned, and Encode::DoubleEncodedUTF8 is probably the most evil one, that "fixes" the double-encoded utf-8 strings back to what you mean. Too evil to use on production but would be still useful to catch bugs like that in testing. HTH, -- Tatsuhiko Miyagawa ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
Pedro Melo wrote: > Hi, > > On Aug 9, 2007, at 9:27 AM, Tobias Kremer wrote: > >> Following up on a conversion I started on the DateTime mailing-list >> I'd like to >> ask if it is really neccessary to use C::P::Unicode if a site uses >> utf8-encoding? > > Also if you use open(), make sure you use the three argument version, > and stick '<:utf8' in the middle arg. It's probably worth mentioning that you can use the open pragma to do this automatically. use open ':utf8'; You can also use the -C switch to perl or the PERL_UNICODE environment variable to set the default PerlIO layer to UTF-8 for handles. A value of 31 should cause all handles to be flagged, including the three standard handles. See perldoc open and man perlrun for more details about these. Matt ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On 09/08/07, Tobias Kremer <[EMAIL PROTECTED]> wrote: > Following up on a conversion I started on the DateTime mailing-list I'd like > to > ask if it is really neccessary to use C::P::Unicode if a site uses > utf8-encoding? > > I have the problem that up until now everything worked absolutely fine without > C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any > other unicode plugin because I believed that if everything is utf8 you don't > really have to worry about it that much. > > Now I recently incorporated DateTime::Locale to get a list of localized month > names. Spitting them out in my templates revealed a symbol > instead of all german umlauts. I took a look at DateTime::Locale and > everything > seems to be correct (use utf8 at the top, etc) so this can't be the culprit. > encode("utf8")-ing the month names makes them look correct. I asked about this > on the DateTime mailing list and everybody suggested a truckload of plugins to > incorporate in Catalyst which _ALL_ break everything else on my site except > the > month names which are displayed fine then. It looks like everything gets > encoded twice when utilizing these plugins. Tobias, I tried jrock's advice of adding C::P::Unicode to the Cat app you sent me a couple days ago - and it does fix the encoding problem. Carl ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
Hi, On Aug 9, 2007, at 10:40 AM, Tatsuhiko Miyagawa wrote: Similarly even if your templates are encoded in utf-8, Template-Toolkit doesn't know which encoding they are in, until you set BOM to your templates or use Template::Provider::Encoding to explicitly specify the encoding to decode the template. hmms.. Is there a third way, just telling TT that all my templates are in UTF8? Setting the BOM is not easy with some editors. Best regards, -- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: [EMAIL PROTECTED] Use XMPP! ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
> Tobias, > > I tried jrock's advice of adding C::P::Unicode to the Cat app you sent > me a couple days ago - and it does fix the encoding problem. I also did that but it only works in some cases. Try adding a block element to the FormFu YAML file (or a comment for the date element) that contains some Umlauts and they will get double-encoded even with Unicode loaded. Most of my site now works with the Unicode plugin loaded but still some pages with FormFu forms are double-encoded - not all of them though. --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: [Semi OT] HTTP DELETEs
On Wed, 8 Aug 2007 23:42:22 +0200, "A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > * Jonathan Tweed <[EMAIL PROTECTED]> [2007-08-08 21:35]: >> Can an HTTP DELETE have an entity body? I have looked in the >> HTTP spec and as far as I can see it doesn't say. > > 4.3 Message Body > > […] A message-body MUST NOT be included in a request if > the specification of the request method (section 5.1.1) > does not allow sending an entity-body in requests. […] I saw this, but in the definitions of the methods themselves I couldn't see where this was explicitly specified. >> If it's legal for a DELETE to have a body they could put the >> reason in there. If not, is it a reasonable use of a custom >> header? > > Yes. We'll do that then. Thanks Jonathan ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
Zitat von Tatsuhiko Miyagawa <[EMAIL PROTECTED]>: > Similarly even if your templates are encoded in utf-8, > Template-Toolkit doesn't know which encoding they are in, until you > set BOM to your templates or use Template::Provider::Encoding to > explicitly specify the encoding to decode the template. So you're saying that there's no sane way using TT without Template::Provider::Encoding (or something similar)? I admit I haven't really grasped this whole Unicode issue fully yet (and I don't seem to be the only one as it's causing trouble for lots of people) but this really should be more DWIM out of the box if possible ... Especially since utf8 is becoming the de-facto standard for encoding everything should "just" work. Yeah, I know, I'm naive :) > Concatinating utf-8 flagged variables with utf-8 encoded byte string > causes automatic SV upgrade, which causes double utf-8 encoded string. Hmmm. So my templates are utf8 _ENCODED_ and the strings coming in from other perl modules are just utf8 _FLAGGED_. When TT concats them together during process() the result is wrecked because of the automatic upgrade. Correct? > You might want to look at the manpages of encoding::warnings and perlunitut. Just quickly tried out encoding::warnings which outputs nothing at all but I'll give it a closer look. > I have a couple of hacks to workaround that, like > Template::Stash::ForceUTF8 that you mentioned, and > Encode::DoubleEncodedUTF8 is probably the most evil one, that "fixes" > the double-encoded utf-8 strings back to what you mean. Too evil to > use on production but would be still useful to catch bugs like that in > testing. Hacks are not an option here :) And there must be a "right" way to do it. --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On 09/08/07, Pedro Melo <[EMAIL PROTECTED]> wrote: > Hi, > > On Aug 9, 2007, at 10:40 AM, Tatsuhiko Miyagawa wrote: > > > Similarly even if your templates are encoded in utf-8, > > Template-Toolkit doesn't know which encoding they are in, until you > > set BOM to your templates or use Template::Provider::Encoding to > > explicitly specify the encoding to decode the template. > > hmms.. Is there a third way, just telling TT that all my templates > are in UTF8? Setting the BOM is not easy with some editors. Looking at Template::Provider::Encoding description: "Template::Provider::Encoding is a Template Provider subclass to decode template using its declaration. You have to declare encoding of the template in the head (1st line) of template using (fake) encoding TT plugin. Otherwise the template is handled as utf-8." So if you want utf8 you just need to use T::P::E and don't need to explicitly specify the encoding. -- Jonas ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
I've been doing Japanese web pages for such a long time now, and yet I still can't claim to have a full grasp of things. But anyways, what I do is: * All my templates are in unicode (open documents with set enc=utf-8, NO BOM), as well as my FormFu config files. * I do NOT use UTF8Columns for my DBIx::Class schema * I do NOT use things like C::P::Unicode, T::P::Encoding I think that means all of my data is in octets, so I have to jump hoops when I want to enforce Unicode semantics, such as truncating a string to X number of characteers, as opposed to bytes. Other than that little "detail", this is working fine for me. I suppose it's a hack, but I couldn't get things to really work the other way around. I don't thinks this is the best practice at all, but just so you know ... --d Tobias Kremerwrote: Following up on a conversion I started on the DateTime mailing-list I'd like to ask if it is really neccessary to use C::P::Unicode if a site uses utf8-encoding? I have the problem that up until now everything worked absolutely fine without C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any other unicode plugin because I believed that if everything is utf8 you don't really have to worry about it that much. Now I recently incorporated DateTime::Locale to get a list of localized month names. Spitting them out in my templates revealed a symbol instead of all german umlauts. I took a look at DateTime::Locale and everything seems to be correct (use utf8 at the top, etc) so this can't be the culprit. encode("utf8")-ing the month names makes them look correct. I asked about this on the DateTime mailing list and everybody suggested a truckload of plugins to incorporate in Catalyst which _ALL_ break everything else on my site except the month names which are displayed fine then. It looks like everything gets encoded twice when utilizing these plugins. So I must admit I'm stuck with this. What is the best-practice for dealing with Catalyst and utf8? Do I really need C::P::Unicode to make this work correctly? What about the various TT plugins? And why the heck is everything double utf8 encoded when using these plugins that everybody else seems to use? Thanks a lot for any input! --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
Zitat von Tatsuhiko Miyagawa <[EMAIL PROTECTED]>: > Similarly even if your templates are encoded in utf-8, > Template-Toolkit doesn't know which encoding they are in, until you > set BOM to your templates or use Template::Provider::Encoding to > explicitly specify the encoding to decode the template. I just found the (undocumented?) "ENCODING" configuration option in Template::Provider. Setting this to "utf-8" makes the templates appear correctly with C::P::Unicode loaded. Is there still a need for Template::Provider::Encoding? --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
On Thu, Aug 09, 2007 at 11:36:45AM +0900, Matt Rosin wrote: > Hello, > > I remember somewhere catalyst-friendly hosting. I'm looking for a new > hosting company. I don't relish using catalyst without root access, > having built it once locally, especially since I don't want to have to > ask the company every time to edit the apache config for me. We're (eventually) intending to offer Catalyst-optimised shared hosting. The reason we don't already is because we haven't yet got our experiments to a point where we think there's a substantial value-add over getting a dreamhost acct and upgrading to $vps/whatever if you outgrow that, plus getting a support contract off us if you want to be able to ask for help with config/beating CPAN into submission/whatever else (I don't normally make a major point of us offering those but it's necessary context to what is for the moment fundamentally a recommendation of dreamhost :). -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Multi Mod_Perl apps - THANK YOU
Thank you all you for your help. Best Regards, Will Adam Sjøgren <[EMAIL PROTECTED]> wrote: On Wed, 8 Aug 2007 06:14:54 -0700 (PDT), Will wrote: > Sorry if I post an old question, I just want to know if I could do > this to run multi app on the same server under mod_perl: > PerlSwitches -I/var/www/MyApp1/lib > PerlModule MyApp1 > > SetHandler modperl > PerlResponseHandler MyApp1 > > PerlSwitches -I/var/www/MyApp2/lib > PerlModule MyApp2 > > SetHandler modperl > PerlResponseHandler MyApp2 > Assuming that the -parts are in different virtual hosts (and not as shown verbatim above), yes; that is what I do. My site-configuration files basically looks like this (stuff omitted at [...] for brevity): ,[ /etc/apache2/sites-enabled/010-www.kammeratadam.dk ] | PerlSwitches -I/var/www/www.kammeratadam.dk/lib | PerlModule KammeratAdam | | | ServerName www.kammeratadam.dk | [...] | | | SetHandler modperl | PerlResponseHandler KammeratAdam | ExpiresDefault "access plus 10 minutes" | | | | SetHandler None | ExpiresDefault "access plus 1 week" | | [...] | ` ,[ /etc/apache2/sites-enabled/010-www.vantbanken.se ] | PerlSwitches -I/var/www/www.vantbanken.se/lib | PerlModule Vantbanken | | | ServerName www.vantbanken.se | [...] | | | SetHandler modperl | PerlResponseHandler Vantbanken | | AuthType Basic | AuthName "Not open yet" | AuthUserFile /var/www/www.vantbanken.se/conf/stats | Require valid-user | | [...] | ` > My question is the PerlSwitches, will it get any error with that? Not unless your apps have different local modules with the same names, I'd guess? Best regards, Adam -- "KOMPRESSOR crush american burger" Adam Sjøgren [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ - Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Issue with JSON view
I'll just do this at the end of my controller method: $c->forward('My::App::View::JSON'); - Alex > -Original Message- > From: Tatsuhiko Miyagawa [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 09, 2007 3:07 AM > To: The elegant MVC web framework > Subject: Re: [Catalyst] Issue with JSON view > > On 8/8/07, Mesdaq, Ali <[EMAIL PROTECTED]> wrote: > >$c->forward('scorer::View::JSON'); > > } > > > > > > My understanding may be wrong but the json view should create the > > headers and return the result itself right? I shouldn't need to > create a > > template file on disk for a json view or so I assume. The only thing > I > > can think of is that for some reason it is still being sent to my TT > > view. > > I encountered with this probelm a few week ago with my pet project. > I've never used View::JSON with my real project. > > Try this instead: > > $c->stash->{current_view} = 'JSON'; > > The View::JSON doc is kinda obsolete and I guess incompatible with the > current RenderView default action. > > If there's a better way to do this, let me know and I'll update the > doc. > > -- > Tatsuhiko Miyagawa > > ___ > List: Catalyst@lists.rawmode.org > Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst > Searchable archive: http://www.mail- > archive.com/catalyst@lists.rawmode.org/ > Dev site: http://dev.catalyst.perl.org/ smime.p7s Description: S/MIME cryptographic signature ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On Thu, Aug 09, 2007 at 02:56:31PM +0200, Tobias Kremer wrote: > I just found the (undocumented?) "ENCODING" configuration option in > Template::Provider. Setting this to "utf-8" makes the templates appear > correctly with C::P::Unicode loaded. Is there still a need for > Template::Provider::Encoding? In config.yml View::TT ENCODING: UTF-8 Template provider will see you are running a modern Perl (UNICODE flag in provider) and then look for a Byte Order Mark. If not found it will then decode your content based on the ENCODING setting. No, you don't need Template::Provider::Encoding if you only have one encoding in your templates. Yes you need Unicode (or the older Unicode::Encoding) plugin so that input params are decoded and output is encoded back to utf8. -- Bill Moseley [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
> View::TT > ENCODING: UTF-8 > > Template provider will see you are running a modern Perl (UNICODE flag > in provider) and then look for a Byte Order Mark. If not found it > will then decode your content based on the ENCODING setting. > > No, you don't need Template::Provider::Encoding if you only have one > encoding in your templates. > > Yes you need Unicode (or the older Unicode::Encoding) plugin so that > input params are decoded and output is encoded back to utf8. Yes, it all starts to make sense :) Thanks for all the great clarifications. MyApp is working fine now with C::P::Unicode and the ENCODING setting. By the way, does anybody know why the ENCODING option is undocumented? IMHO, it really should be mentioned in the Catalyst::Manual alongside some best-practice for Unicode. Use C::P::Unicode and ENCODING: UTF-8 should be enough for most people ... --Tobias ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On Thu, Aug 09, 2007 at 02:56:31PM +0200, Tobias Kremer wrote: > Zitat von Tatsuhiko Miyagawa <[EMAIL PROTECTED]>: > > Similarly even if your templates are encoded in utf-8, > > Template-Toolkit doesn't know which encoding they are in, until you > > set BOM to your templates or use Template::Provider::Encoding to > > explicitly specify the encoding to decode the template. > > I just found the (undocumented?) "ENCODING" configuration option in > Template::Provider. Setting this to "utf-8" makes the templates appear > correctly with C::P::Unicode loaded. Is there still a need for > Template::Provider::Encoding? Ooh. doc patch to View::TT ? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On Thu, Aug 09, 2007 at 04:42:53PM +0200, Tobias Kremer wrote: > > View::TT > > ENCODING: UTF-8 > > > > Template provider will see you are running a modern Perl (UNICODE flag > > in provider) and then look for a Byte Order Mark. If not found it > > will then decode your content based on the ENCODING setting. > > > > No, you don't need Template::Provider::Encoding if you only have one > > encoding in your templates. > > > > Yes you need Unicode (or the older Unicode::Encoding) plugin so that > > input params are decoded and output is encoded back to utf8. > > Yes, it all starts to make sense :) Thanks for all the great clarifications. > MyApp is working fine now with C::P::Unicode and the ENCODING setting. By the > way, does anybody know why the ENCODING option is undocumented? IMHO, it > really > should be mentioned in the Catalyst::Manual alongside some best-practice for > Unicode. Use C::P::Unicode and ENCODING: UTF-8 should be enough for most > people > ... Because (1) we don't control the TT docs, (2) you haven't written the doc patch for the Catalyst docs yet. I agree that you should patch the main manual as well as View::TT docs though :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Method to overload per request
Is there a method in C::Req (or any other part of Cat) that I can overload which is called only once per request? I thought that would be prepare, but it seems that is called several times per page load. Any advice appreciated. John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Storing Login Information
Hello - I'm working on a Catalyst app, mostly just to amuse myself, that is supposed to be a webmail/calendar/address book/user account management app. All of the user account information, as well as the address book, is stored in an LDAP directory, so authenticating against that is not a problem. I am running into a problem if I want the user to be able to connect to an IMAP server, as that would require that user provide their username/password again. Here's basically how my app is currently working: User logs in, auth data is checked against LDAP. Once logged in, the user is trusted to do various things based on my authorization scheme. Say the user wants to check his email. I'm trying to use Net::IMAP::Simple to connect to my IMAP server. However, to log in, the module needs the username and password. So, the two most obvious options are to 1) have the user provide his authentication data again; or 2) store the user's password in the session. Neither sounds like a good idea, the first is just annoying, and the second seems like a security vulnerability. So, does anyone have any advice on how to procede. One idea I had was the login to the IMAP server the first time the user logs in to the web app, and then pass around the IMAP object with the session, but that seems kind of ugly. Any ideas? Thanks. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Storing Login Information
On 09/08/07, Patrick McDonnell <[EMAIL PROTECTED]> wrote: > Hello - > > I'm working on a Catalyst app, mostly just to amuse myself, that is supposed > to be a webmail/calendar/address book/user account management app. All of > the user account information, as well as the address book, is stored in an > LDAP directory, so authenticating against that is not a problem. I am > running into a problem if I want the user to be able to connect to an IMAP > server, as that would require that user provide their username/password > again. Here's basically how my app is currently working: > > User logs in, auth data is checked against LDAP. Once logged in, the user > is trusted to do various things based on my authorization scheme. > Say the user wants to check his email. I'm trying to use Net::IMAP::Simple > to connect to my IMAP server. However, to log in, the module needs the > username and password. So, the two most obvious options are to 1) have the > user provide his authentication data again; or 2) store the user's password > in the session. Neither sounds like a good idea, the first is just > annoying, and the second seems like a security vulnerability. > > So, does anyone have any advice on how to procede. One idea I had was the > login to the IMAP server the first time the user logs in to the web app, and > then pass around the IMAP object with the session, but that seems kind of > ugly. Any ideas? > > Thanks. > You can create a second IMAP server that uses a secret token as the user password. Then you just need to auth against that server with the user login and a password like sha1_hex($username, $your_secret), or something like that. Cheers, -- Jonas ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
On 8/8/07, Matt Rosin <[EMAIL PROTECTED]> wrote: > Hello, > > I remember somewhere catalyst-friendly hosting. I'm looking for a new > hosting company. I don't relish using catalyst without root access, > having built it once locally, especially since I don't want to have to > ask the company every time to edit the apache config for me. > > 1. Has anyone got a good one. I'm thinking of trying a Swamp acct on > HostGator temporarily (around $20) and maybe upgrading to a VPS or > tiny dedicated server later on for about $60-70. I had a VPS at a very > bad hosting company I have to get rid of now. Anyway I understand you > can't do things like ffmpeg with a shared account there so probably a > pain to install other things. I'd probably use fastcgi I think. > > 2. Is it possible to do all the apache configs needed for running > catalyst (fastcgi, or mod_perl) in a config file in my own public_html > directory I wonder. Or does everyone running catalyst as a normal user > emailing their ISP admin to configure apache every time they write a > new app? Yes I know just get a root account is the answer but I'd like > to know. > > Thanks, > > Matt > If you want to take the VPS route now, I've been really happy with Linode.com. $20/mo and it's been rock solid for a couple months. Have 2 slices and been very pleased. Supportive IRC channel, plus a responsive customer support system. -J -- J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird... http://www.toeat.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
I work for pipex hosting, who own 123-reg. 123-reg have cheap dedi servers (from £40/mo) running ubuntu (http://www.123-reg.co.uk/dedicated-server-hosting/). You can get root access (actually a chroot, but you get full control of the box and the ip) and we even put catalyst on there as standard (using the deb packages). Bandwidth is un-metered, with a 10mbps conn to 1gbps backbone in leeds. Mark ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
J. Shirley wrote: If you want to take the VPS route now, I've been really happy with Linode.com. $20/mo and it's been rock solid for a couple months. Have 2 slices and been very pleased. Supportive IRC channel, plus a responsive customer support system. -J Linode++ I used them for years before outgrowing it and moving on to several dedicated servers. Their support cannot be beat and the prices are very reasonable. Best, Brian Kirkbride ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Method to overload per request
> -Original Message- > From: John Lifsey - Contractor - [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 09, 2007 8:04 AM > To: The elegant MVC web framework > Subject: [Catalyst] Method to overload per request > > > Is there a method in C::Req (or any other part of Cat) that I can > overload which is called only once per request? I thought > that would be > prepare, but it seems that is called several times per page load. Any > advice appreciated. > > John > MyApp::Controller::Root->auto? -Dylan ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Unicode woes ...
On 8/9/07, Tobias Kremer <[EMAIL PROTECTED]> wrote: > > View::TT > > ENCODING: UTF-8 > > > > Template provider will see you are running a modern Perl (UNICODE flag > > in provider) and then look for a Byte Order Mark. If not found it > > will then decode your content based on the ENCODING setting. > > > > No, you don't need Template::Provider::Encoding if you only have one > > encoding in your templates. > > > > Yes you need Unicode (or the older Unicode::Encoding) plugin so that > > input params are decoded and output is encoded back to utf8. > > Yes, it all starts to make sense :) Thanks for all the great clarifications. > MyApp is working fine now with C::P::Unicode and the ENCODING setting. By the > way, does anybody know why the ENCODING option is undocumented? IMHO, it > really > should be mentioned in the Catalyst::Manual alongside some best-practice for > Unicode. Use C::P::Unicode and ENCODING: UTF-8 should be enough for most > people > ... IIRC, ENCODING options was added right after I released Template::Provider::Encoding. No idea why it's still undocumented (consult the template-toolkit mailing list :), but yeah, if it's a single encoding you use in your templates, there's no need to use T::P::Encoding. -- Tatsuhiko Miyagawa ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Method to overload per request
Dylan Vanderhoof wrote: Is there a method in C::Req (or any other part of Cat) that I can overload which is called only once per request? I thought that would be prepare, but it seems that is called several times per page load. Any advice appreciated. John MyApp::Controller::Root->auto? -Dylan That would be fine on a per controller basis, but this is in a plugin and should apply for any request to any controller. John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
On 8/9/07, Kieren Diment <[EMAIL PROTECTED]> wrote: > dreamhost seem to be the default. I've been using asmallorange.com > which is ok, although they don't give you +x on gcc so if you need xs > modules installed, you need to open a support ticket. They're pretty > responsive though so that hasn't been a problem. Dreamhost has been a nightmare for me this week. I have a few clients with CGI sites that use Class::DBI. At some point recently they upgraded Perl and failed to install the prerequisites for some modules, such as that one. I had sites go down on different servers there, and it took several days of sending them a test script and showing them what was wrong before it was fixed. I wouldn't run a business site there. Barry Hoggard Tristan Media LLC ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst Hosting
On 8/9/07, Brian Kirkbride <[EMAIL PROTECTED]> wrote: > Linode++ > > I used them for years before outgrowing it and moving on to several > dedicated servers. Their support cannot be beat and the prices are > very reasonable. I don't see a discussion of backups on the site. How did you manage that? I suppose I could set up an amazon s3 backup routine. Barry Hoggard ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Method to overload per request
by "several times per page load" are you referring to multiple requests to render one page? (ie, if you have your css/js/etc served through your app) On Aug 9, 2007, at 8:04 AM, John Lifsey - Contractor - wrote: Is there a method in C::Req (or any other part of Cat) that I can overload which is called only once per request? I thought that would be prepare, but it seems that is called several times per page load. Any advice appreciated. John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Broken plugins
Two plugins I just installed are "busted" on CPAN, it seems after they were updated to use Module::Install. "sudo cpan Catalyst-Plugin-Cache-Memcached-0.7" installed 0.6. "sudo cpan Catalyst::Plugin::Cache::FastMmap" same thing. (I had 0.6 and cpan claims that's up to date. The META.yml file claim it's version 0.6 not 0.7. Looks like a bunch of dot files ended up in the distributions, too. I didn't poke around much but looks like Marcus released a bunch of modules on May 1st that have the same problems. Not a huge deal since they look like upgrades to Module::Install only, but I had a Makefile.PL that referenced the current versions on CPAN. But might be less confusing to people if they installed. -- Bill Moseley [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/