Re: [Catalyst] Requirement for Makfile.PL or Build.PL in home?

2007-05-29 Thread Jeff Chimene
Matt S Trout wrote:
 On Mon, May 28, 2007 at 08:11:19PM -0700, Jeff Chimene wrote:
   
 Great. How does one move the root/ directory? It gets into the .tar
 file, but isn't deployed on the production server.
 

 Assuming Catalyst::Devel is installed on the server you did the make dist
 on, the 'catalyst()' line in your Makefile.PL should invoke the bundled
 inc/Module/Install/Catalyst.pm such that the root/ directory will go
 into site_perl along with everything else; then at runtime Catalyst will
 use File::ShareDir to find this directory again, meaning MyApp-path_to
 will resolve paths to in there.

 Assuming that's -not- what you're seeing, can you check your inc/ to make
 sure the Catalyst Module::Install extension's in there and then maybe use
 'make -n install' or a find on site_perl to see if your root/ has just
 been installed somewhere you didn't expect.
   
Make::Install is there:
$ ls -R inc
inc:
Module

inc/Module:
AutoInstall.pm  Install  Install.pm

inc/Module/Install:
AutoInstall.pm  Can.pmInclude.pm   Metadata.pm  Win32.pm
Base.pm Fetch.pm  Makefile.pm  Scripts.pm   WriteAll.pm

make -n install shows:
/usr/bin/perl -Iinc -MExtUtils::Command -e mkpath
/usr/lib/perl5/5.8.3/i386-linux-thread-multi
/usr/bin/perl -Iinc -MExtUtils::Command::MM -e perllocal_install \
Module aic \
installed into /usr/lib/perl5/site_perl/5.8.3 \
LINKTYPE dynamic \
VERSION 0.01 \
EXE_FILES script/aic_cgi.pl script/aic_create.pl
script/aic_fastcgi.pl script/aic_server.pl script/aic_test.pl \
 /usr/lib/perl5/5.8.3/i386-linux-thread-multi/perllocal.pod
 If that doesn't bring enlightenment, tell us what you -did- see when you
 checked the things I just suggested and with a bit of luck we'll be able to
 figure out what's not going to plan.
   
Thanks for your assistance.

This probably has something to do with the newly discovered requirement
to define CATALYST_HOME in the package. For now, I've put it into the
aic_cgi.pl script.

As badly as things have gone with this technique as well as the
responses I've received from you and Jonathan, I will avoid asking the
list for further advice.

Cheers,
jec

___
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] Requirement for Makfile.PL or Build.PL in home?

2007-05-28 Thread Jeff Chimene
In Catalyst::Utils::home
is the following requirement documented anywhere?
# only return the dir if it has a Makefile.PL or Build.PL
if (-f $home-file(Makefile.PL) or -f $home-file(Build.PL))

Cheers,
jec


___
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] Requirement for Makfile.PL or Build.PL in home?

2007-05-28 Thread Jeff Chimene
Matt S Trout wrote:
 On Mon, May 28, 2007 at 12:11:54PM -0700, Jeff Chimene wrote:
   
 In Catalyst::Utils::home
 is the following requirement documented anywhere?
 # only return the dir if it has a Makefile.PL or Build.PL
 if (-f $home-file(Makefile.PL) or -f $home-file(Build.PL))
 

 It's only required if you haven't installed the app - it's how Catalyst tells
 you're still running out of a development directory.

   
What does installed the app... mean?

The use case is that I copied all files in the HOME  descendants (but
Makefile.PL and Build.PL) to the production machine. Two hours later, I
figured out why the app wouldn't start. Hence this topic.

Pointers to documentation would be appreciated.

Cheers,
jec

P.S. I originally sent this app to the server via Makefile.PL
constructing a tarball. The disadvantage is that this is a crappy way to
send .PATCH files; which process is how I'd like to move from
development to production in this Brave New World after the initial
deployment. Of course, it turns out that the production machine doesn't
have /usr/bin/patch, but that's another issue.


___
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] Requirement for Makfile.PL or Build.PL in home?

2007-05-28 Thread Jeff Chimene
Matt S Trout wrote:
 On Mon, May 28, 2007 at 05:20:04PM -0700, Jeff Chimene wrote:
   
 Matt S Trout wrote:
 
 On Mon, May 28, 2007 at 02:00:13PM -0700, Jeff Chimene wrote:
   
 P.S. I originally sent this app to the server via Makefile.PL
 constructing a tarball. The disadvantage is that this is a crappy way to
 send .PATCH files; which process is how I'd like to move from
 development to production in this Brave New World after the initial
 deployment. Of course, it turns out that the production machine doesn't
 have /usr/bin/patch, but that's another issue.
 
 
 That's a really, spectacularly bad idea since it means your deployment 
 process
 isn't repeatable, which makes it a crappy deployment process :)
   
   
 You aren't the arbiter of what's good or bad. Please just answer my
 questions, reserving your opinions for beer-thirty.
 

 No, but I do have a fair bit of experience deploying software, and I'd 
 strongly
 recommend against any deployment process that isn't as simple and repeatable
 as possible.

 Basically, an idempotent deployment process is almost always preferable where
 possible since it means you don't have to consider ordering problems - if
 a deployment fails part-way through you can simply re-run it, and if a system
 is out of the loop for a couple deployments (due to hardware failure, for
 e.g) you can still treat it identically to a machine on release N-1.

 I'm not on here to 'just answer your questions', I'm on here to be part of a
 community discussion list where we not only try and help people solve problems
 but to solve problems in -good- ways, especially since this list is archived
 and people use archive searches as a way to find ideas and implementation
 techniques - and as a member of the core team I try and make clear what I
 consider wise and unwise since I'm aware my choices often influence those
 of other Catalyst users. You are, of course, welcome to disagree with, argue
 against or ignore entirely any opinion I express but that's not going to stop
 me expressing them :)

   
