Dashboard

cdf.dashboard. Dashboard

Base abstract dashboard class. This class is abstract, so it should not be required or instantiated directly.

Instead, use one of its extending subclasses: Blueprint, Bootstrap or Clean.

Each dashboard instance can be localized by adding, in the same directory, the following properties files:

  • messages_supported_languages.properties - Defines supported languages, if not present, i18n support will not be loaded, for example:

    en=English
    pt=Portuguese
  • messages.properties: Default messages file, for example:

    myDashboard.title=Default title
  • messages_[language_code].properties: Language code messages file, for example:

    myDashboard.title=Title # for messages_en.properties
    myDashboard.title=Título # for messages_pt.properties

Usage:

dashboard.i18nSupport.prop("myDashboard.title");

Extends

  • Base

  • Backbone.Events

Constructor

Name
Description

new Dashboard(options)Abstract

Base abstract dashboard class. It should not be required o

Members

Name
Description

_i18nCurrentLanguageCode : stringProtected

The dashboard's current language code.

_i18nSupport : objectProtected

Localization object.

addIns : ObjectProtected

Serves as a container for holding the registered add-ins.

args : Array.<`string`>Deprecated

Array of arguments.

blockUiOptions : ObjectProtected

Holds the dashboard jQuery.blockUI options.

CDF_ERROR_DIV : stringDeprecated

Legacy identifier of the HTML div element used for showing errors.

components : Array.<`cdf.components.BaseComponent`>Protected

Array which stores all components in the dashboard.

context : ObjectProtected

The dashboard context object used for holding user and server session data.

dataSources : Array.<`Object`>Protected

Map of key value pairs: data source name - data source value.

debug : numberProtected

The dashboard debug level.

ERROR_CODES : ObjectConstant Protected

Dashboard error codes.

escapeParameterValues : BooleanProtected

Defines if the parameter value needs to be encoded before being stored.

flatParameters : BooleanProtected

Defines if parameters are stored in flat names or in nested objects.

globalContext : booleanDeprecated

Determines if components and parameters are retrieved from the window object or from the dashboard instance.

initCounter : NumberDeprecated Protected

Init counter.

initialStorage : ObjectProtected

Holds the dashboard storage value available during the dashboard initialization.

isDisposed : booleanProtected

The dashboard is in a disposed state.

isSilent : booleanProtected

Allows disabling dashboard notifications.

lastServerResponse : NumberProtected

Last server response timestamp.

LEGACY_STORAGE : StringDeprecated Constant

Legacy storage parameter prefix.

legacyPriority : numberDeprecated Protected

Legacy dashboard components do not have priority, so we will assign a very low priority to them.

logLifecycle : booleanProtected

Flag indicating if the lifecycle events should be logged.

monthNames : Array.<`string`>Deprecated

Array of month names.

parameterModel : Backbone.ModelProtected

Backbone model connected with the parameters.

parameters : ArrayProtected

Store of key value pairs: parameter name - parameter value.

queryFactories : ObjectProtected

Container used for registering query types and instantiating queries.

refreshEngine : cdf.dashboard.RefreshEngineProtected

The RefreshEngine which manages the component refresh cycle.

runningCalls : NumberProtected

Running calls counter.

serverCheckResponseTimeout : NumberProtected

Timeout value in milliseconds.

storage : ObjectProtected

Allows a user to persist parameters server-side to be used across different dashboards.

STORAGE : StringConstant

Storage parameters prefix.

view : ObjectProtected

A view is a snapshot of the dashboard parameter's state, useful to restore a dashboard to a previous state.

viewFlags : ObjectConstant

Object used to store the available view flag values (read only).

viewParameters : ObjectProtected

Map containing the list of parameters of a dashboard and their view flag.

webAppPath : StringProtected

The current webapp path.

Methods

Name
Description

registerGlobalQuery(type, query)Static

Registers globally a new query type constructor to be used by any dashboard instance.

setBaseQuery(QueryClass)Static

Sets the BaseQuery class.

_disposeComponents()Protected

Clears resources associated with the dashboard components.

_disposeParameters()Protected

Clears resources associated with the dashboard instance parameters.

_disposeStorage()Protected

Clears resources associated with the dashboard storage.

_disposeViews()Protected

Clears resources associated with the dashboard instance views.

_throwIfDisposed()Protected

Throws an error if the Dashboard is already disposed.

addComponent(component, options) : cdf.dashboard.Dashboard

Adds an instance of a component to the dashboard.

addComponents(components)

Adds an array of component instances to the dashboard.

addDataSource(name, obj, force)

Adds a new data source.

addParameter(parameterName, parameterValue) : Object

Adds a new parameter to the parameter module.

blockUIwithDrag()

Renders a blocking div which can be dragged.

callPentahoAction(obj, solution, path, action, parameters, callback) : Object | stringDeprecated

Calls an xaction.

checkServer() : boolean

Executes a jQuery.ajax to test the connection to the server.

cleanStorage()

Resets the storage value to an empty object and issues a jQuery.ajax request to delete the value stored in the server.

createAndCleanErrorDiv()Deprecated

