[Catalyst-commits] r7615 - in trunk/Catalyst-Plugin-FillInForm: . lib lib/Catalyst lib/Catalyst/Plugin

marcus at dev.catalyst.perl.org marcus at dev.catalyst.perl.org
Sat Apr 12 12:17:26 BST 2008


Author: marcus
Date: 2008-04-12 12:17:26 +0100 (Sat, 12 Apr 2008)
New Revision: 7615

Added:
   trunk/Catalyst-Plugin-FillInForm/lib/
   trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/
   trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/Plugin/
   trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/Plugin/FillInForm.pm
Removed:
   trunk/Catalyst-Plugin-FillInForm/FillInForm.pm
Modified:
   trunk/Catalyst-Plugin-FillInForm/Changes
   trunk/Catalyst-Plugin-FillInForm/MANIFEST
   trunk/Catalyst-Plugin-FillInForm/Makefile.PL
Log:
Fix fillinform deps

Modified: trunk/Catalyst-Plugin-FillInForm/Changes
===================================================================
--- trunk/Catalyst-Plugin-FillInForm/Changes	2008-04-11 19:52:13 UTC (rev 7614)
+++ trunk/Catalyst-Plugin-FillInForm/Changes	2008-04-12 11:17:26 UTC (rev 7615)
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Plugin::FillInForm.
 
+0.08  2008-04-12 13:16:00
+        - Updated to Module::Install;
+        - Added build_requires RenderView
 0.07  2008-04-11 21:49:00
         - Changed all references of output -> body.
         - Added tests & docs (jhannah)

