Skip to content

Commit ef8bd84

Browse files
authored
Update REST.cls
New end point and corresponding method for intersystems-community/DeepSeeWeb#121 Method simply return json containing data sources
1 parent 1703843 commit ef8bd84

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

MDX2JSON/REST.cls

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ XData UrlMap
6666

6767
<!-- Get info about pivot-->
6868
<Route Url="/DataSource" Method="POST" Call="GetDataSource" />
69+
<Route Url="/DataSourceList" Method="POST" Call="GetListDataSources" />
6970

7071
<!-- Get info about pivot-->
7172
<Route Url="/TermList" Method="POST" Call="GetTermList" />
@@ -132,6 +133,41 @@ ClassMethod Test() As %Status
132133
return $$$OK
133134
}
134135

136+
137+
/// Get all data sources including "pivot", "kpi", "worksheets","metrics"
138+
ClassMethod GetListDataSources() As %Status
139+
{
140+
set st = $$$OK
141+
142+
Set tProvider = ##class(%ZEN.Auxiliary.jsonMDXProvider).%New()
143+
144+
if $$$R("dataSource") = "pivot"
145+
{
146+
Set tSC = ##class(%DeepSee.Utils).%GetPivotListArray(.tParms,.pMetaData,.pData)
147+
Quit tSC
148+
}
149+
elseif $$$R("dataSource") = "kpi"
150+
{
151+
Set tSC = ##class(%DeepSee.Utils).%GetKPIListArray(.tParms,.pMetaData,.pData)
152+
Quit tSC
153+
}
154+
elseif $$$R("dataSource") = "worksheets"
155+
{
156+
Set tSC = ##class(%DeepSee.Utils).%GetWorksheetListArray(.tParms,.pMetaData,.pData)
157+
Quit tSC
158+
}
159+
elseif $$$R("datasource") = "metrics"
160+
{
161+
Set tSC = ##class(%DeepSee.Utils).%GetMetricListArray(.tParms,.pMetaData,.pData)
162+
Quit tSC
163+
}
164+
Set tSC = ##class(%DeepSee.REST.v1.DataServer).%CreateObjectFromArray(.pData,pMetaData,.tSourceObj)
165+
Set tSC = tProvider.%ObjectToJSON(tSourceObj)
166+
167+
return st
168+
}
169+
170+
135171
ClassMethod GetDataSource() As %Status
136172
{
137173
return ##class(MDX2JSON.Utils).GetDataSource($$$R("DataSource"))

0 commit comments

Comments
 (0)