Skip to Main Content
Practical Internet Groupware
book

Practical Internet Groupware

by Jon Udell
October 1999
Beginner content levelBeginner
521 pages
15h 28m
English
O'Reilly Media, Inc.
Content preview from Practical Internet Groupware

Previewing Docbase Records

In any system that transforms raw input into HTML pages, it’s crucial to show the user a preview of the page exactly as it will finally appear. Although each Docbase instance provides its own input-validation script, all instances share a common previewing service provided by Docbase::Input. Its _previewDoc( ) method interpolates user-supplied input into the docbase template, activates mailto: and http:// URLs found in the input, and then shows the user what the final docbase record will look like when actually stored and then rendered as an HTML page. Figure 6.3 shows what a preview looks like when the validation script found warnings but no errors.

Docbase record preview, with optional changes

Figure 6-3. Docbase record preview, with optional changes

The preview contains two versions of the record. One appears on the preview form. The other is encoded as a set of hidden variables within the form, ready to be passed along to the handler that will store them if the user presses the Submit button. As shown in Example 6.6, the _previewDoc( ) method wires the preview form to final-submit.pl, a standard component that’s used, unmodified, by every Docbase instance.

Example 6-6. The _previewDoc Method

sub _previewDoc { my ($self,$vars) = @_; my $app = $self->{app}; my $cgi_absolute = $self->{docbase_cgi_absolute}; my $cgi_relative = $self->{docbase_cgi_relative}; my $preview = ''; $preview .= "<form method=post ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Web Operations

Web Operations

John Allspaw, Jesse Robbins

Publisher Resources

ISBN: 1565925378Catalog PageErrata