CdaQuery
cdf.queries. CdaQuery
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
Example
dashboard.addDataSource("myCdaQuery", { queryType: "cda", dataAccessId: "cdaQuery", path: "/public/myQ.cda" }); dashboard.getQuery({dataSource: "myCdaQuery"}).doQuery(successCallback, errorCallback);
Members
Name | Description |
---|---|
_label : Constant Protected | The class label. |
_name : Constant Protected | The class name. |
dashboard : Protected | A reference to the dashboard instance. |
deepProperties : Constant Protected | A list of properties to be extended to the registered queries. |
defaults : Protected | The default properties. |
interfaces : Protected | The default interfaces. |
Methods
Name | Description |
---|---|
buildQueryDefinition(overrides) : object | Builds the query definition 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 |
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 |
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 |
reprocessLastResults(outerCallback) : Object | Reruns the success callback on the last retrieved result set from the server. |
reprocessResults(outsideCallback) : Object | Alias for |
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: Constant Protected |
---|
The class label. Source: queries/CdaQuery.js, line 74 Default Value: "CDA Query" Overrides: cdf.queries.BaseQuery#_label |
_name: Constant Protected |
---|
The class name. Source: queries/CdaQuery.js, line 59 Default Value: "cda" Overrides: cdf.queries.BaseQuery#_name |
dashboard: Protected |
---|
A reference to the dashboard instance. Source: queries/BaseQuery.js, line 76 Inherited From: cdf.queries.BaseQuery#dashboard |
deepProperties: 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: |
defaults: Protected | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The default properties.
Source: queries/CdaQuery.js, line 93 Overrides: cdf.queries.BaseQuery#defaults |
interfaces: Protected | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The default interfaces.
Source: queries/BaseQuery.js, line 137 Inherited From: cdf.queries.BaseQuery#interfaces |
Methods Details
buildQueryDefinition(overrides) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Builds the query definition object. Source: queries/CdaQuery.js, line 151 Overrides: cdf.queries.BaseQuery#buildQueryDefinition
|
doQuery(successCallback, errorCallback) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Executes a server-side query. Source: queries/BaseQuery.js, line 267 Inherited From: cdf.queries.BaseQuery#doQuery
|
exportData(outputType, overrides, options) | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Exports the data, according to a specific output type. Source: queries/CdaQuery.js, line 221 Overrides: cdf.queries.BaseQuery#exportData
|
fetchData(params, successCallback, errorCallback) : Object | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Fetches the data. Source: queries/BaseQuery.js, line 349 Inherited From: cdf.queries.BaseQuery#fetchData
|
getErrorHandler(callback) : function | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the error callback handler that executes the provided callback when the query fails to execute. Source: queries/BaseQuery.js, line 252 Inherited From: cdf.queries.BaseQuery#getErrorHandler
|
getOption(prop) : Object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets an option (fallback for when the OptionManager is not available). Source: queries/BaseQuery.js, line 182 Inherited From: cdf.queries.BaseQuery#getOption
|
getPage(targetPage, outsideCallback) : boolean | Object | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the set of results for the page at index Source: queries/BaseQuery.js, line 579 Inherited From: cdf.queries.BaseQuery#getPage
|
getSuccessHandler(callback) : function | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the success callback handler that executes the provided callback when the query executes successfully. Source: queries/BaseQuery.js, line 229 Inherited From: cdf.queries.BaseQuery#getSuccessHandler
|
init(opts) | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Initializes a CDA query. Source: queries/CdaQuery.js, line 122 Overrides: cdf.queries.BaseQuery#init
|
initPage(pageSize, outsideCallback) : boolean | Object | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the page size and gets the first page of results. Source: queries/BaseQuery.js, line 651 Inherited From: cdf.queries.BaseQuery#initPage
|
lastProcessedResults() : Object | ||||||||
---|---|---|---|---|---|---|---|---|
Gets the last retrieved result after being processed by postFetch. Source: queries/BaseQuery.js, line 431 Inherited From: cdf.queries.BaseQuery#lastProcessedResults
|
lastResults() : Object | ||||||||
---|---|---|---|---|---|---|---|---|
Gets the last retrieved result. Source: queries/BaseQuery.js, line 415 Inherited From: cdf.queries.BaseQuery#lastResults
|
nextPage(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the next page of results, as controlled by the Source: queries/BaseQuery.js, line 533 Inherited From: cdf.queries.BaseQuery#nextPage
|
pageStartingAt(page, outsideCallback) : boolean | Object | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Runs the query, setting a starting page before doing so. If the starting page matches the already selected one, the query run is canceled and Source: queries/BaseQuery.js, line 623 Inherited From: cdf.queries.BaseQuery#pageStartingAt
|
previousPage(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the previous page of results, as controlled by the Source: queries/BaseQuery.js, line 554 Inherited From: cdf.queries.BaseQuery#previousPage
|
reprocessLastResults(outerCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Reruns the success callback on the last retrieved result set from the server. Source: queries/BaseQuery.js, line 448 Inherited From: cdf.queries.BaseQuery#reprocessLastResults
See also: |
reprocessResults(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Alias for Source: queries/BaseQuery.js, line 473 Inherited From: cdf.queries.BaseQuery#reprocessResults
See also: |
setAjaxOptions(newOptions) | ||||||
---|---|---|---|---|---|---|
Sets the jQuery.ajax options for the query. Source: queries/BaseQuery.js, line 298 Inherited From: cdf.queries.BaseQuery#setAjaxOptions
|
setCallback(callback) | ||||||
---|---|---|---|---|---|---|
Sets the success callback for the query. Source: queries/BaseQuery.js, line 493 Inherited From: cdf.queries.BaseQuery#setCallback
|
setErrorCallback(callback) | ||||||
---|---|---|---|---|---|---|
Sets the error callback for the query. Source: queries/BaseQuery.js, line 503 Inherited From: cdf.queries.BaseQuery#setErrorCallback
|
setOption(prop, value) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets an option (fallback for when the OptionManager is not available). Source: queries/BaseQuery.js, line 193 Inherited From: cdf.queries.BaseQuery#setOption
|
setPageSize(pageSize) | ||||||
---|---|---|---|---|---|---|
Sets the page size. Source: queries/BaseQuery.js, line 637 Inherited From: cdf.queries.BaseQuery#setPageSize
|
setPageStartingAt(targetPage) : boolean | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the starting page for later executions of the query. Source: queries/BaseQuery.js, line 601 Inherited From: cdf.queries.BaseQuery#setPageStartingAt
|
setParameters(params) | ||||||
---|---|---|---|---|---|---|
Sets query parameters. Source: queries/BaseQuery.js, line 483 Inherited From: cdf.queries.BaseQuery#setParameters
|
setSearchPattern(pattern) | ||||||
---|---|---|---|---|---|---|
Sets the search pattern for the query. Source: queries/BaseQuery.js, line 513 Inherited From: cdf.queries.BaseQuery#setSearchPattern
|
setSortBy(sortBy) : boolean | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the sort by columns. CDA expects an array of terms consisting of a number and a letter that's either "A" or "D". Each term denotes, in order, a column number and a sort direction: "0A" would then be sorting the first column ascending, and "1D" would sort the second column in descending order. This function accepts either an array with the search terms, or a comma-separated string with the terms: "0A,1D" would then mean the same as the array ["0A","1D"], which would sort the results first by the first column (ascending), and then by the second column (descending). Source: queries/CdaQuery.js, line 294 Overrides: cdf.queries.BaseQuery#setSortBy
|
sortBy(sortBy, outsideCallback) : boolean | Object | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sorts the result set. See the notes on sort columns on the Source: queries/CdaQuery.js, line 362 Overrides: cdf.queries.BaseQuery#sortBy
|