[ W3C Internal Library Code / W3CDBIInterface / W3CAclInterface / W3CRegistration / ShowForm / W3CDebugCGI / ShowSource ]
Last updated: $Date: 1998/06/03 22:08:07 $ by $Author: eric $


W3CDBIInterface: work with W3C SQL Databases.

source
Uses: DBI

This library is used by W3CAclInterface and W3CRegistration. It is not designed to, but may be, used by perl applications directly.


W3CAclInterface: work with W3C ACL Databases.

source
Uses: W3CDBIInterface

Provides tools to manipulate tables in the W3C ACL Datase. This abstracts the interface to the tables and provides methods to compile the userAcls and ipAcls.


W3CRegistration: edit conference registration tables.

source
Uses: W3CDBIInterface

Works with the W3C Administration database.


ShowForm: display forms and form-tables.

source

Reads forms and create tables to handle their input. Edits these forms. Presents forms and stores user input in tables.


W3CDebugCGI: debugging CGI scripts.

source
Uses: CGI

Some simple macros to make it easier to debug cgi scritps that use the CPAN CGI module. Simply use this on in place of CGI. There are extra parameters to control it's behavior:

new W3CDebugCGI(<script path and name> <restore last call parameters> <state path> <dieNoOpen>

example use

# --- DEBUGGING MODE ---
use CGI::Carp qw(fatalsToBrowser);
use W3CDebugCGI;
$query = new W3CDebugCGI($0, $ARGV[0] eq 'DEBUG');
# ---- RELEASE MODE ----
#use CGI;
#$query = new CGI;
Then you call perldb with a 'DEBUG' argument and you get all the state from the last call to the script.

persistance

The state gets stored in /tmp/<script name minus .pl>.out. I usually just save it the the current directory by passing and extra parameter for directory location:
$query = new W3CDebugCGI($0, $ARGV[0] eq 'DEBUG', '', 1);
Since the script runs as nobody, you will probably need to create the file for it if it's in a dir that's not world-writable:
touch <script name minus .pl>.out
chmod o+w <script name minus .pl>.out
If the script does not have access to write to the directory, it will either die or fail silently depending on the value of dieNoOpen. If you pass a 0 or no argument for this, check the date on the .out file.


ShowSource: display source code for scripts and modules.

source

Display source for scripts and referenced modules. It also provides a modicum of links between the moduels.

    use ShowSource;
    my @sources = ('chacl-front.pl', 'chacl-back.pl', 'W3CAclInterface.pm', 'W3CDBIInterface.pm', 'ShowSource.pm');
    my %paths = ('chacl-front.pl' => 'chacl-front', 
		 'chacl-back.pl' => 'chacl-back', 
		 'W3CAclInterface.pm' => 'W3CAclInterface', 
		 'W3CDBIInterface.pm' => 'W3CDBIInterface',
		 'ShowSource.pm' => 'ShowSource');
#    $myself = $query->self_url;

    #####
    # Start the page
    print $query->header;
    print $query->start_html(-title=>'ACL Editor Sources', -BGCOLOR=>"#FFFFFF", -TEXT=>"#000000", -LINK=>"#0000ee", -VLINK=>"#551a8b");
    print <<EOF;
<h1>ACL Editor Sources</h1>
    <p>
    <a href='#chacl-front'>chacl-front</a> presents the the current 
    ACLs for a resource and creates forms to manipulate them. 
    <a href='#chacl-back'>chacl-back</a> handles 
    the output from the forms. Both are layered on top of 
    <a href='#W3CAclInterface'>W3CAclInterface.pm</a> and 
    <a href='#W3CDBIInterface'>W3CDBIInterface.pm</a>.
    <p>
    <brought to you by <a href='#ShowSource'>ShowSource.pm</a>>.
EOF
    ;

    #####
    # Print source
    $ShowSource = ShowSource->new(\@sources, \%paths, $query);
    $ShowSource->present;
    print $query->end_html;


Valid HTML 4.0! Eric Prud'hommeaux (but feel free to change it yourself!)
eric@w3.org
$Date: 1998/06/03 22:08:07 $