Skip to content

Commit 1cc44b0

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents de11f23 + 6787ac9 commit 1cc44b0

9 files changed

+224
-29
lines changed

cache/projectTemplate.xml

+46-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>
55
Cache Class Explorer vX.X.X/*build.replace:pkg.version*/
66
Class 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>
320320
Setup 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>
398408
REST 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>
446486
Returns all package class trees by given package name</Description>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheClassExplorer",
3-
"version": "1.12.0",
3+
"version": "1.13.1",
44
"description": "Class Explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/css/extras.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
}
6464

6565
.icon {
66+
position: relative;
6667
display: inline-block;
6768
background-color: #333;
6869
border-radius: 12px;
6970
width: 24px;
7071
height: 24px;
71-
position: relative;
7272
cursor: pointer;
7373
-webkit-transition: all .2s ease;
7474
-moz-transition: all .2s ease;
@@ -80,6 +80,14 @@
8080
user-select: none;
8181
}
8282

83+
.icon img {
84+
position: absolute;
85+
width: 16px;
86+
height: 16px;
87+
left: 4px;
88+
top: 4px;
89+
}
90+
8391
.icon:hover {
8492
box-shadow: 0 0 5px 2px #ffcc1b;
8593
}

web/index.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@
6060
<div class="inlineSearchBlock" id="diagramSearchBlock">
6161
<input type="search" id="diagramSearch" placeholder="Search on diagram..."/>
6262
</div>
63-
<div id="button.diagramSearch" class="icon search"></div>
64-
<div id="button.zoomIn" class="icon plus"></div>
65-
<div id="button.zoomNormal" class="icon scaleNormal"></div>
66-
<div id="button.zoomOut" class="icon minus"></div>
63+
<div id="button.diagramSearch" class="icon search" title="Search"></div>
64+
<div id="button.zoomIn" class="icon plus" title="Zoom In"></div>
65+
<div id="button.zoomNormal" class="icon scaleNormal" title="Zoom Normal"></div>
66+
<div id="button.zoomOut" class="icon minus" title="Zoom Out"></div>
67+
<div id="button.saveView" class="icon pin" title="Keep Positions">
68+
<img id="saveViewIcon"/>
69+
</div>
6770
</div>
6871
<div id="classView">
6972
<div id="methodCodeView">

web/js/CacheClassExplorer.js

+13
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var CacheClassExplorer = function (treeViewContainer, classViewContainer) {
2222
showSettingsButton: id("button.showSettings"),
2323
helpButton: id("button.showHelp"),
2424
infoButton: id("button.showInfo"),
25+
saveViewButton: id("button.saveView"),
26+
saveViewIcon: id("saveViewIcon"),
2527
methodCodeView: id("methodCodeView"),
2628
closeMethodCodeView: id("closeMethodCodeView"),
2729
methodLabel: id("methodLabel"),
@@ -258,4 +260,15 @@ CacheClassExplorer.prototype.init = function () {
258260

259261
enableSVGDownload(this.classTree);
260262

263+
// default icon
264+
this.elements.saveViewIcon.src = lib.image.pin;
265+
this.elements.saveViewButton.addEventListener("click", function () {
266+
self.classView.switchViewSave();
267+
if (self.classView.viewSaving) {
268+
self.classView.saveView();
269+
} else {
270+
self.source.resetView( self.NAMESPACE + ":" + self.classView.CURRENT_RENDER_NAME );
271+
}
272+
});
273+
261274
};

0 commit comments

Comments
 (0)