Creates an empty HTML div element for showing errors.

decrementRunningCalls()

Decrements the running calls counter.

detectQueryType(qd) : String | undefined

Given a query definition object, returns its query type.

dispose()

Clears resources associated with the dashboard instance, if it wasn't already disposed.

errorNotification(err, ph)

Displays an error notification if the dashboard is not in silent mode.

executeAjax(returnType, url, params, func) : Object | stringDeprecated

Executes an Ajax request.

fetchData(cd, params, callback)Deprecated

Fetches data from the server according to a query definition object.

fireChange(parameter, value)

Changes the value of a parameter, triggering a *parameter*:fireChange event.

generateBookmarkState() : Object

Generates a bookmark state using stored values.

getAddIn(type, subType, addInName) : cdf.AddIn

Gets the add-in from the add-in registry.

getBaseQuery() : cdf.queries.BaseQuery

Gets the base query object constructor from where other query types can be extended.

getBookmarkState() : Object

Gets the bookmark state URL decoded.

getComp()

Alias for getComponent.

getComponent(name) : cdf.components.BaseComponent | undefined

Gets the component instance from a given name.

getComponentByName()

Alias for getComponent.

getComponentIndex(compOrNameOrIndex) : number

Gets the index of a component.

getDataSource(obj) : Object | undefined

Gets the data source with the provided name.

getDataSourceQuery(obj) : Object | undefined

Gets a query from getQuery using the data source with the provided name.

getErrorObj(errorCode) : Object

Gets an error code message.

getMessagesPath() : stringAbstract

Gets the path from which to load the locale-specific properties files.

getParam(parameterName) : Object

Alias for getParameterValue.

getParameterValue(parameterName) : Object

Gets a parameter value.

getQuery(type, opts) : cdf.queries.BaseQuery

Given a type and options, returns the query object for running that particular query.

getRunningCalls() : number

Returns the number of running calls.

getSettingsValue(key, value)Deprecated

Gets a setting value from the server.

getUnboundParameters() : Array.<string>

Gets a list of the names of the dashboard parameters with the view flag set to viewFlags.UNBOUND.

getViewParameters() : Object

Gets a map with the dashboard parameters with the view flag set to viewFlags.VIEW or viewFlags.UNBOUND.

getWcdfSettings() : ObjectAbstract

Gets the dashboard's wcdfSettings.

getWebAppPath() : string

Gets the current webapp path.

handleServerError()

Handles a server error.

hasAddIn(type, subType, addInName) : boolean

Checks if the add-in exists in the add-in registry.

hasQuery(type) : boolean

Determines if a given query type is registered in the current dashboard.

hideProgressIndicator(force)

Hides the progress indicator if the dashboard is not in silent mode.

incrementRunningCalls()

Increments the running calls counter.

init(components)

Dashboard's initialization function.

isBookmarkable(parameter) : boolean

Checks if a parameter is bookmarkable.

isComponentUpdating(the)

Cheks if a component is being updated in the dashboard lifecycle.

isValidQueryDefinition(queryDefinition) : boolean

Tests if a query definition is valid or not.

isViewParameter(parameter) : string

Returns the view flag value of a given parameter.

listAddIns(type, subType) : Array.<cdf.AddIn>

Lists registered add-ins of a given type and subtype.

listQueries() : Array.<String>

Lists the registered query types in this dashboard.

loadStorage()

Loads the storage value from the server.

loginAlert(newOpts)

Shows a login error notification if the dashboard is not in silent mode.

normalizeId(id) : stringAbstract

Normalizes a DOM element identifier.

parseXActionResult(obj, html) : ObjectDeprecated

Parses the xaction result.

pentahoAction(solution, path, action, params, func) : Object | stringDeprecated

Another way to call an xaction.

pentahoServiceAction(serviceMethod, returntype, solution, path, action, params, func) : Object | stringDeprecated

Calls an xaction.

persistBookmarkables(param)

Persists a bookmark state.

processChange(object_name)

Processes a change in a component.

registerAddIn(type, subType, addIn)

Registers an add-in to be used only by this dashboard instance.

registerGlobalAddIn(type, subType, addIn)

Registers a global add-in.

registerQuery(type, query)

Registers a new query type constructor to be used by the dashboard instance.

removeComponent(compOrNameOrIndex) : cdf.components.BaseComponent | undefined

Removes a component from the components array.

removeDataSource(obj)

Removes the data source with the provided name.

resetAll()

Resets the dashboard.

resetRunningCalls()

Resets the running calls counter and hides the progress indicator.

restoreBookmarkables()

Restores the bookmark state.

restoreView()

Restores the dashboard parameters stored in a view.

saveStorage()

Saves the storage value in the server.

setAddInDefaults(type, subType, addInName, defaults)

Sets the default options of an add-in.

setBookmarkable(parameter, value)

Sets a pair parameter/value as bookmarkable.

setBookmarkState(state)

Overrides a bookmark state with a given state.

setDataSource(name, obj)

Adds a data source overriding any existing one with the same name.

setGlobalContext(globalContext)Deprecated

Sets the globalContext value.

setI18nSupport(locale, i18nRef)

