GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::BROWSE::CGI (3)

.ds Aq ’

NAME

DBIx::Browse::CGI - Perl extension to browse tables with a CGI interface.

CONTENTS

SYNOPSIS



  use DBIx::Browse::CGI;
  my ($dbh, $dbb, $q);
  $dbh = DBI->connect("DBI:Pg:dbname=enterprise")
    or croak "Cant connect to database: $@";
 $q   = new CGI;
 $dbb = new  DBIx::Browse::CGI({
    dbh => $dbh,
    table => employee,
    proper_fields => [ qw ( name fname ) ],
    linked_fields => [ qw ( department category office ) ],
    linked_tables => [ qw ( department category office ) ],
    linked_values => [ qw ( name       name     phone  ) ],
    linked_refs   => [ qw ( id         id       ide    ) ],
    aliases       => [ qw ( name fname department category phone )],
    primary_key   => id,
    cgi           => $q
});
 print
    $q->start_html(
                   -title => "Test DBIx::Browse::CGI"
                   );
 $dbb->list_form({
    field_order  => [  1,  0,  4,  3,  2 ],
    field_length => [ 14, 15, 15, 15, 10 ]
 });



...etc

DESCRIPTION

The purpose of DBIx::Browse::CGI is to handle the browsing of relational tables with a human-like interface via Web.

DBIx::Browse::CGI transparently translates SELECTs, UPDATEs, DELETEs and INSERTs from the desired human view to the values needed for the table. This is the case when you have related tables (1 to n) where the detail table has a reference (FOREIGN KEY) to a generic table (i.e. Customers and Bills) with some index (tipically an integer).

METHODS

All the methods inherited from its parent class (DBIX::Browse(3)) plus the following:
<B>newB> Creates a new DBIx::Browse::CGI object. The parameters are passed through a hash with the following added keys with respect to <B>DBIx::Browse::newB>:
cgi A CGI object that will be used for Web interaction. If it is not defined a new CGI object will be created.
max_rows The maximum number of rows to be displayed per Web page (default: 10).
max_flength The maximum field length to be displayed (also the default for unknown field lengths).
row_order The order to be used to order rows (e.g. ’NAME ASC, DATE DESC’).
default_action The default action (web page) that will be displayed if not set by the calling program (currently List or Edit.
form_params A hash ref containing other form parameters that will appear as HIDDEN input fields.
styles An anonymous arrays of css styles (CLASS) that will be applied to succesive rows of output.
no_print If set, the output methods (<B>list_formB>, <B>edit_formB>, and <B>browseB>) will not print directly. Instead, they will return a string containig the output (in fact they always do). Otherwise they will print directly to standard output (default: 0).
<B>list_formB> This method produces a CGI form suitable to explore the main table. It will list its rows in chunks of max_rows. It will present also the possibility to edit (see <B>edit_formB>) any row and to filter the rows to display.

It takes one optional parameter with a hash reference with the following keys:
field_names An array reference containing the field names to be displayed.
field_order An array reference with the desired order index in wich the fields will appear.
field_length An array reference with the desired field length.

<B>edit_formB> This method produces a CGI form suitable to browse the main table record by record. You can update, delete and insert new records.

It takes one optional parameter with a hash reference with the same structure than <B>list_formB>.

<B>browseB> This method will call <B>list_formB> or <B>edit_formB> as needed depending on the user input.

It takes one optional parameter with a hash reference with the same structure than <B>list_formB>.

AUTHOR

Evilio Jose\k:'del Rió Silva\k:'edelrio@icm.csic.es

SEE ALSO

perl(1), DBI(3), CGI(3), DBIx::Browse(3).

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 888: Non-ASCII character seen before =encoding in ’Jose\k:'Assuming ISO8859-1
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CGI (3) 2002-05-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.