G. Matthew Rice | 2 Aug 16:11

Re: oops - event queue for CAF

Hi guys,

I just sent this to Rick (on this list, too) for some new functionality for
CAF.  Basically, it sets up an 'event' queue of things like registrations
where scripts can be run periodically to do things.  The easiest example for
a generic CAF application would be registration of a new user and sending out
an e-mail with more information/confirmation/asking to click on a
confirmation link.

The rest of the examples are LPI centric but gives you an idea of what I'm
thinking.  For example, LPI has 5 (or more) scripts loading exam results from
various testing networks.  They all duplicate the sending of e-mails,
awarding of certifications (and send out more email about that).  And they
all have problems with the logic.  So, instead of fixing them all, I'm
proposing fixing the real problem.

Before we go and implement this, does anyone have comments on this approach?
Rick (and I) will add the generic support like the 'welcome' e-mail and the
queue and leave all of that exam and certification stuff in the LPI
applications.

TTYL,
Matthew

"G. Matthew Rice" <matt@...> writes:
> Sorry, I completely forgot to send you details on what I'm thinking for the
> messaging and other event queue.
> 
> Consider the following tables (ignore the stupid field names):
> 
(Continue reading)

Wim Kerkhoff | 10 Jun 03:10

Apache::Registry?

Me again...

I'm finding that the CAF Example application is pretty slow on my AMD 
500 Mhz testing system. Every request takes at least 3 seconds, 
presumably because perl has to launch, then load, parse, execute, run 
etc tons of packages.

When I run the examples under Apache::Registry, they are much much 
faster. Deleting users via Example_5 seems to hang though... firefox 
sits and spins. Log files aren't doing anything exciting and CPU usage 
looks normal on the server.

Is anybody using CAF in production, or is it really alpha quality? It 
seems to have so much potential...  How do you handle performance? I'm 
wondering if I should stick to CGI::Application + Class::DBI + 
Template::Toolkit for now...

Apache configuration for Apache::Registry:

# BEGIN append to httpd.conf
Alias       /caf-examples /usr/local/caf/htdocs/caf-examples
Alias /cgi-bin/ /usr/local/caf/cgi-bin/
PerlModule Apache::Registry
PerlRequire startup.pl

<Location /cgi-bin>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
</Location>
(Continue reading)

Wim Kerkhoff | 10 Jun 02:51

example_5: can't delete user

Using a fresh install of 0.27 from
http://occamstoothbrush.com/caf/CGI-Application-Framework-0.27.tar.gz, the examples seem
mostly okay. 

When I try to delete Prospector Pete, I get the following after clicking the "Yes, delete this user" link:

Error executing run mode 'process_delete_user': users is not a column of
CDBI::Example::example::UserAlbum at /usr/share/perl5/Class/DBI/Relationship/HasMany.pm line 61
 at /usr/local/caf/cgi-bin/app.cgi line 10

Wim
Wim Kerkhoff | 9 Jun 07:00

CAF Example: login errors

Hi all,

I just discovered C:A:F today, looks great! I'd love to skip the 
CGI::Application step and jump right into C:A:F.

After some fun of installing all the dependencies via Debian's apt-get 
and CPAN, I managed to finally get a login screen. But when I enter 
rdice/foobar, I get a rather ugly Carp error screen. The following shows 
up in Apache's log:

[Thu Jun  8 21:52:34 2006] app.cgi: Error executing class callback in 
prerun stage: Permission denied at /usr/share/perl/5.8/CGI/Carp.pm line 314.
[Thu Jun  8 21:52:34 2006] app.cgi:     (in cleanup) Permission denied 
at /usr/share/perl/5.8/CGI/Carp.pm line 314.

from /usr/local/caf/framework/logs/webapp.log:

[CGI::Application::Framework][Thu Jun  8 21:57:13 2006] 
/usr/local/share/perl/5.8.8/CGI/Application/Framework.pm 2579 debug - 
logging system initialized: (pid: 19271)
[CGI::Application::Framework][Thu Jun  8 21:57:14 2006] 
/usr/local/share/perl/5.8.8/CGI/Application/Framework.pm 2666 debug - In 
'cgiapp_prerun' just before checking the runmode
 --> current run mode : navbar
 --> start mode : login
[CGI::Application::Framework][Thu Jun  8 21:57:14 2006] 
/usr/local/share/perl/5.8.8/CGI/Application/Framework.pm 2693 debug - I 
made it past the login run mode check
[CGI::Application::Framework][Thu Jun  8 21:57:14 2006] 
/usr/local/share/perl/5.8.8/CGI/Application/Framework.pm 2701 debug - 
(Continue reading)

G. Matthew Rice | 10 Feb 15:51

Branching strategies with Perforce

Olaf Alders <olaf@...> writes:
> regular happening.  ;)  I'm assuming  that when 0.27 gets integrated into
> main that I'll be able to p4 sync  to get the latest version?

Guys, I figure that now is a good time to introduce everyone with the
branching patterns that we're using with CAF.  There are three (well four;
when will I learn to not enumerate a list before it's done :) main types of
branches:

Main:  //depot/caf/main/...

    This branch serves the purpose of holding the latest'n'greatest "working"
    code.  I quote working because minor/short term development can occur on
    it providing that the coder doesn't expect to break anything or the code
    will have time to be proven well before an expected release.

