4
4
<Description >
5
5
Cache UML Explorer vX.X.X/*build.replace:pkg.version*/
6
6
Class contains methods that return structured classes/packages data.</Description >
7
- <TimeChanged >63706,86042.410811 </TimeChanged >
7
+ <TimeChanged >63808,84964.699928 </TimeChanged >
8
8
<TimeCreated >63653,67019.989197</TimeCreated >
9
9
10
10
<Method name =" getAllNamespacesList" >
@@ -78,7 +78,7 @@ Returns structured class tree with all classes available in current namespace</D
78
78
]]> </Implementation >
79
79
</Method >
80
80
81
- <Method name =" setClassData " >
81
+ <Method name =" fillClassData " >
82
82
<Description >
83
83
Return structured data about class.</Description >
84
84
<ClassMethod >1</ClassMethod >
@@ -93,7 +93,8 @@ Return structured data about class.</Description>
93
93
do oData.classes.%DispatchSetProperty(classDefinition.Name, oClass) // prevent from recursive setup
94
94
set package = $LISTTOSTRING($LIST($LISTFROMSTRING(classDefinition.Name, "."), 1, *-1),".")
95
95
set oProperties = ##class(%ZEN.proxyObject).%New()
96
- set oClass.super = classDefinition.Super
96
+
97
+ set oClass.super = ..correctInheritance(oData, classDefinition, package)
97
98
set oClass.NAMESPACE = $NAMESPACE
98
99
set oClass.SYSTEM = classDefinition.System
99
100
set oClass.PROCEDUREBLOCK = classDefinition.ProcedureBlock
@@ -114,9 +115,17 @@ Return structured data about class.</Description>
114
115
do oProperties.%DispatchSetProperty(p.Name, oProp)
115
116
set oProp.private = p.Private
116
117
set oProp.readOnly = p.ReadOnly
117
- set oProp.type = p.Type
118
- do ..collectAggregation(oData, classDefinition, p.Type, p.Private)
119
- do ..collectAggregation(oData, classDefinition, package _ "." _ p.Type, p.Private)
118
+ set oProp.cardinality = p.Cardinality
119
+ set oProp.inverse = p.Inverse
120
+ if (..classExists(package _ "." _ p.Type)) {
121
+ set oProp.type = package _ "." _ p.Type
122
+ do ..fillClassData(oData, package _ "." _ p.Type)
123
+ } elseif (..classExists(..extendClassFromType(p.Type))) {
124
+ set oProp.type = ..extendClassFromType(p.Type)
125
+ do ..fillClassData(oData, ..extendClassFromType(p.Type))
126
+ } else {
127
+ set oProp.type = p.Type
128
+ }
120
129
}
121
130
122
131
set oMethods = ##class(%ZEN.proxyObject).%New()
@@ -151,7 +160,7 @@ Return structured data about class.</Description>
151
160
do oParameters.%DispatchSetProperty(p.Name, oPar)
152
161
}
153
162
154
- do ..collectInheritance(oData, classDefinition, package )
163
+ do ..collectInheritance(oData, oClass.super )
155
164
156
165
quit oClass
157
166
]]> </Implementation >
@@ -201,67 +210,56 @@ Wrap registered types to class names</Description>
201
210
<Private >1</Private >
202
211
<ReturnType >%String</ReturnType >
203
212
<Implementation ><![CDATA[
204
- return typeName
205
- /*$CASE(typeName ,
213
+ return $CASE( typeName,
214
+ "%Boolean": "%Library.Boolean" ,
206
215
"%String": "%Library.String",
207
216
"%Integer": "%Library.Integer",
208
217
"%DataType": "%Library.DataType",
209
218
"%Status": "%Library.Status",
210
219
"%CacheString": "%Library.CacheString",
211
220
"%Persistent": "%Library.Persistent",
212
- :typeName)*/
221
+ :typeName)
213
222
]]> </Implementation >
214
223
</Method >
215
224
216
- <Method name =" collectInheritance " >
225
+ <Method name =" correctInheritance " >
217
226
<Description >
218
- Fill inheritance data </Description >
227
+ Return extended inheritance names </Description >
219
228
<ClassMethod >1</ClassMethod >
220
229
<FormalSpec >oData:%ZEN.proxyObject,baseClassDefinition:%Dictionary.ClassDefinition,basePack:%String</FormalSpec >
221
230
<Private >1</Private >
222
- <ReturnType >%Status </ReturnType >
231
+ <ReturnType >%String </ReturnType >
223
232
<Implementation ><![CDATA[
224
233
set superParts = $LISTFROMSTRING(baseClassDefinition.Super, ",")
225
- set oInherit = ##class(%ZEN.proxyObject).%New()
226
- do oData.inheritance.%DispatchSetProperty(baseClassDefinition.Name, oInherit)
227
234
for i=1:1:$LISTLENGTH(superParts) {
228
- set className = ..extendClassFromType( $LISTGET(superParts, i) )
235
+ set className = $LISTGET(superParts, i)
229
236
230
237
// try to find class with base package, if not successfull - try to add class as it is
231
238
if (..classExists(basePack_"."_className)) {
232
239
set clsName = basePack_"."_className
233
240
} else {
234
- set clsName = className
241
+ set clsName = ..extendClassFromType( className)
235
242
}
236
243
237
- do oInherit.%DispatchSetProperty(clsName, 1)
238
- do ..setClassData(oData, clsName)
244
+ set $LIST(superParts, i) = clsName
239
245
}
240
- quit $$$OK
246
+ quit $LISTTOSTRING(superParts)
241
247
]]> </Implementation >
242
248
</Method >
243
249
244
- <Method name =" collectAggregation " >
250
+ <Method name =" collectInheritance " >
245
251
<Description >
246
- Fill aggregation/composition data</Description >
252
+ Fill inheritance data
253
+ Returns new (correct) super</Description >
247
254
<ClassMethod >1</ClassMethod >
248
- <FormalSpec >oData:%ZEN.proxyObject,classDef:%Dictionary.ClassDefinition,aggClassName:%String,private :%String</FormalSpec >
255
+ <FormalSpec >oData:%ZEN.proxyObject,super :%String</FormalSpec >
249
256
<Private >1</Private >
250
257
<ReturnType >%Status</ReturnType >
251
258
<Implementation ><![CDATA[
252
- set aggClassDef = ##class(%Dictionary.ClassDefinition).%OpenId(aggClassName)
253
- if (aggClassDef '= "") {
254
- if (private) { set t = "composition" } else { set t = "aggregation" }
255
- set oAgg = oData.%DispatchGetProperty(t).%DispatchGetProperty(classDef.Name)
256
- if (oAgg = "") {
257
- set oAgg = ##class(%ZEN.proxyObject).%New()
258
- do oData.%DispatchGetProperty(t).%DispatchSetProperty(classDef.Name, oAgg)
259
- }
260
- } else { quit $$$OK }
261
-
262
- do oAgg.%DispatchSetProperty(aggClassName, "1..1")
263
- do ..setClassData(oData, aggClassName)
264
-
259
+ set superParts = $LISTFROMSTRING(super, ",")
260
+ for i=1:1:$LISTLENGTH(superParts) {
261
+ do ..fillClassData(oData, $LISTGET(superParts, i))
262
+ }
265
263
quit $$$OK
266
264
]]> </Implementation >
267
265
</Method >
@@ -278,9 +276,6 @@ Setup basic output data object</Description>
278
276
set oData.basePackageName = packageName
279
277
set oData.restrictPackage = 1 // expand classes only in base package
280
278
set oData.classes = ##class(%ZEN.proxyObject).%New()
281
- set oData.inheritance = ##class(%ZEN.proxyObject).%New()
282
- set oData.aggregation = ##class(%ZEN.proxyObject).%New()
283
- set oData.composition = ##class(%ZEN.proxyObject).%New()
284
279
quit oData
285
280
]]> </Implementation >
286
281
</Method >
@@ -305,7 +300,7 @@ Returns structured class data</Description>
305
300
zn:$GET(namespace)'="" namespace
306
301
set package = $LISTTOSTRING($LIST($LISTFROMSTRING(className, "."), 1, *-1), ".")
307
302
set oData = ..getBaseOData(package)
308
- do ..setClassData (oData, className)
303
+ do ..fillClassData (oData, className)
309
304
quit oData
310
305
]]> </Implementation >
311
306
</Method >
@@ -327,7 +322,7 @@ Returns structured package data</Description>
327
322
set className = classes.Data("Name")
328
323
set packageName = $LISTTOSTRING($LIST($LISTFROMSTRING(className, "."), 1, listLen), ".")
329
324
if (packageName = rootPackageName) {
330
- do ..setClassData (oData, className)
325
+ do ..fillClassData (oData, className)
331
326
}
332
327
}
333
328
0 commit comments