44<Description >
55Cache Class Explorer vX.X.X/*build.replace:pkg.version*/
66Class contains methods that return structured classes/packages data.</Description >
7- <TimeChanged >63919,67431.456639 </TimeChanged >
7+ <TimeChanged >63928,63957.580821 </TimeChanged >
88<TimeCreated >63653,67019.989197</TimeCreated >
99
1010<Method name =" getAllNamespacesList" >
@@ -193,7 +193,7 @@ Return structured data about class.</Description>
193193 set xd = classDefinition.XDatas.GetAt(i)
194194 for j=1:1:props.Properties.Count() {
195195 set pname = props.Properties.GetAt(j).Name
196- set:(pname '= "parent") $PROPERTY(oProp, pname) = $PROPERTY(xd, pname)
196+ set:(( pname '= "parent") && (pname '= "Object") ) $PROPERTY(oProp, pname) = $PROPERTY(xd, pname)
197197 }
198198 do oXDatas.%DispatchSetProperty(xd.Name, oProp)
199199 }
@@ -319,14 +319,22 @@ Returns new (correct) super</Description>
319319<Description >
320320Setup basic output data object</Description >
321321<ClassMethod >1</ClassMethod >
322- <FormalSpec >packageName:%String</FormalSpec >
322+ <FormalSpec >packageName:%String,baseNamespace:%String,savedName:%String </FormalSpec >
323323<Private >1</Private >
324324<ReturnType >%ZEN.proxyObject</ReturnType >
325325<Implementation ><![CDATA[
326326 set oData = ##class(%ZEN.proxyObject).%New()
327327 set oData.basePackageName = packageName
328328 set oData.restrictPackage = 1 // expand classes only in base package
329329 set oData.classes = ##class(%ZEN.proxyObject).%New()
330+
331+ set ns = $namespace
332+ zn baseNamespace
333+ if $get(^ClassExplorer("savedView", ns_":"_savedName)) '= "" {
334+ set oData.savedView = $get(^ClassExplorer("savedView", ns_":"_savedName))
335+ }
336+ zn ns
337+
330338 quit oData
331339]]> </Implementation >
332340</Method >
@@ -348,9 +356,10 @@ Returns structured class data</Description>
348356<FormalSpec >className:%String,namespace:%String</FormalSpec >
349357<ReturnType >%ZEN.proxyObject</ReturnType >
350358<Implementation ><![CDATA[
359+ set baseNamespace = $namespace
351360 zn:$GET(namespace)'="" namespace
352361 set package = $LISTTOSTRING($LIST($LISTFROMSTRING(className, "."), 1, *-1), ".")
353- set oData = ..getBaseOData(package)
362+ set oData = ..getBaseOData(package, baseNamespace, "CLASS:"_className )
354363 do ..fillClassData(oData, className)
355364 quit oData
356365]]> </Implementation >
@@ -363,8 +372,9 @@ Returns structured package data</Description>
363372<FormalSpec >rootPackageName:%String,namespace:%String</FormalSpec >
364373<ReturnType >%ZEN.proxyObject</ReturnType >
365374<Implementation ><![CDATA[
375+ set baseNamespace = $namespace
366376 zn:$GET(namespace)'="" namespace
367- set oData = ..getBaseOData(rootPackageName)
377+ set oData = ..getBaseOData(rootPackageName, baseNamespace, "PACKAGE:"_rootPackageName )
368378 set classes = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
369379 do classes.Execute()
370380 set listLen = $LISTLENGTH($LISTFROMSTRING(rootPackageName, ".")) // bottom level of package to extract
@@ -397,7 +407,7 @@ Returns structured package data</Description>
397407<Description >
398408REST interface for ClassExplorer</Description >
399409<Super >%CSP.REST</Super >
400- <TimeChanged >63697,73073.878177 </TimeChanged >
410+ <TimeChanged >63928,63486.89174 </TimeChanged >
401411<TimeCreated >63648,30450.187229</TimeCreated >
402412
403413<XData name =" UrlMap" >
@@ -413,6 +423,8 @@ REST interface for ClassExplorer</Description>
413423 <Route Url="/GetAllNamespacesList" Method="GET" Call="GetAllNamespacesList"/>
414424 <Route Url="/GetPackageView" Method="GET" Call="GetPackageView"/>
415425 <Route Url="/GetMethod" Method="GET" Call="GetMethod"/>
426+ <Route Url="/SaveView" Method="POST" Call="SaveView"/>
427+ <Route Url="/ResetView" Method="GET" Call="ResetView"/>
416428</Routes>
417429]]> </Data >
418430</XData >
@@ -441,6 +453,34 @@ Returns classTree by given class name</Description>
441453]]> </Implementation >
442454</Method >
443455
456+ <Method name =" SaveView" >
457+ <Description >
458+ Saves the view preferences</Description >
459+ <ClassMethod >1</ClassMethod >
460+ <ReturnType >%Status</ReturnType >
461+ <Implementation ><![CDATA[
462+ set name = %request.Get("name")
463+ set content = %request.Content.Read($$$MaxStringLength) // ~ 7mb
464+ set ^test = name
465+ set ^ClassExplorer("savedView", name) = content
466+ write "{""OK"":true}"
467+ return $$$OK
468+ ]]> </Implementation >
469+ </Method >
470+
471+ <Method name =" ResetView" >
472+ <Description >
473+ Saves the view preferences</Description >
474+ <ClassMethod >1</ClassMethod >
475+ <ReturnType >%Status</ReturnType >
476+ <Implementation ><![CDATA[
477+ set name = %request.Get("name")
478+ kill ^ClassExplorer("savedView", name)
479+ write "{""OK"":true}"
480+ return $$$OK
481+ ]]> </Implementation >
482+ </Method >
483+
444484<Method name =" GetPackageView" >
445485<Description >
446486Returns all package class trees by given package name</Description >
0 commit comments