Sets the current locale and i18n options.

setParam(parameterName, parameterValue, isNotified) : undefined

Alias for setParameter.

setParameter(parameterName, parameterValue, isNotified)

Stores a parameter with a certain value.

setParameterViewMode(parameter, value)

Sets the view flag for a given parameter.

setSettingsValue(name, object)Deprecated

Sets a setting in the server.

showErrorTooltip()Deprecated

Creates a tooltip for showing errors.

showProgressIndicator()

Makes the progress indicator visible if the dashboard is not in silent mode.

syncDebugLevel() : number

Sets the debug level.

update(component)

Adds a component to the "to be updated" queue.

updateComponent(object)

Updates a specific component.

urlAction(url, params, func) : Object | stringDeprecated

Calls an arbitrary URL expecting the result c

Events

Name
Description

cdf:loginError

Event triggered when login fails.

cdf:postInit

Event triggered after dashboard initialization.

cdf:preInit

Event triggered before dashboard initialization.

cdf:serverError

Event triggered when a server error occurs.

parameterName:fireChange(obj)

Event triggered when the dashboard parameter value changes.

Constructor Details

new Dashboard(options)Abstract

Abstract constructor for the Dashboard object.

**Source:**dashboard/Dashboard.js, line 55

Name

Default Value

Summary

options : ObjectOptional

Object that can contain the context, storage and view.

Name
Default Value
Summary

context : ObjectOptional

The context of the dashboard retrieved from the server.

storage : ObjectOptional

The storage of the dashboard retrieved from the server.

view : ObjectOptional

The views of the dashboard retrieved from the server.

isSilent : booleanOptional

Allows disabling the dashboard notifications.

Name

Default Value

Summary

context : ObjectOptional

The context of the dashboard retrieved from the server.

storage : ObjectOptional

The storage of the dashboard retrieved from the server.

view : ObjectOptional

The views of the dashboard retrieved from the server.

isSilent : booleanOptional

Allows disabling the dashboard notifications.

Name

Default Value

Summary

options : ObjectOptional

Object that can contain the context, storage and view.

Name
Default Value
Summary

context : ObjectOptional

The context of the dashboard retrieved from the server.

storage : ObjectOptional

The storage of the dashboard retrieved from the server.

view : ObjectOptional

The views of the dashboard retrieved from the server.

isSilent : booleanOptional

Allows disabling the dashboard notifications.

Name

Default Value

Summary

context : ObjectOptional

The context of the dashboard retrieved from the server.

storage : ObjectOptional

The storage of the dashboard retrieved from the server.

view : ObjectOptional

The views of the dashboard retrieved from the server.

isSilent : booleanOptional

Allows disabling the dashboard notifications.

## Members Details

_i18nCurrentLanguageCode: stringProtected

The dashboard's current language code, used by other localizable components.

**Source:**dashboard/Dashboard.i18n.js, line 61

_i18nSupport: objectProtected

Localization object, which will contain the property/value map and the method to get a value from a property.

**Source:**dashboard/Dashboard.i18n.js, line 45

addIns: ObjectProtected

Serves as a container for holding the registered add-ins of the respective dashboard instance.

**Source:**dashboard/Dashboard.addIns.js, line 86

args: Array.<`string`>Deprecated

Array of arguments.

**Source:**dashboard/Dashboard.js, line 282

blockUiOptions: ObjectProtected

Holds the dashboard jQuery.blockUI options.

**Source:**dashboard/Dashboard.notifications.js, line 66

CDF_ERROR_DIV: stringDeprecated

Legacy identifier of the HTML div element used for showing errors.

**Source:**dashboard/Dashboard.legacy.js, line 199

**Default Value:**cdfErrorDiv

components: Array.<`cdf.components.BaseComponent`>Protected

Array of instances of BaseComponents in the dashboard.

**Source:**dashboard/Dashboard.components.js, line 41

context: ObjectProtected

The dashboard context is used for holding user and server session information, such as the current locale and session timeout settings.

It can be initialized in two different ways. The main way is via the dashboard constructor. If not, it will be initialized via the Dashboard AMD module configuration. If no context configuration is available, it will be initialized as an empty object.

**Source:**dashboard/Dashboard.context.js, line 43

dataSources: Array.<`Object`>Protected

Map of key value pairs where the keys are the data source names and the values are the corresponding data source object.

**Source:**dashboard/Dashboard.dataSources.js, line 39

debug: numberProtected

The dashboard debug level.

**Source:**dashboard/Dashboard.js, line 329

**Default Value:**1

ERROR_CODES: ObjectConstant Protected

Contains the default dashboard error codes.

Name
Default Value
Description

QUERY_TIMEOUT : string

"Query timeout reached"

Query timeout error message.

COMPONENT_ERROR : string

"Error processing component"

Error processing component error message.

**Source:**dashboard/Dashboard.notifications.js, line 46

Name

Default Value

Description

QUERY_TIMEOUT : string

"Query timeout reached"

Query timeout error message.

COMPONENT_ERROR : string

"Error processing component"

Error processing component error message.

escapeParameterValues: BooleanProtected

