[Catalyst] get the path to the home
Hi, I have a I18N module in my Catalyst application and I want to get the path to the home directory of the application. Is it possible to get it without hard codding it in that module? The module is: package MyApp::I18N::ro; Thank you. Octavian ___ 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] Can't start Apache when using Catalyst
Hello, I am using Windows XP SP2, Apache 2.2.4, Active perl 5.8.8 build 822, mod_perl 2.03, and Catalyst 5.7010. If I want to start apache and if I have a virtualhost that uses Catalyst, most of the times it gives the following errors and doesn't want to start: [Sun Sep 23 00:35:36 2007] [crit] master_main: create child process failed. Exiting. [Sun Sep 23 00:36:06 2007] [notice] Parent: Forcing termination of child process 36 [Sun Sep 23 00:36:06 2007] [info] removed PID file E:/apache/logs/httpd.pid (pid=3840) It is strange because sometimes even if I use Catalyst, the server starts, but very seldom. If I used just a virtualhost without Catalyst, but only with mod_perl handlers, the server starts fine. I've searched very much on the web these days about this issue, and I heard that this error can be caused by some antiviruses or antispyware programs, and I've uninstalled Nod32, however these errors still appear. I have a new computer and I haven't used Apache with Catalyst on it until now (Core 2 Duo). I've tried many things, like resetting the TCP/IP settings and configuring them again, changing some settings for the network card, closing some programs that run permanently, however nothing changes. Very rarely Apache starts, but most of the times it gives the errors above. Yesterday I convinced it to start and it worked with a Catalyst app, but I added the plugin I18N to the application, and it didn't want to start anymore even after I remove that module call from the app. Do you have any idea if Catalyst can do something that could make Apache give those errors? I think some modules from Catalyst have a kind of incompatibility with something else from my computer, because without Catalyst, the web server always start. I've also reinstalled perl and installed Catalyst using ppm (a version a little older), and Apache still doesn't want to start. It gives the following errors this time: [Sun Sep 23 12:31:23 2007] [crit] master_main: create child process failed. Exiting. [Sun Sep 23 12:31:53 2007] [notice] Parent: Forcing termination of child process 36 [Sun Sep 23 12:31:53 2007] [info] removed PID file E:/apache/logs/httpd.pid (pid=3712) [Sun Sep 23 12:32:23 2007] [notice] Apache/2.2.4 (Win32) mod_apreq2-20051231/2.6.2-dev mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations [Sun Sep 23 12:32:23 2007] [notice] Server built: Jan 9 2007 23:17:20 [Sun Sep 23 12:32:23 2007] [notice] Parent: Created child process 2116 [Sun Sep 23 12:32:23 2007] [debug] mpm_winnt.c(481): Parent: Sent the scoreboard to the child [Sun Sep 23 12:32:23 2007] [notice] Child 2116: Child process is running [Sun Sep 23 12:32:23 2007] [info] Parent: Duplicating socket 184 and sending it to child process 2116 [Sun Sep 23 12:32:23 2007] [debug] mpm_winnt.c(402): Child 2116: Retrieved our scoreboard from the parent. [Sun Sep 23 12:32:23 2007] [debug] mpm_winnt.c(599): Parent: Sent 1 listeners to child 2116 [Sun Sep 23 12:32:23 2007] [debug] mpm_winnt.c(558): Child 2116: retrieved 1 listeners from parent [Sun Sep 23 12:32:23 2007] [notice] Child 2116: Acquired the start mutex. [Sun Sep 23 12:32:23 2007] [notice] Child 2116: Starting 250 worker threads. [Sun Sep 23 12:32:23 2007] [notice] Child 2116: Starting thread to listen on port 80. [Sun Sep 23 13:18:48 2007] [notice] Parent: Received shutdown signal -- Shutting down the server. [Sun Sep 23 13:18:48 2007] [notice] Child 2116: Exit event signaled. Child process is ending. [Sun Sep 23 13:18:49 2007] [info] Child 2116: Accept thread exiting. [Sun Sep 23 13:18:49 2007] [notice] Child 2116: Released the start mutex [Sun Sep 23 13:18:49 2007] [info] Child 2116: 250 threads blocked on the completion port [Sun Sep 23 13:18:50 2007] [notice] Child 2116: Waiting for 250 worker threads to exit. [Sun Sep 23 13:18:50 2007] [notice] Child 2116: All worker threads have exited. [Sun Sep 23 13:18:50 2007] [notice] Child 2116: Child process is exiting [Sun Sep 23 13:18:50 2007] [notice] Parent: Child process exited successfully. [Sun Sep 23 13:18:50 2007] [info] removed PID file E:/apache/logs/httpd.pid (pid=2092) Thank you very much for any helpful idea. Octavian ___ 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] printing the generated SQL
From: Paul Rudolf Seebacher [EMAIL PROTECTED] Octavian Rasnita wrote: Hi, Is it possible to log a certain SQL which is generated in a Catalyst application by a controller that uses a DBIx::Class model? Thank you. Octavian ___ 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/ This will print out geneerated SQL on debug screen: $ export DBIC_TRACE=1 And where should I enter this command line? I don't need it for a program that uses DBIx::Class which is ran from the command line, but in a Catalyst app. I have also tried to install some Catalyst modules (QueryLog) that should help me to do that, but I couldn't install it due to some make test errors (under Windows XP). Octavian ___ 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] printing the generated SQL
Hi, Is it possible to log a certain SQL which is generated in a Catalyst application by a controller that uses a DBIx::Class model? Thank you. Octavian ___ 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] CMS
Can you tell me if this CMS can be used only with the keyboard? (with no mouse) If somebody knows a CMS that is accessible only with the keyboard and which can create tables and links by someone that doesn't know HTML, please tell me. Octavian - Original Message - From: Davood Firoozian To: The elegant MVC web framework Sent: Wednesday, August 29, 2007 1:19 PM Subject: Re: [Catalyst] CMS Hia, We are developing and using a Catalyst Based CMS called OzinoCMS http://wiki.ozino.com/bin/view/OzinoCMS/WebHome Sample Website: http://www.tpico.ir/ but for some financial reasons the project is paused. you can take a look at source code, but I think we have to redesign recode some parts. Davood Firoozian On 8/23/07, Matt Rosin [EMAIL PROTECTED] wrote: Catalyst makes it easy to build a site with lots of little modules of content composing a single page - the actual content (words/images) being scattered in static apache directories, the database, the templates folders and the code. At some point a content management system of some type is needed. While I hand-roll this sort of thing now it might be nice to have a standard module with perhaps a rich editor and HTML form, or it might be more powerful with the ability to manage various stories/images on disk or db, and integrate uploads even, like some of the portal building systems do. Perhaps one integrated well with Catalyst could also allow the user to select template files to use in a given part of the screen to replace not just on a story basis but on a div basis. I'd just like to ask if anyone uses a CMS (beyond just hand-rolling for each instance) or has been seeing similar needs. I think much development time is spent on creating object management interfaces which perhaps could be boiled down to some repetitive functionality. 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/ -- Kindly Regards Davood Firoozian Proud Developer Ozino Group http://www.ozino.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/ ___ 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] CMS
On 8/29/07, Octavian Rasnita [EMAIL PROTECTED] wrote: Can you tell me if this CMS can be used only with the keyboard? (with no mouse) From: Davood Firoozian I don't think so. but may I ask why you are asking that ? Because I am blind and I cannot use a mouse but only the keyboard. I have no problems creating the html content manually, but I need to make a CMS that is accessible to me, and in the same time to sighted guys that don't know HTML at all. I've tried using some CMS programs created for sighted people, but I've seen that the code generated by all those programs is not clean at all, and it is very hard to modify it manually after it was created by that program, and after modifying it, those programs were not able to modify it again right. So I cannot collaborate with sighted admins for updating a site... Thanks. Octavian ___ 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] Ajax
Hi, Which of the Ajax modules do you recommend using in a Catalyst app? I am interested especially to know which of them work better with Template-Toolkit and DBIx::Class. For the moment I am not interested in the most advanced, but in the most simple to use by someone that doesn't know Javascript very well. Thank you. Octavian ___ 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] Ajax
Ok, thank you all for your suggestions. Octavian - Original Message - From: Jon Schutz [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Friday, August 03, 2007 1:28 PM Subject: RE: [Catalyst] Ajax I've been looking at this just in the last couple weeks so here are my experiences... I looked at the usual suspects and in the end settled on YUI, as it seemed to have the most complete tutorials, examples, and API docs; also has a good set of components, and, most importantly, the particular one that I was after at the time. My experience with dojo was that it was heavyweight, the examples killed my browser half the time, and the docs were patchy, even though there were a lot of them. I glanced at jQuery; it's probably very good but I'd just come from Yahoo where I found all of the docs laid out in a systematic and easy to follow manner, and the jQuery page was just a bit overwhelming; looks like all the info is there though. Also looked at GWT; the thought of writing javascript in java just threw me completely. Why try to make plastic out of steel? I started using Prototype when all I had to do was a few simple Ajax callbacks; I've seen mst can Prototype more than once on this list, and never quite understood why. For doing the basics, it seemed more than adequate to me. It was probably mst's biases that sent me looking at YUI and others rather than Scriptaculous for the pre-built components. As someone who avoids writing javascript as much as possible, I've found YUI very tolerable. -- Jon On Fri, 2007-08-03 at 11:09 +0200, Hartmaier Alexander wrote: Hi Octavian! They all have nothing to do with either the template language or the web framework. I started using Dojo for some nice fading effects and a date selector and imho the docs are ok. -abraxxa -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 9:47 AM To: Catalyst@lists.rawmode.org Subject: [Catalyst] Ajax Hi, Which of the Ajax modules do you recommend using in a Catalyst app? I am interested especially to know which of them work better with Template-Toolkit and DBIx::Class. For the moment I am not interested in the most advanced, but in the most simple to use by someone that doesn't know Javascript very well. Thank you. Octavian ___ 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/ ___ 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] error installing Catalyst::Plugin::Session (2)
Thanks. I have solved it by doing a force install because I guess that error is not a real one. Octavian - Original Message - From: apv [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, July 12, 2007 8:45 AM Subject: Re: [Catalyst] error installing Catalyst::Plugin::Session (2) I ran into this too doing a clean install last week on DreamHost and forgot to report it. I'm sorry! If you're in a hurry, the way I solved it (in the CPAN shell) was to install an older version of Session and family first and then upgrade from there. -Ashley On Jul 11, 2007, at 10:25 PM, Octavian Rasnita wrote: Hi, I have seen that when trying to install C::P::Session, appears the following error. It seems that C::P::Session depends on C::P::Session::State::Cookie but this second module depends on the first one. t/06_finalize.ok 1/3Can't locate Catalyst/Plugin/ Session/State/Cookie.pm in @INC (@INC contains: /home/teddy/modules /Catalyst-Plugin-Session-0.16/blib/lib /home/teddy/modules/Catalyst- Plugin-Session-0.16/blib/arch /usr/local/perl588/lib/5.8.8/x86_6 4-linux-thread-multi /usr/local/perl588/lib/5.8.8/x86_64-linux- thread-multi /usr/local/perl588/lib/5.8.8 /usr/local/perl588/lib/site _perl/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/ site_perl/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/ site_p erl/5.8.8 /usr/local/perl588/lib/site_perl/5.8.8/x86_64-linux- thread-multi /usr/local/perl588/lib/site_perl/5.8.8 /usr/local/perl588 /lib/site_perl . /usr/local/perl588/lib/5.8.8/x86_64-linux-thread- multi /usr/local/perl588/lib/5.8.8 /usr/local/perl588/lib/site_per l/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/site_perl/ 5.8.8 /usr/local/perl588/lib/site_perl .) at /usr/local/perl588/l ib/site_perl/5.8.8/Catalyst.pm line 2139. # Looks like you planned 3 tests but only ran 1. # Looks like your test died just after 1. t/06_finalize.dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-3 Failed 2/3 tests, 33.33% okay t/99_pod..skipped all skipped: set TEST_POD to enable this test t/99_podcoverage..skipped all skipped: Test::Pod::Coverage 1.04 required t/live_appskipped all skipped: Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test Failed Test Stat Wstat Total Fail List of Failed -- - t/06_finalize.t 255 65280 34 2-3 4 tests skipped. Failed 1/8 test scripts. 2/25 subtests failed. Files=8, Tests=25, 1 wallclock secs ( 0.50 cusr + 0.10 csys = 0.60 CPU) Failed 1/8 test programs. 2/25 subtests failed. make: *** [test_dynamic] Error 255 Octavian ___ 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] error installing Catalyst::Plugin::Session (2)
I don't know if this was the case, because I've just installed perl 5.8.8 on a new machine (X86_64 SuSE), and I have tried installing Catalyst using: cpan install Task::Catalyst I guess it should have tried to install the newest versions. Thanks. Octavian - Original Message - From: Yuval Kogman [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, July 12, 2007 3:20 PM Subject: Re: [Catalyst] error installing Catalyst::Plugin::Session (2) ___ 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/
[Catalyst] C::P::Session installation error
Hi, I have tried to install C::P::Session using the cpan shell, and it gave the following error: Failed Test Stat Wstat Total Fail List of Failed --- t/06_finalize.t 255 65280 34 2-3 4 tests skipped. Failed 1/8 test scripts. 2/25 subtests failed. Files=8, Tests=25, 1 wallclock secs ( 0.50 cusr + 0.10 csys = 0.60 CPU) Failed 1/8 test programs. 2/25 subtests failed. make: *** [test_dynamic] Error 255 NUFFIN/Catalyst-Plugin-Session-0.16.tar.gz /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force Failed during this command: NUFFIN/Catalyst-Plugin-Session-0.16.tar.gz : make_test NO Would it be ok if I'd force install it? Thanks. Octavian ___ 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] error installing Catalyst::Plugin::Session (2)
Hi, I have seen that when trying to install C::P::Session, appears the following error. It seems that C::P::Session depends on C::P::Session::State::Cookie but this second module depends on the first one. t/06_finalize.ok 1/3Can't locate Catalyst/Plugin/Session/State/Cookie.pm in @INC (@INC contains: /home/teddy/modules /Catalyst-Plugin-Session-0.16/blib/lib /home/teddy/modules/Catalyst-Plugin-Session-0.16/blib/arch /usr/local/perl588/lib/5.8.8/x86_6 4-linux-thread-multi /usr/local/perl588/lib/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/5.8.8 /usr/local/perl588/lib/site _perl/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/site_perl/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/site_p erl/5.8.8 /usr/local/perl588/lib/site_perl/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/site_perl/5.8.8 /usr/local/perl588 /lib/site_perl . /usr/local/perl588/lib/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/5.8.8 /usr/local/perl588/lib/site_per l/5.8.8/x86_64-linux-thread-multi /usr/local/perl588/lib/site_perl/5.8.8 /usr/local/perl588/lib/site_perl .) at /usr/local/perl588/l ib/site_perl/5.8.8/Catalyst.pm line 2139. # Looks like you planned 3 tests but only ran 1. # Looks like your test died just after 1. t/06_finalize.dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-3 Failed 2/3 tests, 33.33% okay t/99_pod..skipped all skipped: set TEST_POD to enable this test t/99_podcoverage..skipped all skipped: Test::Pod::Coverage 1.04 required t/live_appskipped all skipped: Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test Failed Test Stat Wstat Total Fail List of Failed --- t/06_finalize.t 255 65280 34 2-3 4 tests skipped. Failed 1/8 test scripts. 2/25 subtests failed. Files=8, Tests=25, 1 wallclock secs ( 0.50 cusr + 0.10 csys = 0.60 CPU) Failed 1/8 test programs. 2/25 subtests failed. make: *** [test_dynamic] Error 255 Octavian ___ 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] displaying email addresses
Hi, Do you know if there are any Catalyst plugins, or TT filters, or perl modules that can find all the email addresses in a text and convert them into a Javascript code that prints that email address (possibly as a link)? I want to do something like this for avoiding robots that harvest email addresses for doing spam, but in the same time print the correct email address. Thank you. Octavian ___ 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] displaying email addresses
Ok, thank you all. I think I will use this method and the Email::Find module to do what I want. Octavian - Original Message - From: Marc Logghe [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, June 28, 2007 3:05 PM Subject: RE: [Catalyst] displaying email addresses Do you know if there are any Catalyst plugins, or TT filters, or perl modules that can find all the email addresses in a text and convert them into a Javascript code that prints that email address (possibly as a link)? Don't know about plugins or something. But I guess you can easily achieve that by filtering your body just before sending to the browser. sub render :ActionClass('RenderView') {} sub end :Private { my ( $self, $c ) = @_; # do something before rendering $c-forward('render'); # do something after rendering $c-forward-filter($body); } sub filter :Private { my ( $self, $c ) = @_; my $body = $c-response-body(); # replace email adresses $c-response-body($body); } Don't know about TT, but if you use Mason as a view you could put the filter code in a filter tag in your autohandler or something: http://masonhq.com/docs/manual/Devel.html#filtering Cheers, Marc ___ 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] displaying email addresses
Those harversters should have a Javascript interpreter that will compile the js code and extract the results, and I think most of them don't have such a thing. I have never used a JS interpreter in perl, but I want to try a few modules that could run JS code, and I hope I will find a way of making the code as hard to read as possible. Octavian - Original Message - From: [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, June 28, 2007 5:15 PM Subject: Re: [Catalyst] displaying email addresses Octavian Rasnita [EMAIL PROTECTED] wrote on 06/28/2007 07:41:59 AM: Ok, thank you all. I think I will use this method and the Email::Find module to do what I want. Octavian Octavian, This is really your best bet, as a popular module or method to do this would most certainly already be known by those harvesters and have extracting code for them. -Wade ___ 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] displaying email addresses
Oh, I understand what you mean, but no, my site won't be so popular to worth creating a special parser for finding the email addresses from it. I am thinking to something like a perl code that splits the email address into its parts, then a JS code that joins together those parts. Octavian - Original Message - From: [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Cc: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, June 28, 2007 7:16 PM Subject: Re: [Catalyst] displaying email addresses Chisel Wright [EMAIL PROTECTED] wrote on 06/28/2007 10:54:00 AM: On Thu, Jun 28, 2007 at 06:31:28PM +0300, Octavian Rasnita wrote: Those harversters should have a Javascript interpreter that will compile the js code and extract the results, and I think most of them don't have such a thing. I have never used a JS interpreter in perl, but I want to try a few modules that could run JS code, and I hope I will find a way of making the code as hard to read as possible. Maybe this will be of some interest: http://www.bronze-age.com/nospam/ This is kind of exactly what I am saying. If this is widely used you do not need to interpret javascript -- just be able to pull out an email address from: mail2(nobody,fake.address9z,0,,Mr Nobody) which is an easy task. The ones that would make you interpret js are the ones that build out script sections on the fly with obfued structures and even then could many times be parsed without interpreting js. Process for email harvester coders: find a way email addresses are encoded on a target site. create a test to lock down the encoding type. create parser/extractor for it. rinse and repeat. ___ 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/
[Catalyst] Custom error
Hi, Is it possible to change that multilanguage message that Catalyst displays when the application gives an error? It is that message with Please come back later in a few languages. I would like to be able to display a page made by me when such an error should appear. Thank you. Octavian ___ 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] plat_forms report published on June 20th. 2007. Genevateam on Catalyst wins the Perl track.
From: Matt S Trout [EMAIL PROTECTED] Perl WSDL/SOAP tooling is pants. Film at 11. I do know of a large suite of Cat apps whose primary purpose is to handle such, but I believe the company in question largely built the functionality up from scratch. Perl supports SOAP and even WSDL, but the XML format of requests and especially responses are different in the CPAN perl modules than in Java and .net solutions. And Java and .net is considered a standard way even if we don't like or say that we don't care. I also found a module that pretended to create SOAP and WSDL .net compatible requests, but it didn't work out of the box, so I prefered to create the program manually. Unfortunately there are very many things in perl that don't follow the standards established by programmers in other more popular languages... Anyway, I don't think in this contest the biggest problem of perl teams was the lack of WSDL support in perl. The biggest problem I think it was the security and the small number of features that were completed. The biggest plus I think it was the easiness of maintnance (which is considered the biggest minus of perl). Octavian ___ 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] plat_forms report published on June 20th. 2007. Genevateam on Catalyst wins the Perl track.
From: Daniel McBrearty [EMAIL PROTECTED] If you read closely (p43), re SQL injection : We record any failures to process our inputs appropriately as broken only, i.e., when an exception is raised that stems directly from the SQL processing rather than the application logic. We record a solution as correct if it processes acceptable inputs correctly and rejects inacceptable inputs with an error message produced under proper control of the application. Note that in this approach, an application flagged as broken may actually be acceptable (in particular: secure), but it is impossible to be sure from the outside so we take a conservative approach. I'd guess that they got a cat exception passed up from DBIx::Class, and classified that as broken, basically because the team didn't actually catch the error. But even so, the db itself would have been safe. Is Catalyst showing DBIx::Class errors in the browser if the program doesn't have the Debug module active? I thought it shows that page with Please come back later in a few languages. Octavian ___ 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] redirecting
Hi, I have tried to make the following redirection: $c-res-redirect($c-uri_for(/fr/thread?thread=$id_thread)); But it replaces ? with %3F and the request is: http://www.anrcluj.ro/fr/thread%3Fthread=1 How can I redirect to a URL that contains a question mark? Thank you. Octavian ___ 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] How to show SQL in apache error_log?
You can put $ENV{DBIC_TRACE}++; in MyApp.pm Octavian - Original Message - From: Cookie To: catalyst@lists.rawmode.org Sent: Monday, June 11, 2007 7:01 AM Subject: [Catalyst] How to show SQL in apache error_log? As we know,if we use export DBIC_TRACE=1 and then we run the myapp_server.pl,we can see the sql from the stander output. I want to show the sql in the apache error_log.I modify the httpd.conf file like this: setenv DBIC_TRACE 1 But it seems useless.How can solve this problem? 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/ ___ 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] 2 Catalyst applications on the same server
Hi, I am trying to use 2 Catalyst applications on the same web server, using mod_perl. The problem is that I can run only one of them, no matter which one. If I put them both to run, the web server doesn't want to start, and it doesn't write any error in the error log. I think there might be a conflict between them, but I can't find where it could be. Thank you for your help. In httpd.conf I have: LoadFile d:/usr/bin/perl58.dll LoadModule perl_module modules/mod_perl.so Include e:/web/MyApp1/include/httpd.txt Include e:/web/MyApp2/include/httpd.txt Both httpd.txt files are similar. One of them is for MyApp1, and the other for MyApp2, and look like this: Virtualhost 127.0.0.1:80 ServerName www.myapp1.ro ServerAdmin [EMAIL PROTECTED] DocumentRoot e:/web/MyApp/root ScriptAlias /scripts/ e:/web/MyApp1/scripts/ ErrorLog e:/web/MyApp1/logs/error.txt CustomLog e:/web/MyApp1/logs/access.txt common IfModule mod_perl.c PerlRequire e:/web/MyApp1/script/preload.pl Location / Options Indexes Order allow,deny Allow from all SetHandler perl-script PerlResponseHandler MyApp /Location /IfModule /Virtualhost The file preload.pl contains: #!d:/usr/bin/perl use lib 'e:/web/MyApp/lib'; use MyApp; 1; Octavian ___ 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] 2 Catalyst applications on the same server
From: Peter Flanigan [EMAIL PROTECTED] Octavian Rasnita wrote: Virtualhost 127.0.0.1:80 They cannot both listen on the same address and port Both virtualhosts have the same IP and port, but they use a different server name. I also have another virtualhost that listens to this IP and port, but it doesn't use Catalyst... and it works. Is this a limitation of Catalyst? I couldn't find anything to read about this on pod docs. Thanks. Octavian ___ 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] 2 Catalyst applications on the same server
From: Matt S Trout [EMAIL PROTECTED] In httpd.conf I have: LoadFile d:/usr/bin/perl58.dll LoadModule perl_module modules/mod_perl.so Include e:/web/MyApp1/include/httpd.txt Include e:/web/MyApp2/include/httpd.txt Do you have a NameVirtualHost directive? Yes I have, and the applications work fine if I run only one of them. NameVirtualHost 127.0.0.1:80 This is -not- a Catalyst limitation, it's a configuration problem. I hope. And I hope I will be able to solve it. Try starting apache from the command line and see if it errors on start, or check the windows system event log. I have tried starting apache with: net start apache2.2 But it told that Apache cannot start, and I should use net helpmsg 3547 for finding the problem. That command just shows: A service-specific error occurred. ACTION Refer to the Help or documentation for that service to determine the problem. With other words... no help. If I try starting apache directly with: httpd -k start -n apache2.2 ...it doesn't display any error message. I see that it doesn't start when I try to use this command again and I see that it doesn't complain that a port is already used... No error is printed in Apache's log. I have also tried to put one of the applications to listen to a different port and address, but the server can't start in that case either. It starts and works fine if I configure the server to not load one of the applications. Both applications load an external perl file using PerlRequire , and those files do: use lib ; use MyApp; and I think that maybe the @INC set by one of the applications or the modules it uses, are used somehow in the second application... I don't have other idea. Thanks. Octavian ___ 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] deploying a Catalyst app
Hi, Please tell me where can I find more information about deploying a Catalyst app. I think there should be a way of creating a tarball with the whole app, including the entire application. When installing it on the target machine (with make, make install) it should require all the necessary Catalyst and non-Catalyst modules. It should be also nice if it would be a way of creating automaticly a tarball that contains all the necessary modules, and install them no matter if some of them are already installed on the target machine or not (including the entire Catalyst framework). Thank you. Octavian ___ 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] Using a custom TT filter
Hi, I am trying to use a custom TT filter in a Catalyst app. In MyApp.pm I use: 'View::TT' = { PLUGIN_BASE = __PACKAGE__-path_to('lib'), }, In the lib dir I have a Diverse/NoDia.pm module that looks like this: package Diverse::NoDia; use Template::Plugin::Filter; use base 'Template::Plugin::Filter'; sub filter { my ($self, $text) = @_; $text =~ tr/ăşţîâĂŞŢÎÂ/astiaASTIA/; return $text; } 1; In the template I use: [% USE NoDia = Diverse.NoDia -%] [% FILTER $NoDia -%] ... [% END %] But it gives the following error: Couldn't render template plugin error - Can't locate object method load via package D:\web\TranzactiiBursiere\lib::Diverse::NoDia (perhaps you forgot to load D:\web\TranzactiiBursiere\lib::Diverse::NoDia?) at D:/usr/site/lib/Template/Plugins.pm line 215. How can I define a custom TT filter in a Catalyst app? (I need to filter a text depending on a condition, and I don't know if I can use another method for doing this.) Thank you. Octavian ___ 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] C:P:Session::Store::FastMmap
Thank you for this solution. I hope I will be able to apply it. BTW (and sorry for off topicness) do you know a way of applying the diff results under Windows in other way than manually editing the target file? Thanks. Octavian - Original Message - From: Ishigaki Kenichi [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, May 10, 2007 10:58 AM Subject: Re: [Catalyst] C:P:Session::Store::FastMmap Hi, you can force install it almost safely (if you have successfully installed Cache::FastMmap). The broken test can be fixed like this. diff -ur Catalyst-Plugin-Session-Store-FastMmap-0.02/t/basic.t Catalyst-Plugin-Session-Store-FastMmap-0.02-patch/t/basic.t --- Catalyst-Plugin-Session-Store-FastMmap-0.02/t/basic.t 2006-01-01 20:08:46.0 +0900 +++ Catalyst-Plugin-Session-Store-FastMmap-0.02-patch/t/basic.t 2007-05-10 16:48:44.09200 +0900 @@ -9,8 +9,7 @@ use Catalyst::Plugin::Session::Test::Store ( backend = FastMmap, config = { -storage = ( my $tmp = File::Temp-new( UNLINK = 1 ) ) - -filename,# $tmp: positive refcount +storage = scalar File::Temp::tmpnam(), }, ); You'll see what the point is. Though this may not be perfect, at least it works for me. Kenichi Ishigaki aka tcool. On Wed, 9 May 2007 08:38:13 +0300, Octavian Rasnita [EMAIL PROTECTED] wrote: From: Ash Berlin [EMAIL PROTECTED] http://perlitist.com/static/Cache-FastMmap-1.15.tar.gz The author has been in touch with me, and I've made the changes he asked for, so hopefully it should be avaiable to CPAN soon. Ash Yes, this version is the one I've installed, but I cannot install Catalyst::Plugin::Session::Store::FastMmap It gives errors on nmake test and I don't know if it is a good idea to force install it. Octavian ___ 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/ ___ 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] C:P:Session::Store::FastMmap
Hi, I am trying to install Catalyst::Plugin::Session::Store::FastMmap under Windows XP, and on the nmake test command it gives the following error. Can I do something to be able to install it? I couldn't find a ppm version of this module. (I need it because I want to install Task::Catalyst::Tutorial and it requires that module. t/basicok 1/19Truncate of existing share file D:\DOCUME~1\octavian\LOCALS~1\Temp\NcQsm5D0gJ failed: The proc ess cannot access the file because it is being used by another process. BEGIN failed--compilation aborted at t/basic.t line 15. t/basicdubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 3-19 Failed 17/19 tests, 10.53% okay Failed Test Stat Wstat Total Fail List of Failed --- t/basic.t 2 51219 34 3-19 2 tests skipped. Failed 1/4 test scripts. 17/20 subtests failed. Octavian ___ 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] C:P:Session::Store::FastMmap
I also thought that, but I was able to install Cache-FastMmap-1.15 under Windows. (I found about this version on this list). From: Hartmaier Alexander [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/ ___ 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] C:P:Session::Store::FastMmap
From: Ash Berlin [EMAIL PROTECTED] http://perlitist.com/static/Cache-FastMmap-1.15.tar.gz The author has been in touch with me, and I've made the changes he asked for, so hopefully it should be avaiable to CPAN soon. Ash Yes, this version is the one I've installed, but I cannot install Catalyst::Plugin::Session::Store::FastMmap It gives errors on nmake test and I don't know if it is a good idea to force install it. Octavian ___ 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::Controller::FormBuilder
Hi, I want to create a form with some fields which are displayed only if some conditions are met. Can I do this using Catalyst::Controller::FormBuilder, or in this case I need to create/print the forms manually? For example, I want to print a form for editing the fields in a record from a database, and if a file was uploaded previously, the form should also print a set of 2 radio buttons: keep the previously uploaded file, and upload the new file. Thanks. Octavian ___ 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] connection to DB
Hi, Try this: __PACKAGE__-config( schema_class = 'testDB', connect_info = [ 'dbi:mysql:database=myapp;host=192.168.2.115', 'root', 'test', { AutoCommit = 1 }, ], );___ 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::Plugin::Session::Store::Memcached notcorrectly work with session expire
I don't know if the problem is in this module, because I think I have the same issue, and I am using Session::Store::File Octavian - Original Message - From: Dmitry [EMAIL PROTECTED] To: Catalyst@lists.rawmode.org Sent: Wednesday, March 28, 2007 10:25 PM Subject: [Catalyst] Catalyst::Plugin::Session::Store::Memcached notcorrectly work with session expire If in session expire time reached on server and but on client cookie still valid and user tries to authenticate again. After authentication succeeded Catalyst::Plugin::Session::Store::Memcached::store_session_data called to store new values which called Catalyst::Plugin::Session::session_expires to get new expiration for a key but that method finds that session expired and deletes expires: value instead of renewing one. So session: value stored but expires: only deleted and on next access stored session is expired once again. Here how it looks from memcached perspective: 7 set catalyst_session#0.02#SMDE#session:e1483bb888fc9603201210451aa0ed1b450ec8a5 1 0 229 7 STORED 7 get catalyst_session#0.02#SMDE#expires:e1483bb888fc9603201210451aa0ed1b450ec8a5 7 END 7 delete catalyst_session#0.02#SMDE#session:e1483bb888fc9603201210451aa0ed1b450ec8a5 7 DELETED 7 delete catalyst_session#0.02#SMDE#expires:e1483bb888fc9603201210451aa0ed1b450ec8a5 7 NOT_FOUND 7 delete catalyst_session#0.02#SMDE#flash:e1483bb888fc9603201210451aa0ed1b450ec8a5 7 NOT_FOUND 7 get catalyst_session#0.02#SMDE#expires:e1483bb888fc9603201210451aa0ed1b450ec8a5 7 END 7 delete catalyst_session#0.02#SMDE#session:e1483bb888fc9603201210451aa0ed1b450ec8a5 ___ 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] C::C::FB and captchas or similar
From: Joe Landman [EMAIL PROTECTED] Hi folks: Two part question. Has anyone played with captchas in conjunction with C::C::FB? Second part: should I be looking at different technology rather than captchas? I have no idea if there are other perl modules that can replace Captcha, but I have seen some pages that use to put some questions that should be answered. There were simple questions that can be understood by anyone. It is very good to avoid using Captcha, for following World Wide Web Consortium recommendations, and for making your pages accessible for the blind also, because the screen readers cannot recognize the text from those images. If you still want to use Captcha, it would be also nice to offer an alternative solution, also presenting a .wav file with those letters spoken. Octavian ___ 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] C::C::FB and captchas or similar
Hmmm... I haven't been focusing on this, but it is worth a read. I am working on making the pages as simple as possible (no AJAXian-ness) for a combination of aesthetic and personal time reasons. Any pointers to document design elements to encourage accessibility you can provide would be appreciated. Hi, The most important things that come to my mind, are the following: 1. All the relevant images should use an alt attribute. A relevant image is one that is a label for a link, or a photo that could be saved by the visitors, but not a one-pixel image. The images that are not important, should use alt=. 2. Dupplicate links, one after another, should be avoided. I have seen many cases where an image icon is followed by a text, and each of them are a separate link to the same page. 3. If you need to use captcha, specify in the alt attribute of the image, something like If you can't see this image, you can do the following thing to access the page.. because otherwise the blind users won't understand that they need to enter a text from an image, and they might submit that form for more times, without success. Of course, an alternative way of access should be offered. 4. If you present the data like a table, use an html table, and not preformatted text. Also, use a normal table layout and not 2 parallel tables that don't have any relation between them, but only visual. Also, the first column and the first row of the table should contain data and not graphics that makes the table more nice, because the cells from those rows are spoken as row and column heads. For more complicated tables, that contain column or row headers which span on more lines or columns, and have sub-headers, there are some rules for naming those headers, in order to associate those headers with the cells of the table, but I don't remember those rules. I think they can be found on w3c.org. 5. A very helpful thing is to begin the content of the page with a heading. It is much useful than putting a link at the top of the page with skip navigation or skip to content. The blind users can jump directly to that heading, with a single hotkey. If the page have more other headings, it is also very helpful. 6. Some sites offer a skip to contents link, which is invisible, and it is put at the top of the page. It is a one-pixel image link with a Skip to content alt attribute, that points to the beginning of the page content. Without it and without a heading for jumping directly to the important content, the users need to read all the navigation links in every page, one by one. 7. If possible, don't use Javascript at all. If you need to use Javascript for validating a form, it is very ok, but use it in such a way that if the browser doesn't support Javascript, the form should also work. So, don't put the onSubmit() event to send the form. Use onSubmit() just for validating, and return an alert if the form was not filled correctly, but return true and allow the form to be submitted in the standard non-javascript way. (This is not a recommendation regarding the accessibility for the blind especially). If you need to use Javascript that create menus, make sure that the menus are also accessible when the browser doesn't support Javascript. I have seen a menu made in Javascript that creates a list with sub-lists with links, and without Javascript, that list of lists is shown, and the screen readers sees it like a common list with links that can be accessed. The Javascript code just formats it and shows it like a menu. Other menus are not accessible absolutely at all. I have seen other menus made with Javascript that present a list of links, that could be clicked by the blind users, then the page is re-loaded, and a sub-list of links appears for that list element that was clicked, but it is not as friendly as the first one I've told about. Don't use Javascript in the href=.. attribute of links. Use it in the onClick() event of that link instead if necessary. If using it in the href attribute, that link cannot be opened in another window with shift+Enter (or right click, open in new window), and some blind users prefer this method, because after reading the opened page, they can close the window and return to the previous window, and the focus remains on the link that opened the window, so the users don't need to find that point again. This way the search engines will also index the page targetted unlike when using javascript-based links. 8. Don't use href=# and then use an onClick() event that open the page, possibly in another window. Those links cannot be open in a new window if the visitor choose that, and they cannot avoid opening a new window if they want to not have a new window. 9. Even if opening a new window, don't hide the menus and the address bar. 10. Don't use Javascript to write something in the status bar. That text never helps, but it doesn't let the browser inform
Re: [Catalyst] C::C::FB and captchas or similar
From: Brian Cassidy [EMAIL PROTECTED] A technique i recently saw was to add an input to your form with a usual sounding name (like subject) but style is as display:none. The primary concept is that users manually filling out the form will not see that field and therefore it will be blank on submission. Automated processes will likely see the subject field and stuff it with data. Most of those who are using Captcha are using it for not allowing automatic account creation, and in those cases, this technique is not helpful, because the program that creates the accounts is specially made for a certain site, and the program creator knows that a certain field should not be included. I have also seen that some sites use captcha even though they just need to avoid automatic spamming sent by spiders. In that case, captcha is not needed at all. For example, for avoiding a spider submitting a form on a forum or blog, The page could simply say Please type the word 'blabla' in the field below, and the automatic spider won't know that it needs to type a certain word, and it will fail submitting the form. Octavian ___ 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] putting an object in the stash
Hi, I have a DBIC record object like my $obj = $c-model(Database::Table)-find($id); The table has very many fields and I would like to put their values in a TT template without inserting them one by one in the stash. So I would like to create a hash ref from $obj where the name of the field is the key and the value from the table is the value in that hash, then use $c-stash($hashref). Is it possible to create that hash (ref) from $obj, or I need to do something like $c-stash-{obj} = $obj; and in the template use [% obj.name1 %]... [% obj.name2 %]? And by the way, which do you think is the recommended way? Thank you. Octavian ___ 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] putting an object in the stash
From: Simon Wilcox [EMAIL PROTECTED] I just put the object in the stash. TT abstracts the method/hash key accessor issue for you so that [% obj.name1 %] will work whether obj is an object with a name1 accessor or a hash with a name1 key. Ok, then I will use that way. I hoped that the first solution could be possible, because I don't want to use [% obj.name %] but only [% name %] if it works. Octavian ___ 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] putting an object in the stash
I know that an object is a blessed hash, but the DBIC objects are very complex, and I cannot use $c-stash($obj); If I do that, the values from $obj hash reference are not put in the template like when $obj is a reference to a common hash. That's why I want to find how to put the key/values from $obj into a common hash. Is it possible to do that without specifying all the keys by name? Or at least is there a way to get all the keys from $obj, then loop and create a hash, something like: my $hash; foreach(@keys) { $hash-{$_} = $obj-$_; } Thanks. Octavian ___ 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] putting an object in the stash
From: Simon Wilcox [EMAIL PROTECTED] You will have to iterate over the accessors individually to put them into the stash (I think) but you should be able to use DBIC to do most of the thinking. Something like (untested): my $model = $c-model(Database::Table); foreach my $column (@{$model-columns}) { $column =~ s{me\.}{}; # strip the prefix DBIC adds $c-stash-{$column} = $obj-$column; } Ok, thank you. This is what I needed. You may need to adjust some of the above to get it to recognise $column as an accessor. I hope I won't have any problem, or I think I can use $obj-get_column($column). Thank you all. Octavian ___ 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] putting an object in the stash
From: Simon Wilcox [EMAIL PROTECTED] You will have to iterate over the accessors individually to put them into the stash (I think) but you should be able to use DBIC to do most of the thinking. Something like (untested): my $model = $c-model(Database::Table); foreach my $column (@{$model-columns}) { $column =~ s{me\.}{}; # strip the prefix DBIC adds $c-stash-{$column} = $obj-$column; } I have tried that, but it gave the following error: Can't locate object method columns via package DBIx::Class::ResultSet What am I doing wrong? Thanks. Octavian ___ 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] putting an object in the stash
From: Daniel McBrearty [EMAIL PROTECTED] Impossible to know what you mean here without an example of the template, but I commonly put DBIC objects on the stash, and call methods on them with the dot operator in TT. TT is smart enough to work out what needs to be done and do it so whether the underlying code is $obj-element; or $obj-{element}; [%- obj.element -%] works. (Maybe it always uses the second version - as I've never had a problem, I've never looked ... So I don't really get what the problem is here. Hi, The problem appears when I want to use only [% element %] and not [% obj.element %] in templates. And I want to use the first way because there are very many variables and it is more simple. Octavian ___ 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] putting an object in the stash
From: Matt Lawrence [EMAIL PROTECTED] Alternatively, get_columns will return a hash (not a reference!) of the current row. $c-stash-{obj }= { $row-get_columns }; Oh thanks. Finally I've used $c-stash-{obj} = $obj; and I've modified the template, because it seems that it is a better design. What I thought that I need was something like: $c-stash({ $row-get_columns }); And I'm happy that I also found about this method. Note that this hash contains uninflated values, if you want column inflation you'll need to loop. Please tell me what it means column inflation. Thanks. Octavian ___ 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] assigning vars to $c-stash
Hi, I have a $hash hash reference and I want to add all its elements to the stash. How can I do this? Do I need to use a loop and assign each element one by one? I have seen that it is not possible to use $c-stash = $hash; Can I use something else than foreach(keys %$hash) { $c-stash-{$_} = $hash-{$_}; } Thank you. Octavian ___ 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] assigning vars to $c-stash
Thank you all for your solutions. I think this is the most simple. Octavian - Original Message - From: Eden Cardim [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, March 12, 2007 2:39 PM Subject: Re: [Catalyst] assigning vars to $c-stash On 3/12/07, Robert 'phaylon' Sedlacek [EMAIL PROTECTED] wrote: $c-stash( %$hash ); $c-stash( $hash ); is a little bit faster... -- Eden Cardim Instituto Baiano de Biotecnologia Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas Laboratório de Bioinformática -- you seem to think that 'close enough' is close enough... please learn to be 'literal' around programming. merlyn - on irc.freenode.net#perl ___ 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/
[Catalyst] Catalyst::Plugin::DateTime
Hi, I have tried to install Catalyst::Plugin::DateTime under Windows using the cpan shell, but I have recieved the error below. I have also previously set the environment variable TZ=+02:00 but it still can't find the time zone. Is there anything I can do to install this Catalyst Plugin under Windows? Thanks. t/Catalyst-Plugin-DateTimeok 1/5Cannot determine local time zone ... t/Catalyst-Plugin-DateTimedubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-5 Failed 4/5 tests, 20.00% okay Failed Test Stat Wstat Total Fail List of Failed --- t/Catalyst-Plugin-DateTime.t 255 65280 58 2-5 Failed 1/1 test scripts. 4/5 subtests failed. Files=1, Tests=5, 1 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) Failed 1/1 test programs. 4/5 subtests failed. NMAKE : fatal error U1077: 'D:\usr\bin\perl.exe' : return code '0xff' Stop. F:\programs\nmake.EXE test -- NOT OK Running make install make test had returned bad status, won't install without force Failed during this command: JKISER/Catalyst-Plugin-DateTime-0.03.tgz : make_test NO Octavian ___ 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] reserved words
From: Jason Kohles Hi, Please tell me how can I find the list of reserved words that cannot be used as names for views, controllers, models, $c-stash elements... For example I have seen that the name of the application is also found in $c-stash-{name}. $c-stash-{template} is also special. I have also tried to create a view with the name Show, and I have received the following error in the browser: Caught exception in TranzactiiBursiere::View::Show-process TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You need to inherit from a subclass like Catalyst::View::TT instead. If I changed the name of that view to Html, it worked fine, with no errors... This is the error message you get if you create a subclass of Catalyst::View that doesn't implement a process() method. It probably doesn't have anything to do with the name of the module... I have tried: perl script/myapp_create.pl view Show After restarting the application, it gives that error. If I do instead: perl script/myapp_create.pl view Html The application works fine after restarting it. Am I doing something wrong? Thanks. Octavian ___ 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] reserved words
From: John Napiorkowski This is the error message you get if you create a subclass of Catalyst::View that doesn't implement a process() method. It probably doesn't have anything to do with the name of the module... I have tried: perl script/myapp_create.pl view Show After restarting the application, it gives that error. If I do instead: perl script/myapp_create.pl view Html The application works fine after restarting it. Am I doing something wrong? Thanks. Octavian I'd personally be interested in seeing what the generated files look like. Could you attach them in your response (or post them someplace we can see?) Hi, Here is the first one (Show.pm): package TranzactiiBursiere::View::Show; use strict; use warnings; use base 'Catalyst::View'; =head1 NAME TranzactiiBursiere::View::Show - Catalyst View =head1 DESCRIPTION Catalyst View. =head1 AUTHOR A clever guy =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; And here it is the second one that works (Html.pm): package TranzactiiBursiere::View::Html; use strict; use warnings; use base 'Catalyst::View'; =head1 NAME TranzactiiBursiere::View::Html - Catalyst View =head1 DESCRIPTION Catalyst View. =head1 AUTHOR A clever guy =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; If I just delete the file Show.pm and restart the server, the program works fine, but if I put it back and restart, it gives that error. I have seen the same thing under Linux and Windows. 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/
[Catalyst] reserved words
Hi, Please tell me how can I find the list of reserved words that cannot be used as names for views, controllers, models, $c-stash elements... For example I have seen that the name of the application is also found in $c-stash-{name}. $c-stash-{template} is also special. I have also tried to create a view with the name Show, and I have received the following error in the browser: Caught exception in TranzactiiBursiere::View::Show-process TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You need to inherit from a subclass like Catalyst::View::TT instead. If I changed the name of that view to Html, it worked fine, with no errors... Thank you. Octavian ___ 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: AW: [Catalyst] Session problems with IE and cookies
Today I had that issue. I couldn't login on my site even though I've tried for more times with 2 different user names. I have also tried closing and opening again the browser, but I still wasn't able to login. So I wanted to read the HTTP headers sent and received by IE before trying to delete the cookies. For doing that, I needed to click with the mouse cursor in the text area at the bottom of the browser window where IE Headers plug in shows the headers (for beeing able to read it with the screen reader). After clicking there, the system started to work very slow, so I opened the task manager in order to see what consumes that much, and I have seen that the browser was using 99% of the processor. I've killed that huge process, and after opening again IE, I was able to login fine, with no other problems and no need to delete the cookies. So I think this bug is definitely related to IE or Windows and not with mod_perl, Apache or Catalyst. Octavian - Original Message - From: Tobias Kremer [EMAIL PROTECTED] To: Hartmaier Alexander [EMAIL PROTECTED] Cc: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Thursday, March 01, 2007 12:22 PM Subject: Re: AW: [Catalyst] Session problems with IE and cookies Zitat von Hartmaier Alexander [EMAIL PROTECTED]: Most of the users of my cat apps use IE6/7, some (and I) Firefox. Some times in the past IE users couldn't login, deleting the cookies solved the problem, but it occurred only 3-4 times so I didn't investigate further. And what should I do against browser bugs?! We have this problem since we started using Apache::Session + Apache::Cookie about 5 years ago. Never had the time to actually look into it. It happens only infrequently but often enough to have it included in our site FAQs. Said application is running under Apache 1.3.x + mod_perl + Mason + MySQL - no Catalyst involved! --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] Session problems with IE and cookies
I have created a site using Catalyst, and I access it with IE, but I can login with no issues. However, 2 customers told me that they can login on the site from one location, but they cannot do it from their work place. I don't know, but it might be the same bug, since after the login, the program is making an external redirection, and the cookies are used... Anyway, if somebody will find what's the problem, please write on the list. Octavian - Original Message - From: Marc Logghe [EMAIL PROTECTED] To: Thomas Hartman [EMAIL PROTECTED] Cc: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Wednesday, February 28, 2007 3:02 PM Subject: RE: [Catalyst] Session problems with IE and cookies -Original Message- From: Thomas Hartman [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007 12:09 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Session problems with IE and cookies Don't really understand the root of the problem, but I asked about this on #Catalyst and was told of a workaround, and saved it to my .bashrc hints. If I recall correctly, the consensus is that this is an IE6 bug. Not sure about that. I have exactly the same problem as Dylan. It is not specific for IE, Opera shows the very same problem. The user has to manually delete the cookie in order to login again. Not what you can call user friendly ;-) It seems that only Firefox is expiring the session cookie in the correct way. Also, why is it only us 2 having this problem ? Is everybody else using Firefox only ? Cheers, Marc [EMAIL PROTECTED]:~ thartman_catalyst_IE6_response_redirect_prob_hint try myapp_server.pl with -f -k flags [EMAIL PROTECTED]:~ hope this helps, thomas. On 2/27/07, Dylan Vanderhoof [EMAIL PROTECTED] wrote: I'm seeing an issue where if IE is holding a cookie when a session expires (expires set to 7200, cookie_expires set to 0), the user can't login. Login authenticates successfully, but redirects back to the login page. (Session is expired and not being deleted correctly) This does not happen with Firefox, which appears to actually delete the session correctly. I noticed the same behavior if the session data (Store::DBIC) was deleted from the DB before the session expires. Any ideas what might be causing this and how to fix it? Thanks, Dylan Debug output: (Repeats the last 2 requests until the browser is closed with a session cookie or the cookie file is deleted with a cookie with an expiration) [debug] GET request for / from 209.221.173.66 [debug] Found sessionid cb30ab14db722929594b6ec6e4f35bc28895284f in cookie [debug] Deleting session(session expired) [debug] Redirecting to https://myapp/signin; [info] Request took 0.084344s (11.856/s) .+ -- -. | Action | Time | ++ ++-- -+ | /auto | 0.057025s | | /end | 0.001156s | '+ -- -' [info] *** Request 1 (0.001/s) [3435] [Tue Feb 27 21:50:43 2007] *** [debug] GET request for signin from 209.221.173.66 [debug] Path is signin [debug] Found sessionid cb30ab14db722929594b6ec6e4f35bc28895284f in cookie [debug] Deleting session(session expired) [debug] Rendering template login_welcome.tt [info] Request took 0.178703s (5.596/s) .+ -- -. | Action | Time | ++ ++-- -+ | /auto | 0.000492s | | /auth/signin | 0.083319s | | /end | 0.066447s | | - NetResponse::View::TT-process | 0.062633s | '+ -- -' [info] *** Request 2 (0.002/s) [3435] [Tue Feb 27 13:50:50 2007] *** [debug] Body Parameters are: .-+--- -- -. | Parameter | Value | +-+--- +-+-- -+ | email | username | | password| password | '-+--- -- -' [debug] POST request for signin from 209.221.173.66 [debug] Path is signin [debug] Found sessionid
[Catalyst] displaying csv content
Hi, Can anyone point me to a place where I can find how to send csv content to the browser correctly? If I right click on the link and choose save as... the content is saved correctly, and the file name specified by Content-Disposition appears correctly, but if I just click on the link, it appears a window that asks me if I want to open or save it, and if I choose save, nothing happends, and that window don't ask me for a file name. I know that the http headers might be wrong, but I don't know the right way of sending them. Do I need to create another view, or I need to change something in the end() subroutine? Thanks. Octavian ___ 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] displaying csv content
Thank you for the help. In the end() subroutine I set some HTTP headers. Is this the right way, or I should set them in other controller subroutines? When printing the csv content, I want to skip printing those HTTP headers which are set in the end() sub, because otherwise the browsers don't handle the csv content correctly. I thought that I could set a stash variable and check it in the end() subroutine, and if it is set, then don't let the headers to be set, but I think there should be a more elegant solution. Thank you. Octavian - Original Message - From: vb To: The elegant MVC web framework Sent: Friday, February 23, 2007 4:38 PM Subject: Re: [Catalyst] displaying csv content A solution for CSV from Catalyst I used time ago: sub down_san : Local { my ($self, $c) = @_; my $sc = $c-session-{scoala}; my $lu = $c-session-{stag0}; my $lnu = $lu-nume; my $ln = $lnu; $ln =~ s/-..$//; $ln = $ml{$ln}; my $an = $lnu; $an =~ s/^...-//; $an = '20' . $an; my @ang = salar::Model::State-angsclu($sc-id, $lu-id); my $csv = Text::CSV_XS-new({binary = 1}); my $out = ; my @h = (); my $f = $an.-.$ln.- sanatate.txt; @h = ('Nume-Prenume','CNP','Brut-san','CASS'); $csv-combine(@h); $out .= $csv-string . \n; foreach my $g (@ang) { # don't use diacritics in Romanian institutions! my $nume = $g-id_angajat-nume . ' ' . $g-id_angajat-pren; utf8::decode($nume); $nume =~ s/([ăşţîâĂŞŢÎÂ])/$DIACRITICE{$1}/eg; $nume = uc($nume); my @w = (); push @w, $nume; push @w, $g-id_angajat-cnp; push @w, $g-bsan; push @w, $g-isan; $csv-combine(@w); $out .= $csv-string . \n; } $c-res-headers-header('Content-Type' = 'text/csv'); $c-res-headers-header('Content-Disposition' = attachement;filename=$f); $c-res-body($out); } --vlad On 2/23/07, Octavian Rasnita [EMAIL PROTECTED] wrote: Hi, Can anyone point me to a place where I can find how to send csv content to the browser correctly? If I right click on the link and choose save as... the content is saved correctly, and the file name specified by Content-Disposition appears correctly, but if I just click on the link, it appears a window that asks me if I want to open or save it, and if I choose save, nothing happends, and that window don't ask me for a file name. I know that the http headers might be wrong, but I don't know the right way of sending them. Do I need to create another view, or I need to change something in the end() subroutine? Thanks. Octavian ___ 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/ ___ 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] displaying csv content
I have used a similar solution, and the headers printed by the applications when downloading with LWP's get -e [url] are the following: Connection: close Date: Fri, 23 Feb 2007 21:27:06 GMT Server: Apache/2.2.4 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8 Content-Length: 72934 Content-Type: text/comma-separated-values Client-Date: Fri, 23 Feb 2007 21:28:20 GMT Client-Peer: 81.196.156.249:80 Client-Response-Num: 1 Content-Disposition: attachment;filename=REGS--2007-01-24-2007-02-23.csv Set-Cookie: brk=113bef15c5f8b6727bb01a5586760abda3d1e0c7; domain=.tranzactiibursiere.ro; path=/ X-Catalyst: 5.7006 But the browser doesn't allow downloading that file when clicking on the link then choosing save. It allows downloading it when right-clicking and choosing Save as Does anyone have any idea what could be wrong (with these headers or something else)? Thanks. Octavian - Original Message - From: vb To: The elegant MVC web framework Sent: Friday, February 23, 2007 4:38 PM Subject: Re: [Catalyst] displaying csv content A solution for CSV from Catalyst I used time ago: sub down_san : Local { my ($self, $c) = @_; my $sc = $c-session-{scoala}; my $lu = $c-session-{stag0}; my $lnu = $lu-nume; my $ln = $lnu; $ln =~ s/-..$//; $ln = $ml{$ln}; my $an = $lnu; $an =~ s/^...-//; $an = '20' . $an; my @ang = salar::Model::State-angsclu($sc-id, $lu-id); my $csv = Text::CSV_XS-new({binary = 1}); my $out = ; my @h = (); my $f = $an.-.$ln.- sanatate.txt; @h = ('Nume-Prenume','CNP','Brut-san','CASS'); $csv-combine(@h); $out .= $csv-string . \n; foreach my $g (@ang) { # don't use diacritics in Romanian institutions! my $nume = $g-id_angajat-nume . ' ' . $g-id_angajat-pren; utf8::decode($nume); $nume =~ s/([ăşţîâĂŞŢÎÂ])/$DIACRITICE{$1}/eg; $nume = uc($nume); my @w = (); push @w, $nume; push @w, $g-id_angajat-cnp; push @w, $g-bsan; push @w, $g-isan; $csv-combine(@w); $out .= $csv-string . \n; } $c-res-headers-header('Content-Type' = 'text/csv'); $c-res-headers-header('Content-Disposition' = attachement;filename=$f); $c-res-body($out); } --vlad On 2/23/07, Octavian Rasnita [EMAIL PROTECTED] wrote: Hi, Can anyone point me to a place where I can find how to send csv content to the browser correctly? If I right click on the link and choose save as... the content is saved correctly, and the file name specified by Content-Disposition appears correctly, but if I just click on the link, it appears a window that asks me if I want to open or save it, and if I choose save, nothing happends, and that window don't ask me for a file name. I know that the http headers might be wrong, but I don't know the right way of sending them. Do I need to create another view, or I need to change something in the end() subroutine? Thanks. Octavian ___ 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/ ___ 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] displaying csv content
First I have tried with text/csv but I have seen an example in Catalyst Cookbook with text/comma-separated-values, and that's why I have tried the second way. Now I have tried again using text/csv as a Content-Type and here are the HTTP headers sent: HTTP/1.1 200 OK Date: Fri, 23 Feb 2007 22:13:30 GMT Server: Apache/2.2.4 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8 X-Catalyst: 5.7006 Vary: Accept-Encoding Content-Encoding: gzip Content-Disposition: attachment;filename=REGS--2007-02-24-2007-02-24.csv Content-Length: 96 Content-Type: text/csv Set-Cookie: brk=c636810c0f434768b0e0013988a86758f9f4da34; domain=.tranzactiibursiere.ro; path=/ Connection: close But it works the same as before. I think it might depend on the browser (I am using Internet Explorer 6). I have succeeded (for a few times to save the file by just clicking on the link, but most of the times it doesn't allow saving it). Thank you for suggestions. I don't know if there is a solution for this browser issue (if it is not a HTTP header issue). Octavian - Original Message - From: Jonathan Rockway [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Friday, February 23, 2007 11:41 PM Subject: Re: [Catalyst] displaying csv content Octavian Rasnita wrote: Content-Type: text/comma-separated-values Is this correct? RFC4180 says to use text/csv, although TSV is text/tab-separated-values. Confusing. http://www.rfc-editor.org/rfc/rfc4180.txt Regards, Jonathan Rockway -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ 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/
[Catalyst] no buffering
Hi, I want to send a dynamicly generated csv file to the browser using a Catalyst app, but without storing the whole content in a variable before sending it. Please tell me how can I do this with Catalyst. I have something like: while (...) { # and here I want to add a new line to the csv file and also send it directly to the browser } Thank you. Octavian ___ 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] getting the role id
Ok, thank you. I will try it. Octavian - Original Message - From: Jason Kohles On Feb 4, 2007, at 6:52 AM, Octavian Rasnita wrote: Hi, Is it possible to get the id of the roles of the current user from $c-user? I found that I can get the role names using $c-user-roles, but I need the id of those roles. Do I need to make another query to the database for finding this? If you are using the normal many-to-many method for mapping roles, something like this: User-has_many( 'map_user_role', 'User::Role', 'user_id' ); User-many_to_many( 'roles', 'map_user_role', 'role' ); Then you can get the roles objects with $c-user-roles, and the User::Role objects with $c-user-map_user_role. -- Jason Kohles [EMAIL PROTECTED] http://www.jasonkohles.com/ A witty saying proves nothing. -- Voltaire -- ___ 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] Re: nmake too long error installing catalyst onactiveperl
Ok, I also have it, but I didn't know that the nmake from VS.net 2005 will work for compiling with VS6. However, I have tested nmake test for Catalyst, and it went fine, with no errors found. Octavian - Original Message - From: Greg McAlpin To: catalyst@lists.rawmode.org Sent: Saturday, January 20, 2007 3:37 AM Subject: [Catalyst] Re: nmake too long error installing catalyst onactiveperl I have version 8 of nmake and it worked for me. To get the newer nmake, I had to download MicroSoft's free version of C++: http://msdn.microsoft.com/vstudio/express/visualc/download/ I hope that this helps. Greg --- Date: Fri, 19 Jan 2007 20:55:48 +0100 From: Michael Fuchs Subject: [Catalyst] nmake too long error installing catalyst on activeperl 5.8.8 To: catalyst@lists.rawmode.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-15; format=flowed Hi, when I try to install catalyst 5.7 on Activeperl 5.8.8 on Win XP via cat-install, I get the following error: snip t/unit_utils_prefi x.t t/unit_utils_request.t' too long Stop. nmake test -- NOT OK Running make install make test had returned bad status, won't install without force Thank you for your help. Mike -- ___ 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] nmake too long error installing catalyst on activeperl5.8.8
I understood that the version of nmake is too old and that version doesn't handle long commands. But I couldn't find a newer version than 1.50 which I use. (So I am skipping the make test command when installing Catalyst). Octavian - Original Message - From: Michael Fuchs [EMAIL PROTECTED] To: catalyst@lists.rawmode.org Sent: Friday, January 19, 2007 9:55 PM Subject: [Catalyst] nmake too long error installing catalyst on activeperl5.8.8 Hi, when I try to install catalyst 5.7 on Activeperl 5.8.8 on Win XP via cat-install, I get the following error: snip cp lib/Catalyst/Request/Upload.pm blib\lib\Catalyst\Request\Upload.pm cp lib/Catalyst/Engine.pm blib\lib\Catalyst\Engine.pm cp lib/Catalyst/Component.pm blib\lib\Catalyst\Component.pm C:\Perl\bin\perl.exe -Iinc -MExtUtils::Command -e cp script/catalyst.p l blib\script\catalyst.pl pl2bat.bat blib\script\catalyst.pl nmake -- OK Running make test Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\Perl\bin\perl.exe -Iinc -MExtUtils::Command -e cp script/catalyst.p l blib\script\catalyst.pl pl2bat.bat blib\script\catalyst.pl NMAKE : fatal error U1095: expanded command line 'C:\Perl\bin\perl.exe -MExtUti ls::Command::MM -e test_harness(0, 'inc', 'blib\lib', 'blib\arch') t/01use. t t/02pod.t t/03podcoverage.t t/c3_mro.t t/custom_live_component_controller_acti on_auto_doublebug.t t/live_component_controller_action_action.t t/live_component _controller_action_auto.t t/live_component_controller_action_begin.t t/live_comp onent_controller_action_chained.t t/live_component_controller_action_default.t t /live_component_controller_action_detach.t t/live_component_controller_action_en d.t t/live_component_controller_action_forward.t t/live_component_controller_act ion_global.t t/live_component_controller_action_index.t t/live_component_control ler_action_inheritance.t t/live_component_controller_action_local.t t/live_compo nent_controller_action_multipath.t t/live_component_controller_action_path.t t/l ive_component_controller_action_private.t t/live_component_controller_action_reg exp.t t/live_component_controller_action_streaming.t t/live_component_controller _args.t t/live_engine_request_body.t t/live_engine_request_cookies.t t/live_engi ne_request_headers.t t/live_engine_request_parameters.t t/live_engine_request_up loads.t t/live_engine_request_uri.t t/live_engine_response_cookies.t t/live_engi ne_response_errors.t t/live_engine_response_headers.t t/live_engine_response_lar ge.t t/live_engine_response_redirect.t t/live_engine_response_status.t t/live_en gine_setup_basics.t t/live_engine_setup_plugins.t t/live_loop.t t/live_plugin_lo aded.t t/live_priorities.t t/live_recursion.t t/optional_http-server-restart.t t /optional_http-server.t t/optional_lighttpd-fastcgi-non-root.t t/optional_lightt pd-fastcgi.t t/optional_memleak.t t/optional_stress.t t/optional_threads.t t/uni t_controller_config.t t/unit_controller_namespace.t t/unit_core_action_for.t t/u nit_core_component.t t/unit_core_component_layers.t t/unit_core_component_loadin g.t t/unit_core_log.t t/unit_core_merge_config_hashes.t t/unit_core_mvc.t t/unit _core_path_to.t t/unit_core_plugin.t t/unit_core_uri_for.t t/unit_core_uri_for_a ction.t t/unit_load_catalyst_test.t t/unit_utils_load_class.t t/unit_utils_prefi x.t t/unit_utils_request.t' too long Stop. nmake test -- NOT OK Running make install make test had returned bad status, won't install without force Thank you for your help. Mike ___ 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] creating binaries
From: Joe Landman [EMAIL PROTECTED] Technological measures can be defeated. Assume they provide speed bumps at most to determined hackers. We have found that people are (sometimes) willing to pay for programs when they add significant value to what it is they are doing. That said, much of the reason we see our customers interested in open source has very little to do with libre' and a great deal to do with acquisition cost. The often higher quality is an added benefit. Bla bla. You are living in USA probably, where what you said is not bla bla, but I am living in Romania, Central Europe where even stronger laws than those regarding the piracy are not always respected. In my country there are no many people that care for what you said. Most of the users use pirated programs... more than 90% of the private persons, and over 50% of the companies, or even more. What stops them from doing un-intended things with it are good licenses that grant them the rights they require without granting them the rights they do not require. You are not granting ownership rights, you grant usage rights. So? They will get the source code and give the program to other persons, that won't need to pay for it anymore. Who stops them doing that? Do you think there is an institution in my country that visits the private persons and check to see if they have licences? Not even the companies care about that. Business Software Alliance of MS, Oracle, Corel, SAP and a few other companies visit from time to time the companies, and then they negociate with them for selling them some more licences, because they are found that they have illegal software. That's all. You may chose to restrict these rights, or not grant them at all. In this case, you may need to review which elements of OSS you may yourself use in your program. I cannot do this all the time, because for example I need to create a program that won't even probably have access to the internet. It is a program that should work with a phone exchange for showing statistics about the number of spoken minutes for each line, and other things like that. I need to create a Windows version and a Linux version also. It will be accessible in a web page, in the local intranet of the company, and it would be nice if it could be done with Catalyst, but of course, without showing the source code. I have not seen many users, who have a day job that requires that the get specific work done, try to crack program source code, or reverse engineer their apps. It all comes down to the value you offer, and what you are willing to enable. No, of course they are not paid for this, but the system admin of some companies could try to get the source code, and give it to his friends from other companies. Protection has its purposes, though compiling programs is not what I would call protection. If you want to protect you need to mix encryption with some sort of preventative execution measure, a DRM of sorts. This provides something akin to a higher speedbump, but it is only a speedbump. It is not absolute protection. The only way to get better protection is to never ship the application, only the side effects. Google doesn't ship its applications, though they are some of the most widely used in the world. I am willing to be that the critical internal bits are not OSS. I didn't say I want an absolute protection. I said what I need, but you try to convince me that what I want is bad, just because Catalyst cannot do it. The protection perlapp offers is very good for what I need. It is a very bad marketing to tell the client that the program he paid for is open source, because most of the users might think that in that case the program has no value, or that it could be very simple and that everyone else could get it for free, but he is forced to pay for it. And of course, he will get it and give to other friends that might need it. Hmmm So you think they should spend at least $90US of time to get the program from the internal representation? So do you know about B::Deparse? Oh yes, it would be very well if the program could be cracked only using B::Deparse. In that case I can consider the source code secure enough. The cracker must get the compiled version of the program from the memory, then use B::Deparse, and hope it will give good results... this is not a problem for me. I would suggest reflecting upon which goals you have in preventing access to source. Is it prevention of modification, protection of IP, restriction of redistribution ... It is restriction to redistribution what I want, and the laws don't help me at all. Even to try putting the law work for me, and find the crackers, would cost me more than I can earn. But I don't know if I understood correctly... from this discussion I think that it is not possible to do what I want using Catalyst. This has nothing to do with Catalyst. This is (not
Re: [Catalyst] creating binaries
From: Peter Edwards [EMAIL PROTECTED] Can you tell me how to find the source code from a perlapp program? Everyone says that it is very simple, but nobody was able to do it. The answer is in the manual http://perldoc.perl.org/perlfaq3.html#How-can-I-hide-the-source-for-my-Perl- program%3f I have read: Security through obscurity, the name for hiding your bugs instead of fixing them, is little security indeed. This is what I need. I already said that I don't want an absolute security. I'm still not really sure what you're trying to achieve as you haven't really said what your app will do. There are several approaches to consider: For the moment I want to create 2 versions of an application, one that can run under Windows, and the other one that can run under Linux. The program will have a server that listens to the com port and store the data in a database. (I will also need to find a database that can be protected, but without installing a server, but this is another discussion). And the other part of the program could be made in Catalyst. It will get the data from the database and show it in a browser from the intranet of the client, to authorised users. I want to hide the database connection string, and the code needed to connect, to authorize the users, and so on. I don't want that the system admin of the client to be able to modify the data in the database, and he will never know the password to it. The database will get information from a phone exchange. 1) Use a remote server to host part of the application and talk to it from a front end via SOAP and XML-RPC. That's a lot easier than it sounds provided your users have net access http://search.cpan.org/~rjray/RPC-XML-0.59/. In this case, it is not possible because that application might not have access to the internet, and the client wouldn't want someone from outside to know about their information anyway. 2) Write part of your app in VB or C# and supply a DLL wrapped in copy-protection. It will still be possible to crack but a lot more difficult than trying to hide perl. Bear in mind if your software is popular enough it only takes one person to crack it and list it on astalavista I don't know VB at all, and C# not very well, but the program should also run under Linux, so this is not an option anyway. 3) Go the Open Source route. My customers have started going this way. Why? A lot cheaper. Cost of developing software is 50% testing and if you use popular Open Source or sponsor its development you get a lot of free testing and quicker time to stable software. Yes I agree, but the customers would prefer to get the program from another source, and don't pay anything for it. Octavian ___ 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] creating binaries
From: Bogdan Lucaciu [EMAIL PROTECTED] this is what some people refer to as trolling. (High quality trolling even) Please end this thread, or at least try to keep legal/marketing/philosophy out of it. I wasn't the person that started talking about the legality on this thread. I haven't started talking about licences or things like that. Why didn't you reply to the message that first started talking about that? Have you something against me? I've just wanted to inform the others why some solutions are not always working and why it would be wonderful if Catalyst applications could be included entirely in a perlapp application. I have started this thread asking if I can do something to do that, but noone answered that Catalyst applications could not be entirely included in a binary executable that hides the source code in memory like other simple apps can. But it is ok, I understand that Catalyst cannot be used for that. Octavian ___ 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: Re: [Catalyst] creating binaries
From: Kiki [EMAIL PROTECTED] I would say that treating your customers as potential thieves won't get you very far in doing business with them. 1. In a country where the pyracy is over 90%, yes I can consider the potential customers thieves. 2. I am not selling the program directly to the customers, but to someone that asks for some features, including hiding the source. Octavian ___ 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: Re: [Catalyst] creating binaries
From: Chisel Wright [EMAIL PROTECTED] If hiding the source was a requirement, why did you use perl? Because perl is the only language I know well enough to write a program that could work under Windows and Linux. Octavian ___ 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] creating binaries
From: Matt S Trout [EMAIL PROTECTED] I suspect it's more complaints about people expecting things for free from somebody who's got a hell of a lot of free advice on here without as yet contributing anything useful back are ... ironic at best. I haven't asked anything for free. I've just asked if Catalyst can do some things, and nobody showed that can do it. They try to convince me that what I want is not good. If it cannot do, then it is ok, they could at least tell me that, so I could use my time better and go and use another program for what I want. They would not lose their time either. I have asked that because I consider Catalyst the most complete framework, and I found it much easier to use than something else, but if it is not possible, then... that's it. Actually, it happily can and I know of people who have done so; unfortunately your entitlement attitude and repeated failure to read documentation or to listen when people point you at it has probably resulted in those who're knowledgeable about this not being willing to further help you for free - especially given any time you fail to understand something you accuse the tools of being incapable and broken, often when the authors of those tools are trying to help you learn. I haven't seen any recommendation about hiding the Catalyst source code in case the internet access is not available and web services cannot be used. If there was such a message, I might have missed it. So, Octavian, please moderate your attitude and try and stick to being on-topic and constructive in your comments in future. If I have asked something and that thing could be done, the list members helped very much with their answers. But, if I have asked something that cannot be done, the other tries to convince me that that way is not good, suggest me to use a better licence, and so on, even though sometimes I am asked to do a program in a certain way, and I cannot tell that that way is not good. And I have just explained them why in my case their way is not good. That's why this discussion appeared. And one more thing, if I don't like something, I use to tell it. I don't know why the others don't like this. Why should I like the same thing the others like? Why should we have the same needs or preferences? But this discussion wasn't about this, because I like Catalyst, and that's why I would like to use it in that project I've told you about. Or it is not ok to say that Catalyst cannot do some things? Can Catalyst do everything? I guess not, and I don't think that someone wants it to be able to do everything. So what's the big deal if it cannot be used for some things? Or maybe it can, but just like me, the other users don't know how to use it with perlapp for hiding its source completely. They could just tell me that they don't know, or not reply, because I have explained that I don't want an extremely good protection, and that the program might not have internet access, and that the licence is useless for me. But anyway, it doesn't matter. Octavian This is a community list and you're significantly reducing the utility of it for a substantial number of the other posters. I've had half a dozen complaints about your behaviour already. The next one will result in your subscription being terminated so the rest of the community isn't further disrupted. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.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/ ___ 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] creating binaries
Hi, I want to create a standalone binary executable for Windows and another one for Linux using ActiveState perlapp. Is it possible to make it independent, and distribute only the executable without the modules from the lib directory of the application? I have tried creating an executable from the myapp_server.pl, and it worked fine, but only if the files from the lib directory were in place. When I've renamed /lib to something else, it didn't want to work. Is it possible to do what I want, using perlapp? If not, is it possible with PAR? Thank you. Octavian ___ 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] error
From: Matt S Trout [EMAIL PROTECTED] Couldn't instantiate component TranzactiiBursiere::Model::Db, Can't locate object method compose_namespace via package Db Don't call your database class 'Db'. DB is the namespace reserved for the perl debugger. Windows is case insensitive. Guess what's just happened ... :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Oh thanks! That was it! I've changed the name of the class and now it doesn't give any error. Octavian ___ 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] creating binaries
From: Chisel Wright [EMAIL PROTECTED] On Tue, Jan 16, 2007 at 05:12:05PM +0200, Octavian Rasnita wrote: Is it possible to do what I want, using perlapp? If not, is it possible with PAR? Is this any help? http://www.catalystframework.org/calendar/2005/6 I have tried to do that, but it returned an error on: nmake catalyst_par ... Writing PAR tranzactiibursiere.par NMAKE : fatal error U1077: 'D:\WINDOWS\system32\cmd.exe' : return code '0x2' Stop. But anyway, does this method hide the source code of the application? Thank you. Octavian ___ 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] creating binaries
From: [EMAIL PROTECTED] No. There is really no way to distribute a perl application in a way to hide its source. Any attempt you make will be met with false security and failure. Maybe Perl 6, but that is still unanswered at this point. Have you found a way of cracking the protection of the programs made with perlapp? Many people say that it is not a real protection but nobody was able to crack it. Well, I need that kind of protection that can be cracked, but which nobody cracked it because it might be too hard. I just hope it is possible to create programs with Catalyst protected that way. Octavian ___ 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] creating binaries
From: [EMAIL PROTECTED] Take a look at /tmp/pdk/ perlapp exes dump the plaintext while running. This is not a problem with Catalyst, perl is an interpreted language not a compiled one. perlapp is there to make distributing self contained perl applications easier, not to protect your source. perlapp doesn't drop the source code in /tmp. It puts there only some .dll files, and nothing more than that. (I am using perl Dev Kit 6.02, but now PDK 7 was just released). Can the source code be got easily from those dll files? If it cannot be found easily, then I think it would be nice if the Catalyst applications could be deployed using perlapp. If a language is interpreted, this doesn't mean that the programs that were made with it cannot be protected in any way. Or, is there another way of protecting the code from a Catalyst app? Thanks. Octavian ___ 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] creating binaries
From: Peter Edwards [EMAIL PROTECTED] If a language is interpreted, this doesn't mean that the programs that were made with it cannot be protected in any way. It will be fairly easy to crack installed Perl software. Can you tell me how to find the source code from a perlapp program? Everyone says that it is very simple, but nobody was able to do it. Octavian ___ 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] creating binaries
From: Joe Landman [EMAIL PROTECTED] perlapp doesn't drop the source code in /tmp. It puts there only some .dll files, and nothing more than that. (I am using perl Dev Kit 6.02, but now PDK 7 was just released). The source needs to be obtained somehow and in some state for the Perl program to handle it. Oh yes I know that, but if it would be too hard to get that code, most users would prefer to pay for the program instead of cracking it. Can the source code be got easily from those dll files? If it cannot be found easily, then I think it would be nice if the Catalyst applications could be deployed using perlapp. Once your program is loaded, and compiled into object/internal representation form in memory, the memory could be forced to disk somehow, and a creative hacker can reasonably reassemble your code. That is unless you have your in-memory image also encrypted with on the fly decryption/execution. I am not aware of any one doing this for any language. Though I could be wrong. As far as I know in the latest versions of perlapp, the source code is kept in memory and it is also crypted. That decryption might be done, but it would be much harder, and again, most users will prefer paying for the program instead of fighting with it for breaking the protection. If a language is interpreted, this doesn't mean that the programs that were made with it cannot be protected in any way. Define protection. Do you mean not copied/looked at/altered ? Ok, thanks for asking this, because each one of us understand something different. By protection I understand that if someone would like to get the source code of the program, that person should be a pretty good programmer, and he should spend a long time trying to get it. How much time? Well, a time that doesn't cost more than $90. But I don't know if I understood correctly... from this discussion I think that it is not possible to do what I want using Catalyst. I have also tried an HTTP server module from cpan that works with CGI::Application, but that module cannot be installed under Windows. So I think I will use HTTP::Server::Simple::CGI It would have been much better and easier if I could have done it using Catalyst however, but it is too bad that's not possible. I am wondering why it is not possible. Perlapp includes in the package all the necessary modules that are required by the application. I thought that if I create a binary executable from myapp_server.pl, it would do that, and the application it will work. Does anyone have any idea why it doesn't work? Thank you. Octavian ___ 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 vs Rails vs Django Cook off
From: Carl Johnstone [EMAIL PROTECTED] Now to say the truth, I won't use RoR because I don't know Ruby, but I want to know which are the advantages and disadvantages of Catalyst comparing with other frameworks. The most important advantage/disadvantage *to you* must be that Catalyst is Perl and you know that, and RoR is Ruby and you don't know that. So it becomes more about Ruby vs Perl than Catalyst vs Rails. It's also entirely personal to you, as you've got to factor in your desire to learn Ruby. Carl I have seen fewer and fewer people start learning perl, and more become interested about Python and Ruby (not mentioning those that like C#, Java, C...). They can say that their preferate language is better, that it is newer and that it took what's the best from perl and from other languages, that its object orientation is better, that even though it doesn't have so many libraries as perl does, they are better than those from perl, that the few frameworks available for their language are faster than the frameworks that work under perl, and so on. I would like to say that it is not true, but I cannot see any benchmarks, and I don't know those languages for beeing able to create them, and that's why I would like to know. Octavian ___ 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 vs Rails vs Django Cook off
From: Perrin Harkins [EMAIL PROTECTED] I don't think anyone disputes that Perl (and Python and Java) are much faster than Ruby. You can find benchmarks showing that all over the web. The RoR boosters are usually the ones on the defensive over performance, saying that language performance doesn't matter because the database is always the bottleneck (which I agree with, most of the time). It would be very hard to justify choosing RoR for a project based on performance. - Perrin That's why I was curious and I have sent to the list that blog with the comparison between RoR and Catalyst. Octavian ___ 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] changing the port
From: Bill Moseley [EMAIL PROTECTED] That should work. Look at C::Engine::Apache: http://dev.catalyst.perl.org/browser/trunk/Catalyst-Engine-Apache/lib/Catalyst/Engine/Apache.pm $host = $c-request-header( 'X-Forwarded-Host' ); if ( $host =~ /^(.+):(\d+)$/ ) { $host = $1; $port = $2; } Maybe print out that headers on your back-end Catalyst and see what the front end is sending to make sure the port is included. -- Bill Moseley Hi, I have tried it, and yes, the host and port are well taken this way. But how should I redirect automaticly to the base directory (/) including the port? If I do $c-res-redirect($c-res-base); ... it doesn't work, because it redirects to http://www.server.com/ and not to the port it uses. Is there a way of doing this automaticly, or I will need to get the port manually as you described, then to redirect to the host + port? Thanks. Octavian ___ 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] error
Hi, If I do: perl TranzactiiBursiere.pm it gives the error below. However, if I access the application in the browser, it works fine. Couldn't instantiate component TranzactiiBursiere::Model::Db, Can't locate object method compose_namespace via package Db (perhaps you forgot to load Db?) at D:/usr/site/lib/Catalyst/Model/DBIC/Schema.pm line 287. at D:/usr/site/lib/Catalyst.pm line 1850 Catalyst::setup_component('TranzactiiBursiere', 'TranzactiiBursiere::Model::Db') called at D:/usr/site/lib/Catalyst.pm line 1818 Catalyst::setup_components('TranzactiiBursiere') called at D:/usr/site/lib/Catalyst.pm line 857 Catalyst::setup('TranzactiiBursiere') called at E:\web\TranzactiiBursiere\lib\TranzactiiBursiere.pm line 64 TranzactiiBursiere.pm is the main class of the application. I have also tried using the program tranzactiibursiere_test.pl, but it gives another error: (in cleanup) Can't use an undefined value as a HASH reference at D:/usr/site/lib/Catalyst/Model/DBI.pm line 86 during global destruction. The module Db was created with DBIC::Schema helper application and it is placed in the lib directory (the same directory where TranzactiiBursiere.pm is.) Do you have any idea what could be the problem? Thank you. Octavian ___ 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] serving static files
Hi, I have a Catalyst application that runs under mod_perl2 and I want to serve some static files, but I want to allow access only to the authorized users. I have other free files that I've put in a directory with the SetHandler none Apache configuration, and they can be served directly, however I also want serving some files after the users login. I guess that authorizing the users, then read() -ing the selected file and serving to the browser is not very efficient, especially under mod_perl. Is there a better way? Thank you. Octavian ___ 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] serving static files
From: Perrin Harkins [EMAIL PROTECTED] If you're serving static files and running mod_perl without a reverse proxy, that should be the first thing you change. It has a very significant effect on performance. - Perrin Sorry for off topicness, but please tell me, does it have a bad effect if the files are just some files sitting in a directory, and they are served by apache directly, with no relations with the directories that are handled by a perl-script handler? What I don't understand is why serving the files directly decreases the performance of mod_perl apps, even though downloading those files has no relation with those mod_perl apps. Does it happen the same in case of FastCGI applications? Do you have a recommendation for a text for learning how to use a reverse proxy? Thank you. Octavian ___ 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] Browser window/tab independent sessions
Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but it will be memorised by the current window of the browser, and if the browser window is closed, the session ID is lost, and the user must log in again for creating another session. Same thing if he wants to use another window. Isn't this what is needed? Octavian - Original Message - From: Hermida, Leandro [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, January 08, 2007 3:48 PM Subject: RE: [Catalyst] Browser window/tab independent sessions -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Friday, January 05, 2007 22:26 To: [EMAIL PROTECTED]; The elegant MVC web framework Subject: Re: [Catalyst] Browser window/tab independent sessions On Fri, 2007-01-05 at 20:44 +, Ian Docherty wrote: Does anyone try to keep different state information in different browser windows/tabs? Back in the old days, when we used to make websites with our stone knives and bear skins, we used to keep state information in hidden form fields and query strings. These techniques have none of the global state problems that cookies do. Putting things that are specific to a window/tab in a cookie-based session is a pet peeve of mine actually, since it can break things so spectacularly. If you check, you'll see that all of the major web sites like Yahoo and Amazon are careful to avoid this kind of issue (multiple tabs don't interfere with each other) and they generally seem to use the old-school techniques. How would I create these URI's for each window. I suppose I would have to have a 'create new window' button in the application that generated a new window with a unique window_session? Users are not going to like that. You'll never be able to get something like this working without becoming totally dependent on JavaScript to manipulate your URLs and tell you when new windows are opening. At that point, the hidden form fields will look really easy by comparison. - Perrin The way cookies work for holding application state has the limitation of being for every window/tab of that browser type (someone please correct me if I am wrong). Use Catalyst::Plugin::Session::State::URI to pass the session IDs through the URI but please read the POD on security issues related to this!!! I also had to write an app sometime ago where I didn't use cookies so I just passed the session ID in form hidden fields (for POSTs) and in the URI (for GETs). Then each browser window/tab will have its own independent session no prob.. Leandro ___ 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] Browser window/tab independent sessions
Well, it seems that Internet Explorer doesn't work that way. Here are the steps: I have opened a window with the main page of the site. No cookie file was created. I have logged on. No cookie file was created, even though it was sent, and the login was successful. I have opened another window with the same main URL. It asked again for the username and the password, so the session was not available to the second window. I have logged on using another username. No session file was created but the login was successful this time also. Octavian - Original Message - From: Ian Docherty [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, January 08, 2007 5:37 PM Subject: Re: [Catalyst] Browser window/tab independent sessions Octavian Rasnita wrote: Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but it will be memorised by the current window of the browser, and if the browser window is closed, the session ID is lost, and the user must log in again for creating another session. Same thing if he wants to use another window. Isn't this what is needed? Octavian No, setting it to 0 just ensures that when the *browser* is closed the cookie is removed. A cookie set in one window is available to all windows of that browser and all windows/tabs have the same cookie (and hence the same session). Regards Ian C. Docherty (IcyDee) ___ 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] Browser window/tab independent sessions
From: Carl Franks [EMAIL PROTECTED] To see better what's happening, try using a browser plugin that will let you view current cookies, or use javascript to display the current cookies. IE might not be creating the actual cookie file immediately on each page view. I already use a browser plugin that allows me to see all the headers sent or received. The cookie is set and returned by the browser, and it is not saved on the disk. If the cookie has an expiry date in the future, it is saved imediately for any request. Octavian ___ 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] Apache logs
Hi, I have set one default error log file in httpd.conf for all the virtualhosts, using: ErrorLog logs/error.log and one especially for my virtual host, using: ErrorLog e:/web/TranzactiiBursiere/logs/error.txt The problem is that some of the messages generated by the Catalyst application are send to the first error log file, and others are sent to the second one. Do you know why does this happend, or what can I do to make it store all of them in my virtualhost's error log file? In the main error log appear the most interesting errors, like the list of actions that are executed, and the DBIx::Class errors, and other perl errors. In my virtualhost's error log appear only messages with all the action that were loaded in the entire application. Thank you. Octavian ___ 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] $c-email
Ok, thank you. I had previously used MIME::Lite (not using UTF-8 though) and I think I will follow this way. I asked about $c-email because I thought it might be easier. Octavian - Original Message - From: vb To: The elegant MVC web framework Sent: Sunday, January 07, 2007 12:41 AM Subject: Re: [Catalyst] $c-email I use MIME::Lite, don't know $c-email... A concrete example, from a real salary application (salar.sitsco.com - in short time I provide a new, many featured, version): sub send_fisa : Local { my ( $self, $c, $ia ) = @_; my $st = salar::Model::State-retrieve($ia); my $emal = $st-id_angajat-email; my $from = $st-id_scoala-email; my $subj = 'fişă salariu'; $st-subrute; $c-stash-{angaj} = $st; $c-stash-{sendto} = 1; my $out = $c-view('TT')-render($c, 'fisa_stang.html'); my $msg = new MIME::Lite( From = $from, To = $emal, Subject = $subj, Type = 'TEXT', Data = $out ); $msg-attr(Content-type = text/html;charset=utf-8); $msg-send; # $c-res-redirect('/'); return $c-res-body(scripthideLev('hsind');/script); } --vb On 1/6/07, Octavian Rasnita [EMAIL PROTECTED] wrote: Hi, Does anyone have an example of sending a UTF-8 encoded email message using $c-email? Thank you. Octavian ___ 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/ ___ 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] Modifying a value returned with DBIC
From: Xavier Robin [EMAIL PROTECTED] I solved this thing myself by using the replace method described here : http://search.cpan.org/~abw/Template-Toolkit-2.15/lib/Template/Manual/VMethods.pod So in your template: [% FOREACH message IN messages %] p[% message.replace('\n', 'br') %] [% END %] That should do it ! Xavier Thanks for this. I have found another way for this simple thing, but I might need this method for more complex changes. For replacing \n I use [% message | html_line_break %]. Thanks. Octavian ___ 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] Modifying a value returned with DBIC
Hi, I want to get some messages from a database using DBIx::Class, then to pass them to TT, but I also want to make some preformatting before sending to TT. (I don't know if TT can do what I want). I did: @messages = $c-model(Db::Forum)-search({ id_room = $id_room, }, { join = id_user, prefetch = id_user, rows = $c-user-nr_messages || 10, order_by = 'date desc, time desc', }); $c-stash-{messages} = [EMAIL PROTECTED]; But I want to replace \n in the body of the messages with br /, and who knows, maybe other such format changes. Which is the recommended way of doing this? Should I loop @messages in the program, get each value, modify it and store it into another array then send it to TT, or there is another more elegant method? Thank you. Octavian ___ 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] creating a model
Hmm, strange indeed. Are you using $c-user in your controllers? What version of perl (and build number) are you using? Octavian - Original Message - From: Nilson Santos Figueiredo Junior [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Wednesday, January 03, 2007 8:34 PM Subject: Re: [Catalyst] creating a model On 1/3/07, Len Jaffe [EMAIL PROTECTED] wrote: The Tie::RefHash distributed with perl has a bug, that was fixed, but the new version causes AS perl to die during the test phase of the build. The version with the bug prevents us from using sessions as there's a coderef inside the user object, and Storable balks at freezing a coderef. I find this all too weird. I'm currently using sessions under Win32 with no issues at all. I've got Tie::RefHash version 1.32, which came bundled with my AS Perl. I'm using the following session related plugins: Session Session::Store::File Session::State::Cookie Authentication Authentication::Store::DBIC Authentication::Credential::Password Anything different there which might explain this oddity? -Nilson Santos F. Jr. ___ 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] More about FormBuilder, how do I do more extensive tracing of the Catalyst internal executionpath?
From: David Morel [EMAIL PROTECTED] Catalyst::Controller::FormBuilder is the recommended way to go from now on. D.Morel Why is it recommended? I am asking because I couldn't install it under Windows. It depends on Test::WWW::Mechanize::Catalyst. I found this module using ppm, and I have installed it, but it doesn't work because it depends on Test::WWW::Mechanize that I couldn't found with ppm, and that gives too many errors when I try to install it with cpan. Thanks. Octavian ___ 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] create=static
From: Brandon Black [EMAIL PROTECTED] Are you absolutely sure that your foreign keys are really working in MySQL? Are you using InnoDB? Did you specify them on a separate line like FOREIGN KEY (foo) REFERENCES bar (baz) ? Do they exist when you look at the output of SHOW CREATE TABLE table_name? Nope, I am absolutely sure that the foreign keys don't work in MySQL. :-) I have read in the MySQL manual that even though the foreign keys are not supported (I guess with MyISAM tables) MySQL allow defining them for compatibility, and I thought that DBIx::Class::Loader would see that table creation statement and can make the correct classes. So, I am still learning to use Catalyst, so I have changed the format of the tables to InnoDB in my test database, and now the table classes are created correctly. (I hope I won't need full text indexes and foreign keys support, because as far as I know InnoDB doesn't support full text indexes). I just needed to change some accessors in my code, because I had previously gave different names than the Catalyst helper gave. I don't know yet how those names are chosen... Thank you for help. I have started to understand a little better Catalyst, but I still have some misunderstandings with DBIx::Class... Octavian ___ 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] creating a model
From: Matt S Trout [EMAIL PROTECTED] Because we aren't psychic and can't magically solve your windows installation problems without you ACTUALLY TELLING US WHAT WENT WRONG? No, wait, I don't think other languages' developers have ESP either :) Try the Catalyst-Runtime packages from http://ppm.tcool.org/ or report the problems you encountered getting Catalyst to install under windows - we have users quite happily using both ActiveState perl and Vanilla Perl to run it on windows. If you don't tell us what went wrong so we can help you figure it out, it doesn't mean the framework isn't portable, it just means you're being silly. The application gave errors when using Session Session::State::Cookie Session::Store::File Authentication Authentication::Store::DBIC Authentication::Credential::Password It gave errors when using $c-user in a controller or a template. When not using $c-user, the program worked well. I needed to upgrade more modules, and I couldn't make that upgrade from the beginning, because I couldn't install Tie::RefHash. Finally I have installed this module using cpan (because it is not available in a ppm format), but only with force install because it gave errors on make test. This is ok on the development machine fortunately, but the problem was that I didn't know what to do to make it work. Octavian ___ 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] creating a model
There were a few discussions on the list about that error, even some threads on the list before I got this problem. There was a 404 Not Found error, and in Apache's log an error telling something that from_session was not defined, or something like that, but with no relation to Tie::RefHash. But finally it is ok now, or better said... to be really ok, I should be able to find a way of installing Tie::RefHash under Windows, without accepting nmake test errors. Octavian - Original Message - From: Chisel Wright [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Tuesday, January 02, 2007 7:49 PM Subject: Re: [Catalyst] creating a model On Tue, Jan 02, 2007 at 07:42:41PM +0200, Octavian Rasnita wrote: It gave errors when using $c-user in a controller or a template. When not using $c-user, the program worked well. We're making progress. Now about these errors - what do they actually say? -- Chisel Wright e: [EMAIL PROTECTED] w: http://www.herlpacker.co.uk/ Pedantry is a hugely underrated attribute. ___ 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] creating a model
Hi, I have reported that bug by email, to that address shown on the web page, because it is more simple that way. (I don't have an account...) Here is what I wrote: perl Makefile.pl The result was Ok. nmake The result was ok nmake test errors.txt The result was: D:\usr\bin\perl.exe -MExtUtils::Command::MM -e test_harness(0, 'blib\lib', 'blib\arch') t/*.t t/rebless.ok t/refhash.ok t/storableok t/threadeddubious Test returned status 5 (wstat 1280, 0x500) DIED. FAILED tests 4-14 Failed 11/14 tests, 21.43% okay Failed Test Stat Wstat Total Fail List of Failed --- t/threaded.t5 128014 22 4-14 Failed 1/4 test scripts. 11/79 subtests failed. Files=4, Tests=79, 4 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) I have also tried nmake test 2 error.txt The result was: Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. Failed 1/4 test programs. 11/79 subtests failed. NMAKE : fatal error U1077: 'D:\WINDOWS\system32\cmd.exe' : return code '0x5' Stop. In both cases, it appeared a pop up window with the following error: Perl Command Line Interpreter Perl Command Line Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience. If you were in the middle of something, the information you were working on might be lost. For more information about this error, click here. Debug Close I have also tried installing it with the cpan shell, and in that case some more errors were shown (like 12 from 17 tests failed), and that pop up window with the error appeared for more times. Octavian - Original Message - From: Matt S Trout [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Tuesday, January 02, 2007 7:52 PM Subject: Re: [Catalyst] creating a model On 2 Jan 2007, at 17:42, Octavian Rasnita wrote: From: Matt S Trout [EMAIL PROTECTED] Because we aren't psychic and can't magically solve your windows installation problems without you ACTUALLY TELLING US WHAT WENT WRONG? No, wait, I don't think other languages' developers have ESP either :) Try the Catalyst-Runtime packages from http://ppm.tcool.org/ or report the problems you encountered getting Catalyst to install under windows - we have users quite happily using both ActiveState perl and Vanilla Perl to run it on windows. If you don't tell us what went wrong so we can help you figure it out, it doesn't mean the framework isn't portable, it just means you're being silly. The application gave errors when using Session Session::State::Cookie Session::Store::File Authentication Authentication::Store::DBIC Authentication::Credential::Password It gave errors when using $c-user in a controller or a template. When not using $c-user, the program worked well. I needed to upgrade more modules, and I couldn't make that upgrade from the beginning, because I couldn't install Tie::RefHash. Finally I have installed this module using cpan (because it is not available in a ppm format), but only with force install because it gave errors on make test. This is ok on the development machine fortunately, but the problem was that I didn't know what to do to make it work. Thanks very much, could you please post the errors to http:// rt.cpan.org/ as a ticket for the Tie::RefHash dist? Not one of ours but if there's a ticket to point to we can maybe chase it up. I'll look into making sure the dependancy is added in the appropriate place, I thought this had already been dealt with but apparently if it made it into svn it never got released ... sorry you got bitten by this. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.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/ ___ 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] IMPORTANT: Catalyst::Plugin::FormBuilder obsoleted by::Controller::FormBuilder
Oh, too bad. I have tried installing it under Windows, but I couldn't. It requires Test::WWW::Mechanize::Catalyst. I have installed this module using ppm, but if I run it, it breaks with the error telling that Test::WWW::Mechanize is required but it was not installed. Test::WWW::Mechanize couldn't be found in a ppm repository, and 12 of 17 tests fail if trying to install it with cpan. Can I do something to be able to install it under Windows? Thanks. Octavian - Original Message - From: Matt S Trout [EMAIL PROTECTED] To: [EMAIL PROTECTED]; The elegant MVC web framework catalyst@lists.rawmode.org Sent: Tuesday, January 02, 2007 7:47 PM Subject: Re: [Catalyst] IMPORTANT: Catalyst::Plugin::FormBuilder obsoleted by::Controller::FormBuilder On 31 Dec 2006, at 03:29, Joe Landman wrote: From my previous email on C::P::FormBuilder until now, I have been reading and playing with the code. I found a new controller, Catalyst::Controller::FormBuilder (http://search.cpan.org/~jcamacho/Catalyst-Controller- FormBuilder-0.02/lib/Catalyst/Controller/FormBuilder.pm) which didn't seem to fit into the plugin model. Call me a little confused, I am not sure that I properly grasp which one to use for FormBuilder. For the moment, I am simply going to focus on the plugin (C::P::FB). Don't. The plugin's obsolete, undeveloped and has known interoperability issues. The Controller replaces it outright - use that for all future development. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.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/ ___ 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] creating a model
Oh yes, I was that who said that I have finally solved the problem, by installing Tie::RefHash by force, however I am not sure I won't have problems in the future because of this. Installing by force, just created 2 files: lib/Tie/RefHash.pm and: lib/auto/Tie/RefHash/.packlist I don't know, but I think it should also create another files than these 2. Octavian - Original Message - From: [EMAIL PROTECTED] To: The elegant MVC web framework Sent: Tuesday, January 02, 2007 8:37 PM Subject: Re: [Catalyst] creating a model Chisel wrote: On Tue, Jan 02, 2007 at 01:10:50PM -0500, [EMAIL PROTECTED] wrote: The errors were all about not being able to serialize code refs. Sorry, I think I misread you previous message, and thought you'd overcome the Tie::Refhash problem, and you were getting new/different errors. My bad. Not at all. It wasn't me, it was him, and I may have misread his previous message, and thought that he was still explaining his travails with Cat/sessions/Tie::RefHash on windows. So I jumped in to try to clarify the whole T::RH/Windows thing. Len. -- This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. -- ___ 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/
[Catalyst] getting the ID of the user
Hi, I have tried to get the id of the currently logged user, using: $c-user-id But it returned same thing as $c-user (the username and not its ID). I have seen that if I use other fields like $c-user-email, they are got correctly, so I think id might be a special field which is used by Catalyst. But in that case, is it possible to get it, or I will need to make another query to the database, for finding the ID of the current username? Thank you. Octavian ___ 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] redirection to the original URI
Hi, If the user wants to access a restricted zone and it is redirected to the login page, which is the recommended way of redirecting him back to the original URL? I know that I could create a hidden field in the login form and put the request URL in that field, and after the login, make a redirect to that URL, but I just want to know if there is a more easier way. Thanks. Octavian ___ 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] debugging the login
From: Ash Berlin [EMAIL PROTECTED] Something else is the case here. If you try $c-user; in a controller I suspect it will give you same error as from the template. As to the exact cause, hard to say, but its something to do with authentication setup. Aha, so it is a known issue? Does it happends all the time, or $c-user works well in some cases? It would be helpful if we could know the recommended way, for beeing able to use it right, because otherwise we might think that something's wrong in the code... Thanks. Octavian ___ 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] default template
Hi, I often need to make external redirections like in the following case: sub logout : Local { my ($self, $c) = @_; $c-logout; $c-res-redirect($c-uri_for(/)); } When I access /user/logout for executing this subroutine, it prints the following error: Coldn't render template file error - user/logout: not found So I need to add a template in the stash in this subroutine, even though I don't want to use and print any template, but just do the redirect. If I add before redirection: $c-stash-{template} = index.tt; all works fine, but I guess something is not right in this code. Isn't there a way to just stop everything and make the redirection, without executing the end action? If it is not a way, isn't there a way to specify a default template that's used in these cases, for not needing to specify it manually every time? I have seen that the order of the actions ran is: /auto /user/logout /end - TranzactiiBursiere::View::TT-process Thank you. Octavian ___ 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] default template
From: Eden Cardim [EMAIL PROTECTED] No, there isn't. Catalyst only emits the response after all the actions are dispatched. One way you can keep the end action from running is by not having one. In your case, set up a Controller without an end action just for authentication. In there, you can set up Path actions so you don't have to rewrite all the URLs you've already got in your code: sub logout : Path('/user/logout'){ my ($self, $c) = @_; $c-logout; $c-res-redirect($c-uri_for('/')); } I have something similar, a controller without an end subroutine, but the logout subroutine uses the : Local parameter instead of Path. In that case, the last action is the end subroutine from the Root.pm controller. If I will use Path instead of Local, the end subroutine from Root.pm won't be executed anymore? I thought that if the controller doesn't have a certain Private action defined, the program executes that action from the parent controller, and if that controller doesn't have it, from the parent, and so on, until the root. Octavian ___ 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] default template
Ok, thank you for this code. I haven't seen very many explanations about RenderView, so I didn't understand how it works. So I have used only RenderView until now, but not very smart, something like: sub end : ActionClass('RenderView') { my ($self, $c) = @_; $c-forward($c-view('TT')); } So it was just like a common sub : Private action. Octavian - Original Message - From: Jonathan Rockway [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Friday, December 29, 2006 10:20 PM Subject: Re: [Catalyst] default template Octavian Rasnita wrote: Hi, I often need to make external redirections like in the following case: sub logout : Local { my ($self, $c) = @_; $c-logout; $c-res-redirect($c-uri_for(/)); } How about $c-detach() after the redirect? BTW, I notice a common theme in your posts -- being burned by your poorly-designed custom global end action. Please switch to RenderView and avoid 90% of your problems :) Since the code in RenderView is so small, I'm going to paste it here and tell you why each line there is important. ## comments are my notes sub execute { my $self = shift;## setup my ($controller, $c ) = @_; $self-NEXT::execute( @_ ); ## run everything in the actual end ## action first ## dump requested (by setting ?dump_info=1 in the URL)? ## if so, die so we get the debug screen if ($c-debug $c-req-params-{dump_info}) { die forced debug } ## no content type set? use text/html so that the browser doesn't ## choke if(! $c-response-content_type ) { $c-response-content_type( 'text/html; charset=utf-8' ); } ## client doesn't want body? don't render it! return 1 if $c-req-method eq 'HEAD'; ## custom body set in an action? send that instead return 1 if length( $c-response-body ); ## errors and no template to show them with? let Catalyst handleit return 1 if scalar @{ $c-error } !$c-stash-{template}; ## redirect? don't render the template, just redirect! return 1 if $c-response-status =~ /^(?:204|3\d\d)$/; ## get the view my $view=$c-view() || die Catalyst::Action::RenderView could not find a view to. forward to.\n; ## and forward to it $c-forward( $view ); }; Pretty nice, eh? You can learn a lot by reading the fine source code. Regards, Jonathan Rockway -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ 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/
[Catalyst] accessing the name of the logged user
Hi, Can you tell me how can I access the name of the currently logged user for printing it in a TT template? I have tried: if ($c-user_exists) { $c-stash-{user} = $c-user; } But it gives the following error: Coldn't render template undef error - Can't call method from_session on an undefined value at D:/usr/site/lib/Catalyst\Plugin\Authentication.pm line 122. I have spent a lot of time for finding that this is the problem, and I even found some threads on the list about this issue, but the only solution I have seen was to downgrade from C::P::Authentication 0.08 to 0.007, or to upgrade to 0.09. I am already using the version 0.09 though. If I use the following static text, it works: if ($c-user_exists) { $c-stash-{user} = Gigi; } So the issue is using $c-user. How can I access the user in another way that doesn't give errors? I have also tried (in the code and templates): $c-user-name $c-user-username [% c.user %] But all of them use in fact $c-user, so of course they didn't work. Thank you very much for any solution. Octavian ___ 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/