Deleted: trunk/Catalyst-Plugin-FillInForm/FillInForm.pm
===================================================================
--- trunk/Catalyst-Plugin-FillInForm/FillInForm.pm	2008-04-11 19:52:13 UTC (rev 7614)
+++ trunk/Catalyst-Plugin-FillInForm/FillInForm.pm	2008-04-12 11:17:26 UTC (rev 7615)
@@ -1,152 +0,0 @@
-package Catalyst::Plugin::FillInForm;
-
-use strict;
-use NEXT;
-use HTML::FillInForm;
-
-our $VERSION = '0.07';
-
-=head1 NAME
-
-Catalyst::Plugin::FillInForm - FillInForm for Catalyst
-
-=head1 SYNOPSIS
-
-    use Catalyst 'FillInForm'; 
-    # that's it, if Catalyst::Plugin::FormValidator is being used
-
-    # OR, manually:
-
-    # in MyApp.pm; assume $c->stash->data is seeded elsewhere
-    sub end : Private {
-      my ( $self, $c ) = @_;
-      $c->forward('MyApp::V::TT') unless $c->res->output;
-      $c->fillform( $c->stash->data );
-      # ....
-
-=head1 DESCRIPTION
-
-Fill forms automatically, based on data from a previous HTML
-form. Typically (but not necessarily) used in conjunction with
-L<Catalyst::Plugin::FormValidator>. This module automatically
-inserts data from a previous HTML form into HTML input fields,
-textarea fields, radio buttons, checkboxes, and select
-tags. It is an instance of L<HTML::FillInForm>, which itself
-is a subclass of L<HTML::Parser>, which it uses to parse the
-HTML and insert the values into the proper form tags.
-
-The usual application is after a user submits an HTML form
-without filling out a required field, or with errors in fields
-having specified constraints. FillInForm is used to
-redisplay the HTML form with all the form elements containing
-the submitted info. FillInForm can also be used to fill forms
-with data from any source, e.g. directly from your database.
-
-=head2 EXTENDED METHODS
-
-=head3 finalize
-
-Will automatically fill in forms, based on the parameters in
-C<$c-E<gt>req-E<gt>parameters>, if the last form has missing
-or invalid fields, and if C<Catalyst::Plugin::FormValidator>
-is being used. C<finalize> is called automatically by the
-Catalyst Engine; the end user will not have to call it
-directly. (In fact, it should never be called directly by the
-end user.)
-
-=cut
-
-sub finalize {
-    my $c = shift;
-    if ( $c->isa('Catalyst::Plugin::FormValidator') ) {
-        $c->fillform
-          if $c->form->has_missing
-          || $c->form->has_invalid
-          || $c->stash->{error};
-    }
-    return $c->NEXT::finalize(@_);
-}
-
-=head2 METHODS
-
-=head3 fillform
-
-Fill a form, based on request parameters (the default) or any
-other specified data hash. You would call this manually if
-you're getting your data from some source other than the
-parameters (e.g. if you're seeding an edit form with the
-results of a database query), or if you're using some other
-validation system than C<Catalyst::Plugin::FormValidator>.
-
-    $c->fillform; # defaults to $c->req->parameters
-
-    # OR
-
-    $c->fillform( \%data_hash );
-
-C<fillform> must be called after an HTML template has been
-rendered. A typical way of using it is to place it immediately
-after your C<forward> call to your view class, which might be
-in a built-in C<end> action in your application class.
-
-You can also hand in a hashref of additional params for
-HTML::FillInForm->fill() if you like.  Explicitly providing a
-\%data_hash is mandatory for this use case.
-
-    $c->fillform( $c->req->parameters, {
-       ignore_fields => [ 'pagesrc', 'pagedst' ],
-       fill_password => 0,
-    } );
-
-=cut
-
-sub fillform {
-    my $c    = shift;
-    my $fdat = shift || $c->request->parameters;
-    my $additional_params = shift;
-
-    $c->response->output(
-        HTML::FillInForm->new->fill(
-            scalarref => \$c->response->{body},
-            fdat      => $fdat,
-            %$additional_params,
-        )
-    );
-}
-
-=head1 NOTES
-
-This class does not play well with Catalyst's ActionClass('RenderView')
-so you may want to check your C<end> method (in MyApp.pm or perhaps
-Controller/Root.pm). If it looks like this:
-
-     sub end : ActionClass('RenderView') {}
-
-Then you'll need to change it to something like this:
-
-     sub end : Private {
-        my ($self, $c) = @_;
-        $c->forward('render');
-        $c->fillform($c->req->params);
-     }
-     sub render : ActionClass('RenderView') { }
-
-=head1 SEE ALSO
-
-L<Catalyst>, L<Catalyst::Plugin::FormValidator>, L<HTML::FillInForm>.
-
-=head1 AUTHOR
-
-Sebastian Riedel, C<sri at cpan.org>
-Marcus Ramberg, C<mramberg at cpan.org>
-Jesse Sheidlower, C<jester at panix.com>
-Jay Hannah, C<jay at jays.net>
-
-=head1 COPYRIGHT
-
-This program is free software, you can redistribute it and/or modify it under
-the same terms as Perl itself.
-
-=cut
-
-1;

Modified: trunk/Catalyst-Plugin-FillInForm/MANIFEST
===================================================================
--- trunk/Catalyst-Plugin-FillInForm/MANIFEST	2008-04-11 19:52:13 UTC (rev 7614)
+++ trunk/Catalyst-Plugin-FillInForm/MANIFEST	2008-04-12 11:17:26 UTC (rev 7615)
@@ -1,8 +1,16 @@
 Changes
-FillInForm.pm
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/Catalyst/Plugin/FillInForm.pm
 Makefile.PL
 MANIFEST			This list of files
-META.yml			Module meta-data (added by MakeMaker)
+META.yml
 README
 t/01use.t
 t/02pod.t

Modified: trunk/Catalyst-Plugin-FillInForm/Makefile.PL
===================================================================
--- trunk/Catalyst-Plugin-FillInForm/Makefile.PL	2008-04-11 19:52:13 UTC (rev 7614)
+++ trunk/Catalyst-Plugin-FillInForm/Makefile.PL	2008-04-12 11:17:26 UTC (rev 7615)
@@ -1,11 +1,12 @@
-use ExtUtils::MakeMaker;
+use inc::Module::Install;
+use strict;
 
-WriteMakefile(
-    NAME      => 'Catalyst::Plugin::FillInForm',
-    AUTHOR    => 'Sebastian Riedel (sri at oook.de)',
-    PREREQ_PM => {
-        Catalyst         => '2.99',
-        HTML::FillInForm => 0
-    },
-    VERSION_FROM => 'FillInForm.pm'
-);
+name 'Catalyst-Plugin-FillInForm';
+all_from  'lib/Catalyst/Plugin/FillInForm.pm';
+
+requires 'Catalyst' => '5.7012';
+requires 'HTML::FillInform';
+
+build_requires 'Catalyst::Action::RenderView';
+
+WriteAll();

Copied: trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/Plugin/FillInForm.pm (from rev 7614, trunk/Catalyst-Plugin-FillInForm/FillInForm.pm)
===================================================================
--- trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/Plugin/FillInForm.pm	                        (rev 0)
+++ trunk/Catalyst-Plugin-FillInForm/lib/Catalyst/Plugin/FillInForm.pm	2008-04-12 11:17:26 UTC (rev 7615)
@@ -0,0 +1,152 @@
+package Catalyst::Plugin::FillInForm;
+
+use strict;
+use NEXT;
+use HTML::FillInForm;
+
+our $VERSION = '0.08';
+
+=head1 NAME
+
+Catalyst::Plugin::FillInForm - FillInForm for Catalyst
+
+=head1 SYNOPSIS
+
+    use Catalyst 'FillInForm'; 
+    # that's it, if Catalyst::Plugin::FormValidator is being used
+
+    # OR, manually:
+
+    # in MyApp.pm; assume $c->stash->data is seeded elsewhere
+    sub end : Private {
+      my ( $self, $c ) = @_;
+      $c->forward('MyApp::V::TT') unless $c->res->output;
+      $c->fillform( $c->stash->data );
+      # ....
+
+=head1 DESCRIPTION
+
+Fill forms automatically, based on data from a previous HTML
+form. Typically (but not necessarily) used in conjunction with
+L<Catalyst::Plugin::FormValidator>. This module automatically
+inserts data from a previous HTML form into HTML input fields,
+textarea fields, radio buttons, checkboxes, and select
+tags. It is an instance of L<HTML::FillInForm>, which itself
+is a subclass of L<HTML::Parser>, which it uses to parse the
+HTML and insert the values into the proper form tags.
+
+The usual application is after a user submits an HTML form
+without filling out a required field, or with errors in fields
+having specified constraints. FillInForm is used to
+redisplay the HTML form with all the form elements containing
+the submitted info. FillInForm can also be used to fill forms
+with data from any source, e.g. directly from your database.
+
+=head2 EXTENDED METHODS
+
+=head3 finalize
+
+Will automatically fill in forms, based on the parameters in
+C<$c-E<gt>req-E<gt>parameters>, if the last form has missing
+or invalid fields, and if C<Catalyst::Plugin::FormValidator>
+is being used. C<finalize> is called automatically by the
+Catalyst Engine; the end user will not have to call it
+directly. (In fact, it should never be called directly by the
+end user.)
+
+=cut
+
+sub finalize {
+    my $c = shift;
+    if ( $c->isa('Catalyst::Plugin::FormValidator') ) {
+        $c->fillform
+          if $c->form->has_missing
+          || $c->form->has_invalid
+          || $c->stash->{error};
+    }
+    return $c->NEXT::finalize(@_);
+}
+
+=head2 METHODS
+
+=head3 fillform
+
+Fill a form, based on request parameters (the default) or any
+other specified data hash. You would call this manually if
+you're getting your data from some source other than the
+parameters (e.g. if you're seeding an edit form with the
+results of a database query), or if you're using some other
+validation system than C<Catalyst::Plugin::FormValidator>.
+
+    $c->fillform; # defaults to $c->req->parameters
+
+    # OR
+
+    $c->fillform( \%data_hash );
+
+C<fillform> must be called after an HTML template has been
+rendered. A typical way of using it is to place it immediately
+after your C<forward> call to your view class, which might be
+in a built-in C<end> action in your application class.
+
+You can also hand in a hashref of additional params for
+HTML::FillInForm->fill() if you like.  Explicitly providing a
+\%data_hash is mandatory for this use case.
+
+    $c->fillform( $c->req->parameters, {
+       ignore_fields => [ 'pagesrc', 'pagedst' ],
+       fill_password => 0,
+    } );
+
+=cut
+
+sub fillform {
+    my $c    = shift;
+    my $fdat = shift || $c->request->parameters;
+    my $additional_params = shift;
+
+    $c->response->output(
+        HTML::FillInForm->new->fill(
+            scalarref => \$c->response->{body},
+            fdat      => $fdat,
+            %$additional_params,
+        )
+    );
+}
+
+=head1 NOTES
+
+This class does not play well with Catalyst's ActionClass('RenderView')
+so you may want to check your C<end> method (in MyApp.pm or perhaps
+Controller/Root.pm). If it looks like this:
+
+     sub end : ActionClass('RenderView') {}
+
+Then you'll need to change it to something like this:
+
+     sub end : Private {
+        my ($self, $c) = @_;
+        $c->forward('render');
+        $c->fillform($c->req->params);
+     }
+     sub render : ActionClass('RenderView') { }
+
+=head1 SEE ALSO
+
+L<Catalyst>, L<Catalyst::Plugin::FormValidator>, L<HTML::FillInForm>.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at cpan.org>
+Marcus Ramberg, C<mramberg at cpan.org>
+Jesse Sheidlower, C<jester at panix.com>
+Jay Hannah, C<jay at jays.net>
+
+=head1 COPYRIGHT
+
+This program is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
+1;




More information about the Catalyst-commits mailing list