GNU Info

Info Node: (slib.info)HTML Tables

(slib.info)HTML Tables


Next: HTTP and CGI Prev: HTML Up: Textual Conversion Packages
Enter node , (file) or (file)node

HTML Tables
===========

  `(require 'db->html)'

 - Function: html:table options row ...

 - Function: html:caption caption align
 - Function: html:caption caption
     ALIGN can be `top' or `bottom'.

 - Function: html:heading columns
     Outputs a heading row for the currently-started table.

 - Function: html:href-heading columns uris
     Outputs a heading row with column-names COLUMNS linked to URIs
     URIS.

 - Function: html:linked-row-converter k foreigns
     The positive integer K is the primary-key-limit (number of
     primary-keys) of the table.  FOREIGNS is a list of the filenames of
     foreign-key field pages and #f for non foreign-key fields.

     `html:linked-row-converter' returns a procedure taking a row for
     its single argument.  This returned procedure returns the html
     string for that table row.

 - Function: table-name->filename table-name
     Returns the symbol TABLE-NAME converted to a filename.

 - Function: table->linked-html caption db table-name match-key1 ...
     Returns HTML string for DB table TABLE-NAME.  Every foreign-key
     value is linked to the page (of the table) defining that key.

     The optional MATCH-KEY1 ... arguments restrict actions to a subset
     of the table.  Note: match-key.

 - Function: table->linked-page db table-name index-filename arg ...
     Returns a complete HTML page.  The string INDEX-FILENAME names the
     page which refers to this one.

     The optional ARGS ... arguments restrict actions to a subset of
     the table.  Note: match-key.

 - Function: catalog->html db caption arg ...
     Returns HTML string for the catalog table of DB.

HTML editing tables
-------------------

A client can modify one row of an editable table at a time.  For any
change submitted, these routines check if that row has been modified
during the time the user has been editing the form.  If so, an error
page results.

The behavior of edited rows is:

   * If no fields are changed, then no change is made to the table.

   * If the primary keys equal null-keys (parameter defaults), and no
     other user has modified that row, then that row is deleted.

   * If only primary keys are changed, there are non-key fields, and no
     row with the new keys is in the table, then the old row is deleted
     and one with the new keys is inserted.

   * If only non-key fields are changed, and that row has not been
     modified by another user, then the row is changed to reflect the
     fields.

   * If both keys and non-key fields are changed, and no row with the
     new keys is in the table, then a row is created with the new keys
     and fields.

   * If fields are changed, all fields are primary keys, and no row with
     the new keys is in the table, then a row is created with the new
     keys.

After any change to the table, a `sync-database' of the database is
performed.

 - Function: command:modify-table table-name null-keys update delete
          retrieve
 - Function: command:modify-table table-name null-keys update delete
 - Function: command:modify-table table-name null-keys update
 - Function: command:modify-table table-name null-keys
     Returns procedure (of DB) which returns procedure to modify row of
     TABLE-NAME.  NULL-KEYS is the list of "null" keys which indicate
     that the row is to be deleted.  Optional arguments UPDATE, DELETE,
     and RETRIEVE default to the `row:update', `row:delete', and
     `row:retrieve' of TABLE-NAME in DB.

 - Function: command:make-editable-table rdb table-name arg ...
     Given TABLE-NAME in RDB, creates parameter and `*command*' tables
     for editing one row of TABLE-NAME at a time.
     `command:make-editable-table' returns a procedure taking a row
     argument which returns the HTML string for editing that row.

     Optional ARGS are expressions (lists) added to the call to
     `command:modify-table'.

     The domain name of a column determines the expected arity of the
     data stored in that column.  Domain names ending in:

    `*'
          have arity `nary';

    `+'
          have arity `nary1'.

 - Function: html:editable-row-converter k names edit-point
          edit-converter
     The positive integer K is the primary-key-limit (number of
     primary-keys) of the table.  NAMES is a list of the field-names.
     EDIT-POINT is the list of primary-keys denoting the row to edit
     (or #f).  EDIT-CONVERTER is the procedure called with K, NAMES,
     and the row to edit.

     `html:editable-row-converter' returns a procedure taking a row for
     its single argument.  This returned procedure returns the html
     string for that table row.

     Each HTML table constructed using `html:editable-row-converter'
     has first K fields (typically the primary key fields) of each row
     linked to a text encoding of these fields (the result of calling
     `row->anchor').  The page so referenced typically allows the user
     to edit fields of that row.

HTML databases
--------------

 - Function: db->html-files db dir index-filename caption
     DB must be a relational database.  DIR must be #f or a non-empty
     string naming an existing sub-directory of the current directory.

     `db->html-files' creates an html page for each table in the
     database DB in the sub-directory named DIR, or the current
     directory if DIR is #f.  The top level page with the catalog of
     tables (captioned CAPTION) is written to a file named
     INDEX-FILENAME.

 - Function: db->html-directory db dir index-filename
 - Function: db->html-directory db dir
     DB must be a relational database.  DIR must be a non-empty string
     naming an existing sub-directory of the current directory or one
     to be created.  The optional string INDEX-FILENAME names the
     filename of the top page, which defaults to `index.html'.

     `db->html-directory' creates sub-directory DIR if neccessary, and
     calls `(db->html-files DB DIR INDEX-FILENAME DIR)'.  The `file:'
     URI of INDEX-FILENAME is returned.

 - Function: db->netscape db dir index-filename
 - Function: db->netscape db dir
     `db->netscape' is just like `db->html-directory', but calls
     `browse-url-netscape' with the uri for the top page after the
     pages are created.


automatically generated by info2www version 1.2.2.9