Tools

part of the ArsDigita Community System by Eve Andersson

The Big Idea

Tools are collections of scripts used by other scripts in the ACS to perform common tasks such as spell checking.

The Tools

  1. Spell Checker

    Files:

    webspell is a shell script wrapper to ispell, necessary because ispell requires the HOME environment variable to be set, and setting env(HOME) doesn't seem to work from AOLserver Tcl. It takes two arguments, a filename to be spell checked and a dictionary file of extra words, one word per line.

    The file ispell-words is such a dictionary file. The table ispell_words contains the same information as ispell-words, and is kept to make the editing of ispell-words easy. Any additions or deletions are made to the table, then the entire file is regenerated from the table.

    One table:

    create table ispell_words (
        ispell_word    varchar(100) primary key
    );
    
    To use:
    Say you have a form as follows, and you want the email_body to be spellchecked when the user pushes Submit:
    <form method=post action="email-send.tcl">
    
    <input type=text name="email_to" size=30>
    <input type=text name="email_subject" size=40>
    <textarea name="email_body" rows=10 cols=50></textarea>
    <input type=submit value="Send">
    
    </form>
    
    
    Change the action to /tools/spell.tcl and specify the var_to_spellcheck and target_url as follows:
    <form method=post action="/tools/spell.tcl">
    
    <input type=hidden name="var_to_spellcheck" value="email_body">
    <input type=hidden name="target_url" value="/fullpath/email-send.tcl">
    
    <input type=text name="email_to" size=30>
    <input type=text name="email_subject" size=40>
    <textarea name="email_body" rows=10 cols=50></textarea>
    <input type=submit value="Send">
    
    </form>
    
    
    The user will have the chance to correct any misspellings and then they'll be redirected, with all form variables intact, to the target_url.
    Make sure that all scripts are executable and that the UNIX utility ispell is in /usr/local/bin/. Also, the file ispell-words should contain the same words as the table ispell_words (it's fine if they both start out empty).

    The lovely spell checker was written by Jin Choi (jsc@arsdigita.com) with some finishing touches by Eve Andersson (eveander@arsdigita.com).


eveander@arsdigita.com