I don't have time to argue with you. You are not the arbiter of good or
bad development/deployment practices. I certainly will not be hiring you
for any projects.

Cheers,
jec

___
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] Link to file

2007-05-24 Thread Jeff Chimene
Will Smith wrote:
 Hi,
 I tried to add a link to a wav file on server. The file location is in
 var/www/html/myfolder/myfile.wav. And my app is in var/www/myapp. Hope
 that you could help me out here. Do I need  Static Plugin to add this
 hyper link?
What was the error or result? Are you using Apache? If so, are there any
clues in the error_log?

Cheers,
jec

___
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 unexpectedly expiring

2007-05-23 Thread Jeff Chimene
Jeff Chimene wrote:
 Hi,

 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 The desired cycle is to login then redirect to another controller.

 When I run the standalone server, the session state is recovered, and
 control resumes with the next controller.

 When I run using Apache  the script/xxx_cgi.pl, the session state is
 marked expired and control returns to the login controller.

 I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
 plugins.

 Thanks for your support!

 Cheers,
 jec
More breadcrumbs. The directory is getting created, but session_data
isn't getting created.

___
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 unexpectedly expiring

2007-05-23 Thread Jeff Chimene
Jeff Chimene wrote:
 Hi,

 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 The desired cycle is to login then redirect to another controller.

 When I run the standalone server, the session state is recovered, and
 control resumes with the next controller.

 When I run using Apache  the script/xxx_cgi.pl, the session state is
 marked expired and control returns to the login controller.

 I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
 plugins.

 Thanks for your support!

 Cheers,
 jec
The issue was that I had removed 'libcache-fastmmap-perl' (Debian Etch)
and installed the version from CPAN. The pure CPAN version doesn't play
well on Debian. I removed the CPAN version of File::CacheMmap, installed
the Debian Etch version, and Apache created the session_data file. I'll
contact the Debian maintainer and see if there's any interest in
explaining the discrepancy.

FWIW, I'm not thrilled w/ Debianized Perl modules; I've been attempting
to migrate away from Debianized Perl to CPAN only. There may be some
inherent limitations in that approach.

Cheers,
jec

___
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 unexpectedly expiring

2007-05-21 Thread Jeff Chimene
Jeff Chimene wrote:
 Hi,

 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 The desired cycle is to login then redirect to another controller.

 When I run the standalone server, the session state is recovered, and
 control resumes with the next controller.

 When I run using Apache  the script/xxx_cgi.pl, the session state is
 marked expired and control returns to the login controller.

 I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
 plugins.

 Thanks for your support!

 Cheers,
 jec
This has something to do w/ the implementation of the auto method in
Root.pm

There's some extra stuff I added to support returning to the requested
URI after
login. Nevertheless, it works from script/aic_server.pl, but not from
Apache.

Anyway, I disabled the routine and received goodness from Apache.

sub auto : Private
  {
my ($self, $c) = @_;

if ($c-controller eq $c-controller('Login')) {
  return 1;
}

# If a user doesn't exist, force login
$c-session-{after_login} = '';
if (!$c-user_exists) {
  $c-log-debug('***Root::auto User not found, forwarding to
/login') if $c-debug;

  # make sure we return here after a successful login
  $c-session-{after_login} = $c-request-uri() unless
($c-request-uri() eq $c-request-base());
  $c-detach('aic::Controller::Login', 'index');
}

# User found, so return 1 to continue with processing after this 'auto'
return 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] Session unexpectedly expiring

2007-05-21 Thread Jeff Chimene
[EMAIL PROTECTED] wrote:


 Jeff Chimene [EMAIL PROTECTED] wrote on 05/20/2007 10:13:33 PM:

   
 Thomas L. Shinnick wrote:
 
 At 08:20 PM 5/20/2007, Jeff Chimene wrote:
   
 Hi,
 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 
 [snip]
   
 I'm using the Session, Session::Store::FastMmap,
 Session::State::Cookie plugins.
 
 I've not used it, I'm guessing, and I'm an idiot, but isn't this
 likely permissions problems, between running standalone vs. running
 under Apache?  Any chance the backing storage file is not available to
 Apache processes?  Peeking at the docs:
 storage
  Specifies the file to be used for the sharing of session
 data. ...
 Note that the file will be created with mode 0640, which means
 that
  it will only be writeable by processes running with the same
 uid as
  the process that creates the file.  

 Try deleting the backing file before re-running under Apache?
   
 Good catch. Apache (or script/aic_server.pl) refuses to honor a request
 if the working storage file created by the other HTTP server exists. I
 couldn't even get started w/o a preliminary sudo rm -r /tmp/aic So,
 although that's /a/ problem, it's not /the/ problem.
 

 Without more info (you will post the info Matt asked for?)  
Posted yesterday:
http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05448.html
 this still seems like the best candidate for the issue.  
Ibid. This isn't the problem
 If you are running on Linux
 and have selinux turned on, another common issue is that your policy does
 not allow promiscuous writes from apache.  
Debian Etch
 You may verify this is or is not
 the issue by running audit2why  /var/log/audit/audit.log (or wherever your
 se auditlog is located) and noting any blocks that are happening via yourweb 
 server process.
   
 Also you may want to force the directory for the session stuffs to a sane
 location ( don't know if you are or not -- you will post the info that Matt
 asked for?).
   
Ibid.

I've posted this A.M. w/r/t disabling auto() in Root.pm:
http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html

Cheers,.
jec

___
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 unexpectedly expiring

2007-05-21 Thread Jeff Chimene
James R. Leu wrote:
 Not really related to your issue specifically, but I have seen
 issues with using Session::Store::FastMmap and perl ithreads resulting
 in unrelated sessions appearing to terminate when a thread 'joins'
 back to the parent.  I think is has something to do with ithreads
 interaction with shared memory.  My fix was to not use shared memory :-)
   
