/[SQLSession]/trunk/lib/SQLSession/Action/DoSQL.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/SQLSession/Action/DoSQL.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (hide annotations)
Sat Dec 2 21:17:46 2006 UTC (17 years, 5 months ago) by dpavlin
File size: 966 byte(s)
cleanup, this was a Jifty bug
1 dpavlin 5 use strict;
2     use warnings;
3    
4     =head1 NAME
5    
6     SQLSession::Action::DoSQL
7    
8     =cut
9    
10     package SQLSession::Action::DoSQL;
11     use base qw/SQLSession::Action Jifty::Action/;
12    
13     use SQLSession::Model::DatabaseCollection;
14     use Data::Dump qw/dump/;
15    
16     use Jifty::Param::Schema;
17     use Jifty::Action schema {
18    
19     param sql_query =>
20     label is 'SQL',
21     is mandatory;
22    
23     param database =>
24     label is 'Database',
25     render as 'Select',
26     # available are qw( test foo bar );
27     available are defer {
28     my $dbs = SQLSession::Model::DatabaseCollection->new;
29     $dbs->unlimit;
30 dpavlin 6 [{
31 dpavlin 5 display_from => 'name',
32     value_from => 'name',
33     collection => $dbs,
34     }];
35     };
36    
37     };
38    
39     =head2 take_action
40    
41     =cut
42    
43     sub take_action {
44     my $self = shift;
45    
46     # Custom action code
47    
48     $self->report_success if not $self->result->failure;
49    
50     return 1;
51     }
52    
53     =head2 report_success
54    
55     =cut
56    
57     sub report_success {
58     my $self = shift;
59     # Your success message here
60     $self->result->message('Success');
61     }
62    
63     1;
64    

  ViewVC Help
Powered by ViewVC 1.1.26