Wiki source code of Dashboard API

Last modified by Aurelie Bertrand on 2026/06/30 14:49

Show last authors
1 {{ddtoc/}}
2
3 ----
4
5 (% class="wikigeneratedid" id="HFonctionsJavascript28DashboardAPI29" %)
6 There are two ways to add customised behaviour to dashboards. The first is to use the global JavaScript editor available in the dashboard editor. The second is the Text Editor portlet. This element allows you to add a block of text (and/or HTML) to a dashboard page. The possibilities are expanded thanks to an application programming interface (API) that allows you to add JavaScript calls to dashboard functions to hyperlinks within a text editor.
7
8 Using these functions, you can trigger a page change, apply a filter to a given dimension, change a DigDash variable, and so on.
9
10 Each function is called on an implicit **ddCtrl** object defined by the dashboard engine. Here is the list of functions:
11
12 (% class="box warningmessage" %)
13 (((
14 //Unless otherwise stated, parameter values are object IDs, not formatted and/or translated names. For other parameters that are not IDs, their type is specified by a lower-case letter prefixed to their name: ‘b’ for Boolean, ‘o’ for object, ‘l’ for list (array) and ‘i’ for integer.//
15
16 //A parameter enclosed in square brackets [ ] is optional and may be omitted if it is not required in the context.//
17 )))
18
19 = Variable functions (DDVariables) =
20
21 (% class="wikigeneratedid" id="HvoidddCtrl.changeVariable28nom2Cvaleur29" %)
22 **void ddCtrl.{{id name="changeVariable"/}} changeVariable(name, value)**
23
24 Description: Changes the value of the variable <name>.
25
26 Example:
27
28 (% class="box" %)
29 (((
30 <a href="javascript:__ddCtrl.changeVariable__('ratioEuro', 1.30)">EuroDollar: 1.30</a>
31 )))
32
33
34 **(Number) ddCtrl.getDDVar(name)**
35
36 Description: Returns the value of the variable <name>.
37
38 Example:
39
40 (% class="box" %)
41 (((
42 <a href="javascript:ddCtrl.changeVariable('ratioEuro', __ddCtrl.getDDVar__('ratioEuro') + 0.1)">Increase EuroDollar</a>
43 )))
44
45 = Data filtering and navigation functions =
46
47 **FilterOperand (dimension, member, hierarchy, level, formattedMember, bAddFilter, bExcludeFilter)**
48
49 Description: Object used to specify the filter to be applied.
50
51 Example:
52
53 (% class="box" %)
54 (((
55 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Geo Dim', new FilterOperand('Geo Dim', 'France', 'Geo', 'Country', false, false))">France filter</a>
56 )))
57
58 (% class="box infomessage" %)
59 (((
60 //Note: Setting the boolean bAjoutFiltre to true allows the filter to be added to the existing filter on this dimension. Setting the boolean bExcludeFilter to true enables the filter’s exclusion mode (rather than filtering on the member, this filters all other members except the one specified).//
61 )))
62
63
64 **FilterOperandContinuous (dimension, min, max, bExcludeFilter)**
65
66 Description: Object used to specify the interval filter to be applied to a continuous dimension.
67
68 Example:
69
70 (% class="box" %)
71 (((
72 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Country', new FilterOperandContinuous('Date', new Date(2018, 0, 1).getTime()/1000, new Date(2019, 0, 1).getTime()/1000, false))">Filter: Year 2018</a>
73 )))
74
75 (% class="box infomessage" %)
76 (((
77 //Note: Setting the boolean bExcluFiltre to true enables exclusion mode for the filter (rather than filtering on the specified member, it filters on all other members except the one specified).//
78 )))
79
80
81 **FilterOperandMatch (dimension, hierarchy, level, [values], [operators], mode, ExcludeFilter)**
82
83 Description: Object used to specify a ‘Rule’ type filter to be applied to a continuous dimension.
84
85 Example:
86
87 (% class="box" %)
88 (((
89 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Geo Dim', new FilterOperandMatch('Geo Dim', 'Geographical', 'Country', ['A'], [13], 0, false))">Filter: Countries starting with A</a>
90 )))
91
92 (% class="box infomessage" %)
93 (((
94 //Note~://
95
96 //The ‘Operators’ table contains the filter type for each rule~://
97
98 //0: not empty//
99
100 //1: is empty//
101
102 //2: is equal to//
103
104 //3: contains//
105
106 //4: does not contain//
107
108 //5: is not equal to//
109
110 //6: matches the regular expression//
111
112 //7: contains the word//
113
114 //8: does not contain the word//
115
116 //9: is greater than//
117
118 //10: is less than//
119
120 //11: is greater than or equal to//
121
122 //12: is less than or equal to//
123
124 //13: starts with//
125
126 //14: ends with//
127
128 //15: is contained in//
129
130 //16: is not contained in//
131
132 //The values table contains the required values corresponding to the filter type.//
133 )))
134
135
136 **void ddCtrl.filter (dimension, member)**
137
138 Description: filters by a dimension.
139
140 Example:
141
142 (% class="box" %)
143 (((
144 <a href="javascript:__ddCtrl.filter__('Pays', 'France')">Filter France</a>
145 )))
146
147 (% class="box infomessage" %)
148 (((
149 //Note: The specified member filters the hierarchy and the current level for this dimension.//
150 )))
151
152
153 **void ddCtrl.filter (oFilterOperand)**
154
155 Description: Filters on a dimension by specifying a hierarchy and a level.
156
157 Example:
158
159 (% class="box" %)
160 (((
161 <a href="**javascript:__ddCtrl.filter__(new FilterOperand(**'Lieu', 'FR', 'Géographique', 'Pays'))">France Details</a>
162 )))
163
164 (% class="box infomessage" %)
165 (((
166 //Note: Location// is the dimension, //FR// is the ID of the selected member, //Geographical// is the hierarchy and //Country// is the level.
167 )))
168
169
170 **void ddCtrl.filterOnChart (portlet, oFilterOperand, doNotRefresh)**
171
172 Description: Filters a chart by a dimension by specifying a hierarchy and a level.
173
174 Example:
175
176 (% class="box" %)
177 (((
178 <a href="**javascript:__ddCtrl.filterOnChart__(**'portletId1', new FilterOperand('Lieu', 'FR', 'Géographique', 'Pays'))">Details for France</a>
179 )))
180
181 (% class="box infomessage" %)
182 (((
183 //Note: portletId1//is the chart ID, //Location// is the dimension, //FR// is the ID of the selected member, //Geographical// is the hierarchy and //Country// is the level.
184 )))
185
186
187 **void ddCtrl.filterAndChangePage (page, dimension, member)**
188
189 Description: filters by a dimension and changes the page.
190
191 Example:
192
193 (% class="box" %)
194 (((
195 <a href="javascript:__ddCtrl.filterAndChangePage__('Production.Details Country', 'Country', 'France')">France Details</a>
196 )))
197
198
199 **void ddCtrl.changePageAndFilter (page, dimension, member)**
200
201 Description: changes the page and filters by a dimension.
202
203 Example:
204
205 (% class="box" %)
206 (((
207 <a href="javascript:__ddCtrl.changePageAndFilter__('Production.Details Country', 'Country', 'France')">France Details</a>
208 )))
209
210
211 **void ddCtrl.setFilterMinMax (dimension, min, max)**
212
213 Description: Filters by a continuous dimension by specifying a minimum and maximum value. Note: A DigDash date is a timestamp in seconds.
214
215 Example:
216
217 (% class="box" %)
218 (((
219 <a href="javascript:__ddCtrl.setFilterMinMax__('Date', new Date(2014, 0, 1).getTime()/1000, new Date().getTime()/1000)">2014 to date</a>
220 )))
221
222
223 **(String Array) ddCtrl.getDimensionFilter (dimension [, bContinue])**
224
225 Description: Returns the list of elements filtered by the dimension (continuous or discrete).
226
227 Example:
228
229 (% class="box" %)
230 (((
231 <a href="javascript:alert(__ddCtrl.getDimensionFilter__('Pays'))">Filters by Country</a>
232 )))
233
234
235 **void ddCtrl.isDimensionFiltered (dimension [, bContinue])**
236
237 Description: Returns true if the dimension (continuous or discrete) is filtered. Returns false otherwise.
238
239 Example:
240
241 (% class="box" %)
242 (((
243 <a href="javascript:alert(__ddCtrl.isDimensionFiltered__('Pays'))">Is the country filtered?</a>
244 )))
245
246
247 **void ddCtrl.removeAllFilters ()**
248
249 Description: Removes all filters from the dashboard.
250
251 Example:
252
253 (% class="box" %)
254 (((
255 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.removeAllFilters__(%%)()">Reset</a>
256 )))
257
258
259 **void ddCtrl.removeAllFiltersCurrentPage ()**
260
261 Description: Removes the filters from the current page.
262
263 Example:
264
265 (% class="box" %)
266 (((
267 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)__removeAllFiltersCurrentPage__()">Reset</a>
268 )))
269
270
271 **void ddCtrl.removeFilters (dimension [, bContinue])**
272
273 Description: Removes the current filters on the dimension (continuous or discrete).
274
275 (% class="box" %)
276 (((
277 Example: <a href="javascript:__ddCtrl.removeFilters__('Pays')">All countries</a>
278 )))
279
280
281 **void ddCtrl.beginSelection ()**
282
283 **void ddCtrl.commitSelection ()**
284
285 Description: Used in conjunction with the ddCtrl.filter function. Allows multiple filters on different dimensions to be combined without having to run each filter individually (optimisation).
286
287 Example:
288
289 (% class="box" %)
290 (((
291 <a href="javascript:__ddCtrl.beginSelection__(); ddCtrl.filter('Country', 'France'); ddCtrl.filter('Year', '2013'); __ddCtrl.commitSelection__()">France in 2013</a>
292 )))
293
294
295 **void ddCtrl.setDimensionNavigation (dimension, {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bNavigation)**
296
297 Description: Changes the permission to navigate by a dimension for the specified flow.
298
299 Example:
300
301 (% class="box" %)
302 (((
303 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.setDimensionNavigation__(%%)('Region', 'chart1', true)">Enable navigation by Region</a>
304 )))
305
306
307 **(String array) ddCtrl.getCurrentDrill (portlet, dimension[, hierarchy])**
308
309 Description: Returns the dimension, hierarchy and current level of a chart as an array.
310
311 (% class="box infomessage" %)
312 (((
313 Note: This function can only be called on a chart with a “Navigate hierarchy” or “Change dimension” interaction.
314 )))
315
316 Example:
317
318 {{code language="JAVASCRIPT" cssClass="notranslate"}}
319 ddCtrl.addChartRefreshListener( function(doc, dm, dmsel, chart) {
320  if (chart.title == 'Mon graphique') {
321  var curDrill = ddCtrl.getCurrentDrill(doc.frameId, 'Région', 'Géographique');
322  var dim = curDrill[0];
323  var hier = curDrill[1];
324  var lvl = curDrill[2];
325  alert("L'exploration est " + hier + " / " +lvl + " sur la dimension " + dim);
326  }
327  });
328 {{/code}}
329
330
331 **(BreadPath) ddCtrl.getBreadPath (portlet, dimension)**
332
333 Description: Returns the current navigation path (BreadPath) for a dimension in a chart. This object can be used by `drillTo` (see below).
334
335 Example:
336
337 (% class="box" %)
338 (((
339 <a href="javascript:__ddCtrl.drillTo__('portletId2', 'Lieu', __ddCtrl.getBreadPath__('portletId1', 'Location'))">Current Location Details (Chart 2)</a>
340 )))
341
342
343 **void ddCtrl.drillTo (portletId, dimension, oBreadPath)**
344
345 Description: Navigates within a chart along a hierarchy of the selected dimension, using a navigation path defined by the BreadPath object.
346
347 Example:
348
349 (% class="box" %)
350 (((
351 See example above (getBreadPath)
352 )))
353
354
355 **void ddCtrl.drillDown (portletId, dimension, hierarchy, level, member, formattedMember)**
356
357 Description: Navigates down a hierarchy of the selected dimension to the specified member at the lower level.
358
359 (% class="box infomessage" %)
360 (((
361 Note: The action is performed on all charts sharing the same navigation interaction (“synchronised drill-down”).
362 )))
363
364 Example:
365
366 (% class="box" %)
367 (((
368 <a href="javascript:__ddCtrl.drillTo__('portletId', 'Location', 'Geographic', 'FR', 'France')">France Details</a>0
369 )))
370
371
372 **void ddCtrl.resetDrill (portlet, dimension, [hierarchy])**
373
374 Description: Resets navigation on the dimension hierarchy.
375
376 (% class="box infomessage" %)
377 (((
378 Note: The action is performed on all charts sharing the same navigation interaction (“synchronised drill”).
379 )))
380
381 Example:
382
383 (% class="box" %)
384 (((
385 <a href="javascript:__ddCtrl.resetDrill__('portletId', 'Location')">Back to the world map</a>
386 )))
387
388
389 **void ddCtrl.selectMeasuresOnChart(portlet, [measures])**
390
391 Description: Displays the specified measures on the chart; the other measures on the chart will be hidden.
392
393 Example:
394
395 (% class="box" %)
396 (((
397 <a href="javascript:__selectMeasuresOnChart__('portletId2', ['Turnover', 'Margins'])">Display Turnover and Margins</a>
398 )))
399
400
401
402 **(Number | String) ddCtrl.getDataModelDate (dmId, bFormat)**
403
404 Description: Returns the synchronisation date of a data cube. The parameters are the data model ID and a Boolean value to format the date (true) or return the corresponding timestamp (false).
405
406 (% class="box infomessage" %)
407 (((
408 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
409 )))
410
411 Example:
412
413 (% class="box" %)
414 (((
415 <a href="javascript:alert(__ddCtrl.getDataModelDate__('a1234567890..', true))">Display the data date</a>
416 )))
417
418
419 **(Number | String) ddCtrl.getDataModelLinesCount (dmId)**
420
421 Description: Returns the number of rows in a data cube. The parameter is the data model identifier.
422
423 Example:
424
425 (% class="box" %)
426 (((
427 <a href="javascript:alert(__ddCtrl.getDataModelLinesCount__('a1234567890..'))">Display the number of rows in the data</a>
428 )))
429
430
431
432 **(Number | String) ddCtrl.getFlowDate ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bFormat)**
433
434 Description: Returns the synchronisation date of a flow. The parameters are the flow ID and a Boolean value to format the date (true) or return the corresponding timestamp (false).
435
436 (% class="box infomessage" %)
437 (((
438 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
439 )))
440
441 Example:
442
443 (% class="box" %)
444 (((
445 <A href="javascript:alert(__ddCtrl.getFlowDate__('fluxId', true))">Display the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} date</A>
446 )))
447
448 = Data query functions =
449
450 **(Number | String) ddCtrl.getResultCubeValue ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, measure, lMembers, bFormatted)**
451
452 Description: Returns the value of the measure for the specified axis members from a visible chart. Returns the value as a number or as a formatted string.
453
454 Note: The list of axis members must specify //__one and only one member for each axis used__// in the chart, in the natural order of the chart’s axes. The measure parameter is the measure ID.
455
456 Example: To retrieve a value from a histogram defined as follows: Measure ‘Margin’ on the stack axis, dimension ‘Year’ on the column axis and ‘Country’ on the group axis:
457
458 (% class="box" %)
459 (((
460 <a href="javascript:alert(__ddCtrl.getResultCubeValue__('chart1', 'Margin', ['2023', 'France'], true))">Show the margin for France in 2023</a>
461 )))
462
463 (% class="box warningmessage" %)
464 (((
465 **Important: **It is important to ensure that the chart has loaded before calling this function. The simplest way is to include the call to this function within a listener passed to `addChartRefreshListener`
466 )))
467
468 **(Row table) ddCtrl.getResultCubeRowSet ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, oAxisMemberQuery [, bFormatted])**
469
470 Description: Returns the flattened rows of the result cube for the specified axis members from a visible chart. Returns the result as an array of rows, each row being an array of cells. The cells consist of the chart’s dimensions/axes followed by the measure values.
471
472 (% class="box infomessage" %)
473 (((
474 Note: The query for the axis members to be retrieved is a JavaScript object conforming to the following format (JSON): {"Axis/Dim title 1": "member 1", "Axis/Dim title 2": "member 2", etc.}..*
475 )))
476
477 Example: To retrieve the rows corresponding to the year 2024 and the person ‘John’ from a result cube of a chart named ‘chart1’:
478
479 (% class="box" %)
480 (((
481 <a href="javascript:alert(__ddCtrl.getResultCubeRowSet__('chart1', {'Year' : '2024', 'Person': 'John'})[0][2])">Show John’s first value in 2024</a>
482 )))
483
484 (% class="box warningmessage" %)
485 (((
486 **Important**: It is important to ensure that the chart is loaded before calling this function. The simplest way is to include the call to this function in a listener passed to `addChartRefreshListener`.
487 )))
488
489
490 **(Number) ddCtrl.getResultCubeLinesCount ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
491
492 Description: Returns the number of flattened rows in the result cube.
493
494 Example:
495
496 (% class="box" %)
497 (((
498 <a href="javascript:alert((% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.getResultCubeLinesCount(__(%%)'chart1')" >Number of rows</a>
499 )))
500
501
502 (% class="wikigeneratedid" %)
503 **ddCtrl.getLastDimensionDate('data model ID', 'Time dimension')**
504
505 (% class="wikigeneratedid" %)
506 Description: Returns the maximum date of a time dimension as a timestamp.
507
508 (% class="wikigeneratedid" %)
509 Example:
510
511 (% class="box" %)
512 (((
513 <a href="javascript:alert((% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)getLastDimensionDate(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__(__(%%)'a866caa04fabdd35687fa3bd3758d6a8', 'Date')" >Maximum date</a>
514 )))
515
516
517 **ddCtrl.getCubeValue ("data model ID", [filters], 'dimension or measure name', bUseContext)**
518
519 Description: Retrieves the value of a measure or the member of a dimension in a data model with the filters applied (so that only one row of data is returned by the server).
520 The UseContext parameter, which is a Boolean, allows you to specify whether or not the dashboard’s filtering context should be taken into account when calculating the data.
521
522 Example: To retrieve the value of the ‘Communication Cost’ measure with the filtered elements ‘Mobile’ for //Line Type// and ‘Samsung Galaxy’ for //Hardware, //in the data model with the identifier// " //0b2583609f86d37754ce2ada372f31ae", and taking into account the dashboard’s filter context:
523
524 (% class="box" %)
525 (((
526 <a href="javascript:alert(ddCtrl.getCubeValue("0b2583609f86d37754ce2ada372f31ae", [{"dim":"Line type", "member":"Mobile"}, {"dim":"Hardware", "member":"Samsung Galaxy"}], 'Communication cost', true)">Communication cost value</a>
527 )))
528
529 **ddCtrl.getFlowValue ("flow ID", [filters], 'dimension or measure name', bUseContext)**
530
531 Description: Retrieves the value of a measure or the member of a dimension in a {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} with the filters applied (so that only one row of data is returned by the server).
532 The UseContext parameter, which is a Boolean, allows you to specify whether or not to take the dashboard’s filtering context into account when calculating the data.
533
534 Example: To retrieve the member of the ‘Line Type’ dimension with the filtered element “Samsung Galaxy” for //Hardware, in //the flow with the identifier// “ //b312f6be”, and without taking the dashboard’s filter context into account:
535
536 (% class="box" %)
537 (((
538 <a href="javascript:alert(ddCtrl.getFlowValue("b312f6be", [{"dim":"Hardware", "member":"Samsung Galaxy"}], 'Line Type', false)>Line Type member</a>
539 )))
540
541 = Dashboard functions{{id name="Fonction_TDB"/}} =
542
543 (% class="box infomessage" %)
544 (((
545 ℹ For functions involving PDF export, adding an HTML report or advanced formatting may cause rendering issues.
546 )))
547
548 **void ddCtrl.loadJS (urlJS)**
549
550 Description: Loads a JavaScript file from a URL.
551
552 Example (in the JavaScript editor):
553
554 {{code language="javascript" cssClass="notranslate"}}
555 ddCtrl.loadJS('http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js');
556 var hash = CryptoJS.MD5("Le message");
557 {{/code}}
558
559
560 **void ddCtrl.includeJS (JS_name)**
561
562 Description: Loads a JavaScript file from the DigDash Enterprise configuration folder. The file must have been created beforehand using the JavaScript editor in the dashboard editor.
563
564 Example (in the JavaScript editor):
565
566 {{code language="javascript" cssClass="notranslate"}}
567 ddCtrl.includeJS('fonctions_date.js');
568 {{/code}}
569
570
571
572 **void ddCtrl.drawFlowInElement ('HTML element or widget ID', '{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} ID');**
573
574 Description: Displays a flow within an HTML element
575
576 Example (in the JavaScript editor):
577
578 (% class="box" %)
579 (((
580 <A href="javascript:ddCtrl.drawFlowInElement ('elementHTMLId', 'fluxId')">Display {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
581 )))
582
583 (% class="box infomessage" %)
584 (((
585 💡The ID is that of the portlet. You can copy it from the **Information** tab in **the element’s Settings **panel.
586
587 [[image:1747310722673-137.png]]
588 \\For example: <A href="javascript:ddCtrl.drawFlowInElement ('Retail_Coûts_editor', '1898358537')">Display flow</A>
589 )))
590
591
592 **void ddCtrl.changePage (page)**
593
594 **void ddCtrl.switchPage (page)**
595
596 Description: Changes the current page to <page>.
597
598 Example:
599
600 (% class="box" %)
601 (((
602 <a href="javascript:__ddCtrl.changePage__('Général.Index')">Back to index</a>
603 )))
604
605
606 **void ddCtrl.nextPage ()**
607
608 Description: Moves to the next page (same function).
609
610 Example:
611
612 (% class="box" %)
613 (((
614 <a href="javascript:__ddCtrl.nextPage__()">Next page</a>
615 )))
616
617
618 **void ddCtrl.prevPage ()**
619
620 Description: Moves to the previous page (same role).
621
622 Example:
623
624 (% class="box" %)
625 (((
626 <a href="javascript:__ddCtrl.prevPage__()">Previous page</a>
627 )))
628
629
630 **(Boolean) ddCtrl.isCurrentPage (page)**
631
632 Description: Returns true if the current page is the page with the ID specified as a parameter. Returns false otherwise.
633
634 (% class="box infomessage" %)
635 (((
636 Note: This function replaces the deprecated function __ddCtrl.getCurrentPage__ ()
637 )))
638
639
640 **(String) ddCtrl.getCurrentPage ()**
641
642 Description: Returns the name of the current page in the following format: <//Role name>.<Page name>//.
643
644 (% class="box warningmessage" %)
645 (((
646 **Deprecated**: This function has not been supported since November 2014 due to a change in the page name format. Please use the function __ddCtrl.isCurrentPage__ (page) instead.
647 )))
648
649
650 **(Boolean) ddCtrl.isPageLoaded(page)**
651
652 Description: Returns true if the specified page has already been loaded. Returns false otherwise.
653
654
655 **(Boolean) ddCtrl.isCurrentPageLoaded()**
656
657 Description: Returns true if the current page has already been loaded. Returns false otherwise.
658
659
660 **(Object) ddCtrl.getPage(page)**
661
662 Description: Returns an object containing certain properties (ID, name, title, list of objects, etc.) of the specified page.
663
664
665 **(Array) ddCtrl.getPagePath (page)**
666
667 Description: Returns an array containing the page path (role / page group / page).
668
669
670 **(Array) ddCtrl.dashboardPages**
671
672 Description: An array containing all the pages for all roles of the logged-in user.
673
674 Example:
675
676 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
677 (((
678 {{code language="shell"}}
679 ddCtrl.addCurrentPageLoadListener(function()
680 {
681     console.log(ddCtrl.dashboardPages);
682 });
683 {{/code}}
684
685 (% style="background-color:rgba(220,220,220,0.5)" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]]
686 )))
687
688
689 **(Boolean) canChangeCurrentPage (page)**
690
691 Description: Returns true if it is possible to switch to the page <page>. Returns false otherwise.
692
693
694 **void ddCtrl.hidePage (page)**
695
696 Description: Hides the tab for page <page> if it is visible, without changing the current page.
697
698 Example:
699
700 (% class="box" %)
701 (((
702 <a href="javascript:__ddCtrl.hidePage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Global')">Exit details</a>
703 )))
704
705
706 **void ddCtrl.showPage (page)**
707
708 Description: Displays the tab for page <page> if it is hidden, without changing the current page.
709
710 Example:
711
712 (% class="box" %)
713 (((
714 <a href="javascript:__ddCtrl.showPage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Détails Pays')">Show details</a>
715 )))
716
717
718 **void ddCtrl.openFlowInWindow (flow, iWidth, iHeight)**
719
720 Description: Opens a flow in a pop-up window with the specified width and height.
721
722 Example:
723
724 (% class="box" %)
725 (((
726 <a href="javascript:__ddCtrl.openFlowInWindow__('fluxId', '250', '200')">Display product breakdown</a>
727 )))
728
729
730 **void ddCtrl.openPortletInWindow (portlet, iWidth, iHeight)**
731
732 Description: Opens a portlet in a pop-up window with the specified width and height.
733
734 Example:
735
736 (% class="box" %)
737 (((
738 <a href="javascript:__ddCtrl.openPortletInWindow__('portletId', '250', '200')">Display product breakdown</a>
739 )))
740
741
742 **void ddCtrl.openFlowInWindowWithFilter (flow, iWidth, iHeight, dimension, member [, dimension, member, ...])**
743
744 Description: Opens a flow in a pop-up window with specified width and height, and filters it by the dimension(s) and member(s) specified as parameters (a list of dimension/member pairs).
745
746 (% class="box infomessage" %)
747 (((
748 Note: Filters will only be applied to the new window.
749 )))
750
751 Example:
752
753 (% class="box" %)
754 (((
755 <a href="javascript:__ddCtrl.openFlowInWindowWithFilter__('fluxId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
756 )))
757
758
759 **void ddCtrl.openPortletInWindowWithFilter (portlet, iWidth, iHeight, dimension, member [, dimension, member, ...])**
760
761 Description: Opens a portlet in a pop-up window with the specified width and height, and applies a filter based on the dimensions and members specified as parameters (a list of dimension/member pairs).
762
763 (% class="box infomessage" %)
764 (((
765 Note: Filters will only be applied to the new window.
766 )))
767
768 Example:
769
770 (% class="box" %)
771 (((
772 <a href="javascript:__ddCtrl.openPortletInWindowWithFilter__('portletId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
773 )))
774
775
776 **void ddCtrl.closeFlowInWindow (flow)**
777
778 Description: Allows you to programmatically close a pop-up displayed using the **openFlowInWindow**, **openPortletInWindow** and **openFormInWindow** functions.
779
780 This function takes as a parameter the identifier that was passed to the function used to display the pop-up.
781
782 Example:
783
784 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
785 (((
786 {{code}}
787 ddCtrl.openFlowInWindow('716abf12', '80%', '80%');
788
789 ddCtrl.closeFlowInWindow('716abf12')
790 {{/code}}
791
792 (% style="background-color:rgba(220,220,220,0.5)" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]]
793 )))
794
795
796 **void ddCtrl.openDocument (serverName, fileName)**
797
798 Description: Opens a document in a new window.
799
800 Example:
801
802 (% class="box" %)
803 (((
804 <a href="javascript:__ddCtrl.openDocument__('Common Datasources', 'catalogue_produits.pdf')">Display the product catalogue</a>
805 )))
806
807
808 **void ddCtrl.uploadDocument (serverName, fileName)**
809
810 Description: Uploads a document to a document server. Opens a file selection window on the workstation.
811
812 Example:
813
814 (% class="box" %)
815 (((
816 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.uploadDocument__(%%)('Common Datasources', 'catalogue_produits.pdf')">Upload the product catalogue</a>
817 )))
818
819
820 **void ddCtrl.deleteDocument (serverName, fileName)**
821
822 Description: Deletes a document from the document server.
823
824 Example:
825
826 (% class="box" %)
827 (((
828 <a href="javascript:__ddCtrl.deleteDocument__('Common Datasources', 'catalogue_produits.pdf')">Delete the product catalogue</a>
829 )))
830
831
832 **void ddCtrl.downloadDocument (serverName, fileName)**
833
834 Description: Downloads a document from the document server.
835
836 Example:
837
838 (% class="box" %)
839 (((
840 <a href="javascript:__ddCtrl.downloadDocument__('Common Datasources', 'catalogue_produits.pdf')">Download the product catalogue</a>
841 )))
842
843
844
845 **void ddCtrl.refreshDashboard ()**
846
847 Description: Refreshes the dashboard (same behaviour as the Refresh button in the dashboard header).
848
849 Example:
850
851 (% class="box" %)
852 (((
853 <a href="javascript:__ddCtrl.refreshDashboard__()">Refresh</a>
854 )))
855
856
857 **void ddCtrl.refreshFlow (flow, [event])**
858
859 Description: Refreshes the specified flow with an optional event name.
860
861 Example:
862
863 (% class="box" %)
864 (((
865 <A href="javascript:__ddCtrl.refreshFlow__('flowId', 'MAJ_QUOTIDIENNE')">Refresh {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
866 )))
867
868
869 **void ddCtrl.refreshFlows ([event])**
870
871 Description: Refreshes all flows on the dashboard with an optional event name.
872
873 Example:
874
875 (% class="box" %)
876 (((
877 <a href="javascript:__ddCtrl.refreshFlows__('MAJ_QUOTIDIENNE')"> Refresh all </a>
878 )))
879
880
881 **(String) ddCtrl.getCurrentRole ()**
882
883 Description: Returns the role ID of the current page or the user’s name for a user page.
884
885
886 **(String) ddCtrl.getRole(page)**
887
888 Description: Returns the role ID of the specified page (e.g. previously retrieved by __ddCtrl.getCurrentPage__()) or the user’s name if this page is a user page.
889
890
891 **void ddCtrl.hidePortlet (portlet)**
892
893 **void ddCtrl.showPortlet (portlet)**
894
895 (% class="box warningmessage" %)
896 (((
897 ❗These functions must only be used on portlets present on the current page.
898 )))
899
900 Description: Hides or displays the specified chart portlet. The portlet parameter is an identifier that can be retrieved in the dashboard editor via the portlet’s ‘Information’ menu.
901
902 Example:
903
904 (% class="box" %)
905 (((
906 <a href="javascript:__ddCtrl.showPortlet__('portletId')">Show Details</a>
907 )))
908
909
910 **void ddCtrl.setPortletPos (portlet, x, y)**
911
912 **void ddCtrl.setPortletSize (portlet, width, height)**
913
914 Description: Positions or resizes the portlet to the specified coordinates or dimensions. The `portlet` parameter is an identifier that can be retrieved in the dashboard editor via the portlet’s ‘Information’ menu.
915
916 Example:
917
918 (% class="box" %)
919 (((
920 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '100', '100'); __ddCtrl.setPortletSize__('portletId', '600', '400')">Expand Details</a>
921 )))
922
923
924 **void ddCtrl.setPortletMargins (portlet, marginTop, marginRight, marginBottom, marginLeft)**
925
926 Description: Specifies the margins to be added to the portlet. The `portlet` parameter is an identifier that can be retrieved from the dashboard editor via the portlet’s Information menu.
927
928 Example:
929
930 (% class="box" %)
931 (((
932 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '10', '10', '10', '10'); __ddCtrl.setPortletMargins__('portletId', '600', '400')">Change the margins</a>
933 )))
934
935
936 **(Boolean) ddCtrl.chartIsHidden (portlet)**
937
938 Description: Returns true when the portlet is hidden (see hideChart) and false otherwise.
939
940
941 **void ddCtrl.genTemplatePPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
942
943 Description: Runs a PowerPoint {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}} flow (saves the PPT) with the identifier flowId using the current selection from the dashboard. The user is offered the option to download the generated PPT.
944
945 Example:
946
947 (% class="box" %)
948 (((
949 <A href="javascript:__ddCtrl.genTemplatePPT__('Id Fabrique De Document')">Download PPT</A>
950 )))
951
952
953 **void ddCtrl.exportCurrentPageAsPPT ()**
954
955 Description: Saves the current dashboard page in PPT format. The user is offered the option to download the generated PPT.
956
957 Example:
958
959 (% class="box" %)
960 (((
961 <a href="javascript:__ddCtrl.exportCurrentPageAsPPT__()">Download this page as a PPT</a>
962 )))
963
964
965 **void ddCtrl.exportPageAsPPT (role, page)**
966
967 Description: Saves the page corresponding to the role and page ID specified as parameters. The user is prompted to download the generated PPT. The page ID can be retrieved in the dashboard editor (right-click on a page tab).
968
969 Example:
970
971 (% class="box" %)
972 (((
973 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.exportPageAsPPT__(%%)('Telecom', 'telecom_ventes_1')">Load the telecoms sales PPT</a>
974 )))
975
976
977 **void ddCtrl.genTemplatePDF(flow)**
978
979 Description: Runs a ‘PDF builder’ flow (saves the PDF) with the identifier flowId using the current selection from the dashboard. The user is prompted to download the generated PDF.
980
981 Example:
982
983 (% class="box" %)
984 (((
985 <A href="javascript:__ddCtrl.genTemplatePDF__('Id Fabrique De Document')">Download the PDF</A>
986 )))
987
988
989 **void ddCtrl.exportCurrentPageAsPDF ()**
990
991 Description: Saves the current dashboard page in PDF format. The user is offered the option to download the generated PDF.
992
993 Example:
994
995 (% class="box" %)
996 (((
997 <a href="javascript:__ddCtrl.exportCurrentPageAsPDF__()">Download this page as a PDF</a>
998 )))
999
1000
1001 **void ddCtrl.exportPageAsPDF (role, page)**
1002
1003 Description: Saves the page corresponding to the role and page ID specified as parameters. The user is offered the option to download the generated PDF. The page ID can be retrieved in the dashboard editor (right-click on a page tab).
1004
1005 Example:
1006
1007 (% class="box" %)
1008 (((
1009 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)__exportPageAsPDF__('Telecom', 'telecom_ventes_1')">Download the telecoms sales PDF</a>
1010 )))
1011
1012
1013 **void ddCtrl.genTemplateXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1014
1015 Description: Runs an Excel {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}} flow (saves the XLS file) with the identifier flowId using the current selection from the dashboard. The user is prompted to download the generated XLS file.
1016
1017 Example:
1018
1019 (% class="box" %)
1020 (((
1021 <A href="javascript:__ddCtrl.genTemplateXLS__('Id Fabrique De Document')">Download the XLS</A>
1022 )))
1023
1024 **void ddCtrl.genTemplateHTML ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1025
1026 Description: Runs an {{glossaryReference glossaryId="Glossary" entryId="Fabrique HTML"}}HTML Builder{{/glossaryReference}} flow (saves the HTML) with the identifier flowId using the current selection from the dashboard. The user is offered the option to download the generated HTML.
1027
1028 Example:
1029
1030 (% class="box" %)
1031 (((
1032 <A href="javascript:__ddCtrl.genTemplateHTML__('Id Fabrique De Document')">Download the HTML</A>
1033 )))
1034
1035 **void ddCtrl.exportAsPDF ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1036
1037 Description: Saves the flow as a PDF. The user is offered the option to download the generated PDF.
1038
1039
1040 **void ddCtrl.exportAsPPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1041
1042 Description: Saves the flow as a PPT. The user is offered the option to download the generated PPT.
1043
1044
1045 **void ddCtrl.exportAsXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1046
1047 Description: Saves the flow as an XLS file. The user is offered the option to download the generated XLS file.
1048
1049
1050 **void ddCtrl.exportAsXLSWithoutStyles ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1051
1052 Description: Saves the flow as an XLS file without applying table styles to improve performance. The user is prompted to download the generated XLS file.
1053
1054
1055 **void ddCtrl.exportAsCSV ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1056
1057 Description: Saves the flow as a CSV (Comma-Separated Values) file. The user is prompted to download the generated CSV file.
1058
1059
1060 **void ddCtrl.saveDashboardState (name, default)**
1061
1062 Description: Saves the current state of the dashboard (page, filters, drill-down, variables). This is identical to the action triggered by the ‘Save Selection’ button in the dashboard toolbar. The name parameter is the name of the selection; the bDefault parameter enables the selection to be loaded when the dashboard starts.
1063
1064
1065 **(String) ddCtrl.getCurrentPortletInGroupOfTabs (portletTabId)**
1066
1067 Description: Returns the ID of the current portlet in the Tab Group object. The `portletTabId` parameter is the ID of the Tab Group.
1068
1069
1070 **void ddCtrl.changePortletInGroupOfTabs (portletTabId, portletId)**
1071
1072 Description: Changes the current portlet of the Tab Group object. The `portletTabId` parameter is the identifier of the Tab Group; the `portletId` parameter is the identifier of the portlet to be selected.
1073
1074
1075 **(Array) ddCtrl.getCurrentPagePath ()**
1076
1077 Description: Returns the path of the current page (Role / Page / Subpage) as an array of objects. Each object has the following attributes: id, title, name, type (role/container/page).
1078
1079
1080 **void ddCtrl.expandCollapseNavigationMenu()**
1081
1082 Description: Collapses the navigation menu if it is expanded, and vice versa.
1083
1084
1085 == Scale Mode Functions{{id name="scale"/}} ==
1086
1087 These functions relate to zoom selection in **Scale** or **Grid + Scale** mode.
1088
1089 **void ddCtrl.setScalingZoom(zoom)**
1090
1091 Description: Sets the zoom level to the specified value.
1092
1093 Example:
1094
1095 (% class="box" %)
1096 (((
1097 <a href="javascript:__ddCtrl.setScalingZoom(0.65)__">Set the page zoom to 65%</a>
1098 )))
1099
1100
1101 **void ddCtrl.setScalingAdaptWidth()**
1102
1103 Description: applies the ‘Adapt to width’ zoom.
1104
1105
1106
1107 **void ddCtrl.setScalingAdaptHeight()**
1108
1109 Description: applies the ‘Adapt to height’ zoom.
1110
1111
1112
1113 **void ddCtrl.setScalingZoomRange(min, max)**
1114
1115 Description: sets the minimum and maximum zoom limits. The user will not be able to set a zoom level outside these values.
1116
1117 Example:
1118
1119 (% class="box" %)
1120 (((
1121 <a href="javascript:__setScalingZoomRange(0.4,1.2)__">Set a zoom range between 40 and 120%</a>
1122 )))
1123
1124 = Event handling =
1125
1126 These listener functions are called by the system when specific events are triggered. You can therefore create new behaviours depending on different situations: a chart is refreshed or drawn, a page is changed, a dimension is filtered, etc. The best place to implement these behaviours is in the global JavaScript editor, accessible via the options menu in the dashboard editor.
1127
1128 == Dashboard Events Diagram ==
1129
1130 (% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" tabindex="-1" %)[[image:api_event_diagram.gif||queryString="width=641&height=802"]](% title="Cliquer et glisser pour redimensionner" %)​(% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" style="background-color:rgba(220,220,220,0.5)" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]](% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" tabindex="-1" title="Cliquer et glisser pour redimensionner" %)​
1131
1132 **void ddCtrl.addChartBeforeRefreshListener (Function)**
1133
1134 Description: Adds a listener function for the event triggered before the chart is refreshed.
1135
1136 Example:
1137
1138 (% class="box" %)
1139 (((
1140 ddCtrl.addChartBeforeRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be refreshed"); });
1141 )))
1142
1143
1144 **void ddCtrl.addChartRefreshListener (Function)**
1145
1146 Description: Adds a function to listen for the event triggered after the chart has been refreshed.
1147
1148 Example:
1149
1150 (% class="box" %)
1151 (((
1152 ddCtrl.addChartRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been refreshed"); });
1153 )))
1154
1155
1156 **void ddCtrl.addChartDrawnListener (Function)**
1157
1158 Description: Adds a function to listen for the event triggered when the chart has finished being drawn (first display).
1159
1160 Example:
1161
1162 (% class="box" %)
1163 (((
1164 ddCtrl.addChartDrawnListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been drawn"); });
1165 )))
1166
1167
1168 **void ddCtrl.addChartModelReadyListener (Function)**
1169
1170 Description: Adds a listener function for the event triggered before the chart is drawn (first display).
1171
1172 Example:
1173
1174 (% class="box" %)
1175 (((
1176 ddCtrl.addChartModelReadyListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be drawn"); });
1177 )))
1178
1179
1180 **void ddCtrl.addDimensionFilterListener (Function)**
1181
1182 Description: Adds a listener function for the event triggered after a dimension has been filtered.
1183
1184 Example:
1185
1186 (% class="box" %)
1187 (((
1188 ddCtrl.addDimensionFilterListener(function(dimension, hierarchy, level, members, membersFormatted, bExclude, min, max) { alert("The dimension " + dimension + " has been filtered to " + membersFormatted); });
1189 )))
1190
1191
1192 **void ddCtrl.addVariableChangeListener (Function)**
1193
1194 Description: Adds a listener function for the event triggered after a variable has been changed.
1195
1196 Example:
1197
1198 (% class="box" %)
1199 (((
1200 ddCtrl.addVariableChangeListener(function(variable, value) { alert("The variable " + variable + " has changed; new value: " + value); });
1201 )))
1202
1203
1204 == Dashboard Event Handling{{id name="event_tdb"/}} ==
1205
1206
1207 **void ddCtrl.addDashboardLoadListener (Function)**
1208
1209 Description: Adds a listener for the event triggered once the dashboard has loaded but has not yet been rendered.
1210
1211 Example:
1212
1213 (% class="box" %)
1214 (((
1215 ddCtrl.addDashboardLoadListener(function(currentPage) { alert("Initialising the dashboard"); });
1216 )))
1217
1218
1219
1220 **void ddCtrl.addCurrentPageLoadListener (Function)**
1221
1222 Description: Adds a function to listen for the event triggered once the dashboard page has fully loaded.
1223
1224 Example:
1225
1226 (% class="box" %)
1227 (((
1228 ddCtrl.addCurrentPageLoadListener(function(currentPage) { alert("Page " + currentPage + " has been loaded"); });
1229 )))
1230
1231
1232 **void ddCtrl.addCurrentPageChangeListener (Function)**
1233
1234 Description: Adds a function to listen for the event triggered when a page changes.
1235
1236 Example:
1237
1238 (% class="box" %)
1239 (((
1240 ddCtrl.addCurrentPageChangeListener(function(currentPage, bFirstTime) { alert("The page is now " + currentPage); });
1241 )))
1242
1243
1244 **void ddCtrl.addUserLoggedListener (Function)**
1245
1246 Description: Event triggered once the user has been authenticated. May be useful when using the ddCtrl.getUserAttribute function.
1247
1248 Example:
1249
1250 (% class="box" %)
1251 (((
1252 ddCtrl.addUserLoggedListener(function() { alert("You are logged in"); });
1253 )))
1254
1255
1256 **void ddCtrl.addPortletHiddenListener (Function)**
1257
1258 Description: Event triggered when the object’s status changes from visible to hidden.
1259
1260 Example:
1261
1262 (% class="box" %)
1263 (((
1264 ddCtrl.addPortletHiddenListener(function(portletId) { alert("The object is hidden"); });
1265 )))
1266
1267
1268 **void ddCtrl.addPortletVisibleListener (Function)**
1269
1270 Description: Event triggered when the object’s status changes from hidden to visible.
1271
1272 Example:
1273
1274 (% class="box" %)
1275 (((
1276 ddCtrl.addPortletVisibleListener(function(portletId) { alert("The object is visible"); });
1277 )))
1278
1279
1280 **void ddCtrl.addPortletCollapseListener (Function)**
1281
1282 Description: Event triggered when the user clicks the icon to hide a retractable element.
1283
1284 Example:
1285
1286 (% class="box" %)
1287 (((
1288 ddCtrl.addPortletCollapseListener(function(portletId) { alert("The object is about to be hidden"); });
1289 )))
1290
1291
1292 **void ddCtrl.addPortletCollapsedListener (Function)**
1293
1294 Description: Event triggered once the retractable element has been hidden.
1295
1296 Example:
1297
1298 (% class="box" %)
1299 (((
1300 ddCtrl.addPortletCollapsedListener(function(portletId) { alert("The object is hidden"); });
1301 )))
1302
1303
1304 **void ddCtrl.addPortletExpandListener (Function)**
1305
1306 Description: Event triggered when the user clicks the icon to expand a retractable element.
1307
1308 Example:
1309
1310 (% class="box" %)
1311 (((
1312 ddCtrl.addPortletExpandListener(function(portletId) { alert("The object is about to be displayed"); });
1313 )))
1314
1315
1316 **void ddCtrl.addPortletExpandedListener (Function)**
1317
1318 Description: Event triggered once the retractable element has been displayed.
1319
1320 Example:
1321
1322 (% class="box" %)
1323 (((
1324 ddCtrl.addPortletExpandedListener(function(portletId) { alert("The object is displayed"); });
1325 )))
1326
1327
1328 **void ddCtrl.addGroupOfTabsChangeListener (Function)**
1329
1330 Description: Event triggered when the user changes the chart within a group of tabs. The first parameter is the identifier of the group of tabs object; the second is the identifier of the current portlet.
1331
1332 Example:
1333
1334 (% class="box" %)
1335 (((
1336 ddCtrl.addGroupOfTabsChangeListener(function(portletTabId, curPortletId) { alert("The current portlet is: " + curPortletId); });
1337 )))
1338
1339
1340 **void ddCtrl.addDocumentUploadListener (Function)**
1341
1342 Description: event triggered when the user adds a file via the dashboard.
1343
1344 Example:
1345
1346 (% class="box" %)
1347 (((
1348 ddCtrl.addDocumentUploadListener(function(serverName, filesName) { alert("The file " + filesName[0] + " has been successfully added"); });
1349 )))
1350
1351
1352 **void ddCtrl.addScalingZoomListener(function(zoomConfig){}) (Function){{id name="event_scale"/}}**
1353
1354 Description: Adds a listener for the event triggered after a change in the zoom level for a page in Scale or Grid + Scale mode.
1355
1356 Example:
1357
1358 (% class="box" %)
1359 (((
1360 ddCtrl.addScalingZoomListener(function(zoomConfig){
1361 console.log("The zoom level has been changed: " + JSON.stringify(zoomConfig));
1362 });
1363 )))
1364
1365 = Miscellaneous functions =
1366
1367 **(String array) ddCtrl.getUserRoles ()**
1368
1369 Description: Returns the list of role IDs for the logged-in user.
1370
1371
1372 **(Associative array of strings / booleans) ddCtrl.getUserACLs ()**
1373
1374 Description: Returns a list of the access control list (ACL) IDs for the logged-in user. The returned list is an associative array linking the ACL ID to a Boolean (true) if the ACL is granted to the user.
1375
1376 Example:
1377
1378 (% class="box" %)
1379 (((
1380 if (ddCtrl.getUserACLs()['SaveAsPPT']) alert("You can save as PPT");
1381 )))
1382
1383 List of all possible authorizations:
1384
1385 AccessDBV, AccessDBE, EditDashboardForGroup, LoadWalletForGroup, SaveWalletForGroup, AddFlow, AddRoleFlow, RefreshFlow, RefreshRoleFlow, AccessServerSettings, AccessUserSettings, AccessLicenseSettings, AccessContentManagement, Scheduler, EditDataSourceForGroup, EditDataSource, SaveAsPDF, SaveAsPPT, SaveAsXLS, SaveAsXLSWithoutStyles, SaveAsCSV, ChartNavigation, SendSMS, UploadDocument, UpdateDocument, ListDocumentServers, ListDocuments, ViewComments, AddCommentDataModel, RemoveCommentDataModel, AddCommentFlow, RemoveCommentFlow, AllowIgnoreDMResivion, DashboardCustomization, DashboardJSCustom, DashboardTheme, EditProtectedDashboardPages, DashboardOfflineMode, DashboardNavigationMenu, DictionaryManager, DeviceManager, FormatManager, DBConnectionManager, ColorPaletteManager, PredefinedFunctionManager, StylesManager, HierarchyManager, IconManager, MapManager, ManageACLGroup, ManageProfil, AccessServerStatus, AccessBackup, AccessRestore, ManageScripts, ManageSentences, ManageRole, ManageAllRoles, ManageSchedules, ManageD3, PrintChart, EditUserAttributes, EditUserVariables, AssignProfil, ManageACL, EditProtectedUserVariables, UseAdHocAnalysis, SaveView, SavePublicView, ViewRestrictedData, DependencyAnalyser, TextQuery, AccessStudio, AccessDashboardAssistant, ViewAllComments, DownloadFromCMDR, CreateForm, AddFormData, ManageFormData, ManageAllForms, AllowImpersonate, ManageCommonItems, ManageRoleItems, ExportUsers, ImportUsers, ViewAllUsersInfo, SendMail, AddRole, EditFileDataSource, EditDBDataSource, EditReportDataSource, EditUnionDataSource, EditJoinDataSource, EditTransformerDataSource, EditColTransformerDataSource, EditIODataSource, EditDataCatalogDataSource, AllowSetQuotaByModel, ManageUserParams
1386
1387
1388 **(String) ddCtrl.getUserAttribute (attr)**
1389
1390 Description: Returns the user’s LDAP attribute <attr>.
1391
1392
1393 **(String) ddCtrl.getUserAttribute (attr, Function)**
1394
1395 Description: Returns the user’s LDAP attribute <attr> via an asynchronous call function.
1396
1397 Example:
1398
1399 (% class="box" %)
1400 (((
1401 ddCtrl.getUserAttribute('displayName', function (attrVal) {alert(attrVal)});
1402 )))
1403
1404
1405 **(String) ddCtrl.getSessionAttribute (attr)**
1406
1407 Description: Returns the <attr> attribute of the user’s session.
1408
1409 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1410
1411
1412 **(String) ddCtrl.getSessionAttribute (attr, Function)**
1413
1414 Description: Returns the <attr> attribute of the user session via an asynchronous callback function.
1415
1416 Example:
1417
1418 (% class="box" %)
1419 (((
1420 ddCtrl.getSessionAttribute('regionSelected', function (attrVal) {alert(attrVal)});
1421 )))
1422
1423 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1424
1425
1426 **void ddCtrl.setSessionAttribute (attr, value)**
1427
1428 Description: Updates the <attr> attribute of the user session with the specified value.
1429
1430 Example:
1431
1432 (% class="box" %)
1433 (((
1434 ddCtrl.setSessionAttribute('regionSelected', ‘France’);
1435 )))
1436
1437 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1438
1439
1440 **(String) ddCtrl.getServerAttribute (attr)**
1441
1442 Description: Returns the <ATTR> attribute of the server. Server attributes (or variables) allow you to specify constants used in data models and Flows via the keyword ${server.<ATTR>}.
1443
1444 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
1445
1446
1447 **(String) ddCtrl.getServerAttribute (attr, Function)**
1448
1449 Description: Returns the <attr> server attribute via an asynchronous call.
1450
1451 Example:
1452
1453 (% class="box" %)
1454 (((
1455 ddCtrl.getSessionAttribute('serverMode', function (attrVal) {alert(attrVal)});
1456 )))
1457
1458 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
1459
1460
1461 **(String) ddCtrl.getUserStorage (attr)**
1462
1463 Description: Returns the <attr> attribute of the specified user that was previously saved.
1464
1465 Example:
1466
1467 (% class="box" %)
1468 (((
1469 var value = ddCtrl.getUserStorage('attribute');
1470 )))
1471
1472 **void ddCtrl.setUserStorage (attr, value)**
1473
1474 Description: Saves the user’s <attr> attribute persistently on the server for future use.
1475
1476 Example:
1477
1478 (% class="box" %)
1479 (((
1480 ddCtrl.setUserStorage('attribute', 'value');
1481 )))
1482
1483
1484 **void ddCtrl.fireRefreshEvent (event)**
1485
1486 Description: Triggers a server-side refresh of the data associated with the specified event
1487
1488 Example:
1489
1490 (% class="box" %)
1491 (((
1492 ddCtrl.fireRefreshEvent('DAILY_UPDATE');
1493 )))
1494
1495
1496 **void ddCtrl.newAuthToken ()**
1497
1498 Description: Returns an authentication token generated for the current session.
1499
1500 Example:
1501
1502 (% class="box" %)
1503 (((
1504 var token = ddCtrl.newAuthToken();
1505
1506 window.open("http:~/~/localhost:8080/digdash_dashboard/index.html?user=mon_user&authToken=token");
1507 )))
1508
1509
1510 **void loadCSS(cssFile)**
1511
1512 Description: Loads a CSS file.
1513
1514
1515 **void ddCtrl.loadTheme (cssTheme)**
1516
1517 Description: Loads a DigDash CSS theme onto the dashboard.
1518
1519 Example:
1520
1521 (% class="box" %)
1522 (((
1523 ddCtrl.loadTheme(‘digdash’);
1524 )))
1525
1526 **void ddCtrl.removeTheme (cssTheme)**
1527
1528 Description: Removes the DigDash CSS theme from the dashboard.
1529
1530 Example:
1531
1532 (% class="box" %)
1533 (((
1534 ddCtrl.removeTheme('digdash');
1535 )))
1536
1537 **void openFormInWindow (portlet, width, height, dimension, member [, dimension, member, ...])**
1538
1539 Description: Opens a form (where `portlet` is the form object added to a dashboard page) in a pop-up window and filters it by the dimension(s) and member(s) specified as parameters (a list of dimension/member pairs).
1540
1541 Example:
1542
1543 (% class="box" %)
1544 (((
1545 <a href="javascript:__ddCtrl.openFormInWindow__('portletId', '80%', '80%', 'Year', '2024', 'Country', 'France')">Displays the form with the values ‘France 2024’</a>
1546 )))
1547
1548
1549 **void initFormData (portlet, field name, field value [, name, value, ...])**
1550
1551 Description: Initialises a form with the values specified as parameters (a list of key-value pairs for the form fields).
1552
1553 Example:
1554
1555 (% class="box" %)
1556 (((
1557 <a href="javascript:__ddCtrl.initFormData__('1906313430','//f_project_name//','DigDash')">Initialises the form with the value ‘DigDash’ for the ‘Project Name’ field</a>
1558 )))
1559
1560 * To retrieve the portlet ID, open the portlet’s **Information** tab in the Dashboard Editor and copy **the Unique ID**.
1561 * To retrieve the key for a form field: edit the form, click the **‘Edit JSON** ’ button in the top right-hand corner of the form and copy the ‘key’ value: in this example, //‘f_project_name//’.
1562
1563 **void logout ()**
1564
1565 Description: Logs out the current user.