Skip to content

Commit abd0d70

Browse files
fixed old and important bug that didn't show packages named same as classes
1 parent 20dcb66 commit abd0d70

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

cache/projectTemplate.xml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>
55
Cache UML Explorer vX.X.X/*build.replace:pkg.version*/
66
Class contains methods that return structured classes/packages data.</Description>
7-
<TimeChanged>63843,54972.140109</TimeChanged>
7+
<TimeChanged>63843,83200.096917</TimeChanged>
88
<TimeCreated>63653,67019.989197</TimeCreated>
99

1010
<Method name="getAllNamespacesList">
@@ -45,33 +45,34 @@ Returns structured class tree with all classes available in current namespace</D
4545
set level = 1
4646
do objects.SetAt(resp, level)
4747
48-
4948
do classes.Execute()
5049
while (classes.Next()) {
5150
set name = classes.Data("Name")
5251
if ($EXTRACT(name, 1, 1) = "%") && ($NAMESPACE '= "%SYS") { continue }
5352
set parts = $LISTFROMSTRING(name, ".")
54-
set i = 0
55-
while (i < $LISTLENGTH(parts)) && ($LISTGET(lastParts, i + 1) = $LISTGET(parts, i + 1)) {
56-
set i = i + 1
53+
set level = 1
54+
while ((level < $LISTLENGTH(parts)) && ($LISTGET(lastParts, level) = ("/"_$LISTGET(parts, level)))) {
55+
set level = level + 1
5756
}
58-
set level = i + 1
5957
set resp = objects.GetAt(level)
6058
if (resp="") {
6159
set resp = ##class(%ZEN.proxyObject).%New()
62-
do objects.GetAt(level - 1).%DispatchSetProperty($LISTGET(parts, level - 1), resp)
60+
do objects.GetAt(level - 1).%DispatchSetProperty("/" _ $LISTGET(parts, level - 1), resp)
6361
do objects.SetAt(resp, level)
6462
}
6563
while ($LISTLENGTH(parts) > level) {
6664
set level = level + 1
6765
set resp = ##class(%ZEN.proxyObject).%New()
68-
do objects.GetAt(level - 1).%DispatchSetProperty($LISTGET(parts, level - 1), resp)
66+
do objects.GetAt(level - 1).%DispatchSetProperty("/" _ $LISTGET(parts, level - 1), resp)
6967
do objects.SetAt(resp, level)
7068
}
7169
if ($LISTLENGTH(parts) = level) {
7270
do resp.%DispatchSetProperty($LISTGET(parts, level), classes.Data("Hidden"))
7371
}
7472
set lastParts = parts
73+
for i=1:1:$LISTLENGTH(lastParts)-1 {
74+
set $LIST(lastParts, i) = "/"_$LISTGET(lastParts, i)
75+
}
7576
}
7677
7778
quit objects.GetAt(1)
@@ -96,18 +97,25 @@ Return structured data about class.</Description>
9697
set oQueries = ##class(%ZEN.proxyObject).%New()
9798
set oIndices = ##class(%ZEN.proxyObject).%New()
9899
99-
set oClass.NAMESPACE = $NAMESPACE
100-
set oClass.SYSTEM = classDefinition.System
101-
set oClass.PROCEDUREBLOCK = classDefinition.ProcedureBlock
102-
set oClass.ABSTRACT = classDefinition.Abstract
103-
set oClass.FINAL = classDefinition.Final
104-
set oClass.HIDDEN = classDefinition.Hidden
105-
set oClass.classType = classDefinition.ClassType
106-
set oClass.serverOnly = classDefinition.ServerOnly // -
107100
set oClass.isDataType = classDefinition.ClientDataTypeIsDefined()
101+
set oClass.isOdbcType = classDefinition.OdbcTypeIsDefined()
102+
set oClass.isSoapBindingStyle = classDefinition.SoapBindingStyleIsDefined()
103+
set oClass.isSoapBodyUse = classDefinition.SoapBodyUseIsDefined()
104+
set oClass.isSqlCategory = classDefinition.SqlCategoryIsDefined()
105+
106+
set props = ##class(%Dictionary.ClassDefinition).%OpenId("%Dictionary.ClassDefinition")
107+
for j=1:1:props.Properties.Count() {
108+
set pname = props.Properties.GetAt(j).Name
109+
set:((pname '= "parent")
110+
&& ('props.Properties.GetAt(j).Private)
111+
&& ('$IsObject($PROPERTY(classDefinition, pname)))) $PROPERTY(oClass, pname) = $PROPERTY(classDefinition, pname)
112+
}
113+
if (oClass.TimeChanged) { set oClass.TimeChanged = $zdatetime(oClass.TimeChanged) }
114+
if (oClass.TimeCreated) { set oClass.TimeCreated = $zdatetime(oClass.TimeCreated) }
108115
116+
set oClass.Super = "" // do not quit with super at this moment
109117
if (oData.restrictPackage) && ('..inPackage(oData.basePackageName, package)) quit oClass
110-
set oClass.super = ..correctInheritance(oData, classDefinition, package)
118+
set oClass.Super = ..correctInheritance(oData, classDefinition, package) // now expand super names
111119
112120
set oClass.properties = oProperties
113121
set count = classDefinition.Properties.Count()
@@ -185,7 +193,7 @@ Return structured data about class.</Description>
185193
do oIndices.%DispatchSetProperty(ind.Name, oProp)
186194
}
187195
188-
do ..collectInheritance(oData, oClass.super)
196+
do ..collectInheritance(oData, oClass.Super)
189197
190198
quit oClass
191199
]]></Implementation>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "1.7.4",
3+
"version": "1.7.5",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/js/ClassTree.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,18 @@ ClassTree.prototype.updateTree = function (treeObject, doNotChangeRoot) {
186186

187187
};
188188

189+
var getRealName = function (modName) {
190+
modName = modName + "";
191+
return modName.slice((modName || "")[0] === "/" ? 1 : 0, modName.length);
192+
};
193+
189194
var build = function (rootElement, object, path, level) {
190195

191196
var i, element, rec,
192197
arr = [];
193198

194199
for (i in object) {
195-
arr.push({ name: i, val: object[i] });
200+
arr.push({ name: getRealName(i), val: object[i] });
196201
}
197202

198203
arr.sort(function (a, b) {
@@ -209,7 +214,7 @@ ClassTree.prototype.updateTree = function (treeObject, doNotChangeRoot) {
209214
path.join("."),
210215
level
211216
)) {
212-
build(rec, element.val, path.concat([element.name]), level + 1);
217+
build(rec, element.val, path.concat([getRealName(element.name)]), level + 1);
213218
}
214219
}
215220

0 commit comments

Comments
 (0)