Content-type: text/html; charset=UTF-8
Hx:Init <schema_desc> Hx:DefinedEntryForm <schema_desc> <format> Hx:ColumnSpecs <schema_desc> <name> <exclude attrs> \ <not checked attrs> <num columns> Hx:SortSpecs <schema_desc> <name> <exclude attrs> \ <not checked attrs> <num specs> Hx:GetPostedData Hx:Search <schema_desc> <search list> Hx:FormatTable <table_desc> <rowtitles=1|0> <coltitles=1|0> Hx:PruneTable <table_desc> first last Hx:DefinedListing <schema_desc> <table_desc> format Hx:ParseError Hx:NoSearch Hx:NoMatches Hx:GenericSearchEngine schema_name webmaster hostname \ mypath dbdir \ ?rowincr maxrows title opening message signature procs? Hx:GenericSubmissionForm schema_name webmaster hostname \ mypath dbdir ?title opening message signature procs? ::qddb::hx::body_options
#!/usr/local/qddb/bin/qtclsh lappend auto_path $qddb_library/hx set dir "/var/www/cgi-bin/qddb" set mypath "/cgi-bin/qddb/search" set dbname MyLittleDatabase Hx:GenericSearchEngine $dbname joe@www.somewhere \ www.somewhere $mypath $dir
For data entry, the script is very similar to the script for searching:
#!/usr/local/qddb/bin/qtclsh lappend auto_path $qddb_library/hx set dir "/var/www/cgi-bin/qddb" set mypath "/cgi-bin/qddb/submit" set dbname MyLittleDatabase Hx:GenericSubmissionForm $dbname joe@www.somewhere \ www.somewhere $mypath $dir
{ {attribute label-width entry-type entry-width ?entry-height? ?values?} {<html> <br><br><p>Some stuff for the middle} {attribute label-width entry-type entry-width ?entry-height? ?values?} }where attribute is the attribute name (also used as the entry name), label-width is the width of the entry's label which comes from the verbosename schema option, entry-type is one of the supported HTML form entry types (also select-single or select-multiple), and entry-width/entry-height are the width and height options to the entry. Multiple sublists may be on a single line to denote that those entries should be on a single line in the form. The currently available entry types are text, radio, checkbox, and textarea. A special entry type label allows you to build a label for an attribute and place it anywhere you like. The values list element specifies a value for checkboxes, radiobuttons, select-single, and select-multiple entry-types. Another special entry type <html> is provided to denote that everything after <html> should be inserted verbatim in the form.
{ {name value} {name value} }
where name is either an attribute name or the name of a form entry that was manually introduced into the form.
Hx:Search does not attempt to verify whether the search criteria contains fields that were not supposed to be displayed. It is the programmer's responsibility to check for this situation if they so desire.
{ {attribute entry-type ?entry-width?} {<html> <br><br><p>Some stuff for the middle} {myattr label 0} {myattr textarea 0} }
schema_name - name of the relation (not a schema descriptor) webmaster - e-mail address of the webmaster hostname - web server's host name mypath - full path of the executing script dbdir - full path of the directory containing the Qddb relation "schema_name"
Optional arguments are as follows. Note that these arguments are optional from left to right, that is, if you specify title, you must also specify rowincr and maxrows. All these options default to the empty string.
rowincr - rows displayed on a page (default 10) maxrows - total rows to allow title - <title> parameter opening - Large opening statement message - Message under opening statement signature - A signature if necessary procs - A Tcl list of procedure names: {entryproc listingproc tableproc columnproc sortproc}
entryproc must be the name of a valid procedure of the following form (defaults to Hx:GenericEntryForm):
proc MyEntryProc {schema_desc} { # Some entry form goes here. Typically, # you want to call Hx:DefinedEntryForm # with special parameters. }
listingproc must be the name of a valid procedure of the following form (defaults to Hx:GenericListing):
proc MyListingProc {schema_desc table_desc} { # Some entry form goes here. Typically, # you want to call Hx:DefinedListing # with special parameters and/or manipulate # the table before passing it to Hx:DefinedListing }
tableproc must be the name of a valid procedure of the following form (defaults to Hx:FormatTable):
proc MyTableProc {table_desc} { # Some entry form goes here. Typically, # you want to call Hx:FormatTable # with special parameters and/or manipulate # the table before passing it to Hx:FormatTable. }
columnproc must be the name of a valid procedure of the following form (defaults to Hx:ColumnSpecs and requires the same arguments):
proc MyColumnSpecs {schema_desc varname exclude_attrs notchecked_attrs numcolumns} { # Some column specs go here. Typically, # you want to call Hx:ColumnSpecs # with special parameters or define your # own column specs as follows: append retval "<input type=hidden name=$name value=EntryNumber>" append retval "<input type=hidden name=$name value=Title>" append retval "<input type=hidden name=$name value=Size>" return $retval }
sortproc must be the name of a valid procedure of the following form (defaults to Hx:SortSpecs and requires the same arguments):
proc MySortSpecs {schema_desc varname exclude_attrs notchecked_attrs numcolumns} { # Some sorting specs go here. Typically, # you want to call Hx:SortSpecs # with special parameters or define your # own custom sorting specs as follows: append retval "<input type=hidden name=$name-1 value= append retval "<input type=hidden name=$name-2 value=Title>" append retval "<input type=hidden name=$name-3 value=EntryDate>" return $retval }
schema_name - name of the relation (not a schema descriptor) webmaster - e-mail address of the webmaster hostname - web server's host name mypath - full path of the executing script dbdir - full path of the directory containing the Qddb relation "schema_name"
Optional arguments are as follows. Note that these arguments are optional from left to right, that is, if you specify opening, you must also specify title. All these options default to the empty string.
title - <title> parameter opening - Large opening statement message - Message under opening statement signature - A signature if necessary procs - A Tcl list of procedure names: {entryproc checkproc}
entryproc is the same format as Hx:GenericSearchEngine and defaults to Hx:GenericEntryForm.
checkproc must be the name of a valid procedure of the following form:
proc MyTupleCheckProc {tuple_desc} { # Some checks for valid fields and such go # here. If something is amiss, output # an error to stdout, and exit }
<body>HTML tags. Provides a consistent look and feel for all Hx pages in an application.
A Guide to QDDB Eric H. Herrin II and Raphael A. Finkel Qddb User's Guide An ASCII Database for Fast Queries of Relatively Stable Data Eric H. Herrin II and Raphael A. Finkel Computing Systems, Volume 4 Number 2 University of California Press, Berkeley CA Schema and Tuple Trees: An Intuitive Structure for Representing Relational Data Eric H. Herrin, II and Raphael A. Finkel Computing Systems, Volume 9, Number 2 MIT Press, Cambridge MA TCL and the TK Toolkit John K. Ousterhout Addison-Wesley, 1994 ISBN 0-201-63337-X