OK, but this is a development machine, and I'm the only user. AFAIK, I'm
not using ithreads. As I mentioned, disabling the auto() method in
Root.pm seems to have solved the issue:
http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html

Cheers,
jec
 On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote:
   
 Jeff Chimene wrote:
 
 Hi,

 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 The desired cycle is to login then redirect to another controller.

 When I run the standalone server, the session state is recovered, and
 control resumes with the next controller.

 When I run using Apache  the script/xxx_cgi.pl, the session state is
 marked expired and control returns to the login controller.

 I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
 plugins.

 Thanks for your support!

 Cheers,
 jec
   
 This has something to do w/ the implementation of the auto method in
 Root.pm

 There's some extra stuff I added to support returning to the requested
 URI after
 login. Nevertheless, it works from script/aic_server.pl, but not from
 Apache.

 Anyway, I disabled the routine and received goodness from Apache.

 sub auto : Private
   {
 my ($self, $c) = @_;

 if ($c-controller eq $c-controller('Login')) {
   return 1;
 }

 # If a user doesn't exist, force login
 $c-session-{after_login} = '';
 if (!$c-user_exists) {
   $c-log-debug('***Root::auto User not found, forwarding to
 /login') if $c-debug;

   # make sure we return here after a successful login
   $c-session-{after_login} = $c-request-uri() unless
 ($c-request-uri() eq $c-request-base());
   $c-detach('aic::Controller::Login', 'index');
 }

 # User found, so return 1 to continue with processing after this 'auto'
 return 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/


[Catalyst] Session unexpectedly expiring

2007-05-20 Thread Jeff Chimene
Hi,

I'm trying to figure out why my sessions are expiring in
script/xxx_cgi.pl but not script/xxx_server.pl
The desired cycle is to login then redirect to another controller.

When I run the standalone server, the session state is recovered, and
control resumes with the next controller.

When I run using Apache  the script/xxx_cgi.pl, the session state is
marked expired and control returns to the login controller.

I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
plugins.

Thanks for your support!

Cheers,
jec

___
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 unexpectedly expiring

2007-05-20 Thread Jeff Chimene
Matt S Trout wrote:
 On Sun, May 20, 2007 at 06:20:23PM -0700, Jeff Chimene wrote:
 Thanks for your support!

 This isn't support, this is heckling with the occasional suggestion. Support
 is what your management pays us for if the heckling gets too much :)
/me tries to avoid athletic supporter analogies ;-}

 But anyway, could you show your configs, tell us whether it's the same
 machine and provide fragments of your debug logs please?

Same machine. I don't know what the attachment or HTML rules are for
this list. I'm guessing the
following logs will wrap...

