For the complete documentation index, see llms.txt. This page is also available as Markdown.

CdaQuery

cdf.queries. CdaQuery

Static

Class that represents a CDA query. This class will be registered globally using the static dashboard function registerGlobalQuery.

The constructor of this class is created dynamically and registered in the dashboard query container queryFactories.

To create a new CDA query use the dashboard function getQuery.

**Source:**queries/CdaQuery.js, line 27

Extends

cdf.queries.BaseQuery

Example

dashboard.addDataSource("myCdaQuery", {
 queryType: "cda", dataAccessId: "cdaQuery", path: "/public/myQ.cda"
});
dashboard.getQuery({dataSource: "myCdaQuery"}).doQuery(successCallback, errorCallback);

Members

Name
Description

_label : stringConstant Protected

The class label.

_name : stringConstant Protected

The class name.

dashboard : cdf.dashboard.DashboardProtected

A reference to the dashboard instance.

deepProperties : Array.<`string`>Constant Protected

A list of properties to be extended to the registered queries.

defaults : ObjectProtected

The default properties.

interfaces : ObjectProtected

The default interfaces.

Methods

Name
Description

buildQueryDefinition(overrides) : object

Builds the query definition object.

dispose()

Dispose the query object.

doQuery(successCallback, errorCallback)

Executes a server-side query.

exportData(outputType, overrides, options)

Exports the data, according to a specific output type.

fetchData(params, successCallback, errorCallback) : Object

Fetches the data.

getErrorHandler(callback) : function

Gets the error callback handler.

getOption(prop) : Object

Gets an option (fallback for when the OptionManager is not available).

getPage(targetPage, outsideCallback) : boolean | Object

Gets the set of results for the page at index targetPage (0-indexed).

getSuccessHandler(callback) : function

Gets the success callback handler.

init(opts)

Initializes a CDA query.

initPage(pageSize, outsideCallback) : boolean | Object

Sets the page size and gets the first page of results.

lastProcessedResults() : Object

Gets the last retrieved result after being processed by postFetch.

lastResults() : Object

Gets the last retrieved result.

nextPage(outsideCallback) : Object

Gets the next page of results, as controlled by the pageSize option.

pageStartingAt(page, outsideCallback) : boolean | Object

Runs the query, setting a starting page before doing so.

previousPage(outsideCallback) : Object

Gets the previous page of results, as controlled by the pageSize option.

reprocessLastResults(outerCallback) : Object

Reruns the success callback on the last retrieved result set from the server.

reprocessResults(outsideCallback) : Object

Alias for reprocessLastResults.

setAjaxOptions(newOptions)

Sets the jQuery.ajax options for the query.

setCallback(callback)

Sets the success callback for the query.

setErrorCallback(callback)

Sets the error callback for the query.

setOption(prop, value)

Sets an option (fallback for when the OptionManager is not available).

setPageSize(pageSize)

Sets the page size.

setPageStartingAt(targetPage) : boolean

Sets the starting page for later executions of the query.

setParameters(params)

Sets query parameters.

setSearchPattern(pattern)

Sets the search pattern for the query.

setSortBy(sortBy) : boolean

Sets the sort by columns.

sortBy(sortBy, outsideCallback) : boolean | Object

Sorts the result set.

Members Details

_label: stringConstant Protected

The class label.

**Source:**queries/CdaQuery.js, line 74

Default Value:"CDA Query"

**Overrides:**cdf.queries.BaseQuery#_label

_name: stringConstant Protected

The class name.

**Source:**queries/CdaQuery.js, line 59

Default Value:"cda"

**Overrides:**cdf.queries.BaseQuery#_name

dashboard: cdf.dashboard.DashboardProtected

A reference to the dashboard instance.

**Source:**queries/BaseQuery.js, line 76

Inherited From: cdf.queries.BaseQuery#dashboard

deepProperties: Array.<`string`>Constant Protected

A list of properties to be extended to the registered queries that do not provide their own constructor function.

**Source:**queries/BaseQuery.js, line 67

Inherited From: cdf.queries.BaseQuery#deepProperties

Default Value:

See also:registerQuery

defaults: ObjectProtected

