runmode or user data, add in a CGI
instance with the parameters:
my $cgi = CGI-new( { rm = 'other_runmode', form_field_1 = 'data' } );
my $app = MyApp-new( QUERY = $cgi );
- Jason
William Bulley wrote:
According to Jason Purdy ja...@journalistic.com on Thu, 11/04/10 at 11:16:
You can emulate
Late to this thread - sorry. :)
After giving Brannigan a cursory glance, it looks pretty nice, but what
does this offer that Data::FormValidator doesn't?
Plus DFV has a nice plugin that marries DFV to cgiapp pretty nicely, imo.
- Jason
On 07/25/2010 01:00 AM, Ron Savage wrote:
Hi Folks
You could use a callback, assigning a function to the load_tmpl hook and
then within that function, modify/insert your div of content into the
template parameters.
HTH,
Jason
Gurunandan R. Bhat wrote:
Hi,
Is it possible to add the output of a template to every page/run-mode
without
I'm not sure you need a plugin for reCAPTCHA. The Captcha::reCAPTCHA
CPAN module looks like it's pretty easy to fold into a runmode or a
FormValidator constraint method.
- Jason
P Kishor wrote:
Does such a plugin exist? I can't find one on CPAN. Else, can someone
point me to a tute on how to
Rumors of CAP::MessageStack death are greatly exaggerated. ;)
I apologize for the lack of a response and I wanted to apologize
publicly. I actually owe David Steinbrunner an even bigger apology for
sitting on his work for close to 2 years. I admit I'm a bad CPAN author
and fall victim to the
Terrence Brannon wrote:
Looking forward to a constructive dialogue.
HOW DARE YOU INSULT THE GREAT CGI::Application?!?!?! *laugh*
I'll certainly give your writeup a read (I haven't yet), but
CGI::Prototype hasn't been touched since 2005 and it's not even a 1.0
release. Those two things by
With new advances in Perl OO, we ask what would allow us to leverage that?
For the goodness sake, let's please not base cgiapp on Moose. I have
plenty of instance scripts in production that would not be able to
support it.
Can you elaborate on the new advances and what you'd like to see
Paul,
You may want to check out CAP::Stream, which will handle file handling:
http://search.cpan.org/~purdy/CGI-Application-Plugin-Stream-2.10/lib/CGI/Application/Plugin/Stream.pm
It would reduce your runmode to this:
sub run_mode {
my $cgi_application = shift; # that's a long variable name
I like Google Groups + Google Code. A good example would be what Rose
has done:
http://code.google.com/p/rose/
- Jason
Mark Stosberg wrote:
Please disregard.
Yes, I apologize for the premature announcement. Let me take is opportunity to
reframe the conversation, after speaking with Jesse
I'd like to hear from other users: Do use the FillInForm plugin, or do you use
HTML::FillInForm directly now?
I never used the plugin. I instead used the ValidateRM plugin, which I
assume does its magic w/ HTML::FillInForm directly. If I needed
FillInForm, I used it directly (and I'm still
This is when CGI::Application::Dispatch helps out, tremendously. Once
you set it up, the action in your case translates to the runmode along
with optional parameters.
http://search.cpan.org/~markstos/CGI-Application-Dispatch-2.14/lib/CGI/Application/Dispatch.pm
- Jason
Richard Jones wrote:
I started off w/ Class::DBI and now I use Rose pretty much exclusively.
Very well designed and fast. There is a learning curve, but Randal comes
to the rescue w/ these articles:
http://www.stonehenge.com/merlyn/LinuxMag/col86.html
http://www.stonehenge.com/merlyn/LinuxMag/col87.html
Hi Mark,
I don't think the patch came through. Can you send it to me directly?
Thanks,
Jason
Mark Stosberg wrote:
Attached is a patch for CGI::Application::Plugin::Stream. It proposes
the following changes, and includes full test and doc updates.
* Turn on local auto-flushing
Are folks interested in getting together at YAPC for a BOF? I put up a
quick BOF page here - if you're interested will be there, edit the
page and add yourself + any timing preferences.
http://conferences.mongueurs.net/yn2008/wiki?node=cgiapp%20BOF
- Jason
# CGI::Application community
This probably goes without saying, but I would add that this approach
isn't for every application. For example, we have an e-commerce
application that has our user leaving our site to complete a credit card
transaction and then comes back to our site to complete the order with
the session id.
Hi Mark,
This is a great topic and we have discussed it before on this list (we
should really update the wiki page).
That said, writing webapp tests are really hard these days, what with
AJAX and other JavaScript niceties not being supported in WWW::Mech.
Then there's the spectrum of which
Late chime-in, but my vote: -1
I'm a strong H::T proponent (despite Cees' multiple attempts to sway me
to the dark side ;)), so I enjoy the coupling of functionality.
That's subjective, of course, so let me add something objective. If it
were to become decoupled, I would have to go through
Hmm, I just saw this (catching up on my email, if you can't tell already
;)) after I replied directly to Robert's previous email on this topic.
I wanted to share that I'm using/enjoying Rose, too, but also that I
stumbled onto it and gave it a shot after reading Randal's columns on
the
Karen wrote:
I wish there were more, and in a centralized place. The Perl 5 Wiki has
tentative movement in that direction:
http://www.perlfoundation.org/perl5/index.cgi?recommended_cpan_modules
I didn't know about this - I just published a CGI::Application page:
glance.
- Jason
[1]: http://www.stonehenge.com/merlyn/LinuxMag/col86.html
Ricardo SIGNES wrote:
* Jason Purdy [EMAIL PROTECTED] [2007-09-10T09:17:07]
We use MIME::Lite here a lot w/o any problems and certainly without
thinking it's horrendous. I will say that we don't do a whole lot of
email
My guess is that you're not specifying the append mode in your
log_config - here's a sample from my code:
$self-log_config(
LOG_DISPATCH_MODULES = [
{ module= 'Log::Dispatch::File',
name = 'debugging',
mode = 'append',
This is definitely a good approach, but what it lacks is coverage
reporting capabilities, should you want to know how much of your code is
covered.
Since someone previously posted about T:W:M:CGI, I've been playing
around with that and it also has some flaws that I haven't been able to
I added the votes up and also surveyed the #cgiapp folks:
HT: 7 (Karen, Renee, Ed, Joel, John, Jason, CromeDome)
TT: 4 (Adrian, Dan, Barry, hide)
Both: 2 (mpeters, Scott)
I'm a HT guy, myself. I like how it doesn't have a lot of the
functionality support of TT and that keeps my programming
Hi Brad,
It should work - this is the first I've heard otherwise. The way it
works is that it sends the cookie w/ an expire value of '-1h', which
should tell the browser to delete the cookie.
You may want to file a bug report on RT, along with your particulars
(browser, web server and
I'm probably missing something, but I ran across this article a few days
ago[1] and the huge red flag for me was:
... In 2006 browser vendors still don't support PUT and DELETE.
Is this right? Should we worry about REST if no one can (properly) use
them?
Cheers,
Jason
[1]:
My guess is that you have a loop that's not being terminated.
DBI tracing is a good idea - pointing a trace file to a /tmp file and
monitoring it to see what's going on, in conjunction with your source.
You may also want to inject some print STDERR 'in func()' throughout
your code and then
We're here (the royal we ;)) - just haven't seen anything to drop/chime
in on. My guess is that we're all pretty busy coding up our webapps to
instigate threads.
Drop in on our IRC channel if you want some more chatter. irc.perl.org
#cgiapp
Since I'm posting, I'll add a lil' nugget I
Evan A. Zacks wrote:
On Wed, Nov 08, 2006 at 03:38:28PM -0500, Jason Purdy wrote:
sub my_runmode {
my $self = shift;
my $query = $self-query();
$query-param( 'eid' ) =~ m%^(\d+)$%;
my $email_id = $1;
my $email = OTREmail-retrieve( $query-param( 'eid' ) );
Not sure if this was just
I only have limited experience in JSON (only 2 apps to my name so far
;)), but the methodology I use is different. Instead of putting the
data in the header, I just do a:
sub json_data {
my $self = shift;
my $data = $self-_get_json_data(); # or something...
$self-header_props( -type =
When I run into this, I add that logic before running check_rm:
sub my_runmode {
my $self = shift;
my $query = $self-query();
my $profile = $self-_validate_taskform();
if ( grep { $_ eq 'Help Desk' } $query-param( 'project_names' ) ) {
$profile-{'constraints'}-{'task_names'} =
[NOTE: Code included, so this post is long]
In regards to your 2nd question, I recently tackled that, myself. Those
arrow buttons are done in JavaScript, though I guess you could do them
with forms, too.
First, the HTML:
--
div class=listing_category_box
Hi,
I'm running into a wall here with Dispatch and thought to reach out for
help.
I got everything going great, but decided to move the app to mod_perl
and that's where things went a little crazy.
First, the apache config:
Perl
use lib '/var/www/site/web/resources';
/Perl
Location
more easily changed the Location (but the marketing
person in me wanted that Location ;)).
Lessons learned for next time!
- Jason
Michael Peters wrote:
Jason Purdy wrote:
Hi,
I'm running into a wall here with Dispatch and thought to reach out for
help.
I got everything going great
Bill Stephenson wrote:
I was poking around yesterday and found this:
http://developer.mozilla.org/en/docs/XUL
Very interesting
Has anyone here played around with this at all?
I have - I actually developed my first Firefox extension (been meaning
to share the word):
Robert Hicks wrote:
I am trying out the ValidateRM plugin. I have it working with one form
which is cool.
The second form I have deals with hours worked on a project. The hours
are put in by increments of .25 (i.e. it could be .50 or 7.75). I know I
can check this with the mod ( % ) operator
Paul Johnston wrote:
(First post to this list, so hello!)
Hi Paul! Welcome!
Just wondering if anyone has any Forum/Bulletin Board modules to plugin
to CGI::Application or recommendations for modules to use for this purpose.
Based on this question, I'm not sure cgiapp is what you're
I also ran into this created an RT bug:
http://rt.cpan.org/NoAuth/Bug.html?id=15674
The problem is that you're running the tests as 'root' and so the test
to create a file you can't read or write to fails b/c root is special.
I had to end up hacking the tests to skip 'em.
- Jason
Andrew
I initially started to use HTML::Pager, but have sinced moved on to
Data::Page.
cgiapp runmode code:
sub screen_applicants {
my $self = shift;
my $query = $self-query;
my $unscreened_iterator = RF::CDBI::Subscribers-search( 'screened'
= 0 );
my $unscreened = [];
my
I'm lining up my next cgiapp project, based on my current
frustration/itch: a test module.
I've been all over the board with testing and I've identified four major
methods:
1) Interface directly w/ the cgiapp
2) Write a www-mech script to interface w/ public web server
3) Ditto as #2, but
I didn't do any TT testing, so I apologize for that -- I didn't know it
doesn't like variables that start with underscores. So I added a branch
in the callback code to look for cgiapp's __TT_OBJECT variable and if
it's there, it puts in the param without underscores.
I also hacked a test
Responses below... thanks for the look/input!
Mark Stosberg wrote:
On 2005-09-22, Jason Purdy [EMAIL PROTECTED] wrote:
However, this shouldn't require a session system, because I don't
currently need one. It would be nice for the session system to be
optional.
The user could declare
/PURDY/CGI-Application-Plugin-MessageStack-0.10.tar.gz
size: 11580 bytes
md5: 4888008c73708becd52bdca98809
No action is required on your part
Request entered by: PURDY (Jason Purdy)
Request entered on: Thu, 22 Sep 2005 18:22:47 GMT
Request completed: Thu, 22 Sep 2005 18:24:28 GMT
---
Text
Burst of inspiration from the IRC gang led to this plugin idea. So I
took a first crack at the documentation on our wiki:
http://cgiapp.erlbaum.net/cgi-bin/cgi-app/index.cgi?MessageStack
Feel free to follow-up on list w/ feedback or make revisions directly on
the wiki.
Cheers,
Jason
I hope William (McKee) doesn't kill me, but I spawned another page on
his wiki (I promise, William, I'll move it to the official wiki when
it's live! :)), updating the doc w/ the feedback rec'd:
http://charlotte.pm.org/kwiki/index.cgi?CGIAppStarter
- Jason
I put together a first take on a new generator program,
design/document-wise:
http://www.purdy.info/useperl/cgiapp_starter.pdf
Might have made better sense to use a wiki, but I wanted to whirl on it
now. I'll make sure it's on our new wiki whenever that's up/ready.
Between now then, feel
I just uploaded an alpha of the BREAD plugin - very proud moment for me. :)
As I mention in the docs, please download play with it, but I wouldn't
use it in a production environment until we reach a 1.0 release.
I'm releasing this now to elicit feedback/patches and keep the momentum
alive.
RE: Mark:
That might be easy. Try exporting your start mode from your plugin.
That's too easy -- I will also have other runmodes that are dynamically
generated based on the table names.
RE: Cees:
That's fine -- I don't want people overriding my runmodes, or more PC, I
don't foresee a
We had a book discussion a while ago[1] and nothing came out of it.
Apress approached me a while ago and got me kickstarted on developing a
book, but I was way too lazy to write a book. ;)
Anyway, I do like the book/physical product, but I would recommend NOT
involving a publisher. There are
Well, for the show of hands, my hand (along w/ my head in shame ;)) is down.
I tried the ::Generator, but didn't really help me that much.
I'm starting to find myself copy/pasting the same 100 lines of code
whenever I start a cgiapp project - package lines, use lines, setting up
a setup, a
As matter of fact I would have no problems if someone took over this
C::A wiki - BREAD project has another wiki, is it good?
The only reason I put it on the Charlotte.PM site is that I had
experience with their wiki and it had support for the POD plugin.
If you had that on the cgi-app
William A. Ruppert wrote:
I'm working on my first serious CGIApp.
I would like to use the ValidateRM module, but I'm not sure if I should
use CGI::Application::ValidateRM or
CGI::Application::Plugin::ValidateRM. They seem very similar.
Hi William,
Welcome to the list welcome to cgiapp
One of the things we talked about in our BOF (I will be sending minutes
out as soon as I get them composed! :)), was creating a BREAD (or CRUD)
type of plugin, where someone could install it and then simply create a
package that uses cgiapp the plugin and then it will automatically
create
Sam Tregar wrote:
Sounds cool. I'm curious about your database access approach:
Thanks - I'm not solid on the database approach and I welcome input.
What will the plugin do with just a DBI connect string? Will it use
Class::DBI::Loader internally?
That was my thought process last night
I look forward to being there, though the competing Data Driven Test
Frameworks... is mighty tempting.
I was thinking it might be cool to have a cgiapp powwow (bof?) since
there are going to be a few cgiapp heads there and talk about the
current state of affairs (v4, hooks, plugins and
Michael Peters wrote:
I was thinking it might be cool to have a cgiapp powwow (bof?) since
there are going to be a few cgiapp heads there and talk about the
current state of affairs (v4, hooks, plugins and possibly talking about
a roadmap for the future).
Yeah, definitely a cool idea. I know
Just got the approval from mgmt. and I'm making my arrangements now, so
I look forward to meeting you guys. Maybe we should organize a pow-wow
(BOF?) to talk more on this cgi::session thing.
- Jason
-
Web Archive:
Two options that come to mind quickly:
1) Make your submit buttons the runmode indicator. Given your 'rm'
parameter name:
input type=submit name=rm value=RunmodeA /
input type=submit name=rm value=RunmodeB /
2) Use JavaScript to manipulate the 'rm' hidden parameter before form
submission.
Thanks Sam for your response - I also received some more helpful offlist
responses as well.
So you'd recommend just widening the table, then? When does it get too
complex (or too wide)?
Thanks,
Jason
Sam Tregar wrote:
On Thu, 19 May 2005, Jason Purdy wrote:
So instead of widening the people
So I completed my work on the dynamic charts and thought I'd share back
my findings.
DBD::Chart is definitely the way to go - it's very neat. I did run into
some problems and it was hard to debug (DBI's RaiseError and trace()
don't really help when INSERT'ing bad data into the chart table),
Wojciech Pietron wrote:
Have you ever tried DBD::Chart? I like it very much despite its some
limitations. It is based on GD.
I haven't tried that, though now looking at the docs, they look
familiar. I like the DBI-like interfaces. So I'll give it a shot w/
this module. Wish me luck getting it
Not me, but let me put in a plug for ApacheCon, which has some Perl
talks, including two I'm giving on cgiapp and dfv:
http://www.apachecon.com
- Jason
-
Web Archive: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
I should wait before replying, as I'm sure we'll see a post from someone
w/ more expertise. But I'm send-crazy! ;)
In my (very limited) experience, field_filters don't really work that
way. They're scoped to filter out within the validity checks that
ValidateRM does and reverts back to the
, with help from Jason Purdy.
First, I think I think I found a definite bug in ::Stream. It sets a
'Size' header, which I don't think is correct. Setting 'Content-Length'
instead is correct.
The documentation also says to use 'size', and I think it should
probably be updated to say 'Content_Length
D'oh! Forgot that part!
Also, you may need to put whatever flag in that anonymous hashref
('some_errors' in the docs) that triggers your template code that
something is off.
- Jason
Michael Peters wrote:
Jason Purdy wrote:
if (!$bookid) {
return $self-bookPool( { 'db_error' = 1
I ran into this, too and thought it would make a great infusion for the
Perl Webdev community.
I'm still trying to get my head around it, but having it supported in
cgiapp would be great, perhaps as a Plugin or something.
Here are some other ideas:
1) HTML::Template
In the PHP example, they
Well, I'm very new to CDBI, but I'll take a crack at it.
The big bonus for me is that I can eliminate the SQL code from my Perl
modules, so my code is purely business.
Also, since it's object-oriented, I can do all kinds of neat things like:
$person = My::CDBI::PeopleTable-retrieve( $person_id
I'm just starting out w/ CDBI and what I do is just use it in the runmode:
use My::CDBI::Subclass;
sub user_data {
my $self = shift;
my $query = $self-query();
my $user_obj = My::CDBI::Subclass-retrieve(
$query-param( 'userid' ) );
# yada yada yada...
}
Later on, you may want to have a
Um, I'm afraid I'd have to agree with the point of re-inventing the
wheel (given my prestated opinions on the matter ;)).
If you're looking for a showcase, I would point to Krang:
http://krang.sourceforge.net/
Krang is a fully-functional and powerful CMS application. Those guys
have poured
It looks like my upload made it into CPAN:
http://search.cpan.org/~purdy/CGI-Application-Plugin-Stream-1.00/
Thanks again for the help inspiration. Let me know if you have
problems. This is kinda exciting for me - it's my first original CPAN
work! :)
Cheers,
Jason
I hope I'm not stepping on anyone's toes, but I've always wanted to
contribute to the cgiapp space! If someone's interested in taking over
or helping, let me know.
I took a first crack at how the CAP::Stream module would work, doc-wise
and I put the pod doc up on my site for review:
I updated the documentation from Mark's feedback:
http://www.purdy.info/useperl/Stream.html
I also took a first crack at the code for the Plugin - it wasn't
actually that bad:
http://www.purdy.info/useperl/Stream.pm.html
So now I just need to test it out!
Jason
Thilo Planz wrote:
I just saw that Randal L. Schwartz published CGI::Prototype on CPAN
yesterday.
http://search.cpan.org/~merlyn/CGI-Prototype-0.90/lib/CGI/Prototype.pm
The more, the merrier I suppose...
I just posted a short review, pointing out that it seems redundant to
cgiapp. Gads, that
According to the docs:
Lazy loading is used to prevent expensive file system or database
calls from being made if the session is not needed during this
request. In other words, the Session object is not created until it
is actually needed. Also, the Session object will act as a singleton
by always
Eric Olson wrote:
I had looked at this, but was having problems getting HTML::HTMLDoc from
cpan. This is what I needed here. Are you familiar with how to pass the
pdf created by this into the browser?
Well, I'm not using HTML::HTMLDoc ... just doing it behind the scenes w/
that system() call.
I'm trying to enter the 21st Century by moving from passing along a ton
of hidden variables to just passing along a session ID and save/load the
parameters from a server file.
However, the docs are more geared towards using a cookie and don't
elaborate on how to pass the session ID in this
,
{Directory='/tmp/fbm_sessions/giftsubs'} ],
SEND_COOKIE = 0,
);
}
Jason
Jason Purdy wrote:
I'm trying to enter the 21st Century by moving from passing along a ton
of hidden variables to just passing along a session ID and save/load the
parameters from a server file.
However, the docs
I was searching through the list archives and I cannot find a mention
(besides this guy[1] asking and not getting a response (to the plugin
question)) of why we should change our code from C:A:ValidateRM to
C:A:P:ValidateRM. I've heard lazy loading thrown around, but I'm not
sure what that
Maybe I'm missing something and it's probably a personal preference, but
I enjoy separating all those runmodes (one for display and another for
processing). My forms also submit to themselves, but they have a hidden
runmode parameter to go to the processing runmode directly.
Essentially, you
BTW, I don't know if you guys have played around with Firefox's Live
Bookmarks, but they are really cool. I see the people put the LINK...
tag right in the Wiki so it's even easier to subscribe (it's a button in
the status bar at the bottom right).
More details about Live Bookmarks:
Joel Gwynn wrote:
I finally started using CGI::Application::ValidateRM, and obviously I've
been wasting a signifigant portion of my life up until now. This module
rocks.
Can I get an AMEN!! ? ;)
It works fine, but if the passwords don't match, the default invalid
error is returned. How do I make
I got this e-mail when I presented on CGI::App back at ApacheCon - might
be another good editor contact to pitch the idea to, when it comes to
publishing. I never heard back from him, though.
Count me in for helping out, too, if you'd like. :)
Jason
Mark Stosberg wrote:
Today I saw an
Mark Stosberg wrote:
Have you seen the Sessions with CGI::Application article?
http://twiki.med.yale.edu/twiki2/bin/view/CGIapp/SessionsWithCgiApp
I have and I have used the tips/tricks to implement a session
application, but personally, I find writing a subclass of CGI::App less
of an elegant
Hi Bill,
The way I've seen it done is to have your script redirect the user to an
intermediate page (usually containing an animated GIF) that has a
meta-refresh tag in the HTML header code that continually refreshes
itself every 10 seconds or so. The URL of the refresh usually contains
a
I'm building a new Account Management application for our subscribers
(we publish trade magazines) and I'm limited by the age of its host
server (don't ask ;)). I've been using Apache::AuthCookie on a separate
server, but I don't have that luxury, since I only have mod_perl 1.24
and Perl
Yep - you can do it with the constraint rule ... I did it like this in
the Validator hashref:
sub _second_profile {
return {
'required'= [ qw( [snip] password password2 ) ],
'constraints' = {
'password' = {
name=
85 matches
Mail list logo