Dev:  //depot/caf/dev/≤xyz>/...

    These branches are for longer lived projects where the changes will
    introduce stability issues during development.  Sub <xyz> for a short
    descriptive word for the project.  For example, there are currently two
    dev branches:

        matt <at> brando:~/p4/lpi$ p4 dirs //depot/caf/dev/\*
        //depot/caf/dev/caf-auth
        //depot/caf/dev/i18n

    These are also meant for group efforts.  There's also (this is the fourth
    type) //depot/scratch/≤username>/... directories for people that want to
    go off on their own to work on something or for playing around.
(Continue reading)

Eric Lyons | 9 Feb 20:31
Picon

Bug in Framework::login -- no error processing?

Trying to debug why the Example code doesn't display errors on the login page, I traced into
CGI::Application::Framework::login to 
find:

    $self->log->debug("At top of 'login' subroutine / run mode ");
    # ------------------------------------------------------------------
    # Note that the '_errs' param will be populated if there was
    # an error with the processing of a login form submission; this is a
    # CGI::Application::Plugin::ValidateRM ->check_rm method thing,
    # called from within the 'cgiapp_prerun' subroutine.  There are
    # tmpl_var fields within the .tmpl loaded below that correspond to
    # the entries named in $err.  After reading it, unset it so that
    # it isn't polluted with information the next time this sub is
    # accessed.
    # ------------------------------------------------------------------
    my $errs = shift || $self->_param_read_and_unset('_errs');
    $self->log->debug("\$errs is: " . Data::Dumper->Dump([$errs],[qw(*errs)]));

and indeed, $errs is set correctly, but there's no use of this variable in the rest of the login subroutine. 
I.e., %tmplvars never 
gets set with anything.
It would appear it needs something after:

    foreach my $hash ( $self->_login_tmpl_params() ) {
        while ( my ($key, $value) = each %$hash ) {
            $tmplvars{$key} = $value;
        }
    }

like:
(Continue reading)

Eric Lyons | 9 Feb 00:43
Picon

Questions about the example project/apps

Hi -- I just installed CAF.  I seem to have the example application working, except for one thing:  Errors on
the login page aren't 
displayed.  I see the TMPL_VARs in the templates, but it all just drops out and I get back the same login page. 
Is there something 
wrong with the example code, or is something more mysterious happening?

Here's some debug output:

[CGI::Application::Framework][Wed Feb  8 15:34:05 2006]
/usr/lib/perl5/site_perl/5.8.5/CGI/Application/Framework.pm 2001 debug - At 
top of 'login' subroutine / run mode
[CGI::Application::Framework][Wed Feb  8 15:34:05 2006]
/usr/lib/perl5/site_perl/5.8.5/CGI/Application/Framework.pm 2013 debug - 
$errs is: %errs = (
          'err_username' => '<span style="color:red;font-weight:bold"><span class="dfv_errors">* Missing</span></span>',
          'some_errors' => 1,
          'err_password' => '<span style="color:red;font-weight:bold"><span class="dfv_errors">* Missing</span></span>'
        );
[CGI::Application::Framework][Wed Feb  8 15:34:05 2006]
/usr/lib/perl5/site_perl/5.8.5/CGI/Application/Framework.pm 2723 debug - I 
thought err_page was true!
[CGI::Application::Framework][Wed Feb  8 15:34:05 2006]
/usr/lib/perl5/site_perl/5.8.5/CGI/Application/Framework.pm 2618 debug - In 
'cgiapp_postrun', the current run mode is : _echo_page

Any help appreciated -- I think I'm beginning to grok the rest of CAF, but there's a lot there (especially if
you haven't used 
CGI::App before...)!

Eric.
(Continue reading)

Richard Dice | 9 Dec 20:59
Picon
Favicon

Proposed 0.27 release of CAF


Hi everyone...

Here is a link to a tentative 0.27 tarball, for your review and testing.

  http://occamstoothbrush.com/caf/CGI-Application-Framework-0.27.tar.gz

This is a fairly significant release as it has patches in it from Rick Delaney
regarding the creation of no-login-required interaction.  I've been sitting on
these for a few weeks without time to test, review, ruminate, etc.  But I figure
that's it's unfair of me to keep myself forever on the critical path, so I'm
going to ask the rest of you to take a look, give it a try, and let me know how
it seems.  If I get enough positive feedback I'll upload to CPAN.

Rick is on this list so if anyone has questions I'm sure he'll be able to help
you out.

Cheers,
Richard

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
Rick Delaney | 23 Nov 20:37
Picon

Public methods with leading underscores.

There are a lot of methods, like _login_authenticate, which have leading
underscores but are expected to be overridden in your subclass.  This
goes against convention in most Perl projects and makes it difficult to
distinguish at a glance which methods in Framework.pm are public and which are
private.  Can we rename these?

--

-- 
Rick Delaney
rick@...
Rick Delaney | 23 Nov 20:11
Picon

Removed some bogus dependencies.

I've created a branch for myself, caf-main-to-scratch-rick, like I see
everyone else has.  I'm just using it for small, miscellaneous changes
like 1916, which please integ.

--

-- 
Rick Delaney
rick@...
Rick Delaney | 19 Nov 04:51
Picon

Integrate change 1905

Hi Richard,

Can you integrate change 1905 from branch caf-dev-auth-to-main
to main?  It just changes the test environment so that `make test` can
pass even if the files in the dist are read-only (like they are in a
perforce client workspace).

If you'd rather wait until the whole branch is complete, that's fine
too.  I thought it might be easier to manage in small chunks but you
decide.

Thanks,

--

-- 
Rick Delaney
rick@...

Gmane