Defines if the parameter value needs to be encoded before being stored.

If true, then encode_prepare_arr is called before the parameter value gets stored.

**Source:**dashboard/Dashboard.parameters.js, line 74

flatParameters: BooleanProtected

Defines if parameters are stored in flat names or in nested objects.

For instance, storing parameter name "param1.param2" with flatParameters=true will create a parameter in the root of the parameter store, while with flatParameters=false, a nested object will be created.

**Source:**dashboard/Dashboard.parameters.js, line 85

globalContext: booleanDeprecated

Determines if components and parameters are retrieved from the window object or from the dashboard instance.

**Source:**dashboard/Dashboard.js, line 212

**Default Value:**false

initCounter: NumberDeprecated Protected

Counter which stores the number of components in the dashboard being initialized. This counter is incremented for every component in the dashboard that is initialized and decremented afterwards. The end result after the initialization process should be zero.

**Source:**dashboard/Dashboard.lifecycle.js, line 44

initialStorage: ObjectProtected

Holds the dashboard storage value available during the dashboard initialization.

**Source:**dashboard/Dashboard.storage.js, line 54

isDisposed: booleanProtected

The dashboard is in a disposed state.

**Source:**dashboard/Dashboard.js, line 339

**Default Value:**false

isSilent: booleanProtected

Allows disabling dashboard notifications.

**Source:**dashboard/Dashboard.js, line 295

lastServerResponse: NumberProtected

Last server response timestamp in milliseconds, which used to know if the session expired.

**Source:**dashboard/Dashboard.lifecycle.js, line 62

LEGACY_STORAGE: StringDeprecated Constant

Legacy storage parameter prefix.

This allows users to store parameters between dashboard renders.

**Source:**dashboard/Dashboard.parameters.js, line 96

**Default Value:**Dashboards.storage.

legacyPriority: numberDeprecated Protected

Legacy dashboard components do not have priority, so we will assign a very low priority to them.

**Source:**dashboard/Dashboard.js, line 263

Default Value:-1000

logLifecycle: booleanProtected

Flag indicating if the lifecycle events should be logged.

**Source:**dashboard/Dashboard.js, line 273

**Default Value:**true

monthNames: Array.<`string`>Deprecated

Array of month names.

**Source:**dashboard/Dashboard.js, line 292

parameterModel: Backbone.ModelProtected

Backbone model connected with the parameters to provide an events system over the CDF parameters.

**Source:**dashboard/Dashboard.parameters.js, line 48

**See also:**Backbone.Model

parameters: ArrayProtected

Object which stores key value pairs with parameter name - parameter value.

**Source:**dashboard/Dashboard.parameters.js, line 38

queryFactories: ObjectProtected

Container used for registering query types and instantiating queries.

Implements the factory pattern, providing a generic interface for creating query instances of the specified type.

Query types registered in this container will be accessible only by the dashboard instance.

**Source:**dashboard/Dashboard.query.js, line 69

refreshEngine: cdf.dashboard.RefreshEngineProtected

The RefreshEngine which manages the component refresh cycle.

**Source:**dashboard/Dashboard.js, line 201

runningCalls: NumberProtected

Running calls counter used to control the progress indicator in asynchronous calls.

**Source:**dashboard/Dashboard.lifecycle.js, line 53

serverCheckResponseTimeout: NumberProtected

Timeout value in milliseconds. If serverCheckResponseTimeout passes between ajax communications, then when the next updateComponent is called, the dashboard will first checkServer, showing a loginAlert if it is unable to connect to the server.

**Source:**dashboard/Dashboard.lifecycle.js, line 75

storage: ObjectProtected

The dashboard storage is used for persisting parameters on the server and making them available to other dashboards. It is sometimes referred to as a user parameter store.

It can be initialized in two different ways. The main way is via the dashboard constructor. Otherwise, it will be initialized via the Dashboard AMD module configuration. If no configuration is available, it will be initialized as an empty object.

**Source:**dashboard/Dashboard.storage.js, line 43

STORAGE: StringConstant

Storage parameters prefix.

This allows users to store parameters between dashboard renders.

**Source:**dashboard/Dashboard.parameters.js, line 105

**Default Value:**storage.

view: ObjectProtected

Holds a snapshot of the dashboard parameter's state, which is useful to restore a dashboard to a previous state.

It can be initialized in two different ways. The main way is via the dashboard constructor. If not, it will be initialized via the Dashboard AMD module configuration.

**Source:**dashboard/Dashboard.views.js, line 56

viewFlags: ObjectConstant

Object used to store the available view flag values (read only).

Name
Default Value
Description

UNUSED : string

"unused"

Flag value for unused parameters.

UNBOUND : string

"unbound"

Flag value for unbound parameters.

VIEW : string

"view"

Flag value for view parameters.

**Source:**dashboard/Dashboard.views.js, line 68

Name

Default Value

Description

UNUSED : string

"unused"

Flag value for unused parameters.

UNBOUND : string

"unbound"

Flag value for unbound parameters.

VIEW : string

"view"

Flag value for view parameters.

viewParameters: ObjectProtected