I'm not sure what the configs can provide, but from the lib/aic.pm:
__PACKAGE__-config( name = 'aic'
  , static = { include_path = [ '/usr/local'
   , __PACKAGE__-config-{root} ]
   , ignore_extensions = [ qw/tmpl tt tt2/
   );

I couldn't figure out how to put the __PACKAGE__ reference into YAML
syntax.
There is also a YAML file:
---
name: aic
static:
  no_logs: 0
imgdir: /var/www/httpdocs/images
Model::inspect:
  schema_class: aic::inspect
  connect_info:
- dbi:mysql:database
- theUsername
- thePassword
authentication:
  rdbo:
user_class: aicDB::Access
user_field: username
password_field: password
authorization:
  rdbo:
role_rel: roles
role_field: role

-

Same machine. Here is the log when using script/aic_server.pl:

$ script/aic_server.pl
[debug] Debug messages enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::Authentication 
0.09 |
|
Catalyst::Plugin::Authentication::Credential::Password |
| Catalyst::Plugin::Authentication::Store::RDBO 
0.002   |
| Catalyst::Plugin::Authorization::ACL 
0.08 |
| Catalyst::Plugin::Authorization::Roles 
0.05   |
| Catalyst::Plugin::ConfigLoader 
0.14   |
| Catalyst::Plugin::Session 
0.14|
| Catalyst::Plugin::Session::State::Cookie 
0.07 |
| Catalyst::Plugin::Session::Store::FastMmap 
0.02   |
| Catalyst::Plugin::StackTrace 
0.06 |
| Catalyst::Plugin::Static::Simple 
0.17 |
''

[debug] Loaded dispatcher Catalyst::Dispatcher
[debug] Loaded engine Catalyst::Engine::HTTP
[debug] Found home /home/jchimene/aic
[debug] Loaded Config /home/jchimene/aic/aic.yml
[debug] Loaded components:
.-+--.
| Class   |
Type |
+-+--+
| aic::Controller::Editor |
instance |
| aic::Controller::Login  |
instance |
| aic::Controller::Root   |
instance |
| aic::Model::Access  |
instance |
| aic::Model::Editor  |
instance |
| aic::Model::inspectDB   |
class|
| aic::Model::inspectDB::__RoseDBPrivate__::Rose::DB::MySQL   |
class|
| aic::View::Editor   |
instance |
| aic::View::Login|
instance |
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class|
Method   |
+--+--+--+
| /default | aic::Controller::Root|
default  |
| /end | aic::Controller::Root|
end  |
| /acl_access_denied   | aic  |
acl_access_- |
|  |  |
denied   |
| /auto| aic::Controller::Root|
auto |
| /editor/postCaption- | aic::Controller::Editor  |
postCaption- |
| Handler  |  |
Handler  |
| /editor/postFileHan- | aic::Controller::Editor  |
postFileHan- |
| dler |  |
dler |
| /editor/default  | aic::Controller::Editor  |
default  |
| /editor/access_deni- | aic::Controller::Editor  |
access_deni- |
| ed   |  |
ed   |
| /editor/index| aic::Controller

Re: [Catalyst] Session unexpectedly expiring

2007-05-20 Thread Jeff Chimene
Thomas L. Shinnick wrote:
 At 08:20 PM 5/20/2007, Jeff Chimene wrote:
 Hi,
 I'm trying to figure out why my sessions are expiring in
 script/xxx_cgi.pl but not script/xxx_server.pl
 [snip]
 I'm using the Session, Session::Store::FastMmap,
 Session::State::Cookie plugins.

 I've not used it, I'm guessing, and I'm an idiot, but isn't this
 likely permissions problems, between running standalone vs. running
 under Apache?  Any chance the backing storage file is not available to
 Apache processes?  Peeking at the docs:   
 storage
  Specifies the file to be used for the sharing of session
 data. ...
 Note that the file will be created with mode 0640, which means
 that
  it will only be writeable by processes running with the same
 uid as
  the process that creates the file.  

 Try deleting the backing file before re-running under Apache?
Good catch. Apache (or script/aic_server.pl) refuses to honor a request
if the working storage file created by the other HTTP server exists. I
couldn't even get started w/o a preliminary sudo rm -r /tmp/aic So,
although that's /a/ problem, it's not /the/ problem.

Cheers,
jec

___
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::Helper generating bad code

2007-05-17 Thread Jeff Chimene
Hi,

I'm trying to figure out what's going on w/ Catalyst::Helper.

It's generating bad code for my controller since 7-May

- generated code follows
=head1 METHODS

=over 4

#
# Uncomment and modify this or add new actions to fit your needs
#
#=item default
#
#=cut
#
#sub default : Private {
#my ( $self, $c ) = @_;
#
## Hello World
#$c-response-body('aic::Controller::Login is on Catalyst!');
#}

=back

- end generated code

After uncommenting the code and rendering the generated code:

$ perldoc lib/aic/Controller/Login.pm
.
.
.
The above isn't legal POD after uncommenting:

POD ERRORS
   Hey! The above document had some coding errors, which are
explained below:

   Around line 21:
   You can't have =items (as at line 26) unless the first thing
after the =over is an =item

This started after a recent Catalyst::Devel upgrade via CPAN c.
However, search.cpan doesn't show this version of Catalyst::Helper

I'd like to file a bug report on this, but CPAN isn't reporting this
version of Catalyst::Helper. When I look at the Catalyst::Helper source,
it doesn't match what's installed on my system. The version on CPAN is
what worked before 7-May. I cannot find a VERSION string in
Catalyst::Helper.

Confused,
jec

___
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::Helper generating bad code

2007-05-17 Thread Jeff Chimene
Jeff Chimene wrote:
 Hi,

 I'm trying to figure out what's going on w/ Catalyst::Helper.

 It's generating bad code for my controller since 7-May

 - generated code follows
 =head1 METHODS

 =over 4

 #
 # Uncomment and modify this or add new actions to fit your needs
 #
 #=item default
 #
 #=cut
 #
 #sub default : Private {
 #my ( $self, $c ) = @_;
 #
 ## Hello World
 #$c-response-body('aic::Controller::Login is on Catalyst!');
 #}

 =back

 - end generated code

 After uncommenting the code and rendering the generated code:

 $ perldoc lib/aic/Controller/Login.pm
 .
 .
 .
 The above isn't legal POD after uncommenting:

 POD ERRORS
Hey! The above document had some coding errors, which are
 explained below:

Around line 21:
You can't have =items (as at line 26) unless the first thing
 after the =over is an =item

 This started after a recent Catalyst::Devel upgrade via CPAN c.
 However, search.cpan doesn't show this version of Catalyst::Helper

 I'd like to file a bug report on this, but CPAN isn't reporting this
 version of Catalyst::Helper. When I look at the Catalyst::Helper source,
 it doesn't match what's installed on my system. The version on CPAN is
 what worked before 7-May. I cannot find a VERSION string in
 Catalyst::Helper.

 Confused,
 jec
   
Never mind. I was too liberal with the 'uncomment region' action.

Cheers,
jec

___
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] Howto use ConfigLoader?

2007-05-12 Thread Jeff Chimene
Johannes Rumpf wrote:
 Hey Geeks,

 i'm starting actually with catalyst and try to use the ConfigLoader.
 Actually i'm to dump to get something loaded or accessed. Maybe
 someone arround can give me a helping hand.

 Thats what i've done:

 package myapp;
 use Catalyst qw/-Debug ConfigLoader /;

 and put in the base-dir the following file, more or less exact as in
 the Catalyst tutorial.
It goes in base-dir You can place it elsewhere, but elsewhere isn't
the default. Stick with the default for now.
 myapp.yml

 Basicaly while starting catalyst quoting

 debug] Loaded plugins:
 ..

 | Catalyst::Plugin::ConfigLoader  0.14  |
 ''


 But no file afterwards.

 I'm a bit stucked in the middle.

 Where to put that file
 /
 /lib
 /src ??
It goes in base-dir Stick with the default for now.

 Howto find out if my Config is loaded? Because $c-config-{my_test}
 result in empty value?
Looks like good perl syntax. Have you checked the YAML file for syntax
errors? YAML is /very picky/ about whitespace. The YAML shell (ysh) is a
good debugging aid. e.g.:

$ cat aic.yml
---
name: aic
static:
  no_logs: 0
imgdir: /root/images

$ ysh  aic.yml
$VAR1 = {
  'imgdir' = '/root/images',
  'name' = 'aic',
  'static' = {
'no_logs' = '0'
  }
};

[EDIT AIC.YML]

$ cat aic.yml
---
name: aic
 static:
  no_logs: 0
imgdir: /root/images

