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