Map containing the list of parameters of a dashboard. The keys are the parameter names and the values are the view flag value.

**Source:**dashboard/Dashboard.views.js, line 42

webAppPath: StringProtected

The current webapp path.

**Source:**dashboard/Dashboard.js, line 184

## Methods Details

registerGlobalQuery(type, query)Static

Registers globally a new query type constructor to be used by any dashboard instance.

If the query argument is an object, a new object will be created with a copy of the properties listed in the deepProperties list of the BaseQuery.

If query is a function it will be used to generate new query instances of the specified type with no dependency on the BaseQuery class.

The new query type will be registered at a global level and will be accessible by any dashboard instance. To register the query type on a single dashboard instance please see the registerQuery function.

**Source:**dashboard/Dashboard.query.js, line 293

Name
Default Value
Summary

type : string

The type of the query constructor.

query : object | function

A set of properties specific of the query type being registered, or the constructor for the query type being registered.

See also:registerQuery

Name

Default Value

Summary

type : string

The type of the query constructor.

query : object | function

A set of properties specific of the query type being registered, or the constructor for the query type being registered.

setBaseQuery(QueryClass)Static

Sets the BaseQuery class.

Registered query types will extend from the base query type unless a valid constructor function is provided during registration.

**Source:**dashboard/Dashboard.query.js, line 270

Name
Default Value
Summary

QueryClass : cdf.queries.BaseQuery

The default base query class.

See also:registerGlobalQuery , registerQuery

Name

Default Value

Summary

QueryClass : cdf.queries.BaseQuery

The default base query class.

_disposeComponents()Protected

Dispose resources that the dashboard components may have, and that are no longer needed.

**Source:**dashboard/Dashboard.components.js, line 251

_disposeParameters()Protected

Dispose resources that the dashboard parameters may have, and that are no longer needed.

**Source:**dashboard/Dashboard.parameters.js, line 261

_disposeStorage()Protected

Dispose resources that the dashboard storage may have, and that are no longer needed.

**Source:**dashboard/Dashboard.storage.js, line 83

_disposeViews()Protected

Dispose resources that the dashboard views may have, and that are no longer needed.

**Source:**dashboard/Dashboard.views.js, line 99

_throwIfDisposed()Protected

Throws an error if the Dashboard is already disposed.

**Source:**dashboard/Dashboard.lifecycle.js, line 104

addComponent(component, options) : cdf.dashboard.Dashboard

Adds an instance of BaseComponent to the dashboard components array if it was not already added.

If the component does not have a valid property component.name, or if the property is not a valid string, an exception is thrown.

The options parameter is optional and when it is absent, the component is added to the end of the components array. The same rule is applied if options.index is false. If not, the new component is appended to the array at position options.index.

**Source:**dashboard/Dashboard.components.js, line 133

Name

Default Value

Summary

component : cdf.components.BaseComponent

The new component to be added.

options : ObjectOptional

An option object.

Name
Default Value
Summary

index : NumberOptional

The index at which to add the component.

Name

Default Value

Summary

index : NumberOptional

The index at which to add the component.

|Name|Description| |----|-----------| |`cdf.dashboard.Dashboard`|The dashboard instance where the component was added.|

Name
Description

Error

The component is invalid.

Error

The component already exists in the dashboard instance.

Name

Default Value

Summary

component : cdf.components.BaseComponent

The new component to be added.

options : ObjectOptional

An option object.

Name
Default Value
Summary

index : NumberOptional

The index at which to add the component.

Name

Default Value

Summary

index : NumberOptional

The index at which to add the component.

Name

Description

Error

The component is invalid.

Error

The component already exists in the dashboard instance.

addComponents(components)

Adds one or more components to the dashboard. If a component was already added, it will not be replaced.

It iterates through the array and calls addComponent for each component.

Along with the addComponent behaviour, if a component in the array fails to be added to the dashboard instance, an error is thrown and the execution stops.

**Source:**dashboard/Dashboard.components.js, line 107

Name
Default Value
Summary

components : Array.<cdf.components.BaseComponent>

The array of components to be added.

Name
Description

Error

Error if a component in the array is invalid or was already added.

See also:addComponent

Name

Default Value

Summary

components : Array.<cdf.components.BaseComponent>

The array of components to be added.

Name

Description

Error

Error if a component in the array is invalid or was already added.

addDataSource(name, obj, force)

Adds a data source given a name, the data source object to be added, and an optional boolean indicating if any data source with the same name should be deleted. If the name parameter is an object, its name property will be used as the data source name and the obj parameter will be used as the flag for indicating that previous data sources with the same name were overwritten.

**Source:**dashboard/Dashboard.dataSources.js, line 93

Name
Default Value
Summary

name : string | Object

The name of the data source.

obj : Object | boolean

The data source to be added.

force : boolean | undefinedOptional

false

A flag indicating if any previous data sources with the same name are to be replaced.

Name

Default Value

Summary

name : string | Object

The name of the data source.

obj : Object | boolean

The data source to be added.

force : boolean | undefinedOptional

false

A flag indicating if any previous data sources with the same name are to be replaced.