The default properties.

**Source:**queries/CdaQuery.js, line 93

**Overrides:**cdf.queries.BaseQuery#defaults

Name

Default Value

Description

url : string

The target endpoint URL.

file : string

""

The target file name.

id : string

""

The target identifier.

outputIdx : string

"1"

The default output index.

sortBy : string

""

The default sorting order.

ajaxOptions : Object

{async:true,xhrFields:{withCredentials:true}}

The jQuery.ajax options for the query.

searchPattern : string

""

The default search pattern.

Name
Default Value
Description

url : string

The target endpoint URL.

file : string

""

The target file name.

id : string

""

The target identifier.

outputIdx : string

"1"

The default output index.

sortBy : string

""

The default sorting order.

ajaxOptions : Object

{async:true,xhrFields:{withCredentials:true}}

The jQuery.ajax options for the query.

searchPattern : string

""

The default search pattern.

interfaces: ObjectProtected

The default interfaces.

**Source:**queries/BaseQuery.js, line 138

Inherited From: cdf.queries.BaseQuery#interfaces

Name

Default Value

Description

params : Object

Parameter interfaces.

Name

Default Value

Description

reader : string

"propertiesObject"

Parameter reader.

validator : string

"isObjectOrPropertiesArray"

Parameter validator.

successCallback : Object

Success callback interfaces.

Name

Default Value

Description

validator : string

"isFunction"

Success callback validator.

errorCallback : Object

Error callback interfaces.

Name

Default Value

Description

validator : string

"isFunction"

Error callback validator.

pageSize : Object

Page size interfaces.

Name

Default Value

Description

validator : string

"isPositive"

Page size validator.

Name
Default Value
Description

validator : string

"isPositive"

Page size validator.

Name
Default Value
Description

validator : string

"isFunction"

Error callback validator.

Name
Default Value
Description

validator : string

"isFunction"

Success callback validator.

Name
Default Value
Description

reader : string

"propertiesObject"

Parameter reader.

validator : string

"isObjectOrPropertiesArray"

Parameter validator.

Name

Default Value

Description

params : Object

Parameter interfaces.

Name

Default Value

Description

reader : string

"propertiesObject"

Parameter reader.

validator : string

"isObjectOrPropertiesArray"

Parameter validator.

successCallback : Object

Success callback interfaces.

Name

Default Value

Description

validator : string

"isFunction"

Success callback validator.

errorCallback : Object

Error callback interfaces.

Name

Default Value

Description

validator : string

"isFunction"

Error callback validator.

pageSize : Object

Page size interfaces.

Name

Default Value

Description

validator : string

"isPositive"

Page size validator.

Name
Default Value
Description

validator : string

"isPositive"

Page size validator.

Name
Default Value
Description

validator : string

"isFunction"

Error callback validator.

Name
Default Value
Description

validator : string

"isFunction"

Success callback validator.

Name
Default Value
Description

reader : string

"propertiesObject"

Parameter reader.

validator : string

"isObjectOrPropertiesArray"

Parameter validator.

## Methods Details

buildQueryDefinition(overrides) : object

Builds the query definition object.

**Source:**queries/CdaQuery.js, line 158

**Overrides:**cdf.queries.BaseQuery#buildQueryDefinition

Name

Default Value

Summary

overrides : object

New query definitions to override any existing query definitions.

Name

Description

object

Query definition object.

Name
Description

object

Query definition object.

Name
Default Value
Summary

overrides : object

New query definitions to override any existing query definitions.

dispose()

Dispose the query object.

**Source:**queries/CdaQuery.js, line 431

**Overrides:**cdf.queries.BaseQuery#dispose

doQuery(successCallback, errorCallback)

Executes a server-side query.

**Source:**queries/CdaQuery.js, line 367

**Overrides:**cdf.queries.BaseQuery#doQuery

Name

Default Value

Summary

successCallback : functionOptional

Success callback.

errorCallback : functionOptional

Error callback.

Name
Default Value
Summary

successCallback : functionOptional

Success callback.

errorCallback : functionOptional

Error callback.

exportData(outputType, overrides, options)

Exports the data, according to a specific output type.