$ ysh  aic.yml
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 3
   Document: 1
 at /usr/local/share/perl/5.8.8/YAML.pm line 33

Also, some kind soul has provided yml-mode for Emacs.
 Any advice?

 Thanks and cheers,
  Johannes

___
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] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote:
 One can say that it is a very rare situation. I can tell you that in
 production environment (about 1.000.000 hits per day) it happens every
 day several times. Some users just see an error, some lost their data.
 This is just not always visible to you.
The OP may find a requirement to incorporate a transaction model
(explicit start txn/commit/rollback) to solve this problem in MySQL;
which is what they'd have to do for Oracle or Postgres or Rdb. I'd hope
that MySQL reports a transaction failure when the database connection
evaporates. This would allow a retry on the failed transaction. However,
it may be that the Catalyst Controller / View design/implementation is
only what would ordinarily be flat file accesses that use SQL instead of
keyed-access flat files. If that's the case, wrapping a transaction
around each of these SQL prepare/execute pairs will be a substantial
performance hit.

___
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] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote:
 If you don't need transaction you don't use it. This is not we talking
 about. To use transaction or not in every case is a high-level logic
 decision
I disagree. That /is/ what we are talking about - unless MySQL cannot
tell you that the database connection has evaporated while in
transaction context. I don't know MySQL well enough in this instance to
say for certain that transaction context will address this issue. In a
well-designed RDBMS, a transaction will report failure if, while in
the context of a transaction, any statement fails. In that case, the
entire transaction which may consist of several prepare/execute
operations that can be rolled back and retried.

Transactions are /precisely/ the mechanism to determine, at a high
level, when a certain operation has failed.

 2007/4/27, Jeff Chimene [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:

 Oleg Pronin wrote:
  One can say that it is a very rare situation. I can tell you that in
  production environment (about 1.000.000 hits per day) it happens
 every
  day several times. Some users just see an error, some lost their
 data.
  This is just not always visible to you.
 The OP may find a requirement to incorporate a transaction model
 (explicit start txn/commit/rollback) to solve this problem in MySQL;
 which is what they'd have to do for Oracle or Postgres or Rdb. I'd
 hope
 that MySQL reports a transaction failure when the database connection
 evaporates. This would allow a retry on the failed transaction.
 However,
 it may be that the Catalyst Controller / View design/implementation is
 only what would ordinarily be flat file accesses that use SQL
 instead of
 keyed-access flat files. If that's the case, wrapping a transaction
 around each of these SQL prepare/execute pairs will be a substantial
 performance hit.

 ___
 List: Catalyst@lists.rawmode.org mailto: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] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote:
 If you don't need transaction you don't use it. This is not we talking
 about. To use transaction or not in every case is a high-level logic
 decision
I disagree. That /is/ what we are talking about - unless MySQL cannot
tell you that the database connection has evaporated while in
transaction context. I don't know MySQL well enough in this instance to
say for certain that transaction context will address this issue. In a
well-designed RDBMS, a transaction will report failure if, while in
the context of a transaction, any statement fails. In that case, the
entire transaction which may consist of several prepare/execute
operations that can be rolled back and retried.

Transactions are /precisely/ the mechanism to determine, at a high
level, when a certain operation has failed.

 2007/4/27, Jeff Chimene [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:

 Oleg Pronin wrote:
  One can say that it is a very rare situation. I can tell you that in
  production environment (about 1.000.000 hits per day) it happens
 every
  day several times. Some users just see an error, some lost their
 data.
  This is just not always visible to you.
 The OP may find a requirement to incorporate a transaction model
 (explicit start txn/commit/rollback) to solve this problem in MySQL;
 which is what they'd have to do for Oracle or Postgres or Rdb. I'd
 hope
 that MySQL reports a transaction failure when the database connection
 evaporates. This would allow a retry on the failed transaction.
 However,
 it may be that the Catalyst Controller / View design/implementation is
 only what would ordinarily be flat file accesses that use SQL
 instead of
 keyed-access flat files. If that's the case, wrapping a transaction
 around each of these SQL prepare/execute pairs will be a substantial
 performance hit.

 ___
 List: Catalyst@lists.rawmode.org mailto: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] [ANNOUNCE] Rose::* modules on CPAN

2007-04-23 Thread Jeff Chimene
Peter Karman wrote:
 Cattle-lusters,

 As mentioned here in passing last month, I have uploaded some base
 components to CPAN for use with Rose::HTML::Objects, Rose::DB::Object
 and Catalyst.

 * http://search.cpan.org/dist/Catalyst-Model-RDBO/ (latest: 0.03)

   A Model base class for integrating RDBO with Catalyst. Mostly a thin
   convenience wrapper around Rose::DB::Object and
 Rose::DB::Object::Manager.

 * http://search.cpan.org/dist/Catalyst-Controller-Rose/ (latest: 0.02)

   A collection of Controller base classes for easing CRUD-style
 application
   development with RHTMLO and RDBO.

   Included with the C::C::R controllers is an entire example Catalyst app
   called CatRose. It's in the t/examples/ directory. It includes
 templates,
   in-place-editing with Javascript, and some other goodies.


 Comments/patches/tests welcome.

 cheers,
 pek

Hi,

I've installed the Catalyst-Controller-Rose 0.02 and the examples stayed
in the CPAN working directory. Is this the intended behavior?

