Contents 
 Index 
 "Perl Program Reference" 
 < Previous 
 Next > 

voyant_mt_app.pl

Go to the documentation of this file.
00001 // This file has been modified on-the-fly with an input filter
00002 // to change it from Perl syntax to C++ strictly for the purposes
00003 // of faking out Doxygen. Modifications include:
00004 
00005 // - changing local() definitions to C++ #define statements.
00006 // - commenting out undef statements.
00007 // - changing $globe'... variable names to $globe_...
00008 // - changing sub statements to look like C++ functions.
00009 // - changing # comments to C++ comments.
00010 // - ...
00011 
00012 // If you see other strangeness in the HTML version of the Perl file,
00013 // it comes from getting it to look more C++ like.
00014 
00015 
00016 // #!/usr/#define/bin/perl
00017 //#############################################################################
00018 /** @file
00019  ** @brief Creates table of contents navigation to be displayed in the 
00020  ** navigation pane.
00021  ** 
00022  ** @param $globe::path is the directory_name or location to find the 
00023  ** tree script files. The name should be terminated with a slash (\). 
00024  ** Although the directory_name is the first command line parameter,
00025  ** the true input are the tree script files contained within that directory.
00026  ** Tree script files must begin with "tree_" and end with ".script". 
00027  **
00028  ** @param $globe::master_filename [optional path and] filename for the project file
00029  ** that contains the directory ordering and official titles.
00030  ** 
00031  ** @return m_tree_ files for each directory of the system. The files are
00032  ** named such that they are associated with their owning directory. 
00033  **
00034  ** Tree script files are another way of saying "Table of Contents" files.
00035  ** Tree files themselves are mini-TOC files that were generated by
00036  ** voyant_nav.pl or tree_js_2_script.pl.
00037  **
00038  ** This program reads in the project file (master_filename).
00039  ** Based on the directory names, it makes some assumptions about the names
00040  ** of the tree script files that it expects to see. It steps through all
00041  ** tree script files, reads them in, creates associated master tree script files,
00042  ** and then creates a master tree script file that nests the other tree
00043  ** script files in order.
00044  **
00045  ** If an expected tree script file is missing, an error message is output but
00046  ** a working master tree is still generated that ignores the missing mini-TOC.
00047  ** 
00048  ** @note When the original tree script files were created, they had no
00049  ** path information in the hyperlinks. This was to make them more general
00050  ** and more easy to use in other directory structures. The tree script
00051  ** files needed to stand on their own and be independent of any resulting
00052  ** directory structure where they might be shared.
00053  ** 
00054  ** Hence, this program must create master script files that include the expect 
00055  ** relative paths to the destination topics. The relative path information is
00056  ** again the directory names from the project file.
00057  **
00058  ** @lim The tree files (mini-TOC) that are used as input have unique
00059  ** naming requirements.<ul>
00060  ** <li>The mini-TOC files must begin with "tree_"</li>
00061  ** <li>The mini-TOC files must end with ".script".</li>
00062  ** <li>The mini-TOC files must contain the name of the directory they are associated
00063  ** with.</li>
00064  ** </ul>
00065  **
00066  ** Rather than passing in variables which can create copies in memory, many items
00067  ** use global variables that are defined in globe.pm. When a
00068  ** variable is known to be global, its name begins with "$globe::". The intent is
00069  ** to facilitate maintenance by having all user-defined tags in one place outside 
00070  ** of the program.
00071  **
00072  ** @ingroup tp_tools tp_toc
00073  **
00074  ** @author Glenn C. Maxey
00075  **/
00076 // #
00077 //#    $Id: voyant_mt_app.pl,v 1.6 2003/01/03 19:40:12 gmaxe Exp $
00078 //#
00079 //# 2002 Created by Voyant Technologies, Inc., Westminster, Colorado, USA.
00080 //#
00081 //# Permission to use, copy, modify, and distribute this software and its 
00082 //# documentation under the terms of the GNU General Public License is hereby 
00083 //# granted. No representations are made about the suitability of this software 
00084 //# for any purpose. It is provided "as is" without express or implied warranty. 
00085 //# See the GNU General Public License (http://www.gnu.org/copyleft/gpl.html) 
00086 //# for more details.
00087 //# 
00088 //# Documents produced by this script are derivative works derived from the 
00089 //# input used in their production; they are not affected by this license.
00090 //#
00091 //#    Revision Information:
00092 //#
00093 //#    $Log: voyant_mt_app.pl,v $
00094 //#    Revision 1.6  2003/01/03 19:40:12  gmaxe
00095 //#    More accurate comments.
00096 //#
00097 //#    Revision 1.5  2002/12/24 15:05:55  gmaxe
00098 //#    New name and tweaks to add full paths.
00099 //#
00100 //#    Revision 1.4  2002/11/20 15:23:07  gmaxe
00101 // //#    Added exit codes so that wrapper scripts can catch errors properly.
00102 //#
00103 //#    Revision 1.3  2002/04/06 01:55:16  gmaxe
00104 //#    New files and new general constructs for handling tags. Uses globals better.
00105 //#    The html_look* files are designed to handle spider tracing of html systems.
00106 //#
00107 //#    Revision 1.2  2002/03/04 22:21:55  gmaxe
00108 //#    Enhanced to handle nested script files.
00109 //#
00110 //#    Revision 1.1  2002/02/16 00:59:44  gmaxe
00111 //#    Added support for script files needed for TOC applet.
00112 //#
00113 //#    Revision 1.14  2002/02/12 01:50:29  gmaxe
00114 //#    Added support for more level chunking;
00115 //#    added files to support xhelp;
00116 //#    added file to support generating TOC, index from lists.
00117 //#    PTR#:
00118 //#
00119 //#    Revision 1.13  2002/01/16 19:49:10  gmaxe
00120 //#    Removed much of revision history in comments.
00121 //#
00122 //#    Revision 1.12  2002/01/11 21:53:54  gmaxe
00123 //#    Updated comments.
00124 //#
00125 //#############################################################################
00126 
00127 
00128 //#############################################################################
00129 /** @fn int BEGIN
00130  ** @brief Code to execute when first entered.
00131  **
00132  ** @param None. 
00133  **
00134  ** @return None.
00135  **
00136  ** @lim None
00137  ** @ingroup tp_nav
00138  **/
00139 // #############################################################################
00140 int BEGIN  ( ) {
00141 //    print "\n============  Starting voyant_mt_app.pl ==================================\n";
00142    $_file_list = "_file_list";
00143    $_arg_inc = 0;
00144 
00145    $no_scope_file = 0;
00146    $scope_pm = "globe.pm";  //  first time through; other scope stuff passed in.
00147    $in_file = "";
00148 
00149    push (@INC, `pwd`);
00150    push (@INC, '/rtfm/techpubs/perl');
00151    if (0){
00152 //       print (@INC, "\n");
00153    }
00154    // ####
00155    //  All global variables are defined in the following file
00156    // ####
00157    unless (open ( IN_LIST, $scope_pm)) {
00158       unless (open ( IN_LIST, "/rtfm/techpubs/perl/$scope_pm")) {
00159          push (@file_errors, "Cannot open file \"$scope_pm\" or \"/rtfm/techpubs/perl/$scope_pm\"\n");
00160          $no_scope_file++;
00161       }
00162    }
00163 //    close (IN_LIST);
00164    push (@INC, $scope_pm);
00165    push (@INC, "/rtfm/techpubs/perl/$scope_pm");
00166 
00167    if (!@file_errors) {
00168       // ####
00169       //  All global variables are defined in the following file
00170       // ####
00171       require $scope_pm;
00172    
00173       if (&globe::declare_variables()) {
00174 //          print "Variables initialized from $scope_pm.\n";
00175       } else {
00176          push (@file_errors, "Could not initialize variables from $scope_pm.\n");
00177       }
00178    } //  if not @file_errors
00179 
00180 
00181    if (@ARGV < 1) {
00182       push (@file_errors, "No path specified as first argument.\n");
00183    }
00184    
00185    //  Get path if there is one.
00186    if (@ARGV > $_arg_inc) {
00187       $globe::path = @ARGV[$_arg_inc];
00188       if ($globe::path =~ /\//) {
00189 //          print "The path specified is $globe::path\n";
00190       
00191          @path_chunks = split ( /\//, $globe::path);
00192          if (@path_chunks < 2) {
00193             $globe::rel_path_to_start_point = "./";
00194          } else {
00195             $globe::rel_path_to_start_point = "../";
00196          }
00197       } else {
00198          push (@file_errors, "The input argument \"$globe::path\" requires a forward slash (\/).\n");
00199       }
00200    } //  if 1 or more arguments
00201    $_arg_inc++;
00202    
00203    if (@ARGV > $_arg_inc) {
00204       $globe::master_filename = @ARGV[$_arg_inc];
00205 //       print "The master file is $globe::master_filename\n";
00206       unless (open ( IN_MASTER, $globe::master_filename)) {
00207          push (@file_errors, "Cannot open file \"$globe::master_filename\"\n");
00208       }
00209    } //  if 2 or more arguments
00210    $_arg_inc++;
00211 
00212    if (@ARGV > $_arg_inc) {
00213       //  This is optional; a default is set in globe.pm.
00214       $globe::script_prefix = @ARGV[$_arg_inc];
00215    } //  if 3 or more arguments
00216    $_arg_inc++;
00217 
00218    if (@ARGV > $_arg_inc) {
00219       //  This is optional; a default is set in globe.pm.
00220       $globe::script_master = @ARGV[$_arg_inc];
00221    } //  if 3 or more arguments
00222    $_arg_inc++;
00223    
00224 }
00225 
00226 //#############################################################################
00227 /** @fn int main
00228  ** @brief The main program.
00229  **
00230  ** @param None. 
00231  **
00232  ** @return None.
00233  **
00234  ** @lim None
00235  ** @ingroup tp_nav
00236  **/
00237 // #############################################################################
00238 // sub main {
00239 {
00240    // #############################################################################
00241    // # Program start
00242    // #############################################################################
00243 
00244    if (@file_errors) {
00245       //  Makes no sense to go on if input parameters are off.
00246 //       print "\n============  Summary of errors ==================================\n";
00247       for ($i=0; $i<@file_errors; $i++){
00248 //          print "$i = $file_errors[$i]\n";
00249       }
00250       &using_voy_mt_app();
00251 //       exit(1);
00252    }
00253 
00254 
00255    //  Get the master definitions
00256    while (<IN_MASTER>){    //  entire master file into memory.
00257       $globe::master_nav .= $_;
00258    }
00259 //    close (IN_MASTER);
00260    
00261    &globe::get_master_nav_info();
00262    if (!exists ($globe::m_info{order})) {
00263       if (1) {
00264          push (@file_errors, "ERROR: The master file \"$globe::master_tree_file\" does not have the ordering.");
00265 //          print "Ordering begins with \"$globe::m_define{order}[0]\" \nand ends with \"$globe::m_define{order}[1]\"\n";
00266 //          print "Inbetween on a line by themselves is the directory doc_publish subdirectory name.\n";
00267       }
00268 //       exit(1);
00269    } else {
00270       if (0) {
00271 //          print "Got to here...\n$globe::m_info{order}\n======\n";
00272          for ($i = 0; $i <= $// {$globe::m_info{_array_order}}; $i++) {
00273             foreach $k (keys %{$globe::m_info{_array_order}[$i]}) {
00274 //                print "$i $k $globe::m_info{_array_order}[$i]{$k}\n";
00275             }
00276          }
00277 //          exit(1);
00278       }
00279    }
00280 
00281 
00282    $nested_scripts = 1;
00283    if ($nested_scripts) {
00284       //  new way; preferred way.
00285       if (&create_nested_tree_scripts() ) {
00286          push (@file_errors, "Did not create nessecary script files.\n");
00287       } else {
00288 //          print "Created nessecary script files.\n";
00289       }
00290    } else {
00291       //  old way
00292       &create_master_tree_script();
00293    }
00294    
00295 
00296    // #############################################################################
00297    // # End of most of work
00298    // #############################################################################
00299 //    exit(0);
00300 } //  end of main
00301 
00302 
00303 //#############################################################################
00304 /** @fn int create_nested_tree_scripts
00305  ** @brief Creates multiple script output files that represent the
00306  ** expanding/collapsing elements of the table of contents.
00307  **
00308  ** @param global_variables are used throughout.
00309  **
00310  ** @return A series of master tree (m_tree_...script) files that 
00311  ** make up the navigation.
00312  **
00313  ** This is the preferred way.
00314  **
00315  ** @lim None.
00316  **
00317  ** @ingroup tp_toc
00318  **/
00319 // #############################################################################
00320 int create_nested_tree_scripts  ( ) {
00321    #define $key  ""
00322    #define $out_file  ""
00323 
00324    #define $section
00325    #define $holder
00326 //    print "Entering create_master_tree_script...\n";
00327    
00328    #define $master_script  ""
00329    
00330 
00331 
00332    // ####
00333    //  Go through all items in the master order.
00334    //  We are only worrying about the things I know about
00335    // ####
00336    TOORDER: for ($i=0; $i <= $// {$globe::m_info{_array_order}}; $i++){
00337       next TOORDER if ($globe::m_info{_array_order}[$i]{dir} !~ /^[\s]*[\w]/); //  if empty don't do.
00338 
00339       $book_or_cref = "$globe::m_info{_array_order}[$i]{dir}";
00340 
00341       if (0) {
00342 //          print "ggg $book_or_cref\n";
00343       }
00344       $book_or_cref = "$globe::script_prefix$book_or_cref.script";
00345       
00346       if (open ( OUT_MNAV, "$globe::path$book_or_cref")) {
00347 //          close (OUT_MNAV);
00348          $holder = &creating_master_book_toc("$globe::path$book_or_cref", $globe::m_info{_array_order}[$i]{dir});
00349          $book_or_cref = "$globe::script_master_prefix$book_or_cref";
00350          if (open ( OUT_MNAV, ">$globe::path$book_or_cref")) {
00351 //             print (OUT_MNAV "$holder");
00352 //             close (OUT_MNAV);
00353             $section .= "Item level=1 ";
00354 //             $section .= "image=$globe::nav_folderclosed ";
00355             $section .= "selected=YES ";
00356             $section .= "subscript=$book_or_cref ";
00357             $section .= "text=$globe::m_info{_array_order}[$i]{title}\r\n";
00358          } else {
00359             push (@file_errors, "Cannot open file \"$globe::path$book_or_cref\"");
00360          }
00361       } else {
00362          push (@file_errors, "Cannot open file \"$globe::path$book_or_cref\"");
00363       }
00364       
00365       if (0) {
00366 //          print "ggg $book_or_cref\n";
00367       }
00368    } //  for each file in the order
00369 
00370    $out_file = "m_tree.script";
00371    
00372    if (open ( OUT_MNAV, ">$globe::path$out_file")) {
00373 //       print (OUT_MNAV "$section");
00374 //       close (OUT_MNAV);
00375       return (0);
00376    } else {
00377       push (@file_errors, "Cannot open file \"$globe::path$out_file\"");
00378       return (1);
00379    }
00380 
00381 } //  create_nested_tree_scripts
00382 
00383 
00384 //#############################################################################
00385 /** @fn int creating_master_book_toc
00386  ** @brief Reads in the tree file associated with the master order of a book 
00387  ** and updates path information appropriate for plug-in to a big system.
00388  **
00389  ** @param temp defines the file name of the original tree file.
00390  ** @param up_path is the updated path to place on URL references.
00391  **
00392  ** @retval temp_file_buf is a fully formatted and tagged section that can be
00393  ** placed directly into a master script file.
00394  **
00395  ** @lim None
00396  **
00397  ** @ingroup tp_toc
00398  **/
00399 // #############################################################################
00400 int creating_master_book_toc  ( ) {
00401    $temp = $_[0];
00402    $up_path = $_[1];
00403    
00404 //    //  $temp = sprintf ("%s%s", $globe::script_master_prefix, $temp);
00405    unless (open ( IN_HTREE, "$temp")) {
00406       push (@file_errors, "Cannot open file \"$temp\"");
00407       return ("ERROR");
00408    }
00409 
00410    #define $temp_file_buf  ""
00411    while (<IN_HTREE>){
00412       $temp_file_buf .= $_;
00413 //       //  print "incoming = $_";
00414    }
00415 //    close (IN_HTREE);
00416 
00417    //  Fix up the url paths.
00418    $temp_file_buf =~ s/url\=/url\=$up_path\//g;
00419    
00420    return ($temp_file_buf);
00421 } //  creating_master_book_toc
00422 
00423 
00424 
00425 
00426 //#############################################################################
00427 /** @fn int create_master_tree_script
00428  ** @brief Creates a single script output files that represents the
00429  ** expanding/collapsing elements of the table of contents.
00430  **
00431  ** @param global_variables are used throughout.
00432  **
00433  ** @return A single master tree (m_tree.script) file that 
00434  ** makes up the navigation.
00435  **
00436  ** This is the old method that is no longer preferred, because both
00437  ** book and cref directories will now have unique tree files. It is
00438  ** better to do a nested design.
00439  ** 
00440  ** This creates two types of mini-TOC's. <ol>
00441  ** <li>When it is known that one of them
00442  ** is a book (e.g., from FrameMaker) and had a tree.html file generated
00443  ** by voyant_nav.pl, then it uses that mini-TOC here.</li>
00444  ** <li>When it is something else like a code reference item, it generates
00445  ** a rigid 8 item mini-TOC. It assumes that this piece is for a code
00446  ** reference item and that it is plugging into Doxygen output where
00447  ** certain files are given from the start.</li></ol>
00448  **
00449  ** @lim This assumes either that a mini-TOC is available that can be
00450  ** massaged and plugged in, or that the desired piece is a code reference
00451  ** section which plugs into Doxygen.
00452  **
00453  ** The main cue is having "book" in the directory name.
00454  **
00455  ** @ingroup tp_toc
00456  **/
00457 // #############################################################################
00458 int create_master_tree_script  ( ) {
00459    #define $key  ""
00460    #define $out_file  ""
00461    #define $section
00462 //    print "Entering create_master_tree_script...\n";
00463    
00464    #define $master_script  ""
00465    
00466 
00467 
00468    // ####
00469    //  Go through all items in the master order.
00470    //  We are only worrying about the things I know about
00471    // ####
00472    TOORDER: for ($i=0; $i <= $// {$globe::m_info{_array_order}}; $i++){
00473       next TOORDER if ($globe::m_info{_array_order}[$i]{dir} !~ /^[\s]*[\w]/); //  if empty don't do.
00474 
00475       $book_or_cref = "$globe::m_info{_array_order}[$i]{dir}";
00476 //       //  print "Input to use is $book_or_cref\n";
00477 
00478       $section = "";
00479       
00480      TIORDER: for ($j=0; $j <= $// {$globe::m_info{_array_order}}; $j++){
00481          //  if it is empty, don't put an entry in.
00482          next TIORDER if ($globe::m_info{_array_order}[$j]{dir} !~ /^[\s]*[\w]/);
00483          if ($i == $j) {
00484             if ($book_or_cref =~ /book/i) {
00485                 &creating_book_toc();
00486             } else {    //  if ($book_or_cref !~ /book/i)
00487                //  Create a real stupid second pane navigation
00488 //                $section .= "Item level=1 image=nav_folderclosed.gif selected=YES text=$globe::m_info{_array_order}[$j]{title}\r\n";
00489                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/main.html,basefrm selected=YES text=Main Page\r\n";
00490                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/modules.html,basefrm selected=YES text=Groups\r\n";
00491                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/globals.html,basefrm selected=YES text=Globals [C++, IVE] (Functions, Enum, Struct, Class, Define, etc.)\r\n";
00492                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/annotated.html,basefrm selected=YES text=Classes (annotated)\r\n";
00493                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/classes.html,basefrm selected=YES text=Classes (listed)\r\n";
00494                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/hierarchy.html,basefrm selected=YES text=Class Hierarchy\r\n";
00495                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/functions.html,basefrm selected=YES text=Class Member Functions\r\n";
00496                $section .= "Item level=2 image=nav_doc.gif url=$globe::m_info{_array_order}[$j]{dir}/files.html,basefrm selected=YES text=Files in Project\r\n";
00497 
00498             } //  if ($book_or_cref =~ /book/i)
00499          } else {  //  if ($i != $j)
00500             //  Gets directory without path
00501             @chunk = split ( /\//, $globe::m_info{_array_order}[$j]{dir});
00502             $m_file = $chunk[@chunk-1];
00503             // undef (@chunk);
00504             $m_file =~ s/\.js/\.html/;
00505             //  Write out link to m_ html file
00506             if (0) {
00507                $section .= "Item level=1 image=nav_doc.gif url=m_tree_$m_file.html\// $j,basefrm selected=YES text=$globe::m_info{_array_order}[$j]{title}\r\n";
00508             }
00509          } //  if ($i == $j)
00510       } //  for $j
00511       if (($i =~ 3) && (0)) {
00512 //           print "Section $i:\n$section\n";
00513 //           exit(1);
00514       }
00515       //  swap out with the actual stuff
00516       $globe::master_tree_html = $section;
00517       $master_script .= $section;
00518       if (0) {
00519 //          print $globe::master_tree_html;
00520       }
00521 
00522       &script_output();
00523          
00524    } //  for each file in the order
00525 
00526 
00527    $out_file = "m_tree.script";
00528 
00529    unless (open ( OUT_MNAV, ">$globe::path$out_file")) {
00530 //       print "Cannot open file \"$globe::path$out_file\"\n";
00531 //       exit(1);
00532    }
00533 
00534 //    print (OUT_MNAV "$master_script");
00535 //    close (OUT_MNAV);
00536 
00537 
00538 } //  create_master_tree_script
00539 
00540 
00541 //#############################################################################
00542 /** @fn int creating_book_toc
00543  ** @brief Reads in the tree file associated with the master order of a book and
00544  ** creates the table of contents section for it.
00545  **
00546  ** @param Varables defines aboved.
00547  ** @param IN_HTREE files that were generated from the voyant_nav.pl
00548  ** program. Moreover, these are expected to begin with "tree_" and then
00549  ** contain the path of where they came from.
00550  **
00551  ** @retval $section is a fully formatted and tagged section that can be
00552  ** placed directly into a template.
00553  **
00554  ** This is the old way called by create_master_tree_script, which itself
00555  ** is no longer called.
00556  **
00557  ** This was originally part of the TIORDER loop above and still uses
00558  ** variables as if still above. It was broken out to provide more clarity
00559  ** particularly when adding collapsing/expanding chapters for a book.
00560  **
00561  ** @bug This uses not only globe variables, but also #define variables
00562  ** defined in create_master_tree_script.
00563  ** This expects the tree_...html files contain the path as part of the
00564  ** name.
00565  **
00566  ** @ingroup tp_toc
00567  **/
00568 // #############################################################################
00569 int creating_book_toc  ( ) {
00570 //    $temp = sprintf ("%stree_%s.script", $globe::path, $globe::m_info{_array_order}[$i]{dir});
00571    unless (open ( IN_HTREE, "$temp")) {
00572 //       print "Cannot open file \"$temp\"\n";
00573       next TIORDER;
00574    }
00575 //    //  print "Can open file \"$temp\"\n";
00576 
00577    #define $temp_file_buf  ""
00578    while (<IN_HTREE>){
00579       $temp_file_buf .= $_;
00580 //       //  print "incoming = $_";
00581    }
00582 //    close (IN_HTREE);
00583 
00584    //  Fix up the url paths.
00585    $temp_file_buf =~ s/url\=/url\=$globe::m_info{_array_order}[$i]{dir}\//g;
00586    
00587    //  @f_sect = split ( /url\=/i, $temp_file_buf);
00588    //  foreach $t_sect (@f_sect){
00589    //     $t_sect = "$globe::m_info{_array_order}[$i]{dir}/$t_sect";
00590    //  }
00591    //  $temp_file_buf = join ("url=", @f_sect);
00592    $section .= $temp_file_buf;
00593 
00594    // undef ($temp_file_buf);
00595 }
00596 
00597 
00598 //#############################################################################
00599 /** @fn int script_output
00600  ** @brief Breaks up the book tree files into even smaller chapter
00601  ** tree files.
00602  **
00603  ** @param global_variables
00604  **
00605  ** @return Returns a series of HTML files that represent the
00606  ** expanding/collapsing of chapters within a book.
00607  **
00608  ** This is the old way called by create_master_tree_script, which itself
00609  ** is no longer called.
00610  **
00611  ** It handles the naming and the writing of all tree 
00612  ** navigation files. It changes icons where appropriate.
00613  **
00614  ** The entire mini-TOC for the book was already available. This accomplishes
00615  ** the task of creating chapter chunks that expand/collapse by stripping
00616  ** all the topics from other chapters except the top level. The top level is
00617 //  ** left, but changes its icon to be a closed book and changes the hyperlink
00618  ** to point to the appropriate master tree file associated with that chapter.
00619  **
00620  ** @lim Upon entering, it is known that this is a book file. In fact,
00621  ** the entire mini-TOC for that book is already available.
00622  **
00623  ** @ingroup tp_toc
00624  **/
00625 // #############################################################################
00626 int script_output  ( ) {
00627    //  Test to see if it is a book file
00628    $out_file = "m_tree_$globe::m_info{_array_order}[$i]{dir}.script";
00629 
00630    unless (open ( OUT_MNAV, ">$globe::path$out_file")) {
00631 //       print "Cannot open file \"$globe::path$out_file\"\n";
00632 //       exit(1);
00633    }
00634 
00635 //    print (OUT_MNAV "$globe::master_tree_html");
00636 //    close (OUT_MNAV);
00637 } //  script_output
00638 
00639 
00640 
00641 //#############################################################################
00642 /** @fn int using_voy_mt_app
00643  ** @brief What to do when no arguments are given.
00644  ** @param None
00645  ** @return None
00646  ** 
00647  ** @lim None
00648  ** @ingroup tp_toc
00649  **/
00650 // #############################################################################
00651 int using_voy_mt_app  ( ) {
00652 //    print "\nvoyant_mt_app.pl creates content navigation to be displayed in the navigation \n";
00653 //    print "pane. It assumes that all tree files have been copied into the \n";
00654 //    print "input directory and are named uniquely. The tree files\n";
00655 //    print "were generated by voyant_nav.pl or tree_js_2_script.pl.\n";
00656 //    print "The tree files are mini-TOC files.\n";
00657 //    print "\n-- All tree files must begin with \"tree_\" and have .script extensions.\n";
00658 //    print "-- All files must reside in the input directory.\n\n";
00659 //    print "-- The first argument is the directory for tree files including the forward slash (\/).\n";
00660 //    print "   If no path is specified as the first argument, \".\/\" is used.\n";
00661 //    print "-- The second argument is the master file to use for the navigation.\n";
00662 //    print "   It must have sections for voyant_order.\n";
00663 //    print "\nThe output are files begin with \"m_tree_\".\n";
00664 //    print "The m_tree.script output is displayed in a toc frame while the content it controls\ndisplays in the basefrm.\n";
00665 //    print "\nTerminating voyant_mt_app.pl without doing anything.\n";
00666    return;
00667 }
00668 
00669 
00670 
00671 //#############################################################################
00672 /** @fn int END
00673  ** @brief Code to execute when first entered.
00674  **
00675  ** @param None. 
00676  **
00677  ** @return None.
00678  **
00679  ** @lim None
00680  ** @ingroup tp_nav
00681  **/
00682 // #############################################################################
00683 int END  ( ) {
00684    // undef ($_file_list);     //  "_file_list";
00685    // undef ($_index_file); //  = "_index_list";
00686    // undef ($in_file);     //  "";
00687 
00688    
00689    // #############################################################################
00690    // # Memory clean-up.
00691    // #############################################################################
00692    if ($no_scope_file > 0){
00693       &globe::memory_clean_up();
00694    }
00695 
00696    if (@file_errors) {
00697 //       print "\n============  Summary of errors ==================================\n";
00698       for ($i=0; $i<@file_errors; $i++){
00699 //          print "$i = $file_errors[$i]\n";
00700       }
00701    }
00702 
00703 //    print "\n============  Finished voyant_mt_app.pl ==================================\n";
00704 } //  END
00705 
00706 
00707 
00708 
00709 


 "Perl Program Reference" 
 < Previous 
 Next > 


Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003

TP Tools v2-00-0a

# tpt-perl-hcr-02