Skip to content

Commit fe7dde6

Browse files
committed
TermList support
1 parent 99ad950 commit fe7dde6

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

MDX2JSON/REST.cls.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Example: send HTTP GET request to web application with Dispatch class <b>MDX2JSO
6666
<!-- Get info about pivot-->
6767
<Route Url="/DataSource" Method="POST" Call="GetDataSource" Body="DataSource"/>
6868
69+
<!-- Get info about pivot-->
70+
<Route Url="/TermList" Method="POST" Call="GetTermList" Body="TermList"/>
71+
6972
<!-- Get info about user config-->
7073
<Route Url="/Config" Method="POST" Call="SetConfig" Body="Application"/>
7174
<Route Url="/Config/:Application" Method="GET" Call="GetConfig" />
@@ -130,6 +133,13 @@ Test method, outputs <b>%request</b>, <b>%response</b> and <b>%session</b> objec
130133
]]></Implementation>
131134
</Method>
132135

136+
<Method name="GetTermList">
137+
<ClassMethod>1</ClassMethod>
138+
<ReturnType>%Status</ReturnType>
139+
<Implementation><![CDATA[ return ##class(MDX2JSON.Utils).GetTermList($$$R("TermList"))
140+
]]></Implementation>
141+
</Method>
142+
133143
<Method name="GetWidgetsList">
134144
<Description><![CDATA[
135145
Wrapper for ##class(MDX2JSON.Utils).GetWidgetsList()<br>

MDX2JSON/Utils.cls.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,26 @@ Get information about pivot. <br>
178178
]]></Implementation>
179179
</Method>
180180

181+
<Method name="GetTermList">
182+
<Description><![CDATA[
183+
Get information about TermList. <br>
184+
<b>pTermList</b> - TermList full name (eg.: Patients Pivots) without .termlist extension.]]></Description>
185+
<ClassMethod>1</ClassMethod>
186+
<FormalSpec>pTermList:%String</FormalSpec>
187+
<Implementation><![CDATA[
188+
set st = $$$OK
189+
try {
190+
do ##class(%DeepSee.TermList).%GetValueArray(pTermList,.pArray)
191+
set obj = ##class(%ZEN.proxyObject).%New()
192+
m obj.%data = pArray
193+
set st = obj.%ToJSON()
194+
} catch ex {
195+
set st = ex.AsStatus()
196+
}
197+
return st
198+
]]></Implementation>
199+
</Method>
200+
181201
<Method name="GetWidgetsList">
182202
<Description><![CDATA[
183203
Using dashboard name get JSON representation (array of ("type","title","mdx")) of all its' widgets.<br>

0 commit comments

Comments
 (0)