home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1995
- #
- # File: %W%
- # Author: Harm Leijendeckers
- # Description: Report on Components and properties
- # Usage in: SystemVersion and FileVersion
- #
- #---------------------------------------------------------------------------
- # SccsId = %W% %G% Copyright 1996 Cadre Technologies Inc.
-
-
- Class ReportCompObject : {GCObject} {
- constructor
-
- attribute component
- attribute name
- }
-
-
- constructor ReportCompObject {class this component name} {
- set this [GCObject::constructor $class $this]
- $this component $component
- $this name $name
- return $this
- }
-
-
- Class ReportComponents : {ReportBase} {
- constructor
- method systemReport
- method fileReport
-
- method doReport
- method getName
- method doProperties
- }
-
-
- constructor ReportComponents {class this} {
- set this [ReportBase::constructor $class $this]
- $this reportName "Components and Properties"
- return $this
- }
-
-
- method ReportComponents::systemReport {this} {
- GCControl collectInterval 9999
- set components [query -s components "file.type != cdm" \
- [[$this systemV] localFileVersions]]
- return [$this doReport components 1]
- }
-
-
- method ReportComponents::fileReport {this} {
- set components [[$this fileV] components]
- return [$this doReport components 0]
- }
-
-
- method ReportComponents::doReport {this v_components onSystemLevel} {
- upvar $v_components components
- if [lempty $components] { return 0 }
-
- foreach comp $components {
- lappend compobjects [ReportCompObject new $comp [$this getName $comp]]
- }
-
- set report [$this report]
-
- $report header {
- [$this report] print Component 46
- [$this report] print Type 20
- if $onSystemLevel {
- [$this report] print Diagram
- }
- [$this report] line
- [$this report] line
- }
-
- foreach compobj [osort component.type name $compobjects] {
- set comp [$compobj component]
- $report print [$compobj name] 45
- $report space
- $report print [$comp type] 19
- if $onSystemLevel {
- $report space
- $report print [[$comp diagram] text]
- }
- $report line
-
- # print properties
- if [lempty $Options] {
- $this doProperties $comp.properties
- } else {
- $this doProperties [query "name in {$Options}" $comp.properties]
- }
-
- $report line
- }
-
- $report page
- $report remove header
-
- return 0
- }
-
-
- method ReportComponents::getName {this comp} {
- set queryConstraint "type in {name name_type}"
- case [$comp objType] in {
- { Node ConnectedNode }
- { return [query -s value $queryConstraint $comp.labels] }
-
- Connector
- {
- set from [query -s value $queryConstraint $comp.from.labels]
- set to [query -s value $queryConstraint $comp.to.labels ]
- return "($from - $to)"
- }
-
- { Segment Row Cell }
- {
- # should not occur
- return ""
- }
- }
- }
-
-
- method ReportComponents::doProperties {this properties} {
- if [lempty $properties] {
- return
- }
- set report [$this report]
- foreach prop [osort name $properties] {
- $report space 5
- $report print [$prop name]: 23
- $report space
- $report print [$prop value] 49 line
- }
- }
-
-
- set executeMe [ReportComponents new]
-