addParameter(parameterName, parameterValue) : Object

Adds a new parameter to the parameter module.

Receives a parameter name and an initial value, which will be used if the parameter is not available in the parameter model. Otherwise, the value returned by getParameterValue is used.

**Source:**dashboard/Dashboard.parameters.js, line 280

Name
Default Value
Summary

parameterName : string

The name of the parameter.

parameterValue : Object

The initial value of the parameter.

Name
Description

Object

The value assigned to the parameter or undefined if the parameter name is invalid.

Name

Default Value

Summary

parameterName : string

The name of the parameter.

parameterValue : Object

The initial value of the parameter.

Name

Description

Object

The value assigned to the parameter or undefined if the parameter name is invalid.

blockUIwithDrag()

Renders a blocking div which can be dragged.

**Source:**dashboard/Dashboard.notifications.js, line 99

callPentahoAction(obj, solution, path, action, parameters, callback) : Object | stringDeprecated

Calls an xaction.

**Source:**dashboard/Dashboard.legacy.js, line 56

Name
Default Value
Summary

obj : Object

DOM object where the response from the xaction should be written.

solution : string

The solution folder.

path : string

Path to the xaction. Can be the full path, in which case you do not need the solution and action.

action : string

The xaction name.

parameters : Object

Parameter object to send to the xaction.

callback : function

Callback function to call when the xaction responds.

Name
Description

Object | string

If callback is a function it returns the value of executing pentahoAction. Otherwise, it returns the value of executing parseXActionResult.

See also:pentahoAction , parseXActionResult

Name

Default Value

Summary

obj : Object

DOM object where the response from the xaction should be written.

solution : string

The solution folder.

path : string

Path to the xaction. Can be the full path, in which case you do not need the solution and action.

action : string

The xaction name.

parameters : Object

Parameter object to send to the xaction.

callback : function

Callback function to call when the xaction responds.

Name

Description

Object | string

If callback is a function it returns the value of executing pentahoAction. Otherwise, it returns the value of executing parseXActionResult.

checkServer() : boolean

Executes a jQuery.ajax to test the connection to the server. Uses HTTP POST to avoid cache.

**Source:**dashboard/Dashboard.notifications.js, line 264

Name
Description

boolean

true if able to connect, false otherwise.

Name

Description

boolean

true if able to connect, false otherwise.

cleanStorage()

Resets the storage value to an empty object and deletes the value stored in the server.

**Source:**dashboard/Dashboard.storage.js, line 163

createAndCleanErrorDiv()Deprecated

Creates an empty HTML div element, with identifier CDF_ERROR_DIV for showing error messages.

**Source:**dashboard/Dashboard.legacy.js, line 208

decrementRunningCalls()

Decrements the running calls counter and if it reaches 0, hides the progress indicator.

**Source:**dashboard/Dashboard.lifecycle.js, line 145

detectQueryType(qd) : String | undefined

Given a query definition object, returns its query type. The query can have three groups of types. First cda, with queries using the CDA plugin. Then legacy, using xactions, and an arbitrary value for CPK data sources.

**Source:**dashboard/Dashboard.query.js, line 154

Name

Default Value

Summary

qd : Object

The query definition object.

Name
Default Value
Summary

dataSource : StringOptional

The name of the data source.

queryType : StringOptional

The query type in case it is from CPK.

query : ObjectOptional

The query in case of it being legacy.

path : StringOptional

The path of the CDA file holding the query.

dataAccessId : StringOptional

The name of the query in the CDA file .

Name

Default Value

Summary

dataSource : StringOptional

The name of the data source.

queryType : StringOptional

The query type in case it is from CPK.

query : ObjectOptional

The query in case of it being legacy.

path : StringOptional

The path of the CDA file holding the query.

dataAccessId : StringOptional

The name of the query in the CDA file .

|Name|Description| |----|-----------| |`String` \| `undefined`|The query type or `undefined` if none was detected.|

Name

Default Value

Summary

qd : Object

The query definition object.

Name
Default Value
Summary

dataSource : StringOptional

The name of the data source.

queryType : StringOptional

The query type in case it is from CPK.

query : ObjectOptional

The query in case of it being legacy.

path : StringOptional

The path of the CDA file holding the query.

dataAccessId : StringOptional

The name of the query in the CDA file .

Name

Default Value

Summary

dataSource : StringOptional

The name of the data source.

queryType : StringOptional

The query type in case it is from CPK.

query : ObjectOptional

The query in case of it being legacy.

path : StringOptional

The path of the CDA file holding the query.

dataAccessId : StringOptional

The name of the query in the CDA file .

dispose()

Dispose resources that the dashboard may have and that are no longer needed, if it wasn't already disposed.

**Source:**dashboard/Dashboard.js, line 421

errorNotification(err, ph)

Displays an error notification if the dashboard is not in silent mode.

**Source:**dashboard/Dashboard.notifications.js, line 215

Name
Default Value
Summary

err : Object

An object containing a msg property with the error message to display.

ph : ObjectOptional

A reference to the HTML element to attach the error message.

Name

Default Value

Summary

err : Object