# find . -iname t
./.cpan/sources/authors/id/T
./.cpan/build/Module-Build-0.2807-7RbkWV/t
./.cpan/build/Module-Build-0.2807-KU4mqT/t
./.cpan/build/DateTime-TimeZone-0.6501-7O8xZw/t
./.cpan/build/Catalyst-Plugin-ConfigurablePathTo-0.01-DZEEny/t
./.cpan/build/Catalyst-Controller-Rose-0.02-9BkmPu/t
./.cpan/build/Catalyst-Controller-Rose-0.02-9BkmPu/t/examples/CatRose/t
./.cpan/build/Catalyst-Controller-Rose-0.02-YLjEYT/t
./.cpan/build/Catalyst-Controller-Rose-0.02-YLjEYT/t/examples/CatRose/t
./.cpan/build/Module-Build-0.2807-pPzzuG/t
./.cpan/build/DateTime-TimeZone-0.6501-hjoKYA/t
./.cpan/build/Module-Build-0.2807-WSUn79/t
./.cpan/build/DateTime-TimeZone-0.6501-Op5JLR/t
./.cpan/build/Module-Build-0.2807-wvhqi9/t
# find /usr/local -iname catrose
# find . -iname catrose
./.cpan/build/Catalyst-Controller-Rose-0.02-9BkmPu/t/examples/CatRose
./.cpan/build/Catalyst-Controller-Rose-0.02-9BkmPu/t/examples/CatRose/lib/CatRose
./.cpan/build/Catalyst-Controller-Rose-0.02-YLjEYT/t/examples/CatRose
./.cpan/build/Catalyst-Controller-Rose-0.02-YLjEYT/t/examples/CatRose/lib/CatRose

Cheers,
jec

___
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] HOWTO reference config settings from template

2007-04-13 Thread Jeff Chimene

Bill Moseley wrote:

On Thu, Apr 12, 2007 at 04:18:06PM -0700, Jeff Chimene wrote:
  
Thanks for the reply. The problem I'm trying to solve is referencing 
(reading) config settings from a template. I'd like to tell one or more 
templates that sometimes they will use frames  sometimes not 
(debugging). I blithely assumed this would be an appropriate use of 
configuration variables. I was wrong. I'll use the stash for now.



What's View is generating your templates?

you can't do [% c.config.foo %] ?

How about:

[% USE Dumper;  Dumper.dump( c.config ) | stderr %]

Maybe your View isn't stuffing $c into the stash, or is using a
different name (see C::View::TT).

  

Hi Bill,

Thanks for your reply. As I indicated in an earlier message 
(http://www.mail-archive.com/[EMAIL PROTECTED]/msg04690.html), 
I've tried Dumper. I certainly get c.config values, but none of them are 
TT2 configuration settings. I'm using a view generated by the catalyst 
helper script.


As a result of a PEK answer, I'm going to use the [% DEFAULT %] 
directive in the root/lib/site/html file to address this particular 
issue. As noted earlier ... stash variables are accessible is because 
they are all that are provided to TT by default... [1]


[1]
http://www.mail-archive.com/[EMAIL PROTECTED]/msg04698.html

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-13 Thread Jeff Chimene

Hi,

Thanks for the reply.

I see two ways to obtain TT2 configuration values in the TT2 template:

Bill Moseley wrote:

 [%
 USE foo = Class( 'Whatever::View::TT' );
 USE Dumper; Dumper.dump(foo.config ) | stderr;
 %]

and

Robert 'phaylon' Sedlacek wrote:

 The merged configuration will be usually (if not implemented 
otherwise) in

 the controller instance directly. So the best way might be

   package MyApp::View::TT
   ...
   sub the_config_you_want {
   my ($self) = @_;
   return $self-{the_config_you_want};
   }

 and then in the template

   [% c.view('TT').the_config_you_want %]

Cheers,
jec

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-13 Thread Jeff Chimene

Hi,

Thanks for the reply.

I see two ways to obtain TT2 configuration values in the TT2 template:

Bill Moseley wrote:

 [%
 USE foo = Class( 'Whatever::View::TT' );
 USE Dumper; Dumper.dump(foo.config ) | stderr;
 %]

and

Robert 'phaylon' Sedlacek wrote:

 The merged configuration will be usually (if not implemented 
otherwise) in

 the controller instance directly. So the best way might be

   package MyApp::View::TT
   ...
   sub the_config_you_want {
   my ($self) = @_;
   return $self-{the_config_you_want};
   }

 and then in the template

   [% c.view('TT').the_config_you_want %]

Cheers,
jec

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-13 Thread Jeff Chimene

Jeff Chimene wrote:

Hi,

I'm not sure if this is a Catalyst question -

How do I reference __PACKAGE__config settings from a Template Toolkit 
template?


I'd like to use the config tool to set values outside the stash.

Cheers,
jec

OK. After much research, it turns out that the correct answer is:
   modify the config/main file to add the constants you require. Then, 
reference them in your TT2 templates
This doesn't negate the other responses received; which answers further 
explicate the relationship between Catalyst and TT2.


Cheers,
jec


___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] HOWTO reference config settings from template

2007-04-12 Thread Jeff Chimene

Hi,

I'm not sure if this is a Catalyst question -

How do I reference __PACKAGE__config settings from a Template Toolkit 
template?


I'd like to use the config tool to set values outside the stash.

Cheers,
jec

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-12 Thread Jeff Chimene

Peter Karman wrote:



Jeff Chimene scribbled on 4/12/07 9:29 AM:

Hi,

I'm not sure if this is a Catalyst question -

How do I reference __PACKAGE__config settings from a Template Toolkit 
template?


I'd like to use the config tool to set values outside the stash.




[% c.config.yourconfigkeyhere %]


Hi Peter,

Thank-you for the prompt response.

I tried that as one of my first attempts. No joy. I've also tried:
[%
   USE Dumper;
   dump_html(Catalyst);
%]

and I don't see the TT2 configuration settings. When I try the similar 
experiment in the perl module,  dump __PACKAGE__-config, the TT2 
configuration settings are displayed.


Here is the relevant perl code from the P::V I should be able to display 
any of these variables, right?

