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 >63690,48954.853237 </TimeChanged >
7
+ <TimeChanged >63697,66596.619226 </TimeChanged >
8
8
<TimeCreated >63653,67019.989197</TimeCreated >
9
9
10
+ <Method name =" getAllNamespacesList" >
11
+ <Description >
12
+ Return list with all namespaces</Description >
13
+ <ClassMethod >1</ClassMethod >
14
+ <ReturnType >%ZEN.proxyObject</ReturnType >
15
+ <Implementation ><![CDATA[
16
+ set resp = ##class(%ZEN.proxyObject).%New()
17
+ set resp.namespaces = ##class(%ZEN.proxyObject).%New()
18
+ set resp.currentNamespace = $NAMESPACE
19
+ set result = ##class(%ResultSet).%New("%SYS.Namespace:List")
20
+ do result.Execute()
21
+ while (result.Next()) {
22
+ set ns = ##class(%ZEN.proxyObject).%New()
23
+ set ns.remote = result.Get("Remote")
24
+ set ns.status = result.Get("Status")
25
+ do resp.namespaces.%DispatchSetProperty(result.Get("Nsp"), ns)
26
+ }
27
+ return resp
28
+ ]]> </Implementation >
29
+ </Method >
30
+
10
31
<Method name =" getClassTree" >
11
32
<Description >
12
33
Returns structured class tree with all classes available in current namespace</Description >
13
34
<ClassMethod >1</ClassMethod >
35
+ <FormalSpec >namespace:%String</FormalSpec >
14
36
<ReturnType >%ZEN.proxyObject</ReturnType >
15
37
<Implementation ><![CDATA[
38
+ zn:$GET(namespace)'="" namespace
16
39
set resp = ##class(%ZEN.proxyObject).%New()
17
40
18
41
set classes = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
@@ -22,16 +45,23 @@ Returns structured class tree with all classes available in current namespace</D
22
45
set level = 1
23
46
do objects.SetAt(resp, level)
24
47
48
+
25
49
do classes.Execute()
26
50
while (classes.Next()) {
27
51
set name = classes.Data("Name")
52
+ if ($EXTRACT(name, 1, 1) = "%") && ($NAMESPACE '= "%SYS") { continue }
28
53
set parts = $LISTFROMSTRING(name, ".")
29
54
set i = 0
30
55
while (i < $LISTLENGTH(parts)) && ($LISTGET(lastParts, i + 1) = $LISTGET(parts, i + 1)) {
31
56
set i = i + 1
32
57
}
33
58
set level = i + 1
34
59
set resp = objects.GetAt(level)
60
+ if (resp="") {
61
+ set resp = ##class(%ZEN.proxyObject).%New()
62
+ do objects.GetAt(level - 1).%DispatchSetProperty($LISTGET(parts, level - 1), resp)
63
+ do objects.SetAt(resp, level)
64
+ }
35
65
while ($LISTLENGTH(parts) > level) {
36
66
set level = level + 1
37
67
set resp = ##class(%ZEN.proxyObject).%New()
@@ -130,9 +160,10 @@ Return structured data about class.</Description>
130
160
<Description >
131
161
Return method data.</Description >
132
162
<ClassMethod >1</ClassMethod >
133
- <FormalSpec >className:%String,methodName:%String</FormalSpec >
163
+ <FormalSpec >className:%String,methodName:%String,namespace:%String </FormalSpec >
134
164
<ReturnType >%ZEN.proxyObject</ReturnType >
135
165
<Implementation ><![CDATA[
166
+ zn:$GET(namespace)'="" namespace
136
167
set oMeth = ##class(%ZEN.proxyObject).%New()
137
168
set met = ##class(%Dictionary.MethodDefinition).%OpenId(className _ "||" _ methodName)
138
169
if (met = "") { set oMeth.error = 1 quit oMeth }
@@ -267,9 +298,10 @@ Returns if class with given name exists.</Description>
267
298
<Description >
268
299
Returns structured class data</Description >
269
300
<ClassMethod >1</ClassMethod >
270
- <FormalSpec >className:%String</FormalSpec >
301
+ <FormalSpec >className:%String,namespace:%String </FormalSpec >
271
302
<ReturnType >%ZEN.proxyObject</ReturnType >
272
303
<Implementation ><![CDATA[
304
+ zn:$GET(namespace)'="" namespace
273
305
set package = $LISTTOSTRING($LIST($LISTFROMSTRING(className, "."), 1, *-1), ".")
274
306
set oData = ..getBaseOData(package)
275
307
do ..setClassData(oData, className)
@@ -281,9 +313,10 @@ Returns structured class data</Description>
281
313
<Description >
282
314
Returns structured package data</Description >
283
315
<ClassMethod >1</ClassMethod >
284
- <FormalSpec >rootPackageName:%String</FormalSpec >
316
+ <FormalSpec >rootPackageName:%String,namespace:%String </FormalSpec >
285
317
<ReturnType >%ZEN.proxyObject</ReturnType >
286
318
<Implementation ><![CDATA[
319
+ zn:$GET(namespace)'="" namespace
287
320
set oData = ..getBaseOData(rootPackageName)
288
321
set classes = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
289
322
do classes.Execute()
@@ -303,69 +336,7 @@ Returns structured package data</Description>
303
336
</Class >
304
337
305
338
306
- <Class name =" UMLExplorer.WebAppInstaller" >
307
- <Super >%Projection.AbstractProjection</Super >
308
- <TimeChanged >63696,65168.289869</TimeChanged >
309
- <TimeCreated >63696,64041.85537</TimeCreated >
310
-
311
- <Projection name =" Reference" >
312
- <Type >WebAppInstaller</Type >
313
- </Projection >
314
-
315
- <Method name =" CreateProjection" >
316
- <Description >
317
- This method is invoked when a class is compiled.</Description >
318
- <ClassMethod >1</ClassMethod >
319
- <FormalSpec ><![CDATA[ cls:%String,¶ms]]> </FormalSpec >
320
- <ReturnType >%Status</ReturnType >
321
- <Implementation ><![CDATA[
322
- set ns = $NAMESPACE
323
- zn:ns'="%SYS" "%SYS"
324
- do ##class(Security.System).GetInstallationSecuritySetting(.security)
325
- if (security="None") {
326
- set cspProperties("AutheEnabled") = 64 // Unauthenticated
327
- } else {
328
- set cspProperties("AutheEnabled") = 32 // Password
329
- }
330
- set cspProperties("NameSpace") = ns
331
- set cspProperties("Description") = "A WEB application for Cache UML Explorer."
332
- set cspProperties("IsNameSpaceDefault") = 1
333
- set cspProperties("DispatchClass") = "UMLExplorer.Router"
334
- if ('##class(Security.Applications).Exists("/UMLExplorer")) {
335
- w !, "Creating WEB application ""/UMLExplorer""..."
336
- set tSC = ##class(Security.Applications).Create("/UMLExplorer", .cspProperties)
337
- if $$$ISERR(tSC) throw ##class(%Installer.Exception).CreateFromStatus(tSC)
338
- w !, "WEB application ""/UMLExplorer"" created."
339
- } else {
340
- w !, "WEB application ""/UMLExplorer"" already exists, so it is ready to use."
341
- }
342
- zn:ns'="%SYS" ns
343
- quit $$$OK
344
- ]]> </Implementation >
345
- </Method >
346
-
347
- <Method name =" RemoveProjection" >
348
- <Description >
349
- This method is invoked when a class is 'uncompiled'.</Description >
350
- <ClassMethod >1</ClassMethod >
351
- <FormalSpec ><![CDATA[ cls:%String,¶ms,recompile:%Boolean]]> </FormalSpec >
352
- <ReturnType >%Status</ReturnType >
353
- <Implementation ><![CDATA[
354
- set ns = $NAMESPACE
355
- zn:ns'="%SYS" "%SYS"
356
- if (##class(Security.Applications).Exists("/UMLExplorer")) {
357
- w !, "Deleting WEB application ""/UMLExplorer""..."
358
- do ##class(Security.Applications).Delete("/UMLExplorer")
359
- w !, "WEB application ""/UMLExplorer"" was successfully removed."
360
- }
361
- zn:ns'="%SYS" ns
362
- QUIT $$$OK
363
- ]]> </Implementation >
364
- </Method >
365
- </Class >
366
-
367
-
368
- <Project name =" UMLExplorer" LastModified =" 2015-05-24 18:07:22.008232" >
339
+ <Project name =" UMLExplorer" LastModified =" 2015-05-24 18:14:48.579613" >
369
340
<Items >
370
341
<ProjectItem name =" UMLExplorer.ClassView" type =" CLS" ></ProjectItem >
371
342
<ProjectItem name =" UMLExplorer.Router" type =" CLS" ></ProjectItem >
@@ -379,7 +350,7 @@ This method is invoked when a class is 'uncompiled'.</Description>
379
350
<Description >
380
351
REST interface for UMLExplorer</Description >
381
352
<Super >%CSP.REST</Super >
382
- <TimeChanged >63687,39024.811955 </TimeChanged >
353
+ <TimeChanged >63697,59148.775813 </TimeChanged >
383
354
<TimeCreated >63648,30450.187229</TimeCreated >
384
355
385
356
<XData name =" UrlMap" >
@@ -392,6 +363,7 @@ REST interface for UMLExplorer</Description>
392
363
<Route Url="/Test" Method="GET" Call="Test"/>
393
364
<Route Url="/GetClassTree" Method="GET" Call="GetClassTree"/>
394
365
<Route Url="/GetClassView" Method="GET" Call="GetClassView"/>
366
+ <Route Url="/GetAllNamespacesList" Method="GET" Call="GetAllNamespacesList"/>
395
367
<Route Url="/GetPackageView" Method="GET" Call="GetPackageView"/>
396
368
<Route Url="/GetMethod" Method="GET" Call="GetMethod"/>
397
369
</Routes>
@@ -404,7 +376,7 @@ Method returns whole class tree visible in the current namespace.</Description>
404
376
<ClassMethod >1</ClassMethod >
405
377
<ReturnType >%Status</ReturnType >
406
378
<Implementation ><![CDATA[
407
- do ##class(UMLExplorer.ClassView).getClassTree().%ToJSON(, "ou")
379
+ do ##class(UMLExplorer.ClassView).getClassTree(%request.Get("namespace") ).%ToJSON(, "ou")
408
380
return $$$OK
409
381
]]> </Implementation >
410
382
</Method >
@@ -416,7 +388,7 @@ Returns classTree by given class name</Description>
416
388
<ReturnType >%Status</ReturnType >
417
389
<Implementation ><![CDATA[
418
390
set className = %request.Get("name")
419
- set classData = ##class(UMLExplorer. ClassView).getClassView(className)
391
+ set classData = ##class(ClassView).getClassView(className, %request.Get("namespace") )
420
392
do classData.%ToJSON(, "ou")
421
393
return $$$OK
422
394
]]> </Implementation >
@@ -429,12 +401,23 @@ Returns all package class trees by given package name</Description>
429
401
<ReturnType >%Status</ReturnType >
430
402
<Implementation ><![CDATA[
431
403
set packageName = %request.Get("name")
432
- set classData = ##class(UMLExplorer. ClassView).getPackageView(packageName)
404
+ set classData = ##class(ClassView).getPackageView(packageName, %request.Get("namespace") )
433
405
do classData.%ToJSON(, "ou")
434
406
return $$$OK
435
407
]]> </Implementation >
436
408
</Method >
437
409
410
+ <Method name =" GetAllNamespacesList" >
411
+ <Description >
412
+ Return the list of all namespaces</Description >
413
+ <ClassMethod >1</ClassMethod >
414
+ <ReturnType >%Status</ReturnType >
415
+ <Implementation ><![CDATA[
416
+ do ##class(UMLExplorer.ClassView).getAllNamespacesList().%ToJSON(, "ou")
417
+ return $$$OK
418
+ ]]> </Implementation >
419
+ </Method >
420
+
438
421
<Method name =" GetMethod" >
439
422
<Description >
440
423
Returns method description and code</Description >
@@ -443,7 +426,7 @@ Returns method description and code</Description>
443
426
<Implementation ><![CDATA[
444
427
set className = %request.Get("className")
445
428
set methodName = %request.Get("methodName")
446
- set methodData = ##class(ClassView).getMethod(className, methodName)
429
+ set methodData = ##class(ClassView).getMethod(className, methodName, %request.Get("namespace") )
447
430
do methodData.%ToJSON(, "ou")
448
431
return $$$OK
449
432
]]> </Implementation >
@@ -530,4 +513,66 @@ Write the contents of xData tag</Description>
530
513
]]> </Data >
531
514
</XData >
532
515
</Class >
516
+
517
+
518
+ <Class name =" UMLExplorer.WebAppInstaller" >
519
+ <Super >%Projection.AbstractProjection</Super >
520
+ <TimeChanged >63696,65168.289869</TimeChanged >
521
+ <TimeCreated >63696,64041.85537</TimeCreated >
522
+
523
+ <Projection name =" Reference" >
524
+ <Type >WebAppInstaller</Type >
525
+ </Projection >
526
+
527
+ <Method name =" CreateProjection" >
528
+ <Description >
529
+ This method is invoked when a class is compiled.</Description >
530
+ <ClassMethod >1</ClassMethod >
531
+ <FormalSpec ><![CDATA[ cls:%String,¶ms]]> </FormalSpec >
532
+ <ReturnType >%Status</ReturnType >
533
+ <Implementation ><![CDATA[
534
+ set ns = $NAMESPACE
535
+ zn:ns'="%SYS" "%SYS"
536
+ do ##class(Security.System).GetInstallationSecuritySetting(.security)
537
+ if (security="None") {
538
+ set cspProperties("AutheEnabled") = 64 // Unauthenticated
539
+ } else {
540
+ set cspProperties("AutheEnabled") = 32 // Password
541
+ }
542
+ set cspProperties("NameSpace") = ns
543
+ set cspProperties("Description") = "A WEB application for Cache UML Explorer."
544
+ set cspProperties("IsNameSpaceDefault") = 1
545
+ set cspProperties("DispatchClass") = "UMLExplorer.Router"
546
+ if ('##class(Security.Applications).Exists("/UMLExplorer")) {
547
+ w !, "Creating WEB application ""/UMLExplorer""..."
548
+ set tSC = ##class(Security.Applications).Create("/UMLExplorer", .cspProperties)
549
+ if $$$ISERR(tSC) throw ##class(%Installer.Exception).CreateFromStatus(tSC)
550
+ w !, "WEB application ""/UMLExplorer"" created."
551
+ } else {
552
+ w !, "WEB application ""/UMLExplorer"" already exists, so it is ready to use."
553
+ }
554
+ zn:ns'="%SYS" ns
555
+ quit $$$OK
556
+ ]]> </Implementation >
557
+ </Method >
558
+
559
+ <Method name =" RemoveProjection" >
560
+ <Description >
561
+ This method is invoked when a class is 'uncompiled'.</Description >
562
+ <ClassMethod >1</ClassMethod >
563
+ <FormalSpec ><![CDATA[ cls:%String,¶ms,recompile:%Boolean]]> </FormalSpec >
564
+ <ReturnType >%Status</ReturnType >
565
+ <Implementation ><![CDATA[
566
+ set ns = $NAMESPACE
567
+ zn:ns'="%SYS" "%SYS"
568
+ if (##class(Security.Applications).Exists("/UMLExplorer")) {
569
+ w !, "Deleting WEB application ""/UMLExplorer""..."
570
+ do ##class(Security.Applications).Delete("/UMLExplorer")
571
+ w !, "WEB application ""/UMLExplorer"" was successfully removed."
572
+ }
573
+ zn:ns'="%SYS" ns
574
+ QUIT $$$OK
575
+ ]]> </Implementation >
576
+ </Method >
577
+ </Class >
533
578
</Export >
0 commit comments