An object containing a msg property with the error message to display.

ph : ObjectOptional

A reference to the HTML element to attach the error message.

executeAjax(returnType, url, params, func) : Object | stringDeprecated

Executes an Ajax request. If no func callback is provided, it executes asynchronously and returns a jQuery XMLHttpRequest (jqXHR) object. Otherwise, it executes jQuery.ajax synchronously and returns the result of the HTTP request.

**Source:**dashboard/Dashboard.legacy.js, line 103

Name
Default Value
Summary

returnType : string

The expected return type.

url : string

The URL to call.

params : Object

The parameters object.

func : function

Callback function.

Name
Description

Object | string

If no func callback is provided, it returns a jqXHR object. Otherwise, it returns the result of the HTTP request.

Name

Default Value

Summary

returnType : string

The expected return type.

url : string

The URL to call.

params : Object

The parameters object.

func : function

Callback function.

Name

Description

Object | string

If no func callback is provided, it returns a jqXHR object. Otherwise, it returns the result of the HTTP request.

fetchData(cd, params, callback)Deprecated

Fetches data from the server according to a query definition object. This method is deprecated, so a Query instance should be used instead.

**Source:**dashboard/Dashboard.legacy.js, line 337

Name
Default Value
Summary

cd : Object

The query definition object.

params : Object

The parameters to use in the query.

callback : function

The callback function to be called with results.

Name

Default Value

Summary

cd : Object

The query definition object.

params : Object

The parameters to use in the query.

callback : function

The callback function to be called with results.

fireChange(parameter, value)

Changes the value of a parameter with the provided name. Triggers the *parameter*:fireChange event and updates the components which listen for changes on the aforementioned parameter.

Because some browsers will not draw the blockUI widgets until the script has finished, we find the list of components to update, then execute the actual update in a function wrapped in a setTimeout so the running script has the opportunity to finish.

**Source:**dashboard/Dashboard.lifecycle.js, line 766

Name
Default Value
Summary

parameter : string

The name of the parameter on which to fire the change.

value : Object

Value for the parameter.

Fires: cdf.event:cdf , cdf.dashboard.Dashboard#event:parameterName:fireChange

Name

Default Value

Summary

parameter : string

The name of the parameter on which to fire the change.

value : Object

Value for the parameter.

generateBookmarkState() : Object

Generates a bookmark state using stored values.

**Source:**dashboard/Dashboard.bookmarkable.js, line 147

Name
Description

Object

An object with the state of the parameters previously marked as bookmarkable.

Name

Description

Object

An object with the state of the parameters previously marked as bookmarkable.

getAddIn(type, subType, addInName) : cdf.AddIn

Gets the add-in with the specified name, subtype and type from the add-in registry for this dashboard.

**Source:**dashboard/Dashboard.addIns.js, line 155

Name
Default Value
Summary

type : string

Type of the add-in, usually the component type where this add-in will be available.

subType : string

The subtype of the add-in.

addInName : string

The add-in name.

Name
Description

cdf.AddIn | null

The add-in if one is found, null otherwise.

Name

Default Value

Summary

type : string

Type of the add-in, usually the component type where this add-in will be available.

subType : string

The subtype of the add-in.

addInName : string

The add-in name.

Name

Description

cdf.AddIn | null

The add-in if one is found, null otherwise.

getBaseQuery() : cdf.queries.BaseQuery

Gets the base query object constructor from where other query types can be extended.

**Source:**dashboard/Dashboard.query.js, line 88

Name
Description

cdf.queries.BaseQuery

The base query constructor.

Name

Description

cdf.queries.BaseQuery

The base query constructor.

getBookmarkState() : Object

Gets the bookmark state URL decoded.

**Source:**dashboard/Dashboard.bookmarkable.js, line 215

Name
Description

Object

An object with the current bookmark state.

Name

Description

Object

An object with the current bookmark state.

getComp()

Alias for getComponent.

**Source:**dashboard/Dashboard.components.js, line 81

getComponent(name) : cdf.components.BaseComponent | undefined

Gets the component given a string representing the component's name.

This method iterates over the components array and searches for the component with the name used as the argument. If the component with that name is not found, then undefined is returned.

**Source:**dashboard/Dashboard.components.js, line 65

Name
Default Value
Summary

name : String

The component's name.

Name
Description

cdf.components.BaseComponent

The instance of BaseComponent with the given name.

undefined

/p

Example

1

var` `myComponent = myDashboard.getComponent("myInputComponent");

Name

Default Value

Summary

name : String

The component's name.

Name

Description

cdf.components.BaseComponent

The instance of BaseComponent with the given name.

undefined

/p

1

var` `myComponent = myDashboard.getComponent("myInputComponent");

getComponentByName()

Alias for getComponent.

**Source:**dashboard/Dashboard.components.js, line 89

getComponentIndex(compOrNameOrIndex) : number

Get the index of the array components that contains the component.

If compOrNameOrIndex is a string, it searches the component that first matches such name. If compOrNameOrIndex is a number, it returns component index on the components array. Lastly, if compOrNameOrIndex is a component instance, it returns the index where it is in components array.

