O'Reilly logo

Practical Internet Groupware by Jon Udell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Docbase Form Generator

The form generator, formgen.pl, runs as a CGI script. It requires at least one argument, which tells the generator which instance of Docbase to use. For example, the CGI call:

/cgi-bin/Docbase/formgen.pl?app=ProductAnalysis

produces the form shown in Figure 6.1.

Default ProductAnalysis input form

Figure 6-1. Default ProductAnalysis input form

The assignment date, overridden by the |assigndate| marker, appears as static text. All other fields are open for input. However, this CGI call:

/cgi-bin/Docbase/formgen.pl?app=ProductAnalysis&duedate=1999-05-01&
  analyst=Jon%20Udell&company=Netscape&product=Collabra%20Server%204.0

produces the form shown in Figure 6.2.

Customized ProductAnalysis input form

Figure 6-2. Customized ProductAnalysis input form

Here, the generator, using the services of the Docbase::Input module, has overridden every replaceable marker with a computed or preassigned value. The analyst who completes this form needs to fill in only four of the fields: Title, Summary, Full Report, and Contact Info.

The form generator, formgen.pl, appears in Example 6.2. It’s brief, because most of the work is done by two modules: TinyCGI and Docbase::Input.

Example 6-2. The Docbase Form Generator

#!/usr/bin/perl -w use strict; use TinyCGI; # load basic CGI services my $tc = TinyCGI->new(); print $tc->printHeader(); my $vars = $tc->readParse(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required