Linux SoftwareProgrammingLibrariesDBIx::HTML::ClientDB 1.05

DBIx::HTML::ClientDB 1.05


DBIx::HTML::ClientDB is a Perl module to convert sql into a client-side db with keyed access. Synopsis use DBIx::HTML::
Developer:   Ron Savage
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   11K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


DBIx::HTML::ClientDB is a Perl module to convert sql into a client-side db with keyed access.

Synopsis

use DBIx::HTML::ClientDB;

my($object) = DBIx::HTML::ClientDB -> new
(
dbh => $dbh,
row_headings => 'Unit code,Unit code,Campus name,Unit name',
sql => 'select unit_code, unit_code, campus_name, unit_name ' .
'from unit, campus where unit_campus_id = campus_id ' .
'order by unit_code',
);

print $object -> javascript_for_client_db();
print $object -> table();
print $object -> javascript_for_client_init();

This module takes a db handle, an SQL statement and a specially-formatted row_headings parameter, and builds an array of rows as returned by the SQL.

Then you ask for that array in HTML, ie as a table.

After a call to the table() method, you can call the size() method if you need to check how many rows were returned by the SQL you used.

Neither the module CGI.pm, nor any of that kidney, are used by this module. We simply output pure HTML.

However, for simplicity, this document pretends you are using CGI.pm rather than an alternative. The sentences would become too convoluted otherwise.

The output table is formatted as N rows of 2 columns:

First column

The first column contains the row headings you supply in the 'row_headings' parameter. 'row_headings' is a comma-separated list of strings you want to appear in the first column of the table.

There must be one string in 'row_headings' for each column mentioned in the SQL.

Second column

The second column contains the 'current record' in the database.

Now for the rows:

First row

The first row contains the first prompt string in the first column.

The first row contains a HTML popup menu in the second column.

This menu is what you use to choose the 'current record' in the database.
Since two (2) SQL columns are used to build this menu, two (2) strings from the row_headings parameter are consumed building the first row. The first of these 2 strings appears in the first column, as explained above. The second of these 2 strings is, much to your amazement, discarded!

This way of doing things makes it easy for you to count row_heading strings and their corresponding SQL columns, and makes it easy for me to cross-check your ability to count to 2.

Other rows

Each other row contains a field in the 'current record'. The value in the first column comes from the row_headings parameter, and the value in the second column comes from the database.

The sum result is menu-driven access to the data returned by the SQL. All this is downloaded from your CGI script to the web client. Since changing the current menu item updates the other fields in this table using JavaScript, no message is sent to the web server, and hence you have maximum speed of access.

The whole point of the exercise is to give you simple code for simple access to simple data.

See examples/test-clientdb.cgi for an example which will make all this clear.

Requirements:
  • Perl
    tags the first  row headings  first column  unit code  second column  the row  the second  headings parameter  the current  first row  the sql  row contains  from the  

    Download DBIx::HTML::ClientDB 1.05


     http://ftp.casaafacerilor.ro/mirrors/CPAN/authors/id/R/RS/RSAVAGE/DBIx-HTML-ClientDB-1.05.tgz


    Authors software

    DBIx::HTML::ClientDB 1.05 (by Ron Savage)
    DBIx::HTML::ClientDB is a Perl module to convert sql into a client-side db with keyed access.

    Synopsis

    use DBIx::HTML::

    Data::Page::Viewport 1.02 (by Ron Savage)
    Data::Page::Viewport is a Perl module to scroll thru data a page, or just an item, at a time.

    Synopsis

    This is a complete, test

    CGI::Explorer 2.07 (by Ron Savage)
    CGI::Explorer is a class to manage displaying a hash tree of data, for use in CGI scripts.

    Synopsis

    Install /assets/css/explore

    Getopt::Simple 1.48 (by Ron Savage)
    Getopt::Simple is a Perl module that provides a simple wrapper around Getopt::Long.

    SYNOPSIS

    use Getopt::Simple;


    Similar software

    DBIx::HTML::ClientDB 1.05 (by Ron Savage)
    DBIx::HTML::ClientDB is a Perl module to convert sql into a client-side db with keyed access.

    Synopsis

    use DBIx::HTML::

    PHP Data Grid Class 1.0 Beta (by Stefan Gabos)
    PHP Data Grid Class can be used to display MySQL query results in HTML tables

    SQL::Statement::Embed 1.15 (by Jeff Zucker)
    SQL::Statement::Embed can embed a SQL engine in a DBD or module.

    SQL::Statement is designed to be easy to embed in other modules a

    HTML::TableExtract 2.07 (by Matthew P Sisk)
    HTML::TableExtract is a Perl module that simplifies the extraction of information from tables within HTML documents.

    Tables, no ma

    PHP SQLDiff 2.2 (by Terry Gliedt)
    PHP SQLDiff is a Web application that shows the difference between two SQL database tables.

    If you manage your database tables lik

    PDF::Table 0.91 (by Daemmon Hughes)
    PDF::Table is a utility class for building table layouts in a PDF::API2 object.

    SYNOPSIS

    use PDF::API2;
    use PDF::Table;

    PackRat 0.28 (by Stewart Allen)
    PackRat is a compact, minimalist personal information manager

    Simple C++ ODBC Database API 1.10 (by Eminence Technology Pty Ltd.)
    Simple C++ ODBC Database API is designed to encapsulate the ODBC API functionality in an object oriented manner.

    The API was creat

    DBIx::SQLCrosstab 1.17 (by Giuseppe Maxia)
    DBIx::SQLCrosstab Perl module creates a server-side cross tabulation from a database.

    SYNOPSIS

    use DBIx::SQLCrosstab;

    ListPatron 0.1.1 (by Ferry Boender)
    ListPatron is an (GTK) application for maintaining lists of information


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags