home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
items.tcl
< prev
next >
Wrap
Text File
|
1997-08-27
|
4KB
|
153 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1995
#
# File: @(#)items.tcl /main/titanic/4
# Author: Harm Leijendeckers
# Description: Report on WorkItems and properties
# Usage in: SystemVersion and FileVersion
#
#---------------------------------------------------------------------------
# SccsId = @(#)items.tcl /main/titanic/4 27 Aug 1997 Copyright 1995 Cadre Technologies Inc.
Class ReportItems : {ReportBase} {
constructor
attribute printProps
method systemReport
method fileReport
method doReport
method doName
method getDiagramWorkItems
}
constructor ReportItems {class this} {
set this [ReportBase::constructor $class $this]
if { [lsearch $Options "properties"] != -1 } {
$this printProps 1
} else {
$this printProps 0
}
$this reportName "Items"
return $this
}
method ReportItems::systemReport {this} {
$this doReport [[$this systemV] definedItems]
}
method ReportItems::fileReport {this} {
set fileV [$this fileV]
set configV [$this configV]
set allWorkItems [$fileV definedItems]
if [$fileV isA Diagram] {
set allWorkItems [flatten [concat $allWorkItems \
[$this getDiagramWorkItems $fileV $configV]]]
#[$fileV definedItemRefs $configV]]]
}
set sv [$this systemV]
foreach it [query "type == cl && item.qualifier == [ORB::nil]" \
$allWorkItems] {
set cdm [$sv findFileVersion -byNameAndType [$it name] cdm]
if ![$cdm isNil] {
set allWorkItems [concat $allWorkItems \
[$this getDiagramWorkItems $cdm $configV]]
}
}
$this doReport [flatten $allWorkItems]
}
method ReportItems::doReport {this allWorkItems} {
if [lempty $allWorkItems] { return 0 }
set allWorkItems $allWorkItems
set report [$this report]
$report header {
[$this report] print Name 34
[$this report] print Type 5
[$this report] print Status 10
[$this report] print Scope line
[$this report] line
}
# two seperate loops for speed optimalization
if [$this printProps] {
foreach wi [osort item.qualifiedName $allWorkItems] {
$this doName $wi
set propObj [$wi properties]
if ![$propObj isNil] {
$this showProperties $propObj
}
}
} else {
# elseif ![lempty $Options] to show no props with no options
foreach wi [osort item.qualifiedName $allWorkItems] {
$this doName $wi
set propObj [$wi properties]
if ![$propObj isNil] {
$this showProperties $propObj "$Options"
}
}
}
$report page
$report remove header
return 0
}
method ReportItems::doName {this wi} {
set item [$wi item]
set qual [$item qualifier]
set report [$this report]
$report print [$wi qualifiedName] 33
$report space
$report print [$wi type] 4 break
$report space
$report print [$wi status] 9
$report space
if [$qual isNil] {
regsub -all scope [$wi scope] "" scope
$report print $scope 8
}
$report line
}
method ReportItems::getDiagramWorkItems {this diagram configV} {
set result ""
set components [$diagram components]
set connectors [query "objType == Connector" $components]
set items [concat [[$diagram file] item] \
[query $components.labels.itemRefs.item]]
if {! [lempty $connectors]} {
set items [concat $items \
[query $connectors.segments.labels.itemRefs.item]]
}
foreach item $items {
set wi [$diagram findDeclaration $item $configV]
if ![$wi isNil] {
set result [concat $result $wi]
}
}
return [flatten $result]
}
set executeMe [ReportItems new]