**Source:**queries/CdaQuery.js, line 207

**Overrides:**cdf.queries.BaseQuery#exportData

Name

Default Value

Summary

outputType : string

Output type (CSV, XLS, XML, HTML).

overrides : object

Overrides for the query definition object.

options : object

Export options.

Name

Default Value

Summary

separator : string

Separator.

filename : string

File name.

template : string

Template name.

columnHeaders : object

The column headers.

dtFilter : object

Data table filter.

dtSearchableColumns : object

Data table searchable columns.

exportPage : boolean

Export only one page (true) or full data set (false).

Name
Default Value
Summary

separator : string

Separator.

filename : string

File name.

template : string

Template name.

columnHeaders : object

The column headers.

dtFilter : object

Data table filter.

dtSearchableColumns : object

Data table searchable columns.

exportPage : boolean

Export only one page (true) or full data set (false).

Name

Default Value

Summary

outputType : string

Output type (CSV, XLS, XML, HTML).

overrides : object

Overrides for the query definition object.

options : object

Export options.

Name

Default Value

Summary

separator : string

Separator.

filename : string

File name.

template : string

Template name.

columnHeaders : object

The column headers.

dtFilter : object

Data table filter.

dtSearchableColumns : object

Data table searchable columns.

exportPage : boolean

Export only one page (true) or full data set (false).

Name
Default Value
Summary

separator : string

Separator.

filename : string

File name.

template : string

Template name.

columnHeaders : object

The column headers.

dtFilter : object

Data table filter.

dtSearchableColumns : object

Data table searchable columns.

exportPage : boolean

Export only one page (true) or full data set (false).

fetchData(params, successCallback, errorCallback) : Object

Fetches the data.

**Source:**queries/BaseQuery.js, line 350

Inherited From: cdf.queries.BaseQuery#fetchData

Name

Default Value

Summary

params : Object

Parameters for the query.

successCallback : function

Success callback.

errorCallback : function

Error callback.

Name

Description

Object

The result of calling doQuery with the specified arguments.

Name

Description

InvalidInput

If the arguments are not correct.

Name
Description

InvalidInput

If the arguments are not correct.

Name
Description

Object

The result of calling doQuery with the specified arguments.

Name
Default Value
Summary

params : Object

Parameters for the query.

successCallback : function

Success callback.

errorCallback : function

Error callback.

getErrorHandler(callback) : function

Gets the error callback handler that executes the provided callback when the query fails to execute.

**Source:**queries/BaseQuery.js, line 253

Inherited From: cdf.queries.BaseQuery#getErrorHandler

Name

Default Value

Summary

callback : function

Callback to call if the query fails.

Name

Description

function

Error callback handler.

Name
Description

function

Error callback handler.

Name
Default Value
Summary

callback : function

Callback to call if the query fails.

getOption(prop) : Object

Gets an option (fallback for when the OptionManager is not available).

**Source:**queries/BaseQuery.js, line 183

Inherited From: cdf.queries.BaseQuery#getOption

Name

Default Value

Summary

prop : string

The property from where to get the options.

Name

Description

Object

Value for the option.

Name
Description

Object

Value for the option.

Name
Default Value
Summary

prop : string

The property from where to get the options.

getPage(targetPage, outsideCallback) : boolean | Object

Gets the set of results for the page at index targetPage (0-indexed).

**Source:**queries/BaseQuery.js, line 580

Inherited From: cdf.queries.BaseQuery#getPage

Name

Default Value

Summary

targetPage : number

Index of the page to get, starting at index 0.

outsideCallback : function

Success callback to execute when the page is retrieved.

Name

Description

boolean | Object

false if the page is already the current one, otherwise returns the result of calling doQuery.

Name

Description

InvalidPage

If targetPage is not a positive number.

Name
Description

InvalidPage

If targetPage is not a positive number.

Name
Description

boolean | Object

false if the page is already the current one, otherwise returns the result of calling doQuery.

Name
Default Value
Summary

targetPage : number

Index of the page to get, starting at index 0.

outsideCallback : function

Success callback to execute when the page is retrieved.

getSuccessHandler(callback) : function

