xmla4js
Version:
Javascript interface for XML for Analysis
1,141 lines (1,108 loc) • 322 kB
JavaScript
/*
Copyright 2009,2010,2011 Roland Bouman
contact: Roland.Bouman@gmail.com ~ http://rpbouman.blogspot.com/ ~ http://code.google.com/p/xmla4js
twitter: @rolandbouman
This is xmla4js - a stand-alone javascript library for working with "XML for Analysis".
XML for Analysis (XML/A) is a vendor-neutral industry-standard protocol for OLAP services over HTTP.
Xmla4js is cross-browser and node.js compatible and enables web-browser-based analytical business intelligence applications.
Xmla4js can be loaded as a common js or amd module.
This file contains human-readable javascript source along with the YUI Doc compatible annotations.
Note: some portions of the API documentation were adopted from the original XML/A specification.
I believe that this constitutes fair use, but if you have reason to believe that the documentation
violates any copyright, or is otherwise incompatible with the LGPL license please contact me.
Include this in your web-pages for debug and development purposes only.
For production purposes, consider using the minified/obfuscated versions in the /js directory.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*
* This is xmla4js - a stand-alone javascript library for working with "XML for Analysis".
* XML for Analysis (XML/A) is a vendor-neutral industry-standard protocol for OLAP services over HTTP.
* Xmla4js is cross-browser and node.js compatible and enables web-browser-based analytical business intelligence applications.
* Xmla4js can be loaded as a common js or amd module.
* @module xmla
* @title Xmla
*/
(function(window) {
var Xmla,
_soap = "http://schemas.xmlsoap.org/soap/",
_xmlnsSOAPenvelope = _soap + "envelope/",
_xmlnsSOAPenvelopePrefix = "SOAP-ENV",
_xmlnsIsSOAPenvelope = "xmlns:" + _xmlnsSOAPenvelopePrefix + "=\"" + _xmlnsSOAPenvelope + "\"",
_SOAPencodingStyle = _xmlnsSOAPenvelopePrefix + ":encodingStyle=\"" + _soap + "encoding/\"",
_ms = "urn:schemas-microsoft-com:",
_xmlnsXmla = _ms + "xml-analysis",
_xmlnsIsXmla = "xmlns=\"" + _xmlnsXmla + "\"",
_xmlnsSQLPrefix = "sql",
_xmlnsSQL = _ms + "xml-sql",
_xmlnsSchema = "http://www.w3.org/2001/XMLSchema",
_xmlnsSchemaPrefix = "xsd",
_xmlnsSchemaInstance = "http://www.w3.org/2001/XMLSchema-instance",
_xmlnsSchemaInstancePrefix = "xsi",
_xmlnsRowset = _xmlnsXmla + ":rowset",
_xmlnsDataset = _xmlnsXmla + ":mddataset"
;
var _createXhr;
if (window.XMLHttpRequest) _createXhr = function(){
return new window.XMLHttpRequest();
}
else
if (window.ActiveXObject) _createXhr = function(){
return new window.ActiveXObject("MSXML2.XMLHTTP.3.0");
}
else
if (typeof(require)==="function") _createXhr = function(){
var xhr;
(xhr = function() {
this.readyState = 0;
this.status = -1;
this.statusText = "Not sent";
this.responseText = null;
}).prototype = {
changeStatus: function(statusCode, readyState){
this.status = statusCode;
this.statusText = statusCode;
this.readyState = readyState;
if (_isFun(this.onreadystatechange)) {
this.onreadystatechange.call(this, this);
}
},
open: function(method, url, async, username, password){
if (async !== true) {
throw "Synchronous mode not supported in this environment."
}
var options = require("url").parse(url);
if (options.host.length > options.hostname.length) {
//for some reason, host includes the port, this confuses http.request
//so, overwrite host with hostname (which does not include the port)
//and kill hostname so that we end up with only host.
options.host = options.hostname;
delete options.hostname;
}
if (!options.path && options.pathname) {
//old versions of node may not give the path, so we need to create it ourselves.
options.path = options.pathname + (options.search || "");
}
options.method = "POST";//method;
options.headers = {};
if (username) options.headers.Authorization = "Basic " + (new Buffer(username + ":" + (password || ""))).toString("base64");
this.options = options;
this.changeStatus(-1, 1);
},
send: function(data){
var me = this,
options = me.options,
client
;
options.headers["Content-Length"] = Buffer.byteLength(data);
switch (options.protocol) {
case "http:":
client = require("http");
if (!options.port) options.port = "80";
break;
case "https:":
client = require("https");
if (!options.port) options.port = "443";
break;
default:
throw "Unsupported protocol " + options.protocol;
}
me.responseText = "";
var request = client.request(options, function(response){
response.setEncoding("utf8");
me.changeStatus(-1, 2);
response.on("data", function(chunk){
me.responseText += chunk;
me.changeStatus(response.statusCode, 3);
});
response.on("error", function(error){
me.changeStatus(response.statusCode, 4);
});
response.on("end", function(){
me.changeStatus(response.statusCode, 4);
});
});
request.on("error", function(e){
me.responseText = e;
me.changeStatus(500, 4);
});
/* does not work, maybe only not in old node versions.
request.setTimeout(this.timeout, function(){
request.abort();
me.changeStatus(500, 0);
});
*/
if (data) request.write(data);
request.end();
},
setRequestHeader: function(name, value){
this.options.headers[name] = value;
}
};
return new xhr();
}
else Xmla.Exception._newError(
"ERROR_INSTANTIATING_XMLHTTPREQUEST",
"_ajax",
null
)._throw();
function _ajax(options){
var xhr, args, headers, header,
handlerCalled = false,
handler = function(){
handlerCalled = true;
switch (xhr.readyState){
case 0:
if (_isFun(options.aborted)) options.aborted(xhr);
break;
case 4:
if (xhr.status === 200) options.complete(xhr)
else {
var err = Xmla.Exception._newError(
"HTTP_ERROR",
"_ajax",
{
request: options,
status: this.status,
statusText: this.statusText
}
)
//console.log(err);
//When I have an error in HTTP, this allows better debugging
//So made an extra call instead of _newError inside func call
options.error(err);
}
break;
}
};
xhr = _createXhr();
args = ["POST", options.url, options.async];
if (options.username && options.password) args = args.concat([options.username, options.password]);
xhr.open.apply(xhr, args);
//see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute
if (!_isUnd(options.requestTimeout) && (options.async || !(window && window.document))) {
xhr.timeout = options.requestTimeout;
}
xhr.onreadystatechange = handler;
xhr.setRequestHeader("Accept", "text/xml, application/xml, application/soap+xml");
xhr.setRequestHeader("Content-Type", "text/xml");
if (headers = options.headers) for (header in headers) xhr.setRequestHeader(header, headers[header]);
xhr.send(options.data);
if (!options.async && !handlerCalled) handler.call(xhr);
return xhr;
};
function _isUnd(arg){
return typeof(arg)==="undefined";
};
function _isArr(arg){
return arg && arg.constructor === Array;
};
function _isNum(arg){
return typeof(arg)==="number";
};
function _isFun(arg){
return typeof(arg)==="function";
};
function _isStr(arg) {
return typeof(arg)==="string";
};
function _isObj(arg) {
return arg && typeof(arg)==="object";
};
function _xmlEncode(value){
if (_isStr(value)) {
value = value.replace(/\&/g, "&").replace(/</g, "<").replace(/>/g, ">");
}
return value;
};
function _decodeXmlaTagName(tagName) {
return tagName.replace(/_x(\d\d\d\d)_/g, function(match, hex, offset){
return String.fromCharCode(parseInt(hex, 16));
});
}
//this is here to support (partial) dom interface on top of our own document implementation
//we don't need this in the browser, it's here when running in environments without a native xhr
//where the xhr object does not offer a DOM responseXML object.
function _getElements(parent, list, criteria){
var childNodes = parent.childNodes;
if (!childNodes) return list;
for (var node, i = 0, n = childNodes.length; i < n; i++){
node = childNodes[i];
if (criteria && criteria.call(null, node) === true) list.push(node);
_getElements(node, list, criteria);
}
};
var _getElementsByTagName = function(node, tagName){
var func;
if ("getElementsByTagName" in node) {
func = function(node, tagName) {
return node.getElementsByTagName(tagName);
};
}
else {
func = function(node, tagName){
var list = [],
criteria = tagName === "*" ? null : function(node){
return (node.nodeType === 1 && ((node.namespaceURI === "" ? "" : node.prefix + ":") + node.nodeName) === tagName);
}
;
_getElements(node, list, criteria);
return list;
};
}
return (_getElementsByTagName = func)(node, tagName);
};
var _getElementsByTagNameNS = function(node, ns, prefix, tagName){
var func;
if ("getElementsByTagNameNS" in node) {
func = function(node, ns, prefix, tagName) {
return node.getElementsByTagNameNS(ns, tagName);
};
}
else
if ("getElementsByTagName" in node) {
func = function(node, ns, prefix, tagName){
return node.getElementsByTagName((prefix ? prefix + ":" : "") + tagName);
};
}
else {
func = function(node, ns, prefix, tagName){
var list = [], criteria;
if (tagName === "*") {
criteria = function(_node){
return (_node.nodeType === 1 && _node.namespaceURI === ns);
};
}
else {
criteria = function(_node){
return (_node.nodeType === 1 && _node.namespaceURI === ns && _node.nodeName === tagName);
};
}
_getElements(node, list, criteria);
return list;
};
}
_getElementsByTagNameNS = func;
return func(node, ns, prefix, tagName);
};
var _getAttributeNS = function(element, ns, prefix, attributeName) {
var func;
if ("getAttributeNS" in element) {
func = function(element, ns, prefix, attributeName){
return element.getAttributeNS(ns, attributeName);
};
}
else
if ("getAttribute" in element) {
func = function(element, ns, prefix, attributeName){
return element.getAttribute((prefix ? prefix + ":" : "") + attributeName);
};
}
else {
func = function(element, namespaceURI, prefix, attributeName){
var attributes = element.attributes;
if (!attributes) return null;
for (var attr, i = 0, n = attributes.length; i < n; i++) {
attr = attributes[i];
if (attr.namespaceURI === namespaceURI && attr.nodeName === attributeName) return attr.value;
}
return null;
};
}
return (_getAttributeNS = func)(element, ns, prefix, attributeName);
};
var _getAttribute = function(node, name){
var func;
if ("getAttribute" in node) {
func = function(node, name){
return node.getAttribute(name);
};
}
else {
func = function(node, name) {
var attributes = node.attributes;
if (!attributes) return null;
for (var attr, i = 0, n = attributes.length; i < n; i++) {
attr = attributes[i];
if (attr.nodeName === name) return attr.value;
}
return null;
};
}
return (_getAttribute = func)(node, name);
};
function _getElementText(el){
//on first call, we examine the properies of the argument element
//to try and find a native (and presumably optimized) method to grab
//the text value of the element.
//We then overwrite the original _getElementText
//to use the optimized one in any subsequent calls
var func;
if ("textContent" in el) { //ff, chrome
func = function(el){
return el.textContent;
};
}
else
if ("nodeTypedValue" in el) { //ie8
func = function(el){
return el.nodeTypedValue;
};
}
else
if ("innerText" in el) { //ie
func = function(el){
return el.innerText;
};
}
else
if ("normalize" in el){
func = function(el) {
el.normalize();
if (el.firstChild){
return el.firstChild.data;
}
else {
return null;
}
}
}
else { //generic
func = function(el) {
var text = [], childNode,
childNodes = el.childNodes, i,
n = childNodes ? childNodes.length : 0
;
for (i = 0; i < n; i++){
childNode = childNodes[i];
if (childNode.data !== null) text.push(childNode.data);
}
return text.length ? text.join("") : null;
}
}
_getElementText = func;
return func(el);
};
function _getXmlaSoapList(container, listType, items, indent){
if (!indent) indent = "";
var n, i, entry, property, item, msg = "\n" + indent + "<" + container + ">";
if (items) {
msg += "\n" + indent + " <" + listType + ">";
for (property in items){
if (items.hasOwnProperty(property)) {
item = items[property];
msg += "\n" + indent + " <" + property + ">";
if (_isArr(item)){
n = item.length;
for (i = 0; i < n; i++){
entry = item[i];
msg += "<Value>" + _xmlEncode(entry) + "</Value>";
}
} else {
msg += _xmlEncode(item);
}
msg += "</" + property + ">";
}
}
msg += "\n" + indent + " </" + listType + ">";
}
msg += "\n" + indent + "</" + container + ">";
return msg;
};
var _xmlRequestType = "RequestType";
function _applyProps(object, properties, overwrite){
if (properties && (!object)) {
object = {};
}
var property;
for (property in properties){
if (properties.hasOwnProperty(property)){
if (overwrite || _isUnd(object[property])) {
object[property] = properties[property];
}
}
}
return object;
};
function _xjs(xml) {
// 1234 5 6 789 10 11 12 13 14 15
var re = /<(((([\w\-\.]+):)?([\w\-\.]+))([^>]+)?|\/((([\w\-\.]+):)?([\w\-\.]+))|\?(\w+)([^\?]+)?\?|(!--([^\-]|-[^\-])*--))>|([^<>]+)/ig,
match, name, prefix, atts, ePrefix, eName, piTarget, text,
ns = {"": ""}, newNs, nsUri, doc, parentNode, namespaces = [], nextParent, node = null
;
doc = parentNode = {
nodeType: 9,
childNodes: []
};
function Ns(){
namespaces.push(ns);
var _ns = new (function(){});
_ns.constructor.prototype = ns;
ns = new _ns.constructor();
node.namespaces = ns;
newNs = true;
}
function popNs() {
ns = namespaces.pop();
}
function unescapeEntities(text) {
return text.replace(/&((\w+)|#(x?)([0-9a-fA-F]+));/g, function(match, g1, g2, g3, g4, idx, str){
if (g2) {
var v = ({
lt: "<",
gt: ">",
amp: "&",
apos: "'",
quot: "\""
})[g2];
if (!v) throw "Illegal named entity: " + g2;
}
else {
return String.fromCharCode(g4, g3 ? 16: 10);
}
});
}
while (match = re.exec(xml)) {
node = null;
if (name = match[5]) {
newNs = false;
node = {
offset: match.index,
parentNode: parentNode,
nodeType: 1,
nodeName: name
};
nextParent = node;
if (atts = match[6]) {
if (atts.length && atts.substr(atts.length - 1, 1) === "\/") {
nextParent = node.parentNode;
if (ns === node.namespaces) popNs();
atts = atts.substr(0, atts.length - 1);
}
var attMatch, att;
// 123 4 5 6 7
var attRe = /((([\w\-]+):)?([\w\-]+))\s*=\s*('([^']*)'|"([^"]*)")/g;
while(attMatch = attRe.exec(atts)) {
var pfx = attMatch[3] || "",
value = attMatch[attMatch[6] ? 6 : 7]
;
if (attMatch[1].indexOf("xmlns")) {
if (!node.attributes) node.attributes = [];
att = {
nodeType: 2,
prefix: pfx,
nodeName: attMatch[4],
value: unescapeEntities(value)
};
nsUri = (pfx === "") ? "" : ns[pfx];
if (typeof(nsUri) === "undefined") {
throw "Unrecognized namespace with prefix \"" + prefix + "\"";
}
att.namespaceURI = nsUri;
node.attributes.push(att);
}
else {
if (!newNs) Ns();
ns[attMatch[3] ? attMatch[4] : ""] = value;
}
}
attRe.lastIndex = 0;
}
prefix = match[4] || "";
node.prefix = prefix;
nsUri = ns[prefix];
if (typeof(nsUri) === "undefined") {
throw "Unrecognized namespace with prefix \"" + prefix + "\"";
}
node.namespaceURI = nsUri;
}
else
if (eName = match[10]) {
ePrefix = match[9] || "";
if (parentNode.nodeName === eName && parentNode.prefix === ePrefix) {
nextParent = parentNode.parentNode;
if (ns === parentNode.namespaces) popNs();
}
else throw "Unclosed tag " + ePrefix + ":" + eName;
}
else
if (piTarget = match[11]) {
node = {
offset: match.index,
parentNode: parentNode,
target: piTarget,
data: match[12],
nodeType: 7
};
}
else
if (match[13]) {
node = {
offset: match.index,
parentNode: parentNode,
nodeType: 8,
data: match[14]
};
}
else
if ((text = match[15]) && (!/^\s+$/.test(text))) {
node = {
offset: match.index,
parentNode: parentNode,
nodeType: 3,
data: unescapeEntities(text)
};
}
if (node) {
if (!parentNode.childNodes) parentNode.childNodes = [];
parentNode.childNodes.push(node);
}
if (nextParent) parentNode = nextParent;
}
return doc;
};
/**
*
* The Xmla class provides a javascript API to communicate XML for Analysis (XML/A) over HTTP.
* XML/A is an industry standard protocol that allows webclients to work with OLAP servers.
* To fully understand the scope and purpose of this utility, it is highly recommended
* to read <a href="http://xmla.org/xmla1.1.doc">the XML/A specification</a>
* (MS Word format. For other formats,
* see: <a href="http://code.google.com/p/xmla4js/source/browse/#svn/trunk/doc/xmla1.1 specification">http://code.google.com/p/xmla4js/source/browse/#svn/trunk/doc/xmla1.1 specification</a>).
*
* The optional options parameter sets standard options for this Xmla instnace.
* If ommitted, a copy of the <code><a href="#property_defaultOptions">defaultOptions</code></a> will be used.
*
* @class Xmla
* @constructor
* @param options Object standard options
*/
Xmla = function(options){
this.listeners = {};
this.listeners[Xmla.EVENT_REQUEST] = [];
this.listeners[Xmla.EVENT_SUCCESS] = [];
this.listeners[Xmla.EVENT_ERROR] = [];
this.listeners[Xmla.EVENT_DISCOVER] = [];
this.listeners[Xmla.EVENT_DISCOVER_SUCCESS] = [];
this.listeners[Xmla.EVENT_DISCOVER_ERROR] = [];
this.listeners[Xmla.EVENT_EXECUTE] = [];
this.listeners[Xmla.EVENT_EXECUTE_SUCCESS] = [];
this.listeners[Xmla.EVENT_EXECUTE_ERROR] = [];
this.options = _applyProps(
_applyProps({}, Xmla.defaultOptions, true),
options, true
);
var listeners = this.options.listeners;
if (listeners) this.addListener(listeners);
return this;
};
/**
* These are the default options used for new Xmla instances in case no custom properties are set.
* It sets the following properties:
* <ul>
* <li><code>requestTimeout</code> int: 30000 - number of milliseconds before a request to the XML/A server will timeout </li>
* <li><code>async</code> boolean: false - determines whether synchronous or asynchronous communication with the XML/A server will be used.</li>
* <li><code>addFieldGetters</code> boolean: true - determines whether Xml.Rowset objects will be created with a getter method for each column.</li>
* <li><code>forceResponseXMLEmulation</code> boolean: false - determines whether to parse responseText or to use the native responseXML from the xhr object.</li>
* </ul>
*
* @property defaultOptions
* @static
* @type object
**/
Xmla.defaultOptions = {
requestTimeout: 30000, //by default, we bail out after 30 seconds
async: false, //by default, we do a synchronous request
addFieldGetters: true, //true to augment rowsets with a method to fetch a specific field.
//forceResponseXMLEmulation: true //true to use our own XML parser instead of XHR's native responseXML. Useful for testing.
forceResponseXMLEmulation: false //true to use our own XML parser instead of XHR's native responseXML. Useful for testing.
};
/**
* Can be used as value for the method option in the options object passed to the
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server.
* Instead of explicitly setting the method yourself, consider using the <code><a href="#method_request">discover()</a></code> method.
* The <code>discover()</code> method automatically sets the method option to <code>METHOD_DISCOVER</code>.
* @property METHOD_DISCOVER
* @static
* @final
* @type string
* @default Discover
*/
Xmla.METHOD_DISCOVER = "Discover";
/**
* Can be used as value for the method option property in the options objecct passed to the
* <code><a href="#method_request">request()</code></a> method to invoke the XML/A Execute method on the server.
* Instead of explicitly setting the method yourself, consider using the <code><a href="#method_execute">execute()</a></code> method.
* The <code>execute()</code> method automatically sets the method option to <code>METHOD_EXECUTE</code>.
* @property METHOD_EXECUTE
* @static
* @final
* @type string
* @default Discover
*/
Xmla.METHOD_EXECUTE = "Execute";
var _xmlaDISCOVER = "DISCOVER_";
var _xmlaMDSCHEMA = "MDSCHEMA_";
var _xmlaDBSCHEMA = "DBSCHEMA_";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_DATASOURCES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this constant as requestType yourself, consider calling the <code><a href="#method_discoverDataSources">discoverDataSources()</a></code> method.
* The <code>discoverDataSources()</code> method passes <code>DISCOVER_DATASOURCES</code> automatically as requestType for Discover requests.
*
* @property DISCOVER_DATASOURCES
* @static
* @final
* @type string
* @default DISCOVER_DATASOURCES
*/
Xmla.DISCOVER_DATASOURCES = _xmlaDISCOVER + "DATASOURCES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_PROPERTIES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverProperties">discoverProperties()</a></code> method.
* The <code>discoverProperties()</code> method passes <code>DISCOVER_PROPERTIES</code> automatically as requestType for Discover requests.
*
* @property DISCOVER_PROPERTIES
* @static
* @final
* @type string
* @default DISCOVER_PROPERTIES
*/
Xmla.DISCOVER_PROPERTIES = _xmlaDISCOVER + "PROPERTIES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_SCHEMA_ROWSETS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverSchemaRowsets">discoverSchemaRowsets()</a></code> method.
* The <code>discoverProperties()</code> method passes <code>DISCOVER_PROPERTIES</code> automatically as requestType for Discover requests.
*
* @property DISCOVER_SCHEMA_ROWSETS
* @static
* @final
* @type string
* @default DISCOVER_SCHEMA_ROWSETS
*/
Xmla.DISCOVER_SCHEMA_ROWSETS = _xmlaDISCOVER + "SCHEMA_ROWSETS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_ENUMERATORS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverEnumerators">discoverEnumerators()</a></code> method.
* The <code>discoverSchemaRowsets()</code> method issues a request to invoke the Discover method using <code>DISCOVER_SCHEMA_ROWSETS</code> as requestType.
*
* @property DISCOVER_ENUMERATORS
* @static
* @final
* @type string
* @default DISCOVER_ENUMERATORS
*/
Xmla.DISCOVER_ENUMERATORS = _xmlaDISCOVER + "ENUMERATORS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_KEYWORDS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this requestType yourself, consider calling the <code><a href="#method_discoverLiterals">discoverKeywords()</a></code> method.
* The <code>discoverKeywords()</code> method issues a request to invoke the Discover method using DISCOVER_KEYWORDS as requestType.
*
* @property DISCOVER_KEYWORDS
* @static
* @final
* @type string
* @default DISCOVER_KEYWORDS
*/
Xmla.DISCOVER_KEYWORDS = _xmlaDISCOVER + "KEYWORDS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_LITERALS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverLiterals">discoverLiterals()</a></code> method.
* The <code>discoverLiterals()</code> method issues a request to invoke the Discover method using DISCOVER_LITERALS as requestType.
*
* @property DISCOVER_LITERALS
* @static
* @final
* @type string
* @default DISCOVER_LITERALS
*/
Xmla.DISCOVER_LITERALS = _xmlaDISCOVER + "LITERALS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_CATALOGS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBCatalogs">discoverDBCatalogs()</a></code> method.
* The <code>discoverDBCatalogs()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_CATALOGS</code> as requestType.
*
* @property DBSCHEMA_CATALOGS
* @static
* @final
* @type string
* @default DBSCHEMA_CATALOGS
*/
Xmla.DBSCHEMA_CATALOGS = _xmlaDBSCHEMA + "CATALOGS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_COLUMNS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBColumns">discoverDBColumns()</a></code> method.
* The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_COLUMNS</code> as requestType.
*
* @property DBSCHEMA_COLUMNS
* @static
* @final
* @type string
* @default DBSCHEMA_COLUMNS
*/
Xmla.DBSCHEMA_COLUMNS = _xmlaDBSCHEMA + "COLUMNS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_PROVIDER_TYPES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBProviderTypes">discoverDBProviderTypes()</a></code> method.
* The <code>discoverDBProviderTypes()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_PROVIDER_TYPES</code> as requestType.
*
* @property DBSCHEMA_PROVIDER_TYPES
* @static
* @final
* @type string
* @default DBSCHEMA_PROVIDER_TYPES
*/
Xmla.DBSCHEMA_PROVIDER_TYPES = _xmlaDBSCHEMA + "PROVIDER_TYPES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_SCHEMATA</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBSchemata">discoverDBSchemata()</a></code> method.
* The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_SCHEMATA</code> as requestType.
*
* @property DBSCHEMA_SCHEMATA
* @static
* @final
* @type string
* @default DBSCHEMA_SCHEMATA
*/
Xmla.DBSCHEMA_SCHEMATA = _xmlaDBSCHEMA + "SCHEMATA";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_TABLES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBTables">discoverDBTables()</a></code> method.
* The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_TABLES</code> as requestType.
*
* @property DBSCHEMA_TABLES
* @static
* @final
* @type string
* @default DBSCHEMA_TABLES
*/
Xmla.DBSCHEMA_TABLES = _xmlaDBSCHEMA + "TABLES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_TABLES_INFO</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverDBTablesInfo">discoverDBTablesInfo()</a></code> method.
* The <code>discoverDBTablesInfo()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_TABLES_INFO</code> as requestType.
*
* @property DBSCHEMA_TABLES_INFO
* @static
* @final
* @type string
* @default <code>DBSCHEMA_TABLES_INFO</code>
*/
Xmla.DBSCHEMA_TABLES_INFO = _xmlaDBSCHEMA + "TABLES_INFO";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>MDSCHEMA_ACTIONS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDActions">discoverMDActions()</a></code> method.
* The <code>discoverMDActions()</code> method issues a request to invoke the Discover method using <code>MDSCHEMA_ACTIONS</code> as requestType.
*
* @property MDSCHEMA_ACTIONS
* @static
* @final
* @type string
* @default MDSCHEMA_ACTIONS
*/
Xmla.MDSCHEMA_ACTIONS = _xmlaMDSCHEMA + "ACTIONS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_CUBES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDCubes">discoverMDCubes()</a></code> method.
* The <code>discoverMDCubes()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_CUBES</code> as requestType.
*
* @property MDSCHEMA_CUBES
* @static
* @final
* @type string
* @default MDSCHEMA_CUBES
*/
Xmla.MDSCHEMA_CUBES = _xmlaMDSCHEMA + "CUBES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_DIMENSIONS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDDimensions">discoverMDDimensions()</a></code> method.
* The <code>discoverMDDimensions()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_DIMENSIONS</code> as requestType.
*
* @property MDSCHEMA_DIMENSIONS
* @static
* @final
* @type string
* @default MDSCHEMA_DIMENSIONS
*/
Xmla.MDSCHEMA_DIMENSIONS = _xmlaMDSCHEMA + "DIMENSIONS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_FUNCTIONS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDFunctions">discoverMDFunctions()</a></code> method.
* The <code>discoverMDFunctions()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_FUNCTIONS</code> as requestType.
*
* @property MDSCHEMA_FUNCTIONS
* @static
* @final
* @type string
* @default MDSCHEMA_FUNCTIONS
*/
Xmla.MDSCHEMA_FUNCTIONS = _xmlaMDSCHEMA + "FUNCTIONS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_HIERARCHIES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDHierarchies">discoverMDHierarchies()</a></code> method.
* The <code>discoverMDHierarchies()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_HIERARCHIES</code> as requestType.
*
* @property MDSCHEMA_HIERARCHIES
* @static
* @final
* @type string
* @default MDSCHEMA_HIERARCHIES
*/
Xmla.MDSCHEMA_HIERARCHIES = _xmlaMDSCHEMA + "HIERARCHIES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_LEVELS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDLevels">discoverMDLevels()</a></code> method.
* The <code>discoverMDLevels()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_LEVELS</code> as requestType.
*
* @property MDSCHEMA_LEVELS
* @static
* @final
* @type string
* @default MDSCHEMA_LEVELS
*/
Xmla.MDSCHEMA_LEVELS = _xmlaMDSCHEMA + "LEVELS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_MEASURES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDMeasures">discoverMDMeasures()</a></code> method.
* The <code>discoverMDMeasures()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_MEASURES</code> as requestType.
*
* @property MDSCHEMA_MEASURES
* @static
* @final
* @type string
* @default MDSCHEMA_MEASURES
*/
Xmla.MDSCHEMA_MEASURES = _xmlaMDSCHEMA + "MEASURES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_MEMBERS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDMembers">discoverMDMembers()</a></code> method.
* The <code>discoverMDMembers()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_MEMBERS</code> as requestType.
*
* @property MDSCHEMA_MEMBERS
* @static
* @final
* @type string
* @default MDSCHEMA_MEMBERS
*/
Xmla.MDSCHEMA_MEMBERS = _xmlaMDSCHEMA + "MEMBERS";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_PROPERTIES</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDProperties">discoverMDProperties()</a></code> method.
* The <code>discoverMDProperties()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_PROPERTIES</code> as requestType.
*
* @property MDSCHEMA_PROPERTIES
* @static
* @final
* @type string
* @default MDSCHEMA_PROPERTIES
*/
Xmla.MDSCHEMA_PROPERTIES = _xmlaMDSCHEMA + "PROPERTIES";
/**
* Can be used as value for the <code>requestType</code> option in the options object passed to the to
* <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
* <code>MDSCHEMA_SETS</code> schema rowset.
* The <code>requestType</code> option applies only to Discover requests.
* Instead of passing this <code>requestType</code> yourself, consider calling the
* <code><a href="#method_discoverMDSets">discoverMDSets()</a></code> method.
* The <code>discoverMDSets()</code> method issues a request to invoke the Discover method using
* <code>MDSCHEMA_SETS</code> as requestType.
*
* @property MDSCHEMA_SETS
* @static
* @final
* @type string
* @default MDSCHEMA_SETS
*/
Xmla.MDSCHEMA_SETS = _xmlaMDSCHEMA + "SETS";
/**
* Indicates the <code>request</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>request</code> event is the first event that is fired before submitting a request
* (see: <code><a href="#method_request">request()</a></code>)
* to the server, and before firing the method-specific request events
* (see <code><a href="#property_EVENT_EXECUTE">EVENT_EXECUTE</a></code>
* and <code><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a></code>).
* The <code>request</code> event itself is not method-specific, and fires for <code>Execute</code> as well as <code>Discover</code> requests.
* The <code>EVENT_REQUEST</code> event is <em>cancelable</em>:
* the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
* whether the respective operation should be canceled.
*
* @property EVENT_REQUEST
* @static
* @final
* @type string
* @default request
*/
Xmla.EVENT_REQUEST = "request";
/**
* Indicates the <code>success</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>success</code> event is the last event that is fired after receiving and processing a normal response
* (that is, a response that does not contain an XML/A <code>SoapFault</code>),
* after firing the method-specific success events
* (see <code><a href="#property_EVENT_EXECUTE_SUCCESS">EVENT_EXECUTE_SUCCESS</a></code>
* and <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>).
* The <code>success</code> event is not method-specific, and fires for <code>Execute</code> as well as <code>Discover</code> responses.
* This is event is not cancelable.
*
* @property EVENT_SUCCESS
* @static
* @final
* @type string
* @default success
*/
Xmla.EVENT_SUCCESS = "success";
/**
* Indicates the <code>error</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>error</code> is fired when an error occurs while sending a request or receiving a response.
* The <code>error</code> event is not method-specific, and fires for errors encountered during both <code>Execute</code> as well as <code>Discover</code> method invocations.
* This is event is not cancelable.
*
* @property EVENT_ERROR
* @static
* @final
* @type string
* @default error
*/
Xmla.EVENT_ERROR = "error";
/**
* Indicates the <code>execute</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>execute</code> event is method-specific, and is fired before submitting an <code>Execute</code> request
* (see: <code><a href="#method_execute">execute()</a></code>)
* to the server, but after firing the <code>request</code> event
* (see: <code><a href="#property_EVENT_REQUEST">EVENT_REQUEST</a></code>).
* The <code>EVENT_EXECUTE</code> event is <em>cancelable</em>:
* the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
* whether the respective operation should be canceled.
*
* @property EVENT_EXECUTE
* @static
* @final
* @type string
* @default execute
*/
Xmla.EVENT_EXECUTE = "execute";
/**
* Indicates the <code>executesuccess</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>executesuccess</code> event is method-specific and fired only after receiving and processing a normal response
* (that is, a response that does not contain a <code>SoapFault</code>)
* to an incovation of the XML/A <code>Execute</code> method
* (see: <code><a href="#method_execute">execute()</a></code>).
* This is event is not cancelable.
*
* @property EVENT_EXECUTE_SUCCESS
* @static
* @final
* @type string
* @default executesuccess
*/
Xmla.EVENT_EXECUTE_SUCCESS = "executesuccess";
/**
* Indicates the <code>executeerror</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>executeerror</code> event is method-specific and fired when an error occurs while sending an <code>Execute</code> request, or receiving a response to an <code>Execute</code method.
* (see: <code><a href="#method_execute">execute()</a></code>).
* This is event is not cancelable.
*
* @property EVENT_EXECUTE_ERROR
* @static
* @final
* @type string
* @default executeerror
*/
Xmla.EVENT_EXECUTE_ERROR = "executeerror";
/**
* Indicates the <code>discover</code> event.
* This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
* The <code>discover</code> event is method-specific, and is fired before submitting a <code>Discover</code> request
* (see: <code><a href="#method_discover">discover()</a></code>)
* to the server, but after firing the <code>request</code> event
* (see: <code><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a></code>).
* The <code>EVENT_DISCOVER</code> event is <em>cancelable</em>:
* the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
* whether the respective operation should be canceled.
*
* @property EVENT_DISCOVER
* @static
* @final
* @type string
* @default disco