Example 7.17 shows a script that uses the services of Docbase::Indexer to build both static and dynamic navigational controls for the ProductAnalysis docbase.
Example 7-17. A Docbase::Indexer Driver Script
#! perl -w use strict; my $app = "ProductAnalysis"; my @indexed_fields = ('company','product','analyst','duedate'), use Docbase::Docbase; my $db = Docbase::Docbase->new($app); use Docbase::Indexer; my $di = Docbase::Indexer->new($db,@indexed_fields); $di->buildIndexStructures; $di->buildTabbedIndexes; $di->buildSequenceStructures; $di->buildStaticControls; # optional, only for static version
You could arrange to run this script after each record is added to
the docbase. More likely, you’ll want to schedule it to run
periodically by using a crontab
entry on a
Unix-like system or an AT command on NT.