Gets the success callback handler that executes the provided callback when the query executes successfully.

**Source:**queries/BaseQuery.js, line 230

Inherited From: cdf.queries.BaseQuery#getSuccessHandler

Name

Default Value

Summary

callback : function

Callback to call after the query is successful.

Name

Description

function

Success callback handler.

Name
Description

function

Success callback handler.

Name
Default Value
Summary

callback : function

Callback to call after the query is successful.

init(opts)

Initializes a CDA query.

**Source:**queries/CdaQuery.js, line 125

**Overrides:**cdf.queries.BaseQuery#init

|Name|Description| |----|-----------| |`InvalidQuery`|If the `opts` parameter does not contain a path nor a data access identifier.|

Name

Default Value

Summary

opts : object

The query definition object.

Name

Default Value

Summary

path : string

The path to the CDA file.

dataAccessId : string

The Data access identifier.

sortBy : stringOptional

The sorting order.

pageSize : numberOptional

The page size.

outputIndexId : numberOptional

The output index identifier.

pushEnabled : booleanOptional

If the query should run in push mode.

Name
Default Value
Summary

path : string

The path to the CDA file.

dataAccessId : string

The Data access identifier.

sortBy : stringOptional

The sorting order.

pageSize : numberOptional

The page size.

outputIndexId : numberOptional

The output index identifier.

pushEnabled : booleanOptional

If the query should run in push mode.

Name

Default Value

Summary

opts : object

The query definition object.

Name

Default Value

Summary

path : string

The path to the CDA file.

dataAccessId : string

The Data access identifier.

sortBy : stringOptional

The sorting order.

pageSize : numberOptional

The page size.

outputIndexId : numberOptional

The output index identifier.

pushEnabled : booleanOptional

If the query should run in push mode.

Name
Default Value
Summary

path : string

The path to the CDA file.

dataAccessId : string

The Data access identifier.

sortBy : stringOptional

The sorting order.

pageSize : numberOptional

The page size.

outputIndexId : numberOptional

The output index identifier.

pushEnabled : booleanOptional

If the query should run in push mode.

initPage(pageSize, outsideCallback) : boolean | Object

Sets the page size and gets the first page of results.

**Source:**queries/BaseQuery.js, line 652

Inherited From: cdf.queries.BaseQuery#initPage

Name

Default Value

Summary

pageSize : number

Page Size.

outsideCallback : function

Success callback to execute after query is retrieved.

Name

Description

boolean | Object

false if pageSize is invalid, otherwise the result of calling doQuery.

Name

Description

InvalidPageSize

If the page size is not a positive number.

Name
Description

InvalidPageSize

If the page size is not a positive number.

Name
Description

boolean | Object

false if pageSize is invalid, otherwise the result of calling doQuery.

Name
Default Value
Summary

pageSize : number

Page Size.

outsideCallback : function

Success callback to execute after query is retrieved.

lastProcessedResults() : Object

Gets the last retrieved result after being processed by postFetch.

**Source:**queries/BaseQuery.js, line 432

Inherited From: cdf.queries.BaseQuery#lastProcessedResults

Name

Description

Object

A deep copy of the the last result set obtained from the server after being processed by postFetch.

Name

Description

NoCachedResults

If there have not been previous calls to the server.

Name
Description

NoCachedResults

If there have not been previous calls to the server.

Name
Description

Object

A deep copy of the the last result set obtained from the server after being processed by postFetch.

lastResults() : Object

Gets the last retrieved result.

**Source:**queries/BaseQuery.js, line 416

Inherited From: cdf.queries.BaseQuery#lastResults

Name

Description

Object

A deep copy of the last result set obtained from the server.

Name

Description

NoCachedResults

If there have not been previous calls to the server.

Name
Description

NoCachedResults

If there have not been previous calls to the server.

Name
Description

Object

A deep copy of the last result set obtained from the server.

nextPage(outsideCallback) : Object

Gets the next page of results, as controlled by the pageSize option.

**Source:**queries/BaseQuery.js, line 534

Inherited From: cdf.queries.BaseQuery#nextPage

Name

Default Value

Summary

outsideCallback : function