**Source:**dashboard/Dashboard.components.js, line 180

Name
Default Value
Summary

compOrNameOrIndex : cdf.components.BaseComponent | string | number

The name, index, or the component to search.

Name
Description

number

The index where the component is at or -1 if not found.

Name

Default Value

Summary

compOrNameOrIndex : cdf.components.BaseComponent | string | number

The name, index, or the component to search.

Name

Description

number

The index where the component is at or -1 if not found.

getDataSource(obj) : Object | undefined

Gets a data source according to the provided name or query definition object with a dataSource property.

**Source:**dashboard/Dashboard.dataSources.js, line 142

Name
Default Value
Summary

obj : string | Object

The name of the data source or an object from which to extract the name from.

Name
Description

Object | undefined

The data source or undefined if none is found.

Name

Default Value

Summary

obj : string | Object

The name of the data source or an object from which to extract the name from.

Name

Description

Object | undefined

The data source or undefined if none is found.

getDataSourceQuery(obj) : Object | undefined

Gets a query from getQuery using the data source with the provided name.

**Source:**dashboard/Dashboard.dataSources.js, line 158

Name
Default Value
Summary

obj : string | Object

The name of the data source or an object from which to extract the name from.

Name
Description

Object | undefined

The query built using the target data source or undefined if no data source was found.

Name

Default Value

Summary

obj : string | Object

The name of the data source or an object from which to extract the name from.

Name

Description

Object | undefined

The query built using the target data source or undefined if no data source was found.

getErrorObj(errorCode) : Object

Given an error code, returns the registered error object associated with that code.

**Source:**dashboard/Dashboard.notifications.js, line 155

Name
Default Value
Summary

errorCode : string

The error code.

Name
Description

Object

An object with a msg property containing the error code message or an empty object if the code is not registered.

Name

Default Value

Summary

errorCode : string

The error code.

Name

Description

Object

An object with a msg property containing the error code message or an empty object if the code is not registered.

getMessagesPath() : stringAbstract

Gets the path from which to load the locale-specific properties files.

If this method returns undefined, which is the most common case, the path will be the dashboard's path.

It will be overridden returning the appropriate dashboard path in embedded scenarios.

**Source:**dashboard/Dashboard.i18n.js, line 143

Name
Description

string

The path to the dashboard's locale-specific text files.

Name

Description

string

The path to the dashboard's locale-specific text files.

getParam(parameterName) : Object

Alias for getParameterValue.

**Source:**dashboard/Dashboard.parameters.js, line 319

Name
Default Value
Summary

parameterName : String

The parameter name.

Name
Description

Object

The parameter value or undefined if the parameter name is invalid.

Name

Default Value

Summary

parameterName : String

The parameter name.

Name

Description

Object

The parameter value or undefined if the parameter name is invalid.

getParameterValue(parameterName) : Object

Gets the parameter value from a given parameter name.

If the argument is invalid, undefined is returned.

**Source:**dashboard/Dashboard.parameters.js, line 302

Name
Default Value
Summary

parameterName : String

The parameter name.

Name
Description

Object

The value of the parameter or undefined if the parameter name is invalid.

Name

Default Value

Summary

parameterName : String

The parameter name.

Name

Description

Object

The value of the parameter or undefined if the parameter name is invalid.

getQuery(type, opts) : cdf.queries.BaseQuery

Given a type and options, returns the query object for running that particular query. If a data source name is provided as an option, it also includes all options from it.

**Source:**dashboard/Dashboard.query.js, line 203

Name

Default Value

Summary

type : String | ObjectOptional

"cda"

A string with the query type, or a valid data source or query definition object.

opts : ObjectOptional

An object containing the query options.

Name
Default Value
Summary

dataSource : StringOptional

The data source of the query.

queryType : StringOptional

The query type.

Name

Default Value

Summary

dataSource : StringOptional

The data source of the query.

queryType : StringOptional

The query type.

|Name|Description| |----|-----------| |`cdf.queries.BaseQuery`|The query instance from the required `type` extended with the options in `opts`.|

See also:getDataSource

Example``` // MDX query using an explicit type and a query definition object dashboard.getQuery("mdx", {jndi: "SampleData", catalog: ...}); // MDX query using a query definition object dashboard.getQuery({queryType: "mdx", jndi: "SampleData", catalog: ...}); // MDX query using a data source dashboard.addDataSource("myDatasource", {queryType: "mdx", jndi: "SampleData", catalog: ...}); dashboard.getQuery({dataSource: "myDatasource"}); // defaults to a CDA query dashboard.addDataSource("myDatasource", {dataAccessId: "query1", path: "/public/queries.cda"}); dashboard.getQuery({dataSource: "myDatasource"});

Name

Default Value

Summary

type : String | ObjectOptional

"cda"

A string with the query type, or a valid data source or query definition object.

opts : ObjectOptional

An object containing the query options.

Name
Default Value
Summary

dataSource : StringOptional

The data source of the query.

queryType : StringOptional

The query type.

Name

Default Value

Summary

dataSource : StringOptional

The data source of the query.

queryType : StringOptional

The query type.

Last updated