Skip to content

Commit 284782c

Browse files
committed
Added search support.
1 parent df43362 commit 284782c

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

MDX2JSON/REST.cls.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Dashboard related requests are:
2323
<li>webapplication/Widgets - get all dashboard widgets (POST request with {Dashboard:"DashboardName"} body) with filters as part of widgets.</li>
2424
</ul>
2525
To get information about possible datasource (cube, pivot, kpi, metric) filters and filters' values:<br><ul>
26-
<li>webapplication/Filters - Same but with POST { "DataSource":"DataSourceName.ext","Values":0} body. If values = 1, then filters' values would also be provided.</li>
26+
<li>webapplication/Filters - Same but with POST { "DataSource":"DataSourceName.ext","Values":0, Search:"SearchTerm"} body. If values = 1, then filters' values would also be provided. If Search is not empty only filter values, containing search term would be returned.</li>
2727
</ul>
2828
2929
To get information about pivot:<br><ul>
@@ -195,14 +195,15 @@ Do not use.</Description>
195195

196196
<Method name="WriteFiltersForDataSource">
197197
<Description>
198-
Wrapper for ##class(MDX2JSON.Utils).WriteFiltersForDataSource(pDataSource, pValues)</Description>
198+
Wrapper for ##class(MDX2JSON.Utils).WriteFiltersForDataSource(pDataSource, pValues, pSearchKey)</Description>
199199
<ClassMethod>1</ClassMethod>
200200
<ReturnType>%Status</ReturnType>
201201
<Implementation><![CDATA[
202202
set DataSource = $$$R("DataSource")
203203
set Values = $$$R("Values")
204+
set Search = $$$R("Search")
204205
205-
set st = ##class(MDX2JSON.Utils).WriteFiltersForDataSource(DataSource,Values)
206+
set st = ##class(MDX2JSON.Utils).WriteFiltersForDataSource(DataSource,Values,Search)
206207
return st
207208
]]></Implementation>
208209
</Method>

MDX2JSON/Utils.cls.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Get all filters for DeepSee DataSource in JSON format.<br>
120120
<b>pDataSource</b> - name of DeepSee datasource (cube, pivot, kpi, metric).<br>
121121
<b>pValues</b> - write all filters' values. Takes time.]]></Description>
122122
<ClassMethod>1</ClassMethod>
123-
<FormalSpec>pDataSource:%String,pValues:%Boolean=0</FormalSpec>
123+
<FormalSpec>pDataSource:%String,pValues:%Boolean=0,pSearchKey:%String=""</FormalSpec>
124124
<ReturnType>%Status</ReturnType>
125125
<Implementation><![CDATA[
126126
set st = ##class(%DeepSee.Dashboard.Utils).%GetFiltersForDataSource(pDataSource,.tFilters)
@@ -130,7 +130,7 @@ Get all filters for DeepSee DataSource in JSON format.<br>
130130
if (pValues=1) {
131131
set key = $order(tFilters(""))
132132
while (key '= "") {
133-
set st = ##class(%DeepSee.Dashboard.Utils).%GetMembersForFilter(pDataSource,$lg(tFilters(key),2),.tMembers,.tDefaultFilterValue,,.tRelatedFilters,0,,.tValueList)
133+
set st = ##class(%DeepSee.Dashboard.Utils).%GetMembersForFilter(pDataSource,$lg(tFilters(key),2),.tMembers,.tDefaultFilterValue,pSearchKey,.tRelatedFilters,0,,.tValueList)
134134
return:$$$ISERR(st) st
135135
merge tFilters(key) = tMembers // merge filter values
136136
set key = $order(tFilters(key))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ These are the possible requests to web application (add param ?Namespace={Desire
7676
| Dashboard | POST | {Dashboard:"DashboardName"} | JSON | All widgets in a dashboard, with filters as part of dashboard|
7777
| Widgets | POST | {Dashboard:"DashboardName"} | JSON | All widgets in a dashboard, with filters as part of widgets |
7878
| DataSource | POST |{DataSource:"Pivot fullname"}| JSON | All info about Pivot |
79-
| Filters | POST |{ "DataSource": "DataSourceName.ext", "Values":1}| JSON | All filters for DeepSee DataSource (cube, pivot, kpi, metric) with values (if Values = 1, set to 0 or omit otherwise)|
79+
| Filters | POST |{ "DataSource": "DataSourceName.ext", "Values":1, Search:"SearchTerm"}| JSON | All filters for DeepSee DataSource (cube, pivot, kpi, metric) with values (if Values = 1, set to 0 or omit otherwise). If Search is not empty only filter values, containing search term would be returned.|
8080
| Format | GET | | JSON | Default formatting |
8181
| Test | GET | | JSON | Test info |
8282

0 commit comments

Comments
 (0)