__PACKAGE__-config({
CATALYST_VAR = 'Catalyst',
INCLUDE_PATH = [
 fori-path_to( 'root', 'src' ),
 fori-path_to( 'root', 'lib' )
],
PRE_PROCESS  = 'config/main',
WRAPPER  = 'site/wrapper',
ERROR= 'error.tt2',
TIMER= 0,
FRAMES   = 1,
   });

Here are the TT2 references I've tried. I use ERROR here on the 
assumption (probably incorrect) that I cannot stick a new value into 
the config list.

Frames = [% Catalyst.config.error %]
Frames = [% c.config.error %]
Frames = [% Catalyst.config.ERROR %]
Frames = [% c.config.error %]

Cheers,
jec




___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-12 Thread Jeff Chimene

Peter Karman wrote:



Jeff Chimene scribbled on 4/12/07 10:35 AM:

and I don't see the TT2 configuration settings. When I try the 
similar experiment in the perl module,  dump __PACKAGE__-config, 
the TT2 configuration settings are displayed.




that's because your TT config probably isn't getting set in the master 
config for your app, which is what c.config returns.


Every M/V/C in Catalyst has a config() method (iirc -- please correct 
me, oh gurus), and the master MyApp class has a config() too, which is 
where you generally set values for the entire application.


You can set your TT config there too. But looking at what you're 
trying to do, I wonder if what you really want is a TT type config 
file, which can set constants and other relevant TT stuff. CatRose has 
an example of how I do it:



http://search.cpan.org/src/KARMAN/Catalyst-Controller-Rose-0.01/examples/CatRose/lib/CatRose/View/TT.pm 



cheers.

pek


Hi Peter,

The config is called in the View package (fori::View::Menu) I was hoping 
to set TT2 values /per package/ via the config as created by the TT2 
helper. It looks like (after DEBUG = 'all') that TT2 only references 
the stash when it resolves variables.


I think that I'll look for other ways to solve this problem.

Cheers,
jec

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HOWTO reference config settings from template

2007-04-12 Thread Jeff Chimene

Jason Kohles wrote:

On Apr 12, 2007, at 1:01 PM, Jeff Chimene wrote:



The config is called in the View package (fori::View::Menu) I was 
hoping to set TT2 values /per package/ via the config as created by 
the TT2 helper. It looks like (after DEBUG = 'all') that TT2 only 
references the stash when it resolves variables.


What is the problem you are trying to solve?  Changing the template 
processor configuration from within a template that it is currently 
processing doesn't seem wise to me.



That being said, the reason that only the stash variables are 
accessible is because they are all that are provided to TT by default...


package MyApp::View::TT;

sub template_vars {
my ( $self, $c ) = @_;

my %vars = $self-SUPER::template_vars( $c );

$vars{ 'ttconfig' } = $self-config;

return %vars;
}


Hi Jason,

Thanks for the reply. The problem I'm trying to solve is referencing 
(reading) config settings from a template. I'd like to tell one or more 
templates that sometimes they will use frames  sometimes not 
(debugging). I blithely assumed this would be an appropriate use of 
configuration variables. I was wrong. I'll use the stash for now.


Cheers,
jec

___
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: HTML::FormFu and Rose::DB::Object?

2007-04-07 Thread Jeff Chimene
Peter Karman wrote:


 Quinn Weaver scribbled on 4/4/07 1:12 AM:
 Bill Moseley wrote:

 On Tue, Apr 03, 2007 at 08:53:32PM -0700, Quinn Weaver wrote:

 In contrast to FormBuilder, RHTMLO wants you to write your HTML form
 by calling Perl methods, somewhat in the spirit of CGI.pm.  This makes
 it hard for design people to edit the form.
 Maybe I'm not understanding that paragraph, but in RHTMLO (IIRC) you
 can do [% form.field('foo').xhtml %] in a template.  What are
 you thinking would be easier for the design people?

 No, you're right.  I didn't catch that possibility, though it's
 implicit in the documentation.  Partly because the docs tell you the
 details of all the methods you can call, but not the big picture of
 what they're good for--in other words, they're etic, not emic.


 yes, the docs are often very exhaustive (exhausting) but sometimes
 lacking in more simple overviews. That's partly why I put together the
 CatRose example.

 Check out the example .tt files in the CatRose app in the C::C::Rose
 package,
 especially edit.tt and view.tt.

 You'll see that those are generic form templates, but in my apps I
 often override with specific form generation if it doesn't fit the
 generic model. Just like a real web designer would. ;)

 I find that defining the form in YAML is one level removed from the
 XHTML itself, so I just define a base RHTMLO class with default labels
 for all my fields, and then do whatever the business requirements
 demand in the actual .tt files.

Hi,

I realize that one is supposed to be born knowing these things, but for
those of us who arrived late to the party:
In view.tt, edit,tt results.tt there are references to methods isa()
and can()
Are those methods from Rose, from Template Toolkit ...?

I realize that there's probably a Google query that can answer this
question immediately, but they are common words, and a satisfactory
search is difficult to construct.

As always, a pointer to documentation would be quite helpful.

___
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 capitalization rules

2007-04-05 Thread Jeff Chimene
Hi all,

I seem to recall someplace there is a Best Practice for Catalyst
capitalization rules. Would some kind sole please post the reference?

Cheers,
jec

___
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] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Jeff Chimene
Hi,

I was wondering if anyone has extended the Authentication tutorial
example to handle the redirect to original URI concept requested
in this thread: http://www.gossamer-threads.com/lists/catalyst/users/11676

Does that suggested answer work with the implementation in
Catalyst::Manual::Tutorial::Authentication? It looks like one would
update the end method in the login controller to implement this technique?

