Wiki source code of Dashboard API

Last modified by Aurelie Bertrand on 2026/06/29 17:48

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
686 )))
687
688 **(Boolean) canChangeCurrentPage (page)**
689
690 Description: Returns true if it is possible to switch to the page <page>. Returns false otherwise.
691
692
693 **void ddCtrl.hidePage (page)**
694
695 Description: Hides the tab for page <page> if it is visible, without changing the current page.
696
697 Example:
698
699 (% class="box" %)
700 (((
701 <a href="javascript:__ddCtrl.hidePage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Global')">Exit details</a>
702 )))
703
704
705 **void ddCtrl.showPage (page)**
706
707 Description: Displays the tab for page <page> if it is hidden, without changing the current page.
708
709 Example:
710
711 (% class="box" %)
712 (((
713 <a href="javascript:__ddCtrl.showPage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Détails Pays')">Show details</a>
714 )))
715
716
717 **void ddCtrl.openFlowInWindow (flow, iWidth, iHeight)**
718
719 Description: Opens a flow in a pop-up window with the specified width and height.
720
721 Example:
722
723 (% class="box" %)
724 (((
725 <a href="javascript:__ddCtrl.openFlowInWindow__('fluxId', '250', '200')">Display product breakdown</a>
726 )))
727
728
729 **void ddCtrl.openPortletInWindow (portlet, iWidth, iHeight)**
730
731 Description: Opens a portlet in a pop-up window with the specified width and height.
732
733 Example:
734
735 (% class="box" %)
736 (((
737 <a href="javascript:__ddCtrl.openPortletInWindow__('portletId', '250', '200')">Display product breakdown</a>
738 )))
739
740
741 **void ddCtrl.openFlowInWindowWithFilter (flow, iWidth, iHeight, dimension, member [, dimension, member, ...])**
742
743 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).
744
745 (% class="box infomessage" %)
746 (((
747 Note: Filters will only be applied to the new window.
748 )))
749
750 Example:
751
752 (% class="box" %)
753 (((
754 <a href="javascript:__ddCtrl.openFlowInWindowWithFilter__('fluxId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
755 )))
756
757
758 **void ddCtrl.openPortletInWindowWithFilter (portlet, iWidth, iHeight, dimension, member [, dimension, member, ...])**
759
760 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).
761
762 (% class="box infomessage" %)
763 (((
764 Note: Filters will only be applied to the new window.
765 )))
766
767 Example:
768
769 (% class="box" %)
770 (((
771 <a href="javascript:__ddCtrl.openPortletInWindowWithFilter__('portletId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
772 )))
773
774
775 **void ddCtrl.closeFlowInWindow (flow)**
776
777 Description: Allows you to programmatically close a pop-up displayed using the **openFlowInWindow**, **openPortletInWindow** and **openFormInWindow** functions.
778
779 This function takes as a parameter the identifier that was passed to the function used to display the pop-up.
780
781 Example:
782
783 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
784 (((
785 {{code}}
786 ddCtrl.openFlowInWindow('716abf12', '80%', '80%');
787
788 ddCtrl.closeFlowInWindow('716abf12')
789 {{/code}}
790
791 (% 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"]]
792 )))
793
794
795 **void ddCtrl.openDocument (serverName, fileName)**
796
797 Description: Opens a document in a new window.
798
799 Example:
800
801 (% class="box" %)
802 (((
803 <a href="javascript:__ddCtrl.openDocument__('Common Datasources', 'catalogue_produits.pdf')">Display the product catalogue</a>
804 )))
805
806
807 **void ddCtrl.uploadDocument (serverName, fileName)**
808
809 Description: Uploads a document to a document server. Opens a file selection window on the workstation.
810
811 Example:
812
813 (% class="box" %)
814 (((
815 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.uploadDocument__(%%)('Common Datasources', 'catalogue_produits.pdf')">Upload the product catalogue</a>
816 )))
817
818
819 **void ddCtrl.deleteDocument (serverName, fileName)**
820
821 Description: Deletes a document from the document server.
822
823 Example:
824
825 (% class="box" %)
826 (((
827 <a href="javascript:__ddCtrl.deleteDocument__('Common Datasources', 'catalogue_produits.pdf')">Delete the product catalogue</a>
828 )))
829
830
831 **void ddCtrl.downloadDocument (serverName, fileName)**
832
833 Description: Downloads a document from the document server.
834
835 Example:
836
837 (% class="box" %)
838 (((
839 <a href="javascript:__ddCtrl.downloadDocument__('Common Datasources', 'catalogue_produits.pdf')">Download the product catalogue</a>
840 )))
841
842
843
844 **void ddCtrl.refreshDashboard ()**
845
846 Description: Refreshes the dashboard (same behaviour as the Refresh button in the dashboard header).
847
848 Example:
849
850 (% class="box" %)
851 (((
852 <a href="javascript:__ddCtrl.refreshDashboard__()">Refresh</a>
853 )))
854
855
856 **void ddCtrl.refreshFlow (flow, [event])**
857
858 Description: Refreshes the specified flow with an optional event name.
859
860 Example:
861
862 (% class="box" %)
863 (((
864 <A href="javascript:__ddCtrl.refreshFlow__('flowId', 'MAJ_QUOTIDIENNE')">Refresh {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
865 )))
866
867
868 **void ddCtrl.refreshFlows ([event])**
869
870 Description: Refreshes all flows on the dashboard with an optional event name.
871
872 Example:
873
874 (% class="box" %)
875 (((
876 <a href="javascript:__ddCtrl.refreshFlows__('MAJ_QUOTIDIENNE')"> Refresh all </a>
877 )))
878
879
880 **(String) ddCtrl.getCurrentRole ()**
881
882 Description: Returns the role ID of the current page or the user’s name for a user page.
883
884
885 **(String) ddCtrl.getRole(page)**
886
887 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.
888
889
890 **void ddCtrl.hidePortlet (portlet)**
891
892 **void ddCtrl.showPortlet (portlet)**
893
894 (% class="box warningmessage" %)
895 (((
896 ❗These functions must only be used on portlets present on the current page.
897 )))
898
899 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.
900
901 Example:
902
903 (% class="box" %)
904 (((
905 <a href="javascript:__ddCtrl.showPortlet__('portletId')">Show Details</a>
906 )))
907
908
909 **void ddCtrl.setPortletPos (portlet, x, y)**
910
911 **void ddCtrl.setPortletSize (portlet, width, height)**
912
913 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.
914
915 Example:
916
917 (% class="box" %)
918 (((
919 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '100', '100'); __ddCtrl.setPortletSize__('portletId', '600', '400')">Expand Details</a>
920 )))
921
922
923 **void ddCtrl.setPortletMargins (portlet, marginTop, marginRight, marginBottom, marginLeft)**
924
925 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.
926
927 Example:
928
929 (% class="box" %)
930 (((
931 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '10', '10', '10', '10'); __ddCtrl.setPortletMargins__('portletId', '600', '400')">Change the margins</a>
932 )))
933
934
935 **(Boolean) ddCtrl.chartIsHidden (portlet)**
936
937 Description: Returns true when the portlet is hidden (see hideChart) and false otherwise.
938
939
940 **void ddCtrl.genTemplatePPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
941
942 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.
943
944 Example:
945
946 (% class="box" %)
947 (((
948 <A href="javascript:__ddCtrl.genTemplatePPT__('Id Fabrique De Document')">Download PPT</A>
949 )))
950
951
952 **void ddCtrl.exportCurrentPageAsPPT ()**
953
954 Description: Saves the current dashboard page in PPT format. The user is offered the option to download the generated PPT.
955
956 Example:
957
958 (% class="box" %)
959 (((
960 <a href="javascript:__ddCtrl.exportCurrentPageAsPPT__()">Download this page as a PPT</a>
961 )))
962
963
964 **void ddCtrl.exportPageAsPPT (role, page)**
965
966 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).
967
968 Example:
969
970 (% class="box" %)
971 (((
972 <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>
973 )))
974
975
976 **void ddCtrl.genTemplatePDF(flow)**
977
978 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.
979
980 Example:
981
982 (% class="box" %)
983 (((
984 <A href="javascript:__ddCtrl.genTemplatePDF__('Id Fabrique De Document')">Download the PDF</A>
985 )))
986
987
988 **void ddCtrl.exportCurrentPageAsPDF ()**
989
990 Description: Saves the current dashboard page in PDF format. The user is offered the option to download the generated PDF.
991
992 Example:
993
994 (% class="box" %)
995 (((
996 <a href="javascript:__ddCtrl.exportCurrentPageAsPDF__()">Download this page as a PDF</a>
997 )))
998
999
1000 **void ddCtrl.exportPageAsPDF (role, page)**
1001
1002 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).
1003
1004 Example:
1005
1006 (% class="box" %)
1007 (((
1008 <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>
1009 )))
1010
1011
1012 **void ddCtrl.genTemplateXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1013
1014 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.
1015
1016 Example:
1017
1018 (% class="box" %)
1019 (((
1020 <A href="javascript:__ddCtrl.genTemplateXLS__('Id Fabrique De Document')">Download the XLS</A>
1021 )))
1022
1023 **void ddCtrl.genTemplateHTML ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1024
1025 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.
1026
1027 Example:
1028
1029 (% class="box" %)
1030 (((
1031 <A href="javascript:__ddCtrl.genTemplateHTML__('Id Fabrique De Document')">Download the HTML</A>
1032 )))
1033
1034 **void ddCtrl.exportAsPDF ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1035
1036 Description: Saves the flow as a PDF. The user is offered the option to download the generated PDF.
1037
1038
1039 **void ddCtrl.exportAsPPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1040
1041 Description: Saves the flow as a PPT. The user is offered the option to download the generated PPT.
1042
1043
1044 **void ddCtrl.exportAsXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1045
1046 Description: Saves the flow as an XLS file. The user is offered the option to download the generated XLS file.
1047
1048
1049 **void ddCtrl.exportAsXLSWithoutStyles ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1050
1051 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.
1052
1053
1054 **void ddCtrl.exportAsCSV ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
1055
1056 Description: Saves the flow as a CSV (Comma-Separated Values) file. The user is prompted to download the generated CSV file.
1057
1058
1059 **void ddCtrl.saveDashboardState (name, default)**
1060
1061 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.
1062
1063
1064 **(String) ddCtrl.getCurrentPortletInGroupOfTabs (portletTabId)**
1065
1066 Description: Returns the ID of the current portlet in the Tab Group object. The `portletTabId` parameter is the ID of the Tab Group.
1067
1068
1069 **void ddCtrl.changePortletInGroupOfTabs (portletTabId, portletId)**
1070
1071 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.
1072
1073
1074 **(Array) ddCtrl.getCurrentPagePath ()**
1075
1076 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).
1077
1078
1079 **void ddCtrl.expandCollapseNavigationMenu()**
1080
1081 Description: Collapses the navigation menu if it is expanded, and vice versa.
1082
1083
1084 == Scale Mode Functions{{id name="scale"/}} ==
1085
1086 These functions relate to zoom selection in **Scale** or **Grid + Scale** mode.
1087
1088 **void ddCtrl.setScalingZoom(zoom)**
1089
1090 Description: Sets the zoom level to the specified value.
1091
1092 Example:
1093
1094 (% class="box" %)
1095 (((
1096 <a href="javascript:__ddCtrl.setScalingZoom(0.65)__">Set the page zoom to 65%</a>
1097 )))
1098
1099
1100 **void ddCtrl.setScalingAdaptWidth()**
1101
1102 Description: applies the ‘Adapt to width’ zoom.
1103
1104
1105
1106 **void ddCtrl.setScalingAdaptHeight()**
1107
1108 Description: applies the ‘Adapt to height’ zoom.
1109
1110
1111
1112 **void ddCtrl.setScalingZoomRange(min, max)**
1113
1114 Description: sets the minimum and maximum zoom limits. The user will not be able to set a zoom level outside these values.
1115
1116 Example:
1117
1118 (% class="box" %)
1119 (((
1120 <a href="javascript:__setScalingZoomRange(0.4,1.2)__">Set a zoom range between 40 and 120%</a>
1121 )))
1122
1123 = Event handling =
1124
1125 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.
1126
1127 == Dashboard Events Diagram ==
1128
1129 (% 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" %)​
1130
1131 **void ddCtrl.addChartBeforeRefreshListener (Function)**
1132
1133 Description: Adds a listener function for the event triggered before the chart is refreshed.
1134
1135 Example:
1136
1137 (% class="box" %)
1138 (((
1139 ddCtrl.addChartBeforeRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be refreshed"); });
1140 )))
1141
1142
1143 **void ddCtrl.addChartRefreshListener (Function)**
1144
1145 Description: Adds a function to listen for the event triggered after the chart has been refreshed.
1146
1147 Example:
1148
1149 (% class="box" %)
1150 (((
1151 ddCtrl.addChartRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been refreshed"); });
1152 )))
1153
1154
1155 **void ddCtrl.addChartDrawnListener (Function)**
1156
1157 Description: Adds a function to listen for the event triggered when the chart has finished being drawn (first display).
1158
1159 Example:
1160
1161 (% class="box" %)
1162 (((
1163 ddCtrl.addChartDrawnListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been drawn"); });
1164 )))
1165
1166
1167 **void ddCtrl.addChartModelReadyListener (Function)**
1168
1169 Description: Adds a listener function for the event triggered before the chart is drawn (first display).
1170
1171 Example:
1172
1173 (% class="box" %)
1174 (((
1175 ddCtrl.addChartModelReadyListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be drawn"); });
1176 )))
1177
1178
1179 **void ddCtrl.addDimensionFilterListener (Function)**
1180
1181 Description: Adds a listener function for the event triggered after a dimension has been filtered.
1182
1183 Example:
1184
1185 (% class="box" %)
1186 (((
1187 ddCtrl.addDimensionFilterListener(function(dimension, hierarchy, level, members, membersFormatted, bExclude, min, max) { alert("The dimension " + dimension + " has been filtered to " + membersFormatted); });
1188 )))
1189
1190
1191 **void ddCtrl.addVariableChangeListener (Function)**
1192
1193 Description: Adds a listener function for the event triggered after a variable has been changed.
1194
1195 Example:
1196
1197 (% class="box" %)
1198 (((
1199 ddCtrl.addVariableChangeListener(function(variable, value) { alert("The variable " + variable + " has changed; new value: " + value); });
1200 )))
1201
1202
1203 == Dashboard Event Handling{{id name="event_tdb"/}} ==
1204
1205
1206 **void ddCtrl.addDashboardLoadListener (Function)**
1207
1208 Description: Adds a listener for the event triggered once the dashboard has loaded but has not yet been rendered.
1209
1210 Example:
1211
1212 (% class="box" %)
1213 (((
1214 ddCtrl.addDashboardLoadListener(function(currentPage) { alert("Initialising the dashboard"); });
1215 )))
1216
1217
1218
1219 **void ddCtrl.addCurrentPageLoadListener (Function)**
1220
1221 Description: Adds a function to listen for the event triggered once the dashboard page has fully loaded.
1222
1223 Example:
1224
1225 (% class="box" %)
1226 (((
1227 ddCtrl.addCurrentPageLoadListener(function(currentPage) { alert("Page " + currentPage + " has been loaded"); });
1228 )))
1229
1230
1231 **void ddCtrl.addCurrentPageChangeListener (Function)**
1232
1233 Description: Adds a function to listen for the event triggered when a page changes.
1234
1235 Example:
1236
1237 (% class="box" %)
1238 (((
1239 ddCtrl.addCurrentPageChangeListener(function(currentPage, bFirstTime) { alert("The page is now " + currentPage); });
1240 )))
1241
1242
1243 **void ddCtrl.addUserLoggedListener (Function)**
1244
1245 Description: Event triggered once the user has been authenticated. May be useful when using the ddCtrl.getUserAttribute function.
1246
1247 Example:
1248
1249 (% class="box" %)
1250 (((
1251 ddCtrl.addUserLoggedListener(function() { alert("You are logged in"); });
1252 )))
1253
1254
1255 **void ddCtrl.addPortletHiddenListener (Function)**
1256
1257 Description: Event triggered when the object’s status changes from visible to hidden.
1258
1259 Example:
1260
1261 (% class="box" %)
1262 (((
1263 ddCtrl.addPortletHiddenListener(function(portletId) { alert("The object is hidden"); });
1264 )))
1265
1266
1267 **void ddCtrl.addPortletVisibleListener (Function)**
1268
1269 Description: Event triggered when the object’s status changes from hidden to visible.
1270
1271 Example:
1272
1273 (% class="box" %)
1274 (((
1275 ddCtrl.addPortletVisibleListener(function(portletId) { alert("The object is visible"); });
1276 )))
1277
1278
1279 **void ddCtrl.addPortletCollapseListener (Function)**
1280
1281 Description: Event triggered when the user clicks the icon to hide a retractable element.
1282
1283 Example:
1284
1285 (% class="box" %)
1286 (((
1287 ddCtrl.addPortletCollapseListener(function(portletId) { alert("The object is about to be hidden"); });
1288 )))
1289
1290
1291 **void ddCtrl.addPortletCollapsedListener (Function)**
1292
1293 Description: Event triggered once the retractable element has been hidden.
1294
1295 Example:
1296
1297 (% class="box" %)
1298 (((
1299 ddCtrl.addPortletCollapsedListener(function(portletId) { alert("The object is hidden"); });
1300 )))
1301
1302
1303 **void ddCtrl.addPortletExpandListener (Function)**
1304
1305 Description: Event triggered when the user clicks the icon to expand a retractable element.
1306
1307 Example:
1308
1309 (% class="box" %)
1310 (((
1311 ddCtrl.addPortletExpandListener(function(portletId) { alert("The object is about to be displayed"); });
1312 )))
1313
1314
1315 **void ddCtrl.addPortletExpandedListener (Function)**
1316
1317 Description: Event triggered once the retractable element has been displayed.
1318
1319 Example:
1320
1321 (% class="box" %)
1322 (((
1323 ddCtrl.addPortletExpandedListener(function(portletId) { alert("The object is displayed"); });
1324 )))
1325
1326
1327 **void ddCtrl.addGroupOfTabsChangeListener (Function)**
1328
1329 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.
1330
1331 Example:
1332
1333 (% class="box" %)
1334 (((
1335 ddCtrl.addGroupOfTabsChangeListener(function(portletTabId, curPortletId) { alert("The current portlet is: " + curPortletId); });
1336 )))
1337
1338
1339 **void ddCtrl.addDocumentUploadListener (Function)**
1340
1341 Description: event triggered when the user adds a file via the dashboard.
1342
1343 Example:
1344
1345 (% class="box" %)
1346 (((
1347 ddCtrl.addDocumentUploadListener(function(serverName, filesName) { alert("The file " + filesName[0] + " has been successfully added"); });
1348 )))
1349
1350
1351 **void ddCtrl.addScalingZoomListener(function(zoomConfig){}) (Function){{id name="event_scale"/}}**
1352
1353 Description: Adds a listener for the event triggered after a change in the zoom level for a page in Scale or Grid + Scale mode.
1354
1355 Example:
1356
1357 (% class="box" %)
1358 (((
1359 ddCtrl.addScalingZoomListener(function(zoomConfig){
1360 console.log("The zoom level has been changed: " + JSON.stringify(zoomConfig));
1361 });
1362 )))
1363
1364 = Miscellaneous functions =
1365
1366 **(String array) ddCtrl.getUserRoles ()**
1367
1368 Description: Returns the list of role IDs for the logged-in user.
1369
1370
1371 **(Associative array of strings / booleans) ddCtrl.getUserACLs ()**
1372
1373 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.
1374
1375 Example:
1376
1377 (% class="box" %)
1378 (((
1379 if (ddCtrl.getUserACLs()['SaveAsPPT']) alert("You can save as PPT");
1380 )))
1381
1382 List of all possible authorizations:
1383
1384 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
1385
1386
1387 **(String) ddCtrl.getUserAttribute (attr)**
1388
1389 Description: Returns the user’s LDAP attribute <attr>.
1390
1391
1392 **(String) ddCtrl.getUserAttribute (attr, Function)**
1393
1394 Description: Returns the user’s LDAP attribute <attr> via an asynchronous call function.
1395
1396 Example:
1397
1398 (% class="box" %)
1399 (((
1400 ddCtrl.getUserAttribute('displayName', function (attrVal) {alert(attrVal)});
1401 )))
1402
1403
1404 **(String) ddCtrl.getSessionAttribute (attr)**
1405
1406 Description: Returns the <attr> attribute of the user’s session.
1407
1408 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1409
1410
1411 **(String) ddCtrl.getSessionAttribute (attr, Function)**
1412
1413 Description: Returns the <attr> attribute of the user session via an asynchronous callback function.
1414
1415 Example:
1416
1417 (% class="box" %)
1418 (((
1419 ddCtrl.getSessionAttribute('regionSelected', function (attrVal) {alert(attrVal)});
1420 )))
1421
1422 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1423
1424
1425 **void ddCtrl.setSessionAttribute (attr, value)**
1426
1427 Description: Updates the <attr> attribute of the user session with the specified value.
1428
1429 Example:
1430
1431 (% class="box" %)
1432 (((
1433 ddCtrl.setSessionAttribute('regionSelected', ‘France’);
1434 )))
1435
1436 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
1437
1438
1439 **(String) ddCtrl.getServerAttribute (attr)**
1440
1441 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>}.
1442
1443 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
1444
1445
1446 **(String) ddCtrl.getServerAttribute (attr, Function)**
1447
1448 Description: Returns the <attr> server attribute via an asynchronous call.
1449
1450 Example:
1451
1452 (% class="box" %)
1453 (((
1454 ddCtrl.getSessionAttribute('serverMode', function (attrVal) {alert(attrVal)});
1455 )))
1456
1457 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
1458
1459
1460 **(String) ddCtrl.getUserStorage (attr)**
1461
1462 Description: Returns the <attr> attribute of the specified user that was previously saved.
1463
1464 Example:
1465
1466 (% class="box" %)
1467 (((
1468 var value = ddCtrl.getUserStorage('attribute');
1469 )))
1470
1471 **void ddCtrl.setUserStorage (attr, value)**
1472
1473 Description: Saves the user’s <attr> attribute persistently on the server for future use.
1474
1475 Example:
1476
1477 (% class="box" %)
1478 (((
1479 ddCtrl.setUserStorage('attribute', 'value');
1480 )))
1481
1482
1483 **void ddCtrl.fireRefreshEvent (event)**
1484
1485 Description: Triggers a server-side refresh of the data associated with the specified event
1486
1487 Example:
1488
1489 (% class="box" %)
1490 (((
1491 ddCtrl.fireRefreshEvent('DAILY_UPDATE');
1492 )))
1493
1494
1495 **void ddCtrl.newAuthToken ()**
1496
1497 Description: Returns an authentication token generated for the current session.
1498
1499 Example:
1500
1501 (% class="box" %)
1502 (((
1503 var token = ddCtrl.newAuthToken();
1504
1505 window.open("http:~/~/localhost:8080/digdash_dashboard/index.html?user=mon_user&authToken=token");
1506 )))
1507
1508
1509 **void loadCSS(cssFile)**
1510
1511 Description: Loads a CSS file.
1512
1513
1514 **void ddCtrl.loadTheme (cssTheme)**
1515
1516 Description: Loads a DigDash CSS theme onto the dashboard.
1517
1518 Example:
1519
1520 (% class="box" %)
1521 (((
1522 ddCtrl.loadTheme(‘digdash’);
1523 )))
1524
1525 **void ddCtrl.removeTheme (cssTheme)**
1526
1527 Description: Removes the DigDash CSS theme from the dashboard.
1528
1529 Example:
1530
1531 (% class="box" %)
1532 (((
1533 ddCtrl.removeTheme('digdash');
1534 )))
1535
1536 **void openFormInWindow (portlet, width, height, dimension, member [, dimension, member, ...])**
1537
1538 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).
1539
1540 Example:
1541
1542 (% class="box" %)
1543 (((
1544 <a href="javascript:__ddCtrl.openFormInWindow__('portletId', '80%', '80%', 'Year', '2024', 'Country', 'France')">Displays the form with the values ‘France 2024’</a>
1545 )))
1546
1547
1548 **void initFormData (portlet, field name, field value [, name, value, ...])**
1549
1550 Description: Initialises a form with the values specified as parameters (a list of key-value pairs for the form fields).
1551
1552 Example:
1553
1554 (% class="box" %)
1555 (((
1556 <a href="javascript:__ddCtrl.initFormData__('1906313430','//f_project_name//','DigDash')">Initialises the form with the value ‘DigDash’ for the ‘Project Name’ field</a>
1557 )))
1558
1559 * To retrieve the portlet ID, open the portlet’s **Information** tab in the Dashboard Editor and copy **the Unique ID**.
1560 * 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//’.
1561
1562 **void logout ()**
1563
1564 Description: Logs out the current user.