Skip to content

Commit a0f2de5

Browse files
committed
DisplayInfo for widgets and dashboards
1 parent cb6d3df commit a0f2de5

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

MDX2JSON/Dashboard.cls.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Converts %DeepSee.Dashboard.Definition widgets into %ZEN.proxyObject.</Descripti
9292
#Dim widget As %DeepSee.Dashboard.Widget
9393
set Widgetlist = ##class(%ZEN.proxyObject).%New()
9494
set Widgetlist.children = ##class(%ListOfObjects).%New()
95+
set Widgetlist.displayInfo = ..GetDashboardDisplayInfo(Dashboard)
9596
9697
set st = $$$OK
9798
try {
@@ -131,6 +132,7 @@ Converts relevant parts of %DeepSee.Dashboard.Widget object into %ZEN.proxyObjec
131132
set obj.dataSource = Widget.dataSource
132133
set obj.drillDownDataSource = Widget.drillDownDataSource
133134
set obj.cube = cube
135+
set obj.displayInfo = ..GetWidgetDisplayInfo(Widget)
134136
set obj.controls = ##class(%ListOfObjects).%New()
135137
136138
for i=1:1:Widget.controls.Count()
@@ -270,6 +272,44 @@ Returns list of %ZEN.proxyObject:<br/>]]></Description>
270272
]]></Implementation>
271273
</Method>
272274

275+
<Method name="GetDashboardDisplayInfo">
276+
<Description>
277+
Converts %DeepSee.Dashboard.Definition display information into %ZEN.proxyObject.</Description>
278+
<ClassMethod>1</ClassMethod>
279+
<FormalSpec>Dashboard:%DeepSee.Dashboard.Definition</FormalSpec>
280+
<ReturnType>%ZEN.proxyObject</ReturnType>
281+
<Implementation><![CDATA[
282+
set DisplayInfo = ##class(%ZEN.proxyObject).%New()
283+
set DisplayInfo.snapToGrid = Dashboard.snapTo // Dashboard is in "snap to grid" mode.
284+
set DisplayInfo.gridMode = Dashboard.snapGrid // Dashboard uses the new snapGrid layout mode.
285+
set DisplayInfo.gridRows = Dashboard.gridRows
286+
set DisplayInfo.gridCols = Dashboard.gridCols
287+
return DisplayInfo
288+
]]></Implementation>
289+
</Method>
290+
291+
<Method name="GetWidgetDisplayInfo">
292+
<Description>
293+
Converts %DeepSee.Dashboard.Widget display information into %ZEN.proxyObject.</Description>
294+
<ClassMethod>1</ClassMethod>
295+
<FormalSpec>Widget:%DeepSee.Dashboard.Widget</FormalSpec>
296+
<ReturnType>%ZEN.proxyObject</ReturnType>
297+
<Implementation><![CDATA[
298+
set DisplayInfo = ##class(%ZEN.proxyObject).%New()
299+
300+
set DisplayInfo.top = Widget.top
301+
set DisplayInfo.left = Widget.left
302+
set DisplayInfo.width = Widget.width
303+
set DisplayInfo.height = Widget.height
304+
set DisplayInfo.topCol = Widget.homeColL
305+
set DisplayInfo.leftRow = Widget.homeRowL
306+
set DisplayInfo.colWidth = Widget.colSpanL
307+
set DisplayInfo.rowHeight = Widget.rowSpanL
308+
309+
return DisplayInfo
310+
]]></Implementation>
311+
</Method>
312+
273313
<Storage name="Default">
274314
<Type>%Library.CacheStorage</Type>
275315
</Storage>

MDX2JSON/DashboardFilters.cls.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Converts %DeepSee.Dashboard.Definition widgets into %ZEN.proxyObject.</Descripti
1818
set Widgetlist = ##class(%ZEN.proxyObject).%New()
1919
set Widgetlist.widgets = ##class(%ListOfObjects).%New()
2020
set Widgetlist.filters = ##class(%ListOfObjects).%New()
21+
set Widgetlist.displayInfo = ..GetDashboardDisplayInfo(Dashboard)
2122
2223
set st = $$$OK
2324
try {

0 commit comments

Comments
 (0)