|
NAMESQLite::Work::CGI - Report and update a SQLite database using CGIVERSIONversion 0.1601SYNOPSISuse SQLite::Work::CGI; my $obj = SQLite::Work::CGI->new(%args); DESCRIPTIONThis module is an expansion of SQLite::Work suitable for use in a CGI script to report and update a SQLite database.CLASS METHODSnewmy $obj = SQLite::Work->new( database=>$database_file, row_ids=>{ episodes=>'title_id', }, join_cols=>{ 'episodes+recordings'=>'title_id', } }, report_template=>$report_template, default_format=>{ 'episodes' => { 'title'=>'title', 'series_title'=>'title', } }, input_format=>{ 'reviews' => { 'Review'=>{ type=>'textarea', cols=>60, rows=>4, } } }, max_sort_fields=>10, sort_label=>'Zsort', sort_reversed_prefix=>'Zsort_reversed_', headers_label=>'Zheader_', show_label=>'Zshow', where_prefix=>'Zwhere_', not_prefix=>'Znot_', );Make a new report object. Takes the same arguments as SQLite::Work::new() plus the following additions:
OBJECT METHODSdo_select$obj->do_select($table, command=>'Search');Select data from a table in the database. Uses CGI to get most of the parameters. The 'command' is 'Search' by default; if it is something else, then the result generated has edit fields and buttons in it. do_single_updateUpdate a single column in a single row, or all columns in a single row.do_add_form$obj->do_add_form($table);Set up for adding a row to the database. do_addAdd a row to a table.do_single_deleteDelete a single row.make_search_formCreate the search form for the given table.my $form = $obj->make_search_form($table, %args); do_search_formDisplay the search form for the given table.make_table_formMake the table selection form.do_table_formDisplay the table selection form.Helper MethodsLower-level methods, generally just called from other methods, but possibly suitable for other things.print_messagePrint an (error) message to the user.$self->print_message($message); # error message $self->print_message($message, 0); # non-error message search_formConstruct a search-a-table formmake_add_formConstruct an add-a-row form.make_buttonsMake the buttons for the forms.make_page_buttonMake a button for a particular pageprint_selectPrint a selection result. (slightly different for Edits than for Search)format_reportFormat the report results If 'command' is 'Search' then use the parent format_report; otherwise make an edit-table.make_edit_tableMake a table for editing a search result.make_edittextMake a textarea for editing a search result.get_input_fieldGet the required input field for the table+columnREQUIRESSQLite::Work CGI Test::More INSTALLATIONTo install this module, run the following commands:perl Build.PL ./Build ./Build test ./Build install Or, if you're on a platform (like DOS or Windows) that doesn't like the "./" notation, you can do this: perl Build.PL perl Build perl Build test perl Build install In order to install somewhere other than the default, such as in a directory under your home directory, like "/home/fred/perl" go perl Build.PL --install_base /home/fred/perl as the first step instead. This will install the files underneath /home/fred/perl. You will then need to make sure that you alter the PERL5LIB variable to find the modules, and the PATH variable to find the script. Therefore you will need to change: your path, to include /home/fred/perl/script (where the script will be) PATH=/home/fred/perl/script:${PATH} the PERL5LIB variable to add /home/fred/perl/lib PERL5LIB=/home/fred/perl/lib:${PERL5LIB} SEE ALSOperl(1).BUGSPlease report any bugs or feature requests to the author.AUTHORKathryn Andersen (RUBYKAT) perlkat AT katspace dot com http://www.katspace.com COPYRIGHT AND LICENCECopyright (c) 2005 by Kathryn AndersenThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |