home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / ilcatconge.tcl < prev    next >
Text File  |  1996-05-29  |  2KB  |  92 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)ilcatconge.tcl    1.2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)ilcatconge.tcl    1.2   23 Jun 1995 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "ilcongen.tcl"
  15.  
  16. Class IlCatConGen : {IlConGen} {
  17.     method destructor
  18.     constructor
  19.     method generate
  20.     method section
  21.     attribute _section
  22. }
  23.  
  24. method IlCatConGen::destructor {this} {
  25.     set ref [$this _section]
  26.     if {$ref != ""} {
  27.         $ref _contentsGenerator ""
  28.     }
  29.     # Start destructor user section
  30.     # End destructor user section
  31.     $this IlConGen::destructor
  32. }
  33.  
  34. constructor IlCatConGen {class this name section} {
  35.     set this [IlConGen::constructor $class $this $name $section]
  36.     $this _section $section
  37.     $section _contentsGenerator $this
  38.  
  39.     return $this
  40. }
  41.  
  42. method IlCatConGen::generate {this} {
  43.  
  44.     set catFid [$this openAsc]
  45.  
  46.     if {$catFid == ""} {
  47.         return
  48.     }
  49.  
  50.     # tocName used in template
  51.     set tocName ""
  52.     foreach section [[$this section] getTree] {
  53.         if {[$section docType] == "Toc"} {
  54.             set tocName [$section uiName]
  55.             break
  56.         }
  57.     }
  58.  
  59.     # departmentName used in template
  60.     set departmentName    "<Department Name>"
  61.  
  62.     set header [TextSection new]
  63.     set version [[[[$this section] document] editor] version]
  64.     expand_file $header [m4_path_name etc il${version}doc.asc]
  65.  
  66.     # The header is placed in the catalog.con template
  67.  
  68.     set contents [TextSection new]
  69.     expand_file $contents [m4_path_name etc il${version}catalog.asc]
  70.  
  71.     $contents write $catFid
  72.     close $catFid
  73. }
  74.  
  75. # Do not delete this line -- regeneration end marker
  76.  
  77. method IlCatConGen::section {this args} {
  78.     if {$args == ""} {
  79.         return [$this _section]
  80.     }
  81.     set ref [$this _section]
  82.     if {$ref != ""} {
  83.         $ref _contentsGenerator ""
  84.     }
  85.     set obj [lindex $args 0]
  86.     if {$obj != ""} {
  87.         $obj _contentsGenerator $this
  88.     }
  89.     $this _section $obj
  90. }
  91.  
  92.