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

  1. #---------------------------------------------------------------------------
  2. #
  3. #    (c) Cadre Technologies Inc. 1995
  4. #
  5. #    File:        @(#)files.tcl    /main/hindenburg/1
  6. #    Author:        Harm Leijendeckers
  7. #    Description:    Report on file versions
  8. #    Usage in:    SystemVersion and higher
  9. #
  10. #---------------------------------------------------------------------------
  11. # SccsId = @(#)files.tcl    /main/hindenburg/1    11 Mar 1997    Copyright 1995 Cadre Technologies Inc.
  12.  
  13.  
  14. Class ReportFiles : {ReportBase} {
  15.     constructor
  16.     method systemReport
  17.     method doNameAndType
  18. }
  19.  
  20.  
  21. constructor ReportFiles {class this} {
  22.     set this [ReportBase::constructor $class $this]
  23.     $this reportName Files
  24.     return $this
  25. }
  26.  
  27.  
  28. method ReportFiles::systemReport {this} {
  29.     set allFileVersions  [query "file.type != cdm" \
  30.                 [[$this systemV] localFileVersions]]
  31.     set allExternalLinks [[$this systemV] externalLinks]
  32.     if { ![llength $allFileVersions] && ![llength $allExternalLinks] } {
  33.     return 0
  34.     }
  35.  
  36.     set report [$this report]
  37.  
  38.     $report header {
  39.     [$this report] print File 31
  40.     [$this report] print Type 11
  41.     [$this report] print Version 26
  42.     [$this report] print Status 11
  43.     [$this report] print Corporate 10
  44.     [$this report] print Link line
  45.     [$this report] line
  46.     }
  47.  
  48.     foreach fileV [osort file.name file.type $allFileVersions] {
  49.     $this doNameAndType [[$fileV file] name] [[$fileV file] type]
  50.     $report print [$fileV versionName] 25
  51.     $report space
  52.     $report print [$fileV status] 10
  53.     $report space
  54.     $report print \
  55.         [expr { [$fileV inCorporate] ? "yes" : "no" } ] 10 center
  56.     set link [[$this systemV] findFileVersionLink -byFileVersion $fileV]
  57.     if ![$link isNil] {
  58.         $report print [$link status] 30
  59.     }
  60.     $report line
  61.     }
  62.  
  63.     if [llength $allExternalLinks] {
  64.     if [llength $allFileVersions] { $report line }
  65.  
  66.     foreach externalLink [osort type name $allExternalLinks] {
  67.         $this doNameAndType [$externalLink name] [$externalLink type]
  68.         $report print [$externalLink path] line
  69.     }
  70.     }
  71.  
  72.     $report page
  73.     $report remove header
  74.  
  75.     return 0
  76. }
  77.  
  78.  
  79. method ReportFiles::doNameAndType {this name type} {
  80.     set report [$this report]
  81.     $report print $name 30
  82.     $report space
  83.     $report print $type 10
  84.     $report space
  85. }
  86.  
  87.  
  88. set executeMe [ReportFiles new]
  89.