___
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] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Jeff Chimene
Chisel Wright wrote:
 On Thu, Mar 29, 2007 at 02:27:14AM -0700, Jeff Chimene wrote:
   
 Hi,

 I was wondering if anyone has extended the Authentication tutorial
 example to handle the redirect to original URI concept requested
 in this thread: http://www.gossamer-threads.com/lists/catalyst/users/11676

 Does that suggested answer work with the implementation in
 Catalyst::Manual::Tutorial::Authentication? It looks like one would
 update the end method in the login controller to implement this technique?
 

 I just have:

  sub login_if_required {
 my ($c, $message) = @_;

 if( not $c-is_logged_in($c) ) {
 # make sure we return here after a successful login
 $c-session-{after_login} = $c-request-uri();
 # set an informative message to display on the login screen
 if (defined $message) {
 $c-session-{login_message} = $message;
 }
 # send the user to the login screen
 $c-response-redirect( $c-uri_for('/user/login') );
 return;
 }
  }

 in MyApp.pm and

   # if we've stored somewhere to go after we log-in, got there now
   if ( $c-session-{after_login} ) {
   $c-response-redirect( delete $c-session-{after_login} );
   }

 after a successful login.

 It's worked for me so far ... 
   

Thanks, I'll give that a try.

As a side question, why does this particular technique use redirect()?
As opposed to, e.g. detach()?

Cheers,
jec


___
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] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Jeff Chimene
Chisel Wright wrote:
 if( not $c-is_logged_in($c) ) {
   
I had to change to
 if( not $c-user_exists() ) {
it looks like is_logged_in() is a routine you wrote?

otherwise, it does what I need. Thanks!

cheers,
jec

___
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] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Jeff Chimene
Chisel Wright wrote:
 On Thu, Mar 29, 2007 at 09:13:31AM -0700, Jeff Chimene wrote:
   
 As a side question, why does this particular technique use redirect()?
 As opposed to, e.g. detach()?
 

 Because Parley has kinda evolved over [a long period of] time, and I
 expect there wasn't a detach() method when I wrote that method. :)

 As an example of how useless I am at making time for it, I've only just
 got back onto it after a 6-month break.

 Chisel
   
Sorry, I wasn't throughly explicit.

Even the Authentication tutorial uses this technique. There's probably a
technical reason why it's used instead of detach. The tutorial doesn't
elaborate the reasons.

Cheers,
jec

___
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] Detecting if a user aborted a (long) download

2007-03-12 Thread Jeff Chimene

Jonathan Rockway wrote:

On Sunday 11 March 2007 21:18, Jeff Chimene wrote:
  

Jonathan Rockway wrote:


On Sunday 11 March 2007 20:59, Jeff Chimene wrote:
  

How does that differ from something that compares bytes sent to bytes
received? Assuming that the OP defines success when bytes received =
bytes sent


How do you determine how many bytes were received and successfully
written to disk?
  

There's also this:


http://ajaxpatterns.org/Progress_Indicator#What_sort_of_progress_indicato
r_will_you_use.3F
  


I think this thread has wandered a bit off topic.

That's hardly for you to decide, now is it?
  We are talking about how to 
ensure that a user has reliably downloaded and is able to access (from his 
own machine) an mp3 file.  
No, you are. The original question was I need to figure out if a user 
aborted a longish download.
The answer is that you can't do that without 
asking the user :)
  

To that question, you are correct. But, that's not the question.
There are various compromises that you can make instead, including checking to 
see if the whole file at least made it out of your catalyst app (by having 
your filehandle monitor that for you).  You can also give the user a good 
amount of time to download the file as many times as he likes (bandwidth is 
cheap), or you can have customer support allow the user to re-download if he 
complains (Apple does this).


You are free to ignore all of the above advice.  It isn't my problem.
  

Then why bother to reply?

Since we haven't heard from the OP. I have two questions:
o Did you investigate sendfile?
o Have you considered implementing a download progress indicator? One of 
the reasons users give up on downloads is that they don't know what's 
happening.



___
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] Detecting if a user aborted a (long) download

2007-03-11 Thread Jeff Chimene

Jonathan Rockway wrote:

On Sunday 11 March 2007 09:26, Thomas Klausner wrote:
  

But how do I figure out if the download was successfull? I didn't find
anything in the docs (but a RTFM-answer is appreciated, if I missed the
right piece of codocumentation).



You probably want a subclass of IO::File that will callback into your 
application as the file is streamed.  Keep in mind that this won't account 
for buffering between the app and webserver, the webserver and the load 
balancer, the load balancer and the user's ISP's front-end proxy, the user's 
ISP's front-end proxy and the user's TCP stack, the user's TCP stack and the 
web browser, the web browser and disk cache, and finally the disk cache and 
the user's disk.  Not as simple as it seems, is it? :)


You'd be better off just letting the user download the file as many times as 
it takes for, say, a week.


Regards,
Jonathan Rockway

  


How does that differ from something that compares bytes sent to bytes 
received? Assuming that the OP defines success when bytes received = 
bytes sent


___
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] Detecting if a user aborted a (long) download

2007-03-11 Thread Jeff Chimene

Jonathan Rockway wrote:

On Sunday 11 March 2007 20:59, Jeff Chimene wrote:
  

How does that differ from something that compares bytes sent to bytes
received? Assuming that the OP defines success when bytes received =
bytes sent



How do you determine how many bytes were received and successfully written to 
disk?
  

content-length header = received
whatever-writes-on-the-client-side = written


___
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] Detecting if a user aborted a (long) download

2007-03-11 Thread Jeff Chimene

Jonathan Rockway wrote:

On Sunday 11 March 2007 20:59, Jeff Chimene wrote:
  

How does that differ from something that compares bytes sent to bytes
received? Assuming that the OP defines success when bytes received =
bytes sent



How do you determine how many bytes were received and successfully written to 
disk?


There's also this:

http://ajaxpatterns.org/Progress_Indicator#What_sort_of_progress_indicator_will_you_use.3F



___
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/