Tree Decorator Tool | Download | Installation | Operation | Results

System View The purpose of TreeDec is to make it easier for the website developer to maintain a consistent set of navigation aids on the pages of the website. Instead of directly manipulating all of the pages, the necessary information about the site's hierarchical structure is collected into a single file, td-tree.dat, which TreeDec uses to decorate the entire website.

The question then becomes: how to generate this tree file? To the extent that the tree structure to be imposed on the website is designed by the website developer, it cannot be automatically derived from other sources. Part of the purpose of TreeDec is to allow the developer this freedom of design.

There are (at least) three ways to create the tree file:

  • Type in the information by hand.
  • Use a system command to generate a list of files to serve as a basis for further editing. For example, in Unix systems, a command such as:
       find . -name "*.*htm*" -print | cat > treedec/td-tree.dat
    
    will collect the names of all the HTML files within the subtree of the current directory.
  • Use the utilities described in the following scenario, and then edit the result.

TreeDec provides pre-processing utilities to automatically generate a first approximation of the tree file to serve as a basis for precise editing by the developer. This approximation is based on the following premises:

  • The static link structure of the website is used as the basis for the tree file.
  • The user identifies the file to be used as the root of the logical tree.
  • The tree is then constructed by performing a breadth-first expansion out from the root.
Take a look at the overall dataflow diagram to see how all the pieces fit together.
Typical Scenario The following steps are the simplest way to use the entire TreeDec system on a website. You may consult the detailed documentation of the individual components for more sophisticated usage:

  1. Figure out where your parent directory is. This directory subtree contains all the HTML files of your website to be affected by TreeDec. We'll call it "web-root" for this example. All the programs should be executed with this as the current directory.

  2. Create a new subdirectory called "treedec", to contain the work files needed by the TreeDec system. Perform following steps from within this directory.

  3. You will need a td-tree.dat file to tell TreeDec about the hierarchical structure of your website. Here is an example of a tree file. If you want to create this directly with a text editor, go ahead and then skip down to step #8: setting up the configuration file. If you want some automated help, see the next step.

  4. If not already there, cd into your web-root directory and execute linklint, like this:
       perl $WEBMET_TOOLS/resources/weblink/linklint \
               -xref -doc treedec /@
    
    which tells linklint to analyze cross-references, to write its files into the treedec directory, and to analyze all files in the current subtree. After execution, there should be an informative treedec/fileF.txt file (along with several other diagnostic files).

  5. Execute the convert-ll program, like this:
       perl $WEBMET_TOOLS/TreeDec/td-convert-ll.perl 
    
    This will read from and write to the treedec directory by default. After execution, there should be informative treedec/pages.dat and links.dat files.

  6. Execute the GenTree program, like this:
       perl $WEBMET_TOOLS/TreeDec/gentree.perl root=whatever.html
    
    This will read from and write to the treedec directory by default. The root parameter must indicate the HTML file to be used as the logical root of the tree. After execution, there should be an informative treedec/td-tree.dat file.

  7. You may want to edit and customize the treedec/td-tree.dat file.

  8. Using any text editor, set up your td-config.dat file in the treedec directory to tell TreeDec exactly what you want done. Here is an example of a configuration file. Note especially the rewrite_option which controls how files get written, renamed, saved, and deleted.

  9. Invoke TreeDec, like this:
       perl $WEBMET_TOOLS/TreeDec/treedec.perl
    
    This will read from and write to the treedec directory by default. Messages from the program should give you a good idea if TreeDec is working properly. If everything works, the HTML files of the website are now systematically decorated with pointers to nearby pages, as in this example.

  10. A very simple table of contents file, td-toc.html gets created in the web-root directory (not in the treedec subdirectory), and you may wish to edit it. Here is an unedited example.


Overview | Installation | Operation | Results | FAQ
Version 1.1
Page last modified: 15 May 2002
National Institute of Standards and Technology (NIST)