home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
groups.tcl
< prev
next >
Wrap
Text File
|
1997-01-09
|
4KB
|
142 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1995
#
# File: @(#)groups.tcl /main/titanic/1
# Author: Harm Leijendeckers
# Description: Report on group versions
# Usage in: SystemVersion
#
#---------------------------------------------------------------------------
# SccsId = @(#)groups.tcl /main/titanic/1 9 Jan 1997 Copyright 1995 Cadre Technologies Inc.
Class ReportGroups : {ReportBase} {
constructor
method systemReport
method explicitFiles
method explicitSubgroups
method filtersAndSelectors
}
constructor ReportGroups {class this} {
set this [ReportBase::constructor $class $this]
$this reportName "Contents of Group Versions"
return $this
}
method ReportGroups::systemReport {this} {
set allGroupVersions [[$this systemV] groupVersions]
if [lempty $allGroupVersions] { return 0 }
set report [$this report]
$report header {
[$this report] print Group 20
[$this report] print Status 8
[$this report] print Link 8
[$this report] print "Explicit Files" 24
[$this report] print "Explicit Subs" 20
[$this report] print "Filters / Selectors" line
[$this report] line
}
foreach groupV [osort group.name $allGroupVersions] {
$report print [[$groupV group] name].[$groupV versionName] 19
$report space
$report print [$groupV status] 7
$report space
set link [[$this systemV] findGroupVersionLink -byVersion $groupV]
if { ![$link isNil] } {
$report print [$link status] 7
$report space
} else {
$report space 8
}
$report print [$this explicitFiles $groupV] 24
$report print [$this explicitSubgroups $groupV] 20
$report print [$this filtersAndSelectors $groupV] 51 line
$report line
}
$report page
$report remove header
return 0
}
method ReportGroups::explicitFiles {this groupV} {
set files [osort type name [$groupV explicitFiles]]
set result ""
foreach file $files {
set name [string range [$file name].[$file type] 0 22]
set result [format "%s%-23s " $result $name]
}
return $result;
}
method ReportGroups::explicitSubgroups {this groupV} {
set subgroups [osort name [$groupV explicitSubgroups]]
set result ""
foreach subgroup $subgroups {
set name [string range [$subgroup name] 0 18]
set result [format "%s%-19s " $result $name]
}
return $result;
}
method ReportGroups::filtersAndSelectors {this groupV} {
set filters [osort filterType [$groupV filters]]
set fileSelectors [osort itemType [$groupV fileSelectors]]
set itemSelectors [osort itemType fileType [$groupV itemSelectors]]
set result ""
foreach filter [osort filterType $filters] {
set str [list [$filter namePattern] [$filter typePattern] \
[$filter propName] [$filter propPattern]]
add result "F [string range [$filter filterType] 0 3]" $str
}
foreach sel [osort itemType $fileSelectors] {
set str [list [$sel itemType] [$sel decompFlags] [$sel fileTypes]]
regsub -all decompFiles $str file str
regsub -all decompParents $str parent str
regsub -all decompComponents $str comp str
regsub -all decompLeafs $str leaf str
add result "S file" $str
}
foreach sel [osort itemType fileType $itemSelectors] {
set str [list [$sel fileType] [$sel itemType] [$sel qualified]]
add result "S item" $str
}
return $result;
}
proc add { result str1 str2 } {
upvar 1 $result res
while { [string length $str2] > 44 } {
set head [string range $str2 0 43]
set str2 [string range $str2 44 end]
set res [format "%s%-6s %-44s" $res $str1 $head]
set str1 " "
}
set res [format "%s%-6s %-44s" $res $str1 $str2]
}
# ----------------------------------------------------------------------
#
set executeMe [ReportGroups new]