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 24
Extends
Example
dashboard.addDataSource("myCdaQuery", { queryType: "cda", dataAccessId: "cdaQuery", path: "/public/myQ.cda" }); dashboard.getQuery({dataSource: "myCdaQuery"}).doQuery(successCallback, errorCallback);
Members
Name | Description |
---|---|
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. |
label : Constant Protected | The class label. |
name : Constant Protected | The class name. |
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
dashboard: Protected |
---|
A reference to the dashboard instance. Source: queries/BaseQuery.js, line 69 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 60 Inherited From: cdf.queries.BaseQuery#deepProperties Default Value: See also: |
defaults: Protected | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The default properties.
Source: queries/CdaQuery.js, line 82 Overrides: cdf.queries.BaseQuery#defaults |
interfaces: Protected | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The default interfaces.
Source: queries/BaseQuery.js, line 127 Inherited From: cdf.queries.BaseQuery#interfaces |
label: Constant Protected |
---|
The class label. Source: queries/CdaQuery.js, line 66 Default Value: "CDA Query" Overrides: cdf.queries.BaseQuery#label |
name: Constant Protected |
---|
The class name. Source: queries/CdaQuery.js, line 54 Default Value: "cda" Overrides: cdf.queries.BaseQuery#name |
Methods Details
buildQueryDefinition(overrides) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Builds the query definition object. Source: queries/CdaQuery.js, line 136 Overrides: cdf.queries.BaseQuery#buildQueryDefinition
|
doQuery(successCallback, errorCallback) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Executes a server-side query. Source: queries/BaseQuery.js, line 257 Inherited From: cdf.queries.BaseQuery#doQuery
|
exportData(outputType, overrides, options) | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Exports the data, according to a specific output type. Source: queries/CdaQuery.js, line 197 Overrides: cdf.queries.BaseQuery#exportData
|
fetchData(params, successCallback, errorCallback) : Object | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Fetches the data. Source: queries/BaseQuery.js, line 331 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 242 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 172 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 550 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 219 Inherited From: cdf.queries.BaseQuery#getSuccessHandler
|
init(opts) | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Initializes a CDA query. Source: queries/CdaQuery.js, line 110 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 622 Inherited From: cdf.queries.BaseQuery#initPage
|
lastProcessedResults() : Object | ||||||||
---|---|---|---|---|---|---|---|---|
Gets the last retrieved result after being processed by postFetch. Source: queries/BaseQuery.js, line 402 Inherited From: cdf.queries.BaseQuery#lastProcessedResults
|
lastResults() : Object | ||||||||
---|---|---|---|---|---|---|---|---|
Gets the last retrieved result. Source: queries/BaseQuery.js, line 386 Inherited From: cdf.queries.BaseQuery#lastResults
|
nextPage(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the next page of results, as controlled by the Source: queries/BaseQuery.js, line 504 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 594 Inherited From: cdf.queries.BaseQuery#pageStartingAt
|
previousPage(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the previous page of results, as controlled by the Source: queries/BaseQuery.js, line 525 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 419 Inherited From: cdf.queries.BaseQuery#reprocessLastResults
See also: |
reprocessResults(outsideCallback) : Object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Alias for Source: queries/BaseQuery.js, line 444 Inherited From: cdf.queries.BaseQuery#reprocessResults
See also: |
setAjaxOptions(newOptions) | ||||||
---|---|---|---|---|---|---|
Sets the jQuery.ajax options for the query. Source: queries/BaseQuery.js, line 294 Inherited From: cdf.queries.BaseQuery#setAjaxOptions
|
setCallback(callback) | ||||||
---|---|---|---|---|---|---|
Sets the success callback for the query. Source: queries/BaseQuery.js, line 464 Inherited From: cdf.queries.BaseQuery#setCallback
|
setErrorCallback(callback) | ||||||
---|---|---|---|---|---|---|
Sets the error callback for the query. Source: queries/BaseQuery.js, line 474 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 183 Inherited From: cdf.queries.BaseQuery#setOption
|
setPageSize(pageSize) | ||||||
---|---|---|---|---|---|---|
Sets the page size. Source: queries/BaseQuery.js, line 608 Inherited From: cdf.queries.BaseQuery#setPageSize
|
setPageStartingAt(targetPage) : boolean | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the starting page for later executions of the query. Source: queries/BaseQuery.js, line 572 Inherited From: cdf.queries.BaseQuery#setPageStartingAt
|
setParameters(params) | ||||||
---|---|---|---|---|---|---|
Sets query parameters. Source: queries/BaseQuery.js, line 454 Inherited From: cdf.queries.BaseQuery#setParameters
|
setSearchPattern(pattern) | ||||||
---|---|---|---|---|---|---|
Sets the search pattern for the query. Source: queries/BaseQuery.js, line 484 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 267 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 331 Overrides: cdf.queries.BaseQuery#sortBy
|