From bf04ab5ffc373b47262794cb41367e9005454f2c Mon Sep 17 00:00:00 2001
From: Mark For a single listener, you can pass a
-* You can use
-* Alternatively, you can pass the element as separate arguments instead of as an object literal:
-*
-* To register multiple listeners, pass an array of listener objects:
-*
-* Alternatively, pass multiple listener objects as separate arguments:
-*
-* Or, pass a single object literal with event names as keys and listener objects or functions as values:
-* defaultOptions 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:
-*
-*
-*
-* @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
-* requestTimeout int: 30000 - number of milliseconds before a request to the XML/A server will timeout async boolean: false - determines whether synchronous or asynchronous communication with the XML/A server will be used.addFieldGetters boolean: true - determines whether Xml.Rowset objects will be created with a getter method for each column.forceResponseXMLEmulation boolean: false - determines whether to parse responseText or to use the native responseXML from the xhr object.request() method to invoke the XML/A Discover method on the server.
-* Instead of explicitly setting the method yourself, consider using the discover() method.
-* The discover() method automatically sets the method option to METHOD_DISCOVER.
-* @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
-* request() method to invoke the XML/A Execute method on the server.
-* Instead of explicitly setting the method yourself, consider using the execute() method.
-* The execute() method automatically sets the method option to METHOD_EXECUTE.
-* @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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_DATASOURCES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this constant as requestType yourself, consider calling the discoverDataSources() method.
-* The discoverDataSources() method passes DISCOVER_DATASOURCES 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_PROPERTIES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverProperties() method.
-* The discoverProperties() method passes DISCOVER_PROPERTIES 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_SCHEMA_ROWSETS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverSchemaRowsets() method.
-* The discoverProperties() method passes DISCOVER_PROPERTIES 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_ENUMERATORS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverEnumerators() method.
-* The discoverSchemaRowsets() method issues a request to invoke the Discover method using DISCOVER_SCHEMA_ROWSETS as requestType.
-*
-* @property DISCOVER_ENUMERATORS
-* @static
-* @final
-* @type string
-* @default DISCOVER_ENUMERATORS
-*/
-Xmla.DISCOVER_ENUMERATORS = _xmlaDISCOVER + "ENUMERATORS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_KEYWORDS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverKeywords() method.
-* The discoverKeywords() 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DISCOVER_LITERALS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverLiterals() method.
-* The discoverLiterals() 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_CATALOGS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverDBCatalogs() method.
-* The discoverDBCatalogs() method issues a request to invoke the Discover method using DBSCHEMA_CATALOGS as requestType.
-*
-* @property DBSCHEMA_CATALOGS
-* @static
-* @final
-* @type string
-* @default DBSCHEMA_CATALOGS
-*/
-Xmla.DBSCHEMA_CATALOGS = _xmlaDBSCHEMA + "CATALOGS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_COLUMNS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverDBColumns() method.
-* The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_COLUMNS as requestType.
-*
-* @property DBSCHEMA_COLUMNS
-* @static
-* @final
-* @type string
-* @default DBSCHEMA_COLUMNS
-*/
-Xmla.DBSCHEMA_COLUMNS = _xmlaDBSCHEMA + "COLUMNS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_PROVIDER_TYPES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverDBProviderTypes() method.
-* The discoverDBProviderTypes() method issues a request to invoke the Discover method using DBSCHEMA_PROVIDER_TYPES 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 requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_SCHEMATA schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverDBSchemata() method.
-* The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_SCHEMATA as requestType.
-*
-* @property DBSCHEMA_SCHEMATA
-* @static
-* @final
-* @type string
-* @default DBSCHEMA_SCHEMATA
-*/
-Xmla.DBSCHEMA_SCHEMATA = _xmlaDBSCHEMA + "SCHEMATA";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_TABLES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the discoverDBTables() method.
-* The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_TABLES as requestType.
-*
-* @property DBSCHEMA_TABLES
-* @static
-* @final
-* @type string
-* @default DBSCHEMA_TABLES
-*/
-Xmla.DBSCHEMA_TABLES = _xmlaDBSCHEMA + "TABLES";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_TABLES_INFO schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverDBTablesInfo() method.
-* The discoverDBTablesInfo() method issues a request to invoke the Discover method using DBSCHEMA_TABLES_INFO as requestType.
-*
-* @property DBSCHEMA_TABLES_INFO
-* @static
-* @final
-* @type string
-* @default DBSCHEMA_TABLES_INFO
-*/
-Xmla.DBSCHEMA_TABLES_INFO = _xmlaDBSCHEMA + "TABLES_INFO";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the MDSCHEMA_ACTIONS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDActions() method.
-* The discoverMDActions() method issues a request to invoke the Discover method using MDSCHEMA_ACTIONS as requestType.
-*
-* @property MDSCHEMA_ACTIONS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_ACTIONS
-*/
-Xmla.MDSCHEMA_ACTIONS = _xmlaMDSCHEMA + "ACTIONS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_CUBES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDCubes() method.
-* The discoverMDCubes() method issues a request to invoke the Discover method using
-* MDSCHEMA_CUBES as requestType.
-*
-* @property MDSCHEMA_CUBES
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_CUBES
-*/
-Xmla.MDSCHEMA_CUBES = _xmlaMDSCHEMA + "CUBES";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_DIMENSIONS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDDimensions() method.
-* The discoverMDDimensions() method issues a request to invoke the Discover method using
-* MDSCHEMA_DIMENSIONS as requestType.
-*
-* @property MDSCHEMA_DIMENSIONS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_DIMENSIONS
-*/
-Xmla.MDSCHEMA_DIMENSIONS = _xmlaMDSCHEMA + "DIMENSIONS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_FUNCTIONS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDFunctions() method.
-* The discoverMDFunctions() method issues a request to invoke the Discover method using
-* MDSCHEMA_FUNCTIONS as requestType.
-*
-* @property MDSCHEMA_FUNCTIONS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_FUNCTIONS
-*/
-Xmla.MDSCHEMA_FUNCTIONS = _xmlaMDSCHEMA + "FUNCTIONS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_HIERARCHIES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDHierarchies() method.
-* The discoverMDHierarchies() method issues a request to invoke the Discover method using
-* MDSCHEMA_HIERARCHIES as requestType.
-*
-* @property MDSCHEMA_HIERARCHIES
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_HIERARCHIES
-*/
-Xmla.MDSCHEMA_HIERARCHIES = _xmlaMDSCHEMA + "HIERARCHIES";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_LEVELS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDLevels() method.
-* The discoverMDLevels() method issues a request to invoke the Discover method using
-* MDSCHEMA_LEVELS as requestType.
-*
-* @property MDSCHEMA_LEVELS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_LEVELS
-*/
-Xmla.MDSCHEMA_LEVELS = _xmlaMDSCHEMA + "LEVELS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_MEASURES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDMeasures() method.
-* The discoverMDMeasures() method issues a request to invoke the Discover method using
-* MDSCHEMA_MEASURES as requestType.
-*
-* @property MDSCHEMA_MEASURES
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_MEASURES
-*/
-Xmla.MDSCHEMA_MEASURES = _xmlaMDSCHEMA + "MEASURES";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_MEMBERS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDMembers() method.
-* The discoverMDMembers() method issues a request to invoke the Discover method using
-* MDSCHEMA_MEMBERS as requestType.
-*
-* @property MDSCHEMA_MEMBERS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_MEMBERS
-*/
-Xmla.MDSCHEMA_MEMBERS = _xmlaMDSCHEMA + "MEMBERS";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_PROPERTIES schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDProperties() method.
-* The discoverMDProperties() method issues a request to invoke the Discover method using
-* MDSCHEMA_PROPERTIES as requestType.
-*
-* @property MDSCHEMA_PROPERTIES
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_PROPERTIES
-*/
-Xmla.MDSCHEMA_PROPERTIES = _xmlaMDSCHEMA + "PROPERTIES";
-/**
-* Can be used as value for the requestType option in the options object passed to the to
-* request() method to invoke the XML/A Discover method on the server to return the
-* MDSCHEMA_SETS schema rowset.
-* The requestType option applies only to Discover requests.
-* Instead of passing this requestType yourself, consider calling the
-* discoverMDSets() method.
-* The discoverMDSets() method issues a request to invoke the Discover method using
-* MDSCHEMA_SETS as requestType.
-*
-* @property MDSCHEMA_SETS
-* @static
-* @final
-* @type string
-* @default MDSCHEMA_SETS
-*/
-Xmla.MDSCHEMA_SETS = _xmlaMDSCHEMA + "SETS";
-/**
-* Indicates the request event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The request event is the first event that is fired before submitting a request
-* (see: request())
-* to the server, and before firing the method-specific request events
-* (see EVENT_EXECUTE
-* and EVENT_DISCOVER).
-* The request event itself is not method-specific, and fires for Execute as well as Discover requests.
-* The EVENT_REQUEST event is cancelable:
-* the handler function specified in the listener object passed to addListener 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 success event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The success 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 SoapFault),
-* after firing the method-specific success events
-* (see EVENT_EXECUTE_SUCCESS
-* and EVENT_DISCOVER_SUCCESS).
-* The success event is not method-specific, and fires for Execute as well as Discover responses.
-* This is event is not cancelable.
-*
-* @property EVENT_SUCCESS
-* @static
-* @final
-* @type string
-* @default success
-*/
-Xmla.EVENT_SUCCESS = "success";
-/**
-* Indicates the error event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The error is fired when an error occurs while sending a request or receiving a response.
-* The error event is not method-specific, and fires for errors encountered during both Execute as well as Discover method invocations.
-* This is event is not cancelable.
-*
-* @property EVENT_ERROR
-* @static
-* @final
-* @type string
-* @default error
-*/
-Xmla.EVENT_ERROR = "error";
-
-/**
-* Indicates the execute event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The execute event is method-specific, and is fired before submitting an Execute request
-* (see: execute())
-* to the server, but after firing the request event
-* (see: EVENT_REQUEST).
-* The EVENT_EXECUTE event is cancelable:
-* the handler function specified in the listener object passed to addListener 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 executesuccess event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The executesuccess event is method-specific and fired only after receiving and processing a normal response
-* (that is, a response that does not contain a SoapFault)
-* to an incovation of the XML/A Execute method
-* (see: execute()).
-* This is event is not cancelable.
-*
-* @property EVENT_EXECUTE_SUCCESS
-* @static
-* @final
-* @type string
-* @default executesuccess
-*/
-Xmla.EVENT_EXECUTE_SUCCESS = "executesuccess";
-/**
-* Indicates the executeerror event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The executeerror event is method-specific and fired when an error occurs while sending an Execute request, or receiving a response to an Execute method.
-* (see: execute()).
-* This is event is not cancelable.
-*
-* @property EVENT_EXECUTE_ERROR
-* @static
-* @final
-* @type string
-* @default executeerror
-*/
-Xmla.EVENT_EXECUTE_ERROR = "executeerror";
-
-/**
-* Indicates the discover event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The discover event is method-specific, and is fired before submitting a Discover request
-* (see: discover())
-* to the server, but after firing the request event
-* (see: EVENT_DISCOVER).
-* The EVENT_DISCOVER event is cancelable:
-* the handler function specified in the listener object passed to addListener should return a boolen, indicating
-* whether the respective operation should be canceled.
-*
-* @property EVENT_DISCOVER
-* @static
-* @final
-* @type string
-* @default discover
-*/
-Xmla.EVENT_DISCOVER = "discover";
-/**
-* Indicates the discoversuccess event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The discoversuccess event is method-specific and fired only after receiving and processing a normal response
-* (that is, a response that does not contain a SoapFault)
-* to an incovation of the XML/A Discover method
-* (see: discover()).
-* This is event is not cancelable.
-*
-* @property EVENT_DISCOVER_SUCCESS
-* @static
-* @final
-* @type string
-* @default discoversuccess
-*/
-Xmla.EVENT_DISCOVER_SUCCESS = "discoversuccess";
-/**
-* Indicates the discovererror event.
-* This constant can be used as en entry in the events array argument for the addListener() method.
-* The discovererror is method-specific and fired when an error occurs while sending an Discover request,
-* or receiving a response to an Discover method.
-* (see: discover()).
-* This is event is not cancelable.
-*
-* @property EVENT_DISCOVER_ERROR
-* @static
-* @final
-* @type string
-* @default discovererror
-*/
-Xmla.EVENT_DISCOVER_ERROR = "discovererror";
-
-/**
-* Unifies all general events, that is, all events that are not method-specific.
-* This constant can be used as events array argument for the addListener() method,
-* or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
-* This constant is especially intended for asyncronous handling of Schema rowset data.
-*
-* @property EVENT_GENERAL
-* @static
-* @final
-* @type string[]
-* @default [EVENT_REQUEST,EVENT_SUCCESS,EVENT_ERROR]
-*/
-Xmla.EVENT_GENERAL = [
- Xmla.EVENT_REQUEST,
- Xmla.EVENT_SUCCESS,
- Xmla.EVENT_ERROR
-];
-
-/**
-* Unifies all events specific for the Discover method.
-* This constant can be used as events array argument for the addListener() method,
-* or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
-*
-* @property EVENT_DISCOVER_ALL
-* @static
-* @final
-* @type string[]
-* @default [EVENT_DISCOVER,EVENT_DISCOVER_SUCCESS,EVENT_DISCOVER_ERROR]
-*/
-Xmla.EVENT_DISCOVER_ALL = [
- Xmla.EVENT_DISCOVER,
- Xmla.EVENT_DISCOVER_SUCCESS,
- Xmla.EVENT_DISCOVER_ERROR
-];
-
-/**
-* Unifies all events specific for the Execute method.
-* This constant can be used as events array argument for the addListener() method,
-* or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
-*
-* @property EVENT_EXECUTE_ALL
-* @static
-* @final
-* @type string[]
-* @default [EVENT_EXECUTE,EVENT_EXECUTE_SUCCESS,EVENT_EXECUTE_ERROR]
-*/
-Xmla.EVENT_EXECUTE_ALL = [
- Xmla.EVENT_EXECUTE,
- Xmla.EVENT_EXECUTE_SUCCESS,
- Xmla.EVENT_EXECUTE_ERROR
-];
-
-/**
-* Unifies all method-specific and non method-specific events.
-* This constant can be used as events array argument for the addListener() method.
-*
-* @property EVENT_ALL
-* @static
-* @final
-* @type string[]
-* @default [].concat(Xmla.EVENT_GENERAL, Xmla.EVENT_DISCOVER_ALL, Xmla.EVENT_EXECUTE_ALL)
-*/
-Xmla.EVENT_ALL = [].concat(
- Xmla.EVENT_GENERAL,
- Xmla.EVENT_DISCOVER_ALL,
- Xmla.EVENT_EXECUTE_ALL
-);
-
-/**
-* Can be used as key in the properties member of the options object
-* passed to the request() method
-* to specify the XML/A DataSourceInfo property.
-* The XML/A DataSourceInfo, together with the XML/A service URL are required to
-* connect to a particular OLAP datasource.
-* Valid values for the DataSourceInfo as well as the corresponding URL should be obtained
-* by querying the DataSourceInfo and URL columns of the DISCOVER_DATASOURCES
-* rowset respectively (see discoverDataSources()).
-*
-* @property PROP_DATASOURCEINFO
-* @static
-* @final
-* @type string
-* @default DataSourceInfo
-*/
-Xmla.PROP_DATASOURCEINFO = "DataSourceInfo";
-/**
-* Can be used as key in the properties member of the options object
-* passed to the execute() method
-* to specify the XML/A Catalog property.
-* The XML/A Catalog spefifies where to look for cubes that are referenced in th MDX statment.
-* Valid values for the Catalog should be obtained
-* by querying the CATALOG_NAME of the DBSCHEMA_CATALOGS
-* rowset (see discoverDBCatalogs()).
-*
-* @property PROP_Catalog
-* @static
-* @final
-* @type string
-* @default Catalog
-*/
-Xmla.PROP_CATALOG = "Catalog";
-Xmla.PROP_CUBE = "Cube";
-
-/**
-* Can be used as key in the properties member of the options object
-* passed to the execute() method
-* to specify the XML/A Format property.
-* This property controls the structure of the resultset.
-*
-* @property PROP_FORMAT
-* @static
-* @final
-* @type string
-* @default Format
-*/
-Xmla.PROP_FORMAT = "Format";
-/**
-* Can be used as value for the
-* execute() method.
-* When used, this specifies that the multidimensional resultset should be returned in a tabular format,
-* causeing the multidimensional resultset to be represented with an instance of the
-* Xmla.Rowset class.
-*
-* @property PROP_FORMAT_TABULAR
-* @static
-* @final
-* @type string
-* @default Tabular
-*/
-Xmla.PROP_FORMAT_TABULAR = "Tabular";
-/**
-* Can be used as value for the
-* execute() method.
-* When used, this specifies that the multidimensional resultset should be returned in a multidimensional format.
-* Currently, Xmla4js does not provide a class to represent the resultset in this format.
-* However, you can access the results as xml through the
-* responseText and
-* responseXML properties.
-*
-* @property PROP_FORMAT_MULTIDIMENSIONAL
-* @static
-* @final
-* @type string
-* @default Multidimensional
-*/
-Xmla.PROP_FORMAT_MULTIDIMENSIONAL = "Multidimensional";
-
-/**
-* Can be used as key in the properties member of the options object
-* passed to the execute() method
-* to specify the XML/A AxisFormat property.
-* The XML/A AxisFormat property specifies how the client wants to receive the multi-dimensional resultset of a MDX query.
-* Valid values for the AxisFormat property are available as the static final properties
-* PROP_AXISFORMAT_TUPLE,
-* PROP_AXISFORMAT_CLUSTER,
-* PROP_AXISFORMAT_CUSTOM.
-*
-* @property PROP_AXISFORMAT
-* @static
-* @final
-* @type string
-* @default AxisFormat
-*/
-Xmla.PROP_AXISFORMAT = "AxisFormat";
-/**
-* Can be used as value for the AxisFormat XML/A property
-* (see: PROP_AXISFORMAT)
-* in invocations of the Execute method
-* (see: execute()).
-*
-* @property PROP_AXISFORMAT_TUPLE
-* @static
-* @final
-* @type string
-* @default TupleFormat
-*/
-Xmla.PROP_AXISFORMAT_TUPLE = "TupleFormat";
-/**
-* Can be used as value for the AxisFormat XML/A property
-* (see: PROP_AXISFORMAT)
-* in invocations of the Execute method
-* (see: execute()).
-*
-* @property PROP_AXISFORMAT_CLUSTER
-* @static
-* @final
-* @type string
-* @default ClusterFormat
-*/
-Xmla.PROP_AXISFORMAT_CLUSTER = "ClusterFormat";
-/**
-* Can be used as value for the AxisFormat XML/A property
-* (see: PROP_AXISFORMAT)
-* in invocations of the Execute method
-* (see: execute()).
-*
-* @property PROP_AXISFORMAT_CUSTOM
-* @static
-* @final
-* @type string
-* @default CustomFormat
-*/
-Xmla.PROP_AXISFORMAT_CUSTOM = "CustomFormat";
-
-/**
-* Can be used as key in the properties member of the options object
-* passed to the request() method
-* to specify the XML/A Content property.
-* The XML/A Content property specifies whether to return data and/or XML Schema metadata by the Discover and Execute invocations.
-* Valid values for the Content property are available as the static final properties
-* PROP_CONTENT_DATA,
-* PROP_CONTENT_NONE,
-* PROP_CONTENT_SCHEMA,
-* PROP_CONTENT_SCHEMADATA.
-*
-* Note: This key is primarily intended for clients that use the low-level request() method.
-* You should not set this property when calling the discover() method,
-* the execute() method,
-* or any of the discoverXXX() methods.
-*
-* @property PROP_CONTENT
-* @static
-* @final
-* @type string
-* @default Content
-*/
-Xmla.PROP_CONTENT = "Content";
-/**
-* Can be used as value for the XML/A Content property
-* (see: PROP_CONTENT).
-* This value specifies that the response should contain only data, but no XML Schema metadata.
-*
-* As the Xmla class relies on the XML Schema metadata to construct Rowset and Resultset instances,
-* this option is primarily useful if you know how to process the XML response directly.
-*
-* @property PROP_CONTENT_DATA
-* @static
-* @final
-* @type string
-* @default Data
-*/
-Xmla.PROP_CONTENT_DATA = "Data";
-/**
-* Can be used as value for the XML/A Content property
-* (see: PROP_CONTENT).
-* This value specifies that the response should contain neither data nor XML Schema metadata.
-* This is useful to check the validity of the request.
-*
-* @property PROP_CONTENT_NONE
-* @static
-* @final
-* @type string
-* @default None
-*/
-Xmla.PROP_CONTENT_NONE = "None";
-/**
-* Can be used as value for the XML/A Content property
-* (see: PROP_CONTENT).
-* This value specifies that the response should only return XML Schema metadata, but no data.
-*
-* @property PROP_CONTENT_SCHEMA
-* @static
-* @final
-* @type string
-* @default Schema
-*/
-Xmla.PROP_CONTENT_SCHEMA = "Schema";
-/**
-* Can be used as value for the XML/A Content property
-* (see: PROP_CONTENT).
-* This value specifies that the response should return both data as well as XML Schema metadata.
-*
-* @property PROP_CONTENT_SCHEMADATA
-* @static
-* @final
-* @type string
-* @default SchemaData
-*/
-Xmla.PROP_CONTENT_SCHEMADATA = "SchemaData";
-
-Xmla.prototype = {
-/**
-* This object stores listeners.
-* Each key is a listener type (see the static final EVENT_XXX constants),
-* each value is an array of listener objects that are subscribed to that particular event.
-*
-* @property listeners
-* @protected
-* @type Object
-* @default
-{
- "request": []
- , "succss": []
- , "error": []
- , "discover": []
- , "discoversuccss": []
- , "discovererror": []
- , "execute": []
- , "executesuccss": []
- , "executeerror": []
-}
-*/
- listeners: null,
-/**
-* The soap message sent in the last request to the server.
-*
-* @property soapMessage
-* @type {string}
-* @default null
-*/
- soapMessage: null,
-/**
-* This property is set to null right before sending an XML/A request.
-* When a successfull response is received, it is processed and the response object is assigned to this property.
-* The response object is either a
-* Rowset (after a successful invocation of XML/A Discover method, see: discover()) or a
-* Resultset (after a successful invocation of the XML/A Execute method, see: execute())
-* instance.
-*
-* If you are interested in processing the raw response XML, see
-* responseXML and
-* responseText.
-*
-* Note that it is not safe to read this property immediately after doing an asynchronous request.
-* For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
-*
-* @property response
-* @type Xmla.Rowset|Xmla.Dataset
-* @default null
-*/
- response: null,
-/**
-* This property is set to null right before sending an XML/A request.
-* When a successfull response is received, the XML response is stored to this property as plain text.
-*
-* If you are interested in processing a DOM document rather than the raw XML text, see the
-* responseXML property.
-*
-* If you are interested in traversing the dataset returned in the XML/A response, see the
-* response property.
-*
-* Note that it is not safe to read this property immediately after doing an asynchronous request.
-* For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
-*
-* @property responseText
-* @type {string}
-* @default null
-*/
- responseText: null,
-/**
-* This property is set to null right before sending an XML/A request.
-* When a successfull response is received, the XML response is stored to this property as a DOM Document.
-*
-* If you are interested in processing the raw XML text rather than a DOM document, see the
-* responseText property.
-*
-* If you are interested in traversing the dataset returned in the XML/A response, see the
-* response property.
-*
-* Note that it is not safe to read this property immediately after doing an asynchronous request.
-* For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
-*
-* @deprecated
-* @property responseXML
-* @type {DOMDocument}
-* @default null
-* @see getRep
-*/
- responseXML: null,
-/**
-* @method getResponseXML
-* @return {DOMDocument}
-*/
- getResponseXML: function(){
- if (this.options.forceResponseXMLEmulation !== true) {
- return this.responseXML;
- }
- else
- if (this.responseText === this._responseTextForResponseXML && this.responseXML) {
- return this.responseXML;
- }
-
- this.responseXML = _xjs(this.responseText);
- this._responseTextForResponseXML = this.responseText;
- return this.responseXML;
- },
-/**
-* This method can be used to set a number of default options for the Xmla instance.
-* This is especially useful if you don't want to pass each and every option to each method call all the time.
-* Where appropriate, information that is missing from the parameter objects passed to the methods of the Xmla object
-* may be augmented with the values set through this method.
-* For example, if you plan to do a series of requests pertaining to one particular datasource,
-* you can set the mandatory options like url, async, datasource and catalog just once:
-*
- xmla.setOptions({
- url: "http://localhost:8080/pentaho/Xmla",
- async: true,
- properties: {
- DataSourceInfo: "Pentaho Analysis Services",
- Catalog: "Foodmart"
- }
- });
-*
-* Then, a subsequent
-* @method setOptions
-* @param Object
-*/
- setOptions: function(options){
- _applyProps(
- this.options,
- options,
- true
+ 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 the XML/A specification
+ * (MS Word format. For other formats,
+ * see: http://code.google.com/p/xmla4js/source/browse/#svn/trunk/doc/xmla1.1 specification).
+ *
+ * The optional options parameter sets standard options for this Xmla instnace.
+ * If ommitted, a copy of the defaultOptions 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
);
- },
-/**
-* This method can be used to register one or more listeners. On such listener can listen for one or more events.
-* listener object literal with the following structure:{
-* events: ...event name or array of event names...,
-* handler: ...function or array of functions...,
-* scope: object
-* }
-* event as an alias for events.
-* Likewise, you can use handlers as an alias for handler.
-* addListener(name, func, scope)
-* where name is a valid event name, func is the function that is to be called when the event occurs.
-* The last argument is optional and can be used to specify the scope that will be used as context for executing the function.
-* addListener([listener1, ..., listenerN])
-* addListener(listener1, ..., listenerN)
-* addListener({
-* discover: function() {
-* ...handle discover event...
-* },
-* error: {
-* handler: function() {
-* ...handle error event...
-* },
-* scope: obj
-* },
-* scope: defaultscope
-* })
-* In this case, you can use scope as a key to specify the default scope for the handler functions.
-*
Below is a more detailed description of the listener object and its components:
-*eventsstring|string[] REQUIRED.
-* The event or events to listen to.
-* You can specify a single event by using one of the EVENT_XXX string constant values.
-* You can specify multiple events by using an array of EVENT_XXX string constant values.
-* You can also use one of the predefined EVENT_XXX array constant values,
-* or use array concatenation and compose a custom list of event names.
-* To listen to all events, either use EVENT_ALL,
-* or otherwise the string value "all".
-* Below is the list of constants that may be used for the events or events property: "all" may also be used.eventstring|string[] Alias for eventshandlerfunction|function[] REQUIRED.
-* This function will be called and notified whenever one of the specified events occurs.
-* The function has the following signature: boolean handler(string eventName, object eventData, Xmla xmla)
-* You can also pass in an array of functions if you want multiple functions to be called when the event occurs.
-* The function is called in scope of the scope property of the listener object.
-* If no scope is specified, a global function is assumed.
-* The handler function has the following arguments:
-* eventNamestring The event for which notification is given.
-* This is useful to distinguish between events in case the same handler function is used for multiple events.
-* In this case, use the EVENT_XXX constants to check the eventName.eventDataObject An object that conveys event-specific data.xmlaXmla A reference to this Xmla instance that is the source of the event.
-* Listeners can obtain the response as well as the original SOAP message sent to the server through this instance.
-* This allows one listener to be shared across multiple Xmla instances without managing the context manually.
-* boolean.
-* If the handler returns false the respective operation will be canceled.
-* Otherwise, the operation continues (but may be canceled by another handler).
-* Currently, the following events are cancelable:
-* EVENT_DISCOVER,
-* EVENT_EXECUTE, and
-* EVENT_REQUEST.
-* handlersfunction|function[] Alias for handlerscopeObject OPTIONAL When specified, this object is used as the this object when calling the handler.
-* When not specified, the global window is used.
-* requestTimeout int: 30000 - number of milliseconds before a request to the XML/A server will timeout async boolean: false - determines whether synchronous or asynchronous communication with the XML/A server will be used.addFieldGetters boolean: true - determines whether Xml.Rowset objects will be created with a getter method for each column.forceResponseXMLEmulation boolean: false - determines whether to parse responseText or to use the native responseXML from the xhr object.request() method to invoke the XML/A Discover method on the server.
+ * Instead of explicitly setting the method yourself, consider using the discover() method.
+ * The discover() method automatically sets the method option to METHOD_DISCOVER.
+ * @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
+ * request() method to invoke the XML/A Execute method on the server.
+ * Instead of explicitly setting the method yourself, consider using the execute() method.
+ * The execute() method automatically sets the method option to METHOD_EXECUTE.
+ * @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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_DATASOURCES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this constant as requestType yourself, consider calling the discoverDataSources() method.
+ * The discoverDataSources() method passes DISCOVER_DATASOURCES 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_PROPERTIES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverProperties() method.
+ * The discoverProperties() method passes DISCOVER_PROPERTIES 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_SCHEMA_ROWSETS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverSchemaRowsets() method.
+ * The discoverProperties() method passes DISCOVER_PROPERTIES 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_ENUMERATORS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverEnumerators() method.
+ * The discoverSchemaRowsets() method issues a request to invoke the Discover method using DISCOVER_SCHEMA_ROWSETS as requestType.
+ *
+ * @property DISCOVER_ENUMERATORS
+ * @static
+ * @final
+ * @type string
+ * @default DISCOVER_ENUMERATORS
+ */
+ Xmla.DISCOVER_ENUMERATORS = _xmlaDISCOVER + "ENUMERATORS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_KEYWORDS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverKeywords() method.
+ * The discoverKeywords() 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DISCOVER_LITERALS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverLiterals() method.
+ * The discoverLiterals() 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_CATALOGS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverDBCatalogs() method.
+ * The discoverDBCatalogs() method issues a request to invoke the Discover method using DBSCHEMA_CATALOGS as requestType.
+ *
+ * @property DBSCHEMA_CATALOGS
+ * @static
+ * @final
+ * @type string
+ * @default DBSCHEMA_CATALOGS
+ */
+ Xmla.DBSCHEMA_CATALOGS = _xmlaDBSCHEMA + "CATALOGS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_COLUMNS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverDBColumns() method.
+ * The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_COLUMNS as requestType.
+ *
+ * @property DBSCHEMA_COLUMNS
+ * @static
+ * @final
+ * @type string
+ * @default DBSCHEMA_COLUMNS
+ */
+ Xmla.DBSCHEMA_COLUMNS = _xmlaDBSCHEMA + "COLUMNS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_PROVIDER_TYPES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverDBProviderTypes() method.
+ * The discoverDBProviderTypes() method issues a request to invoke the Discover method using DBSCHEMA_PROVIDER_TYPES 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 requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_SCHEMATA schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverDBSchemata() method.
+ * The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_SCHEMATA as requestType.
+ *
+ * @property DBSCHEMA_SCHEMATA
+ * @static
+ * @final
+ * @type string
+ * @default DBSCHEMA_SCHEMATA
+ */
+ Xmla.DBSCHEMA_SCHEMATA = _xmlaDBSCHEMA + "SCHEMATA";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_TABLES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the discoverDBTables() method.
+ * The discoverDBColumns() method issues a request to invoke the Discover method using DBSCHEMA_TABLES as requestType.
+ *
+ * @property DBSCHEMA_TABLES
+ * @static
+ * @final
+ * @type string
+ * @default DBSCHEMA_TABLES
+ */
+ Xmla.DBSCHEMA_TABLES = _xmlaDBSCHEMA + "TABLES";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the DBSCHEMA_TABLES_INFO schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverDBTablesInfo() method.
+ * The discoverDBTablesInfo() method issues a request to invoke the Discover method using DBSCHEMA_TABLES_INFO as requestType.
+ *
+ * @property DBSCHEMA_TABLES_INFO
+ * @static
+ * @final
+ * @type string
+ * @default DBSCHEMA_TABLES_INFO
+ */
+ Xmla.DBSCHEMA_TABLES_INFO = _xmlaDBSCHEMA + "TABLES_INFO";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the MDSCHEMA_ACTIONS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDActions() method.
+ * The discoverMDActions() method issues a request to invoke the Discover method using MDSCHEMA_ACTIONS as requestType.
+ *
+ * @property MDSCHEMA_ACTIONS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_ACTIONS
+ */
+ Xmla.MDSCHEMA_ACTIONS = _xmlaMDSCHEMA + "ACTIONS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_CUBES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDCubes() method.
+ * The discoverMDCubes() method issues a request to invoke the Discover method using
+ * MDSCHEMA_CUBES as requestType.
+ *
+ * @property MDSCHEMA_CUBES
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_CUBES
+ */
+ Xmla.MDSCHEMA_CUBES = _xmlaMDSCHEMA + "CUBES";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_DIMENSIONS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDDimensions() method.
+ * The discoverMDDimensions() method issues a request to invoke the Discover method using
+ * MDSCHEMA_DIMENSIONS as requestType.
+ *
+ * @property MDSCHEMA_DIMENSIONS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_DIMENSIONS
+ */
+ Xmla.MDSCHEMA_DIMENSIONS = _xmlaMDSCHEMA + "DIMENSIONS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_FUNCTIONS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDFunctions() method.
+ * The discoverMDFunctions() method issues a request to invoke the Discover method using
+ * MDSCHEMA_FUNCTIONS as requestType.
+ *
+ * @property MDSCHEMA_FUNCTIONS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_FUNCTIONS
+ */
+ Xmla.MDSCHEMA_FUNCTIONS = _xmlaMDSCHEMA + "FUNCTIONS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_HIERARCHIES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDHierarchies() method.
+ * The discoverMDHierarchies() method issues a request to invoke the Discover method using
+ * MDSCHEMA_HIERARCHIES as requestType.
+ *
+ * @property MDSCHEMA_HIERARCHIES
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_HIERARCHIES
+ */
+ Xmla.MDSCHEMA_HIERARCHIES = _xmlaMDSCHEMA + "HIERARCHIES";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_LEVELS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDLevels() method.
+ * The discoverMDLevels() method issues a request to invoke the Discover method using
+ * MDSCHEMA_LEVELS as requestType.
+ *
+ * @property MDSCHEMA_LEVELS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_LEVELS
+ */
+ Xmla.MDSCHEMA_LEVELS = _xmlaMDSCHEMA + "LEVELS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_MEASURES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDMeasures() method.
+ * The discoverMDMeasures() method issues a request to invoke the Discover method using
+ * MDSCHEMA_MEASURES as requestType.
+ *
+ * @property MDSCHEMA_MEASURES
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_MEASURES
+ */
+ Xmla.MDSCHEMA_MEASURES = _xmlaMDSCHEMA + "MEASURES";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_MEMBERS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDMembers() method.
+ * The discoverMDMembers() method issues a request to invoke the Discover method using
+ * MDSCHEMA_MEMBERS as requestType.
+ *
+ * @property MDSCHEMA_MEMBERS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_MEMBERS
+ */
+ Xmla.MDSCHEMA_MEMBERS = _xmlaMDSCHEMA + "MEMBERS";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_PROPERTIES schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDProperties() method.
+ * The discoverMDProperties() method issues a request to invoke the Discover method using
+ * MDSCHEMA_PROPERTIES as requestType.
+ *
+ * @property MDSCHEMA_PROPERTIES
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_PROPERTIES
+ */
+ Xmla.MDSCHEMA_PROPERTIES = _xmlaMDSCHEMA + "PROPERTIES";
+ /**
+ * Can be used as value for the requestType option in the options object passed to the to
+ * request() method to invoke the XML/A Discover method on the server to return the
+ * MDSCHEMA_SETS schema rowset.
+ * The requestType option applies only to Discover requests.
+ * Instead of passing this requestType yourself, consider calling the
+ * discoverMDSets() method.
+ * The discoverMDSets() method issues a request to invoke the Discover method using
+ * MDSCHEMA_SETS as requestType.
+ *
+ * @property MDSCHEMA_SETS
+ * @static
+ * @final
+ * @type string
+ * @default MDSCHEMA_SETS
+ */
+ Xmla.MDSCHEMA_SETS = _xmlaMDSCHEMA + "SETS";
+ /**
+ * Indicates the request event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The request event is the first event that is fired before submitting a request
+ * (see: request())
+ * to the server, and before firing the method-specific request events
+ * (see EVENT_EXECUTE
+ * and EVENT_DISCOVER).
+ * The request event itself is not method-specific, and fires for Execute as well as Discover requests.
+ * The EVENT_REQUEST event is cancelable:
+ * the handler function specified in the listener object passed to addListener 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 success event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The success 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 SoapFault),
+ * after firing the method-specific success events
+ * (see EVENT_EXECUTE_SUCCESS
+ * and EVENT_DISCOVER_SUCCESS).
+ * The success event is not method-specific, and fires for Execute as well as Discover responses.
+ * This is event is not cancelable.
+ *
+ * @property EVENT_SUCCESS
+ * @static
+ * @final
+ * @type string
+ * @default success
+ */
+ Xmla.EVENT_SUCCESS = "success";
+ /**
+ * Indicates the error event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The error is fired when an error occurs while sending a request or receiving a response.
+ * The error event is not method-specific, and fires for errors encountered during both Execute as well as Discover method invocations.
+ * This is event is not cancelable.
+ *
+ * @property EVENT_ERROR
+ * @static
+ * @final
+ * @type string
+ * @default error
+ */
+ Xmla.EVENT_ERROR = "error";
+
+ /**
+ * Indicates the execute event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The execute event is method-specific, and is fired before submitting an Execute request
+ * (see: execute())
+ * to the server, but after firing the request event
+ * (see: EVENT_REQUEST).
+ * The EVENT_EXECUTE event is cancelable:
+ * the handler function specified in the listener object passed to addListener 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 executesuccess event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The executesuccess event is method-specific and fired only after receiving and processing a normal response
+ * (that is, a response that does not contain a SoapFault)
+ * to an incovation of the XML/A Execute method
+ * (see: execute()).
+ * This is event is not cancelable.
+ *
+ * @property EVENT_EXECUTE_SUCCESS
+ * @static
+ * @final
+ * @type string
+ * @default executesuccess
+ */
+ Xmla.EVENT_EXECUTE_SUCCESS = "executesuccess";
+ /**
+ * Indicates the executeerror event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The executeerror event is method-specific and fired when an error occurs while sending an Execute request, or receiving a response to an Execute method.
+ * (see: execute()).
+ * This is event is not cancelable.
+ *
+ * @property EVENT_EXECUTE_ERROR
+ * @static
+ * @final
+ * @type string
+ * @default executeerror
+ */
+ Xmla.EVENT_EXECUTE_ERROR = "executeerror";
+
+ /**
+ * Indicates the discover event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The discover event is method-specific, and is fired before submitting a Discover request
+ * (see: discover())
+ * to the server, but after firing the request event
+ * (see: EVENT_DISCOVER).
+ * The EVENT_DISCOVER event is cancelable:
+ * the handler function specified in the listener object passed to addListener should return a boolen, indicating
+ * whether the respective operation should be canceled.
+ *
+ * @property EVENT_DISCOVER
+ * @static
+ * @final
+ * @type string
+ * @default discover
+ */
+ Xmla.EVENT_DISCOVER = "discover";
+ /**
+ * Indicates the discoversuccess event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The discoversuccess event is method-specific and fired only after receiving and processing a normal response
+ * (that is, a response that does not contain a SoapFault)
+ * to an incovation of the XML/A Discover method
+ * (see: discover()).
+ * This is event is not cancelable.
+ *
+ * @property EVENT_DISCOVER_SUCCESS
+ * @static
+ * @final
+ * @type string
+ * @default discoversuccess
+ */
+ Xmla.EVENT_DISCOVER_SUCCESS = "discoversuccess";
+ /**
+ * Indicates the discovererror event.
+ * This constant can be used as en entry in the events array argument for the addListener() method.
+ * The discovererror is method-specific and fired when an error occurs while sending an Discover request,
+ * or receiving a response to an Discover method.
+ * (see: discover()).
+ * This is event is not cancelable.
+ *
+ * @property EVENT_DISCOVER_ERROR
+ * @static
+ * @final
+ * @type string
+ * @default discovererror
+ */
+ Xmla.EVENT_DISCOVER_ERROR = "discovererror";
+
+ /**
+ * Unifies all general events, that is, all events that are not method-specific.
+ * This constant can be used as events array argument for the addListener() method,
+ * or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
+ * This constant is especially intended for asyncronous handling of Schema rowset data.
+ *
+ * @property EVENT_GENERAL
+ * @static
+ * @final
+ * @type string[]
+ * @default [EVENT_REQUEST,EVENT_SUCCESS,EVENT_ERROR]
+ */
+ Xmla.EVENT_GENERAL = [
+ Xmla.EVENT_REQUEST,
+ Xmla.EVENT_SUCCESS,
+ Xmla.EVENT_ERROR
+ ];
+
+ /**
+ * Unifies all events specific for the Discover method.
+ * This constant can be used as events array argument for the addListener() method,
+ * or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
+ *
+ * @property EVENT_DISCOVER_ALL
+ * @static
+ * @final
+ * @type string[]
+ * @default [EVENT_DISCOVER,EVENT_DISCOVER_SUCCESS,EVENT_DISCOVER_ERROR]
+ */
+ Xmla.EVENT_DISCOVER_ALL = [
+ Xmla.EVENT_DISCOVER,
+ Xmla.EVENT_DISCOVER_SUCCESS,
+ Xmla.EVENT_DISCOVER_ERROR
+ ];
+
+ /**
+ * Unifies all events specific for the Execute method.
+ * This constant can be used as events array argument for the addListener() method,
+ * or you can use array concatenation to combine it with other arrays of EVENT_XXX constants.
+ *
+ * @property EVENT_EXECUTE_ALL
+ * @static
+ * @final
+ * @type string[]
+ * @default [EVENT_EXECUTE,EVENT_EXECUTE_SUCCESS,EVENT_EXECUTE_ERROR]
+ */
+ Xmla.EVENT_EXECUTE_ALL = [
+ Xmla.EVENT_EXECUTE,
+ Xmla.EVENT_EXECUTE_SUCCESS,
+ Xmla.EVENT_EXECUTE_ERROR
+ ];
+
+ /**
+ * Unifies all method-specific and non method-specific events.
+ * This constant can be used as events array argument for the addListener() method.
+ *
+ * @property EVENT_ALL
+ * @static
+ * @final
+ * @type string[]
+ * @default [].concat(Xmla.EVENT_GENERAL, Xmla.EVENT_DISCOVER_ALL, Xmla.EVENT_EXECUTE_ALL)
+ */
+ Xmla.EVENT_ALL = [].concat(
+ Xmla.EVENT_GENERAL,
+ Xmla.EVENT_DISCOVER_ALL,
+ Xmla.EVENT_EXECUTE_ALL
+ );
+
+ /**
+ * Can be used as key in the properties member of the options object
+ * passed to the request() method
+ * to specify the XML/A DataSourceInfo property.
+ * The XML/A DataSourceInfo, together with the XML/A service URL are required to
+ * connect to a particular OLAP datasource.
+ * Valid values for the DataSourceInfo as well as the corresponding URL should be obtained
+ * by querying the DataSourceInfo and URL columns of the DISCOVER_DATASOURCES
+ * rowset respectively (see discoverDataSources()).
+ *
+ * @property PROP_DATASOURCEINFO
+ * @static
+ * @final
+ * @type string
+ * @default DataSourceInfo
+ */
+ Xmla.PROP_DATASOURCEINFO = "DataSourceInfo";
+ /**
+ * Can be used as key in the properties member of the options object
+ * passed to the execute() method
+ * to specify the XML/A Catalog property.
+ * The XML/A Catalog spefifies where to look for cubes that are referenced in th MDX statment.
+ * Valid values for the Catalog should be obtained
+ * by querying the CATALOG_NAME of the DBSCHEMA_CATALOGS
+ * rowset (see discoverDBCatalogs()).
+ *
+ * @property PROP_Catalog
+ * @static
+ * @final
+ * @type string
+ * @default Catalog
+ */
+ Xmla.PROP_CATALOG = "Catalog";
+ Xmla.PROP_CUBE = "Cube";
+
+ /**
+ * Can be used as key in the properties member of the options object
+ * passed to the execute() method
+ * to specify the XML/A Format property.
+ * This property controls the structure of the resultset.
+ *
+ * @property PROP_FORMAT
+ * @static
+ * @final
+ * @type string
+ * @default Format
+ */
+ Xmla.PROP_FORMAT = "Format";
+ /**
+ * Can be used as value for the
+ * execute() method.
+ * When used, this specifies that the multidimensional resultset should be returned in a tabular format,
+ * causeing the multidimensional resultset to be represented with an instance of the
+ * Xmla.Rowset class.
+ *
+ * @property PROP_FORMAT_TABULAR
+ * @static
+ * @final
+ * @type string
+ * @default Tabular
+ */
+ Xmla.PROP_FORMAT_TABULAR = "Tabular";
+ /**
+ * Can be used as value for the
+ * execute() method.
+ * When used, this specifies that the multidimensional resultset should be returned in a multidimensional format.
+ * Currently, Xmla4js does not provide a class to represent the resultset in this format.
+ * However, you can access the results as xml through the
+ * responseText and
+ * responseXML properties.
+ *
+ * @property PROP_FORMAT_MULTIDIMENSIONAL
+ * @static
+ * @final
+ * @type string
+ * @default Multidimensional
+ */
+ Xmla.PROP_FORMAT_MULTIDIMENSIONAL = "Multidimensional";
+
+ /**
+ * Can be used as key in the properties member of the options object
+ * passed to the execute() method
+ * to specify the XML/A AxisFormat property.
+ * The XML/A AxisFormat property specifies how the client wants to receive the multi-dimensional resultset of a MDX query.
+ * Valid values for the AxisFormat property are available as the static final properties
+ * PROP_AXISFORMAT_TUPLE,
+ * PROP_AXISFORMAT_CLUSTER,
+ * PROP_AXISFORMAT_CUSTOM.
+ *
+ * @property PROP_AXISFORMAT
+ * @static
+ * @final
+ * @type string
+ * @default AxisFormat
+ */
+ Xmla.PROP_AXISFORMAT = "AxisFormat";
+ /**
+ * Can be used as value for the AxisFormat XML/A property
+ * (see: PROP_AXISFORMAT)
+ * in invocations of the Execute method
+ * (see: execute()).
+ *
+ * @property PROP_AXISFORMAT_TUPLE
+ * @static
+ * @final
+ * @type string
+ * @default TupleFormat
+ */
+ Xmla.PROP_AXISFORMAT_TUPLE = "TupleFormat";
+ /**
+ * Can be used as value for the AxisFormat XML/A property
+ * (see: PROP_AXISFORMAT)
+ * in invocations of the Execute method
+ * (see: execute()).
+ *
+ * @property PROP_AXISFORMAT_CLUSTER
+ * @static
+ * @final
+ * @type string
+ * @default ClusterFormat
+ */
+ Xmla.PROP_AXISFORMAT_CLUSTER = "ClusterFormat";
+ /**
+ * Can be used as value for the AxisFormat XML/A property
+ * (see: PROP_AXISFORMAT)
+ * in invocations of the Execute method
+ * (see: execute()).
+ *
+ * @property PROP_AXISFORMAT_CUSTOM
+ * @static
+ * @final
+ * @type string
+ * @default CustomFormat
+ */
+ Xmla.PROP_AXISFORMAT_CUSTOM = "CustomFormat";
+
+ /**
+ * Can be used as key in the properties member of the options object
+ * passed to the request() method
+ * to specify the XML/A Content property.
+ * The XML/A Content property specifies whether to return data and/or XML Schema metadata by the Discover and Execute invocations.
+ * Valid values for the Content property are available as the static final properties
+ * PROP_CONTENT_DATA,
+ * PROP_CONTENT_NONE,
+ * PROP_CONTENT_SCHEMA,
+ * PROP_CONTENT_SCHEMADATA.
+ *
+ * Note: This key is primarily intended for clients that use the low-level request() method.
+ * You should not set this property when calling the discover() method,
+ * the execute() method,
+ * or any of the discoverXXX() methods.
+ *
+ * @property PROP_CONTENT
+ * @static
+ * @final
+ * @type string
+ * @default Content
+ */
+ Xmla.PROP_CONTENT = "Content";
+ /**
+ * Can be used as value for the XML/A Content property
+ * (see: PROP_CONTENT).
+ * This value specifies that the response should contain only data, but no XML Schema metadata.
+ *
+ * As the Xmla class relies on the XML Schema metadata to construct Rowset and Resultset instances,
+ * this option is primarily useful if you know how to process the XML response directly.
+ *
+ * @property PROP_CONTENT_DATA
+ * @static
+ * @final
+ * @type string
+ * @default Data
+ */
+ Xmla.PROP_CONTENT_DATA = "Data";
+ /**
+ * Can be used as value for the XML/A Content property
+ * (see: PROP_CONTENT).
+ * This value specifies that the response should contain neither data nor XML Schema metadata.
+ * This is useful to check the validity of the request.
+ *
+ * @property PROP_CONTENT_NONE
+ * @static
+ * @final
+ * @type string
+ * @default None
+ */
+ Xmla.PROP_CONTENT_NONE = "None";
+ /**
+ * Can be used as value for the XML/A Content property
+ * (see: PROP_CONTENT).
+ * This value specifies that the response should only return XML Schema metadata, but no data.
+ *
+ * @property PROP_CONTENT_SCHEMA
+ * @static
+ * @final
+ * @type string
+ * @default Schema
+ */
+ Xmla.PROP_CONTENT_SCHEMA = "Schema";
+ /**
+ * Can be used as value for the XML/A Content property
+ * (see: PROP_CONTENT).
+ * This value specifies that the response should return both data as well as XML Schema metadata.
+ *
+ * @property PROP_CONTENT_SCHEMADATA
+ * @static
+ * @final
+ * @type string
+ * @default SchemaData
+ */
+ Xmla.PROP_CONTENT_SCHEMADATA = "SchemaData";
+
+ Xmla.prototype = {
+ /**
+ * This object stores listeners.
+ * Each key is a listener type (see the static final EVENT_XXX constants),
+ * each value is an array of listener objects that are subscribed to that particular event.
+ *
+ * @property listeners
+ * @protected
+ * @type Object
+ * @default
+ {
+ "request": []
+ , "succss": []
+ , "error": []
+ , "discover": []
+ , "discoversuccss": []
+ , "discovererror": []
+ , "execute": []
+ , "executesuccss": []
+ , "executeerror": []
+ }
+ */
+ listeners: null,
+ /**
+ * The soap message sent in the last request to the server.
+ *
+ * @property soapMessage
+ * @type {string}
+ * @default null
+ */
+ soapMessage: null,
+ /**
+ * This property is set to null right before sending an XML/A request.
+ * When a successfull response is received, it is processed and the response object is assigned to this property.
+ * The response object is either a
+ * Rowset (after a successful invocation of XML/A Discover method, see: discover()) or a
+ * Resultset (after a successful invocation of the XML/A Execute method, see: execute())
+ * instance.
+ *
+ * If you are interested in processing the raw response XML, see
+ * responseXML and
+ * responseText.
+ *
+ * Note that it is not safe to read this property immediately after doing an asynchronous request.
+ * For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
+ *
+ * @property response
+ * @type Xmla.Rowset|Xmla.Dataset
+ * @default null
+ */
+ response: null,
+ /**
+ * This property is set to null right before sending an XML/A request.
+ * When a successfull response is received, the XML response is stored to this property as plain text.
+ *
+ * If you are interested in processing a DOM document rather than the raw XML text, see the
+ * responseXML property.
+ *
+ * If you are interested in traversing the dataset returned in the XML/A response, see the
+ * response property.
+ *
+ * Note that it is not safe to read this property immediately after doing an asynchronous request.
+ * For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
+ *
+ * @property responseText
+ * @type {string}
+ * @default null
+ */
+ responseText: null,
+ /**
+ * This property is set to null right before sending an XML/A request.
+ * When a successfull response is received, the XML response is stored to this property as a DOM Document.
+ *
+ * If you are interested in processing the raw XML text rather than a DOM document, see the
+ * responseText property.
+ *
+ * If you are interested in traversing the dataset returned in the XML/A response, see the
+ * response property.
+ *
+ * Note that it is not safe to read this property immediately after doing an asynchronous request.
+ * For asynchronous requests, you can read this property by the time the XXX_SUCCESS event handlers are notified (until it is set to null again by a subsequent request).
+ *
+ * @deprecated
+ * @property responseXML
+ * @type {DOMDocument}
+ * @default null
+ * @see getRep
+ */
+ responseXML: null,
+ /**
+ * @method getResponseXML
+ * @return {DOMDocument}
+ */
+ getResponseXML: function(){
+ if (this.options.forceResponseXMLEmulation !== true) {
+ return this.responseXML;
+ }
+ else
+ if (this.responseText === this._responseTextForResponseXML && this.responseXML) {
+ return this.responseXML;
+ }
+
+ this.responseXML = _xjs(this.responseText);
+ this._responseTextForResponseXML = this.responseText;
+ return this.responseXML;
+ },
+ /**
+ * This method can be used to set a number of default options for the Xmla instance.
+ * This is especially useful if you don't want to pass each and every option to each method call all the time.
+ * Where appropriate, information that is missing from the parameter objects passed to the methods of the Xmla object
+ * may be augmented with the values set through this method.
+ * For example, if you plan to do a series of requests pertaining to one particular datasource,
+ * you can set the mandatory options like url, async, datasource and catalog just once:
+ *
+ xmla.setOptions({
+ url: "http://localhost:8080/pentaho/Xmla",
+ async: true,
+ properties: {
+ DataSourceInfo: "Pentaho Analysis Services",
+ Catalog: "Foodmart"
+ }
+ });
+ *
+ * Then, a subsequent
+ * @method setOptions
+ * @param Object
+ */
+ setOptions: function(options){
+ _applyProps(
+ this.options,
+ options,
+ true
+ );
+ },
+ /**
+ * This method can be used to register one or more listeners. On such listener can listen for one or more events.
+ * For a single listener, you can pass a listener object literal with the following structure:
{
+ * events: ...event name or array of event names...,
+ * handler: ...function or array of functions...,
+ * scope: object
+ * }
+ *
+ * You can use event as an alias for events.
+ * Likewise, you can use handlers as an alias for handler.
+ *
+ * Alternatively, you can pass the element as separate arguments instead of as an object literal:
+ * addListener(name, func, scope)
+ * where name is a valid event name, func is the function that is to be called when the event occurs.
+ * The last argument is optional and can be used to specify the scope that will be used as context for executing the function.
+ *
+ * To register multiple listeners, pass an array of listener objects:
+ * addListener([listener1, ..., listenerN])
+ *
+ * Alternatively, pass multiple listener objects as separate arguments:
+ * addListener(listener1, ..., listenerN)
+ *
+ * Or, pass a single object literal with event names as keys and listener objects or functions as values: + *
addListener({
+ * discover: function() {
+ * ...handle discover event...
+ * },
+ * error: {
+ * handler: function() {
+ * ...handle error event...
+ * },
+ * scope: obj
+ * },
+ * scope: defaultscope
+ * })
+ * In this case, you can use scope as a key to specify the default scope for the handler functions.
+ *
+ * Below is a more detailed description of the listener object and its components:
+ *eventsstring|string[] REQUIRED.
+ * The event or events to listen to.
+ * You can specify a single event by using one of the EVENT_XXX string constant values.
+ * You can specify multiple events by using an array of EVENT_XXX string constant values.
+ * You can also use one of the predefined EVENT_XXX array constant values,
+ * or use array concatenation and compose a custom list of event names.
+ * To listen to all events, either use EVENT_ALL,
+ * or otherwise the string value "all".
+ * Below is the list of constants that may be used for the events or events property: "all" may also be used.eventstring|string[] Alias for eventshandlerfunction|function[] REQUIRED.
+ * This function will be called and notified whenever one of the specified events occurs.
+ * The function has the following signature: boolean handler(string eventName, object eventData, Xmla xmla)
+ * You can also pass in an array of functions if you want multiple functions to be called when the event occurs.
+ * The function is called in scope of the scope property of the listener object.
+ * If no scope is specified, a global function is assumed.
+ * The handler function has the following arguments:
+ * eventNamestring The event for which notification is given.
+ * This is useful to distinguish between events in case the same handler function is used for multiple events.
+ * In this case, use the EVENT_XXX constants to check the eventName.eventDataObject An object that conveys event-specific data.xmlaXmla A reference to this Xmla instance that is the source of the event.
+ * Listeners can obtain the response as well as the original SOAP message sent to the server through this instance.
+ * This allows one listener to be shared across multiple Xmla instances without managing the context manually.
+ * boolean.
+ * If the handler returns false the respective operation will be canceled.
+ * Otherwise, the operation continues (but may be canceled by another handler).
+ * Currently, the following events are cancelable:
+ * EVENT_DISCOVER,
+ * EVENT_EXECUTE, and
+ * EVENT_REQUEST.
+ * handlersfunction|function[] Alias for handlerscopeObject OPTIONAL When specified, this object is used as the this object when calling the handler.
+ * When not specified, the global window is used.
+ * method {string} REQUIRED the XML/A method to invoke. This should be one of the following constants:
+ * METHOD_DISCOVER
+ * This method is used to obtain metadata from the XML/A service or XML/A provider.
+ * Metadata is returned in a tabular format called Schema Rowsets, which are represented by an instance of the
+ * Xmla.Rowset class.
+ * For these types of requests, you must pass the requestType option to specify which schema rowset you want to obtain.
+ * In addition, you can specify a restrictions object that is used as filter criteria to restrict which rows will be returned in the rowset.
+ *
+ * Instead of explicitly passing METHOD_DISCOVER as the requestType, you can also call the
+ * discover() method (which requires you to explictly pass a requestType option).
+ * Finally, you can also call one of the discoverXXX() methods in order to request a particular schema rowset.
+ *
METHOD_EXECUTE
+ * This method is used to send an MDX quey to the XML/A provider.
+ * Query results are returned in a multidimentsional format which is represented by an instance of the
+ * Xmla.Dataset class.
+ * For these types of requests, you must pass the statement option to specify the MDX query.
+ *
+ * Instead of explicitly passing METHOD_EXECUTE as the requestType, you can also call the
+ * execute() method.
+ *
url {string} REQUIRED the URL of XML/A service, or of a XML/A datasource.
+ * Typically, you first use the URL of a XML/A service (like http://your.pentaho.server:8080/pentaho/Xmla?userid=joe&password=password)
+ * and use that to retrieve the DISCOVER_DATASOURCES rowset.
+ * Then, you can connect to a XML/A datasource using the value returned by the URL column of the DISCOVER_DATASOURCES rowset
+ * (typically, you also have to set a DataSourceInfo property using the value found in the DataSourceInfo column of the DISCOVER_DATASOURCES rowset).
+ * properties {Object} XML/A properties.
+ * The appropriate types and values of XML/A properties are dependent upon the specific method and requestType.
+ * The XML/A standard defines a set of pre-defined properties.
+ * The Xmla class defines a static final property for each of these (see the PROP_XXX constants).
+ * The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
+ * (see discoverProperties()).
+ * Each javascript property of the properties object is mapped literally to a XML/A property.
+ * async {boolean}
+ * Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
+ * In this case, the return value of the request() method is not defined,
+ * and the response must be received by registering a listener.
+ * (see addListener()).
+ *
+ * As an alternative to using listeners, you can also pass
+ * success, error and callback callback functions.
+ * Callbacks are described in more detail below.
+ * false: The request is performed synchronously: the call to request() will block until it receives a response from the XML/A server or times out.
+ * In this case, the request() method returns
+ * a Rowset (for Discover requests) or
+ * a Resultset (for Execute requests).
+ * If you registered any listeners (see addListener()),
+ * then these will still be notified of any events (such as receiving the response).
+ * success (function)
+ * A function that is to be called after the requests is executed and a successful response is receieved.
+ * Any listeners appropriate for the request are called after this handler is executed.
+ * error (function)
+ * A function that is to be called after the requests is executed and an error was encountered.
+ * Any listeners appropriate for the request are called after this handler is executed.
+ * callback (function)
+ * A function that is to be called after the requests is executed and the response is receieved,
+ * and after calling any listeners that are appropriate for the request.
+ * This function will be called both in case of success and of error.
+ * If the options also contain a success and/or error handler, then
+ * callback will be called after those more specific handlers are called.
+ * options object are method-specific.
+ * method is METHOD_DISCOVER:
+ * requestType - {string} Applies to the Discover method and indicates the kind of schema rowset to retrieve.
+ * You can use one of the DISCOVER_XXX, DBSCHEMA_XXX or MDSCHEMA_XXX constants for this property.
+ * You can also dymically discover which values for requestType are supported by the XML/A provider using the
+ * DISCOVER_SCHEMA_ROWSETS rowset (see: discoverMDSchemaRowsets()).
+ * See the discover() method for more information.
+ * restrictions {Object} XML/A restrictions are used to filter the requested schema rowset.
+ * For more information on restrictions, see the discover() method.
+ * method is METHOD_EXECUTE:
+ * statement - {string} Applies to the Execute method and specifies the MDX query to send to the server.
+ * discover() (to obtain a schema rowset),
+ * execute() (to issue a MDX query),
+ * or one of the specialized discoverXXX() methods (to obtain a particular schema rowset).
+ * @method request
+ * @param {Object} options An object whose properties convey the options for the request.
+ * @return {Xmla.Rowset|Xmla.Dataset} The result of the invoking the XML/A method. For an asynchronous request, the return value is not defined. For synchronous requests, Discover requests return an instance of a Xmla.Rowset, and Execute results return an instance of a Xmla.Dataset.
+ */
+ request: function(options){
+ var ex, xmla = this;
+
+ this.response = null;
+ this.responseText = null;
+ this.responseXML = null;
+
+ options = _applyProps(options, this.options, false);
+ if (!options.url){
+ ex = Xmla.Exception._newError(
+ "MISSING_URL",
+ "Xmla.request",
+ options
+ );
+ ex._throw();
+ }
+ options.properties = _applyProps(options.properties, this.options.properties, false);
+ options.restrictions = _applyProps(options.restrictions, this.options.restrictions, false);
+ delete options.exception;
+
+ if (
+ !this._fireEvent(Xmla.EVENT_REQUEST, options, true) ||
+ (options.method == Xmla.METHOD_DISCOVER && !this._fireEvent(Xmla.EVENT_DISCOVER, options)) ||
+ (options.method == Xmla.METHOD_EXECUTE && !this._fireEvent(Xmla.EVENT_EXECUTE, options))
+ ){
+ return false;
+ }
+
+ var soapMessage = this.getXmlaSoapMessage(options);
+ this.soapMessage = soapMessage;
+ var myXhr;
+ var ajaxOptions = {
+ async: options.async,
+ timeout: options.requestTimeout,
+ data: soapMessage,
+ error: function(exception){
+ options.exception = exception;
+ xmla._requestError(options, exception);
+ },
+ complete: function(xhr){
+ options.xhr = xhr;
+ xmla._requestSuccess(options);
+ },
+ url: options.url
+ };
+ if (options.username) {
+ ajaxOptions.username = options.username;
+ }
+ if (options.password) {
+ ajaxOptions.password = options.password;
+ }
+
+ var headers = {};
+ if (this.options.headers) {
+ headers = _applyProps(headers, this.options.headers);
+ }
+ if (options.headers) {
+ headers = _applyProps(headers, options.headers, true);
+ }
+ ajaxOptions.headers = headers;
+
+ myXhr = _ajax(ajaxOptions);
+ return this.response;
+ },
+ _requestError: function(options, exception) {
+ if (options.error) {
+ options.error.call(options.scope ? options.scope : null, this, options, exception);
+ }
+ if (options.callback) {
+ options.callback.call(options.scope ? options.scope : null, Xmla.EVENT_ERROR, this, options, exception);
+ }
+ this._fireEvent(Xmla.EVENT_ERROR, options);
+ },
+ //https://msdn.microsoft.com/en-us/library/ms187142.aspx#handling_soap_faults
+ _parseSoapFault: function(soapFault){
+ //Get faultactor, faultstring, faultcode and detail elements
+ function _parseSoapFaultDetail(detailNode){
+ var errors = [];
+ var i, childNodes = detailNode.childNodes, n = childNodes.length, childNode;
+ for (i = 0; i < n; i++) {
+ childNode = childNodes[i];
+ if (childNode.nodeType !== 1) {
+ continue;
+ }
+ switch (childNode.nodeName){
+ case "Error":
+ errors.push({
+ ErrorCode: _getAttribute(childNode, "ErrorCode"),
+ Description: _getAttribute(childNode, "Description"),
+ Source: _getAttribute(childNode, "Source"),
+ HelpFile: _getAttribute(childNode, "HelpFile")
+ });
+ break;
+ default:
+ }
+ }
+ return errors;
+ }
+
+ var fields = {}, field, nodeName;
+ var i, childNodes = soapFault.childNodes, n = childNodes.length, childNode;
+ for (i = 0; i < n; i++){
+ childNode = childNodes[i];
+ if (childNode.nodeType !== 1) {
+ continue;
+ }
+ nodeName = childNode.nodeName;
+ switch (nodeName) {
+ case "faultactor":
+ case "faultstring":
+ case "faultcode":
+ field = _getElementText(childNode);
break;
- case 2:
- case 3:
- var event = arguments[0];
- scope = arguments[2];
- handler = arguments[1];
- if (_isStr(event) && (_isFun(handler)||(_isObj(handler)))) this._addListener(event, handler, scope);
- else {
- var arr = [event, handler];
- if (scope) arr.push(scope);
- this.addListener(arr);
- }
+ case "detail":
+ field = _parseSoapFaultDetail(childNode);
break;
- default:
- this._addListeners(arguments);
- }
- },
- _addListeners: function(listeners) {
- var i, n = listeners.length;
- for (i = 0; i < n; i++) this.addListener(listeners[i]);
- },
- _addListener: function(name, handler, scope) {
- var myListeners = this.listeners[name];
- if (!myListeners)
- Xmla.Exception._newError(
- "UNKNOWN_EVENT",
- "Xmla.addListener",
- {event: name, handler: handler, scope: scope}
- )._throw();
- if (!scope) scope = null;
- switch (typeof(handler)) {
- case "function":
- myListeners.push({handler: handler, scope: scope});
+ default:
+ field = null;
break;
- case "object":
- var handlers = handler.handler || handler.handlers;
- if (handler.scope) scope = handler.scope;
- if (_isFun(handlers)) {
- myListeners.push({handler: handlers, scope: scope});
+ }
+ if (field) {
+ fields[nodeName] = field;
+ }
+ }
+ return fields;
+ },
+ _requestSuccess: function(request) {
+ var xhr = request.xhr, response;
+ if (request.forceResponseXMLEmulation !== true) {
+ this.responseXML = xhr.responseXML;
+ }
+ this.responseText = xhr.responseText;
+
+ var method = request.method;
+
+ try {
+ var responseXml = this.getResponseXML();
+ if (!responseXml) {
+ request.exception = new Xmla.Exception(
+ Xmla.Exception.TYPE_ERROR,
+ Xmla.Exception.ERROR_PARSING_RESPONSE_CDE,
+ "Response is not an XML document."
+ );
}
- else
- if (_isArr(handlers)) {
- var i, n = handlers.length;
- for (i = 0; i < n; i++) this._addListener(name, handlers[i], scope);
+ var soapFault = _getElementsByTagNameNS(responseXml, _xmlnsSOAPenvelope, _xmlnsSOAPenvelopePrefix, "Fault");
+ if (soapFault.length) {
+ //TODO: extract error info
+ soapFault = soapFault[0];
+ soapFault = this._parseSoapFault(soapFault);
+ //type, code, message, helpfile, source, data, args, detail, actor
+ request.exception = new Xmla.Exception(
+ Xmla.Exception.TYPE_ERROR,
+ soapFault.faultcode, soapFault.faultstring,
+ null, "_requestSuccess",
+ request, null,
+ soapFault.detail, soapFault.faultactor
+ );
}
- break;
- }
- },
- _fireEvent: function(eventName, eventData, cancelable){
- var listeners = this.listeners[eventName];
- if (!listeners) {
- Xmla.Exception._newError(
- "UNKNOWN_EVENT",
- "Xmla._fireEvent",
- eventName
- )._throw();
- }
- var n = listeners.length, outcome = true;
- if (n) {
- var listener, listenerResult, i;
- for (i = 0; i < n; i++){
- listener = listeners[i];
- listenerResult = listener.handler.call(
- listener.scope,
- eventName,
- eventData,
- this
- );
- if (cancelable && listenerResult===false){
- outcome = false;
- break;
+ else {
+ switch(method){
+ case Xmla.METHOD_DISCOVER:
+ request.rowset = response = new Xmla.Rowset(responseXml, request.requestType, this);
+ break;
+ case Xmla.METHOD_EXECUTE:
+ var resultset = null, dataset = null;
+ var format = request.properties[Xmla.PROP_FORMAT];
+ switch(format){
+ case Xmla.PROP_FORMAT_TABULAR:
+ response = resultset = new Xmla.Rowset(responseXml, null, this);
+ break;
+ case Xmla.PROP_FORMAT_MULTIDIMENSIONAL:
+ response = dataset = new Xmla.Dataset(responseXml);
+ break;
+ }
+ request.resultset = resultset;
+ request.dataset = dataset;
+ break;
+ }
+ this.response = response;
}
}
- }
- else //if there is neither a listener nor an error nor a general callback we explicitly throw the exception.
- if (eventName === Xmla.EVENT_ERROR && !_isFun(eventData.error) && !_isFun(eventData.callback)) eventData.exception._throw();
- return outcome;
- },
-/**
-* Create a XML/A SOAP message that may be used as message body for a XML/A request
-* @method getXmlaSoapMessage
-* @param {object} options An object representing the message. The object can have these properties:
-* @return {string} The SOAP message.
-**/
- getXmlaSoapMessage: function getXmlaSoapMessage(options){
- var method = options.method,
- msg = "" +
- "\n<" + _xmlnsSOAPenvelopePrefix + ":Envelope" +
- " " + _xmlnsIsSOAPenvelope +
- " " + _SOAPencodingStyle + ">" +
- "\n <" + _xmlnsSOAPenvelopePrefix + ":Body>" +
- "\n <" + method + " " + _xmlnsIsXmla + " " + _SOAPencodingStyle + ">"
- ;
- switch(method){
- case Xmla.METHOD_DISCOVER:
- if (!options.requestType) {
- Xmla.Exception._newError(
- "MISSING_REQUEST_TYPE",
- "Xmla._getXmlaSoapMessage",
- options
- )._throw();
+ catch (exception) {
+ request.exception = exception;
+ }
+ if (request.exception) {
+ switch(method){
+ case Xmla.METHOD_DISCOVER:
+ this._fireEvent(Xmla.EVENT_DISCOVER_ERROR, request);
+ break;
+ case Xmla.METHOD_EXECUTE:
+ this._fireEvent(Xmla.EVENT_EXECUTE_ERROR, request);
+ break;
}
- msg += "\n <" + _xmlRequestType + ">" + options.requestType + "" + _xmlRequestType + ">" +
- _getXmlaSoapList("Restrictions", "RestrictionList", options.restrictions, " ") +
- _getXmlaSoapList("Properties", "PropertyList", options.properties, " ");
- break;
- case Xmla.METHOD_EXECUTE:
- if (!options.statement){
- Xmla.Exception._newError(
- "MISSING_REQUEST_TYPE",
- "Xmla._getXmlaSoapMessage",
- options
- )._throw();
+ if (request.error) {
+ request.error.call(request.scope ? request.scope : null, this, request, request.exception);
}
- msg += "\n method {string} REQUIRED the XML/A method to invoke. This should be one of the following constants:
-* METHOD_DISCOVER
-* This method is used to obtain metadata from the XML/A service or XML/A provider.
-* Metadata is returned in a tabular format called Schema Rowsets, which are represented by an instance of the
-* Xmla.Rowset class.
-* For these types of requests, you must pass the requestType option to specify which schema rowset you want to obtain.
-* In addition, you can specify a restrictions object that is used as filter criteria to restrict which rows will be returned in the rowset.
-*
-* Instead of explicitly passing METHOD_DISCOVER as the requestType, you can also call the
-* discover() method (which requires you to explictly pass a requestType option).
-* Finally, you can also call one of the discoverXXX() methods in order to request a particular schema rowset.
-*
METHOD_EXECUTE
-* This method is used to send an MDX quey to the XML/A provider.
-* Query results are returned in a multidimentsional format which is represented by an instance of the
-* Xmla.Dataset class.
-* For these types of requests, you must pass the statement option to specify the MDX query.
-*
-* Instead of explicitly passing METHOD_EXECUTE as the requestType, you can also call the
-* execute() method.
-*
url {string} REQUIRED the URL of XML/A service, or of a XML/A datasource.
-* Typically, you first use the URL of a XML/A service (like http://your.pentaho.server:8080/pentaho/Xmla?userid=joe&password=password)
-* and use that to retrieve the DISCOVER_DATASOURCES rowset.
-* Then, you can connect to a XML/A datasource using the value returned by the URL column of the DISCOVER_DATASOURCES rowset
-* (typically, you also have to set a DataSourceInfo property using the value found in the DataSourceInfo column of the DISCOVER_DATASOURCES rowset).
-* properties {Object} XML/A properties.
-* The appropriate types and values of XML/A properties are dependent upon the specific method and requestType.
-* The XML/A standard defines a set of pre-defined properties.
-* The Xmla class defines a static final property for each of these (see the PROP_XXX constants).
-* The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
-* (see discoverProperties()).
-* Each javascript property of the properties object is mapped literally to a XML/A property.
-* async {boolean}
-* Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
-* In this case, the return value of the request() method is not defined,
-* and the response must be received by registering a listener.
-* (see addListener()).
-*
-* As an alternative to using listeners, you can also pass
-* success, error and callback callback functions.
-* Callbacks are described in more detail below.
-* false: The request is performed synchronously: the call to request() will block until it receives a response from the XML/A server or times out.
-* In this case, the request() method returns
-* a Rowset (for Discover requests) or
-* a Resultset (for Execute requests).
-* If you registered any listeners (see addListener()),
-* then these will still be notified of any events (such as receiving the response).
-* success (function)
-* A function that is to be called after the requests is executed and a successful response is receieved.
-* Any listeners appropriate for the request are called after this handler is executed.
-* error (function)
-* A function that is to be called after the requests is executed and an error was encountered.
-* Any listeners appropriate for the request are called after this handler is executed.
-* callback (function)
-* A function that is to be called after the requests is executed and the response is receieved,
-* and after calling any listeners that are appropriate for the request.
-* This function will be called both in case of success and of error.
-* If the options also contain a success and/or error handler, then
-* callback will be called after those more specific handlers are called.
-* options object are method-specific.
-* method is METHOD_DISCOVER:
-* requestType - {string} Applies to the Discover method and indicates the kind of schema rowset to retrieve.
-* You can use one of the DISCOVER_XXX, DBSCHEMA_XXX or MDSCHEMA_XXX constants for this property.
-* You can also dymically discover which values for requestType are supported by the XML/A provider using the
-* DISCOVER_SCHEMA_ROWSETS rowset (see: discoverMDSchemaRowsets()).
-* See the discover() method for more information.
-* restrictions {Object} XML/A restrictions are used to filter the requested schema rowset.
-* For more information on restrictions, see the discover() method.
-* method is METHOD_EXECUTE:
-* statement - {string} Applies to the Execute method and specifies the MDX query to send to the server.
-* discover() (to obtain a schema rowset),
-* execute() (to issue a MDX query),
-* or one of the specialized discoverXXX() methods (to obtain a particular schema rowset).
-* @method request
-* @param {Object} options An object whose properties convey the options for the request.
-* @return {Xmla.Rowset|Xmla.Dataset} The result of the invoking the XML/A method. For an asynchronous request, the return value is not defined. For synchronous requests, Discover requests return an instance of a Xmla.Rowset, and Execute results return an instance of a Xmla.Dataset.
-*/
- request: function(options){
- var ex, xmla = this;
-
- this.response = null;
- this.responseText = null;
- this.responseXML = null;
-
- options = _applyProps(options, this.options, false);
- if (!options.url){
- ex = Xmla.Exception._newError(
- "MISSING_URL",
- "Xmla.request",
- options
- );
- ex._throw();
- }
- options.properties = _applyProps(options.properties, this.options.properties, false);
- options.restrictions = _applyProps(options.restrictions, this.options.restrictions, false);
- delete options.exception;
-
- if (
- !this._fireEvent(Xmla.EVENT_REQUEST, options, true) ||
- (options.method == Xmla.METHOD_DISCOVER && !this._fireEvent(Xmla.EVENT_DISCOVER, options)) ||
- (options.method == Xmla.METHOD_EXECUTE && !this._fireEvent(Xmla.EVENT_EXECUTE, options))
- ){
- return false;
- }
-
- var soapMessage = this.getXmlaSoapMessage(options);
- this.soapMessage = soapMessage;
- var myXhr;
- var ajaxOptions = {
- async: options.async,
- timeout: options.requestTimeout,
- data: soapMessage,
- error: function(exception){
- options.exception = exception;
- xmla._requestError(options, exception);
- },
- complete: function(xhr){
- options.xhr = xhr;
- xmla._requestSuccess(options);
- },
- url: options.url
- };
- if (options.username) {
- ajaxOptions.username = options.username;
- }
- if (options.password) {
- ajaxOptions.password = options.password;
- }
-
- var headers = {};
- if (this.options.headers) {
- headers = _applyProps(headers, this.options.headers);
- }
- if (options.headers) {
- headers = _applyProps(headers, options.headers, true);
- }
- ajaxOptions.headers = headers;
-
- myXhr = _ajax(ajaxOptions);
- return this.response;
- },
- _requestError: function(options, exception) {
- if (options.error) {
- options.error.call(options.scope ? options.scope : null, this, options, exception);
- }
- if (options.callback) {
- options.callback.call(options.scope ? options.scope : null, Xmla.EVENT_ERROR, this, options, exception);
- }
- this._fireEvent(Xmla.EVENT_ERROR, options);
- },
- //https://msdn.microsoft.com/en-us/library/ms187142.aspx#handling_soap_faults
- _parseSoapFault: function(soapFault){
- //Get faultactor, faultstring, faultcode and detail elements
- function _parseSoapFaultDetail(detailNode){
- var errors = [];
- var i, childNodes = detailNode.childNodes, n = childNodes.length, childNode;
- for (i = 0; i < n; i++) {
- childNode = childNodes[i];
- if (childNode.nodeType !== 1) {
- continue;
- }
- switch (childNode.nodeName){
- case "Error":
- errors.push({
- ErrorCode: _getAttribute(childNode, "ErrorCode"),
- Description: _getAttribute(childNode, "Description"),
- Source: _getAttribute(childNode, "Source"),
- HelpFile: _getAttribute(childNode, "HelpFile")
- });
- break;
- default:
- }
- }
- return errors;
- }
-
- var fields = {}, field, nodeName;
- var i, childNodes = soapFault.childNodes, n = childNodes.length, childNode;
- for (i = 0; i < n; i++){
- childNode = childNodes[i];
- if (childNode.nodeType !== 1) {
- continue;
- }
- nodeName = childNode.nodeName;
- switch (nodeName) {
- case "faultactor":
- case "faultstring":
- case "faultcode":
- field = _getElementText(childNode);
- break;
- case "detail":
- field = _parseSoapFaultDetail(childNode);
- break;
- default:
- field = null;
- break;
- }
- if (field) {
- fields[nodeName] = field;
- }
- }
- return fields;
- },
- _requestSuccess: function(request) {
- var xhr = request.xhr, response;
- if (request.forceResponseXMLEmulation !== true) {
- this.responseXML = xhr.responseXML;
- }
- this.responseText = xhr.responseText;
-
- var method = request.method;
-
- try {
- var responseXml = this.getResponseXML();
- if (!responseXml) {
- request.exception = new Xmla.Exception(
- Xmla.Exception.TYPE_ERROR,
- Xmla.Exception.ERROR_PARSING_RESPONSE_CDE,
- "Response is not an XML document."
- );
- }
- var soapFault = _getElementsByTagNameNS(responseXml, _xmlnsSOAPenvelope, _xmlnsSOAPenvelopePrefix, "Fault");
- if (soapFault.length) {
- //TODO: extract error info
- soapFault = soapFault[0];
- soapFault = this._parseSoapFault(soapFault);
- //type, code, message, helpfile, source, data, args, detail, actor
- request.exception = new Xmla.Exception(
- Xmla.Exception.TYPE_ERROR,
- soapFault.faultcode, soapFault.faultstring,
- null, "_requestSuccess",
- request, null,
- soapFault.detail, soapFault.faultactor
- );
+ if (request.callback) {
+ request.callback.call(request.scope ? request.scope : null, Xmla.EVENT_ERROR, this, request, request.exception);
+ }
+ this._fireEvent(Xmla.EVENT_ERROR, request);
}
else {
switch(method){
case Xmla.METHOD_DISCOVER:
- request.rowset = response = new Xmla.Rowset(responseXml, request.requestType, this);
+ this._fireEvent(Xmla.EVENT_DISCOVER_SUCCESS, request);
break;
case Xmla.METHOD_EXECUTE:
- var resultset = null, dataset = null;
- var format = request.properties[Xmla.PROP_FORMAT];
- switch(format){
- case Xmla.PROP_FORMAT_TABULAR:
- response = resultset = new Xmla.Rowset(responseXml, null, this);
- break;
- case Xmla.PROP_FORMAT_MULTIDIMENSIONAL:
- response = dataset = new Xmla.Dataset(responseXml);
- break;
- }
- request.resultset = resultset;
- request.dataset = dataset;
+ this._fireEvent(Xmla.EVENT_EXECUTE_SUCCESS, request);
break;
}
- this.response = response;
+ if (request.success) {
+ request.success.call(
+ request.scope ? request.scope : null,
+ this, request, response
+ );
+ }
+ if (request.callback) {
+ request.callback.call(
+ request.scope ? request.scope : null,
+ Xmla.EVENT_SUCCESS, this, request, response
+ );
+ }
+ this._fireEvent(Xmla.EVENT_SUCCESS, request);
}
- }
- catch (exception) {
- request.exception = exception;
- }
- if (request.exception) {
- switch(method){
- case Xmla.METHOD_DISCOVER:
- this._fireEvent(Xmla.EVENT_DISCOVER_ERROR, request);
- break;
- case Xmla.METHOD_EXECUTE:
- this._fireEvent(Xmla.EVENT_EXECUTE_ERROR, request);
- break;
+ },
+ /**
+ * Sends an MDX query to a XML/A DataSource to invoke the XML/A Execute method and obtain the multi-dimensional resultset.
+ * Options are passed using a generic options object.
+ * Applicable properties of the options object are:
+ * url {string} REQUIRED the URL of a XML/A datasource.
+ * This should be a value obtained from the URL column of the DISCOVER_DATASOURCES rowset
+ * (see: discoverDataSources()).
+ * statement - {string} The MDX query to send to the server.
+ * properties {Object} XML/A properties.
+ * The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
+ * (see discoverProperties()).
+ * Typically, execute() requires these properties:DataSourceInfo propertyPROP_DATASOURCEINFO
+ * as key in the properties object of the options object passed to the execute() method.
+ * Valid values for this property should be obtained from the DataSourceInfo column
+ * of the DISCOVER_DATASOURCES schema rowset (see: discoverDataSources()).
+ * Note that the values for the DataSourceInfo property and the url must both be taken from the same row of the DISCOVER_DATASOURCES schema rowset.
+ * Catalog propertyPROP_CATALOG
+ * as key in the properties object of the options object passed to the execute() method.
+ * Valid values for this property should be obtained from the CATALOG_NAME column
+ * of the DBSCHEMA_CATALOGS schema rowset (see: discoverDBCatalogs()).
+ * async {boolean}
+ * Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
+ * In this case, the return value of the request() method is not defined,
+ * and the response must be received by registering a listener
+ * (see addListener()).
+ * false: The request is performed synchronously: the call to execute() will block until it receives a response from the XML/A server or times out.
+ * In this case, a Resultset is returned that represents the multi-dimensional data set.
+ * If you registered any REQUEST_XXX and/or EXECUTE_XXX listeners (see addListener()),
+ * then these will still be notified.
+ * Execute request.
+ * @return {Xmla.Dataset|Xmla.Rowset} The result of the invoking the XML/A Execute method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a Xmla.Dataset that represents the multi-dimensional result set of the MDX query. If the Format property in the request was set to Tabular, then an instance of the
+ Rowset class is returned to represent the Resultset.
+ */
+ execute: function(options) {
+ var properties = options.properties;
+ if (!properties){
+ properties = {};
+ options.properties = properties;
}
- if (request.error) {
- request.error.call(request.scope ? request.scope : null, this, request, request.exception);
+ _applyProps(properties, this.options.properties, false)
+ if (!properties[Xmla.PROP_CONTENT]) {
+ properties[Xmla.PROP_CONTENT] = Xmla.PROP_CONTENT_SCHEMADATA;
}
- if (request.callback) {
- request.callback.call(request.scope ? request.scope : null, Xmla.EVENT_ERROR, this, request, request.exception);
+ if (!properties[Xmla.PROP_FORMAT]) {
+ options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
}
- this._fireEvent(Xmla.EVENT_ERROR, request);
- }
- else {
- switch(method){
- case Xmla.METHOD_DISCOVER:
- this._fireEvent(Xmla.EVENT_DISCOVER_SUCCESS, request);
- break;
- case Xmla.METHOD_EXECUTE:
- this._fireEvent(Xmla.EVENT_EXECUTE_SUCCESS, request);
- break;
+ var request = _applyProps(options, {
+ method: Xmla.METHOD_EXECUTE
+ }, true);
+ return this.request(request);
+ },
+ /**
+ * Sends an MDX query to a XML/A DataSource to invoke the execute() method using PROP_FORMAT_TABULAR as value for the PROP_FORMAT property. This has the effect of obtaining the multi-dimensional resultset as a Rowset.
+ * @method executeTabular
+ * @param {Object} options An object whose properties convey the options for the XML/A Execute request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Execute method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a Xmla.Rowset that represents the multi-dimensional result set of the MDX query.
+ */
+ executeTabular: function(options){
+ if (!options.properties) {
+ options.properties = {};
+ }
+ options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
+ return this.execute(options);
+ },
+ /**
+ * Sends an MDX query to a XML/A DataSource to invoke the PROP_FORMAT_MULTIDIMENSIONAL as value for the PROP_FORMAT property. In this case, the result is available only as XML text or XML document in the responseText
+ and responseXML properties.
+ * @method executeMultiDimensional
+ * @param {Object} options An object whose properties convey the options for the XML/A Execute request.
+ */
+ executeMultiDimensional: function(options){
+ if (!options.properties) {
+ options.properties = {};
}
- if (request.success) {
- request.success.call(
- request.scope ? request.scope : null,
- this, request, response
- );
+ options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
+ return this.execute(options);
+ },
+ /**
+ * Sends a request to invoke the XML/A Discover method and returns a schema rowset specified by the requestType option.
+ * Options are passed using a generic options object.
+ * Applicable properties of the options object are:
+ * requestType - {string} Indicates the kind of schema rowset to retrieve.
+ * You can use one of the following predefined XML for Analysis Schema Rowset constants:
+ * DISCOVER_DATASOURCESDISCOVER_ENUMERATORSDISCOVER_KEYWORDSDISCOVER_LITERALSDISCOVER_PROPERTIESDISCOVER_SCHEMA_ROWSETSDBSCHEMA_CATALOGSDBSCHEMA_COLUMNSDBSCHEMA_PROVIDER_TYPESDBSCHEMA_SCHEMATADBSCHEMA_TABLESDBSCHEMA_TABLES_INFOMDSCHEMA_ACTIONSMDSCHEMA_CUBESMDSCHEMA_DIMENSIONSMDSCHEMA_FUNCTIONSMDSCHEMA_HIERARCHIESMDSCHEMA_MEASURESMDSCHEMA_MEMBERSMDSCHEMA_PROPERTIESMDSCHEMA_SETSrequestType are supported by the XML/A provider.
+ * To do that, refer to the SchemaName column of the DISCOVER_SCHEMA_ROWSETS rowset
+ * (see: discoverMDSchemaRowsets()).
+ * url {string} REQUIRED the url of the XML/A service or XML/A datasource.
+ * If the value for the requestType option is one of the predefined XML/A DISCOVER_XXX constants,
+ * then this should be the url of the XML/A service.
+ * properties {Object} XML/A properties.
+ * The appropriate types and values of XML/A properties are dependent upon the value passed as requestType.
+ * The XML/A standard defines a set of pre-defined properties.
+ * The Xmla class defines a static final property for each of these (see the PROP_XXX constants).
+ * The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
+ * (see discoverProperties()).
+ * Each javascript property of the properties object is mapped literally to a XML/A property.
+ * restrictions {Object} XML/A restrictions.
+ * These are used to specify a filter that will be applied to the data in the schema rowset.
+ * Each javascript property of the restrictions object is mapped to a column of the requested schema rowset.
+ * The value for the restriction is sent with the request, and processed by the XML/A server to only return matching rows from the requested schema dataset.
+ * The name, types and values of the restrictions are dependent upon which schema rowset is requested.
+ * The available restrictions are specified by the Restrictions column of the DISCOVER_SCHEMA_ROWSETS schema rowset.
+ * For a number of schema rowsets, the available restrictions are pre-defined.
+ * These are documented together with each particular discoverXXX() method.
+ * async {boolean}
+ * Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
+ * In this case, the return value of the request() method is not defined,
+ * and the response must be received by registering a listener
+ * (see addListener()).
+ * false: The request is performed synchronously: the call to execute() will block until it receives a response from the XML/A server or times out.
+ * In this case, a Resultset is returned that represents the multi-dimensional data set.
+ * If you registered any REQUEST_XXX and/or EXECUTE_XXX listeners (see addListener()),
+ * then these will still be notified.
+ * discoverXXX() methods to obtain a particular schema rowset.
+ * @method discover
+ * @param {Object} options An object whose properties convey the options for the XML/A Discover request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the requested schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discover: function(options) {
+ var request = _applyProps(options, {
+ method: Xmla.METHOD_DISCOVER
+ }, true);
+ if (!request.requestType) {
+ request.requestType = this.options.requestType;
}
- if (request.callback) {
- request.callback.call(
- request.scope ? request.scope : null,
- Xmla.EVENT_SUCCESS, this, request, response
- );
+ if (!request.properties) {
+ request.properties = {};
}
- this._fireEvent(Xmla.EVENT_SUCCESS, request);
- }
- },
-/**
-* Sends an MDX query to a XML/A DataSource to invoke the XML/A Execute method and obtain the multi-dimensional resultset.
-* Options are passed using a generic options object.
-* Applicable properties of the options object are:
-* url {string} REQUIRED the URL of a XML/A datasource.
-* This should be a value obtained from the URL column of the DISCOVER_DATASOURCES rowset
-* (see: discoverDataSources()).
-* statement - {string} The MDX query to send to the server.
-* properties {Object} XML/A properties.
-* The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
-* (see discoverProperties()).
-* Typically, execute() requires these properties:DataSourceInfo propertyPROP_DATASOURCEINFO
-* as key in the properties object of the options object passed to the execute() method.
-* Valid values for this property should be obtained from the DataSourceInfo column
-* of the DISCOVER_DATASOURCES schema rowset (see: discoverDataSources()).
-* Note that the values for the DataSourceInfo property and the url must both be taken from the same row of the DISCOVER_DATASOURCES schema rowset.
-* Catalog propertyPROP_CATALOG
-* as key in the properties object of the options object passed to the execute() method.
-* Valid values for this property should be obtained from the CATALOG_NAME column
-* of the DBSCHEMA_CATALOGS schema rowset (see: discoverDBCatalogs()).
-* async {boolean}
-* Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
-* In this case, the return value of the request() method is not defined,
-* and the response must be received by registering a listener
-* (see addListener()).
-* false: The request is performed synchronously: the call to execute() will block until it receives a response from the XML/A server or times out.
-* In this case, a Resultset is returned that represents the multi-dimensional data set.
-* If you registered any REQUEST_XXX and/or EXECUTE_XXX listeners (see addListener()),
-* then these will still be notified.
-* Execute request.
-* @return {Xmla.Dataset|Xmla.Rowset} The result of the invoking the XML/A Execute method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a Xmla.Dataset that represents the multi-dimensional result set of the MDX query. If the Format property in the request was set to Tabular, then an instance of the
-Rowset class is returned to represent the Resultset.
-*/
- execute: function(options) {
- var properties = options.properties;
- if (!properties){
- properties = {};
- options.properties = properties;
- }
- _applyProps(properties, this.options.properties, false)
- if (!properties[Xmla.PROP_CONTENT]) {
- properties[Xmla.PROP_CONTENT] = Xmla.PROP_CONTENT_SCHEMADATA;
- }
- if (!properties[Xmla.PROP_FORMAT]) {
- options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
- }
- var request = _applyProps(options, {
- method: Xmla.METHOD_EXECUTE
- }, true);
- return this.request(request);
- },
-/**
-* Sends an MDX query to a XML/A DataSource to invoke the execute() method using PROP_FORMAT_TABULAR as value for the PROP_FORMAT property. This has the effect of obtaining the multi-dimensional resultset as a Rowset.
-* @method executeTabular
-* @param {Object} options An object whose properties convey the options for the XML/A Execute request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Execute method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a Xmla.Rowset that represents the multi-dimensional result set of the MDX query.
-*/
- executeTabular: function(options){
- if (!options.properties) {
- options.properties = {};
- }
- options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
- return this.execute(options);
- },
-/**
-* Sends an MDX query to a XML/A DataSource to invoke the PROP_FORMAT_MULTIDIMENSIONAL as value for the PROP_FORMAT property. In this case, the result is available only as XML text or XML document in the responseText
-and responseXML properties.
-* @method executeMultiDimensional
-* @param {Object} options An object whose properties convey the options for the XML/A Execute request.
-*/
- executeMultiDimensional: function(options){
- if (!options.properties) {
- options.properties = {};
- }
- options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
- return this.execute(options);
- },
-/**
-* Sends a request to invoke the XML/A Discover method and returns a schema rowset specified by the requestType option.
-* Options are passed using a generic options object.
-* Applicable properties of the options object are:
-* requestType - {string} Indicates the kind of schema rowset to retrieve.
-* You can use one of the following predefined XML for Analysis Schema Rowset constants:
-* DISCOVER_DATASOURCESDISCOVER_ENUMERATORSDISCOVER_KEYWORDSDISCOVER_LITERALSDISCOVER_PROPERTIESDISCOVER_SCHEMA_ROWSETSDBSCHEMA_CATALOGSDBSCHEMA_COLUMNSDBSCHEMA_PROVIDER_TYPESDBSCHEMA_SCHEMATADBSCHEMA_TABLESDBSCHEMA_TABLES_INFOMDSCHEMA_ACTIONSMDSCHEMA_CUBESMDSCHEMA_DIMENSIONSMDSCHEMA_FUNCTIONSMDSCHEMA_HIERARCHIESMDSCHEMA_MEASURESMDSCHEMA_MEMBERSMDSCHEMA_PROPERTIESMDSCHEMA_SETSrequestType are supported by the XML/A provider.
-* To do that, refer to the SchemaName column of the DISCOVER_SCHEMA_ROWSETS rowset
-* (see: discoverMDSchemaRowsets()).
-* url {string} REQUIRED the url of the XML/A service or XML/A datasource.
-* If the value for the requestType option is one of the predefined XML/A DISCOVER_XXX constants,
-* then this should be the url of the XML/A service.
-* properties {Object} XML/A properties.
-* The appropriate types and values of XML/A properties are dependent upon the value passed as requestType.
-* The XML/A standard defines a set of pre-defined properties.
-* The Xmla class defines a static final property for each of these (see the PROP_XXX constants).
-* The list of all valid properties can be obtained from the DISCOVER_PROPERTIES schema rowset
-* (see discoverProperties()).
-* Each javascript property of the properties object is mapped literally to a XML/A property.
-* restrictions {Object} XML/A restrictions.
-* These are used to specify a filter that will be applied to the data in the schema rowset.
-* Each javascript property of the restrictions object is mapped to a column of the requested schema rowset.
-* The value for the restriction is sent with the request, and processed by the XML/A server to only return matching rows from the requested schema dataset.
-* The name, types and values of the restrictions are dependent upon which schema rowset is requested.
-* The available restrictions are specified by the Restrictions column of the DISCOVER_SCHEMA_ROWSETS schema rowset.
-* For a number of schema rowsets, the available restrictions are pre-defined.
-* These are documented together with each particular discoverXXX() method.
-* async {boolean}
-* Determines how the request is performed:true: The request is performed asynchronously: the call to request() will not block and return immediately.
-* In this case, the return value of the request() method is not defined,
-* and the response must be received by registering a listener
-* (see addListener()).
-* false: The request is performed synchronously: the call to execute() will block until it receives a response from the XML/A server or times out.
-* In this case, a Resultset is returned that represents the multi-dimensional data set.
-* If you registered any REQUEST_XXX and/or EXECUTE_XXX listeners (see addListener()),
-* then these will still be notified.
-* discoverXXX() methods to obtain a particular schema rowset.
-* @method discover
-* @param {Object} options An object whose properties convey the options for the XML/A Discover request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the requested schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discover: function(options) {
- var request = _applyProps(options, {
- method: Xmla.METHOD_DISCOVER
- }, true);
- if (!request.requestType) {
- request.requestType = this.options.requestType;
+ request.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
+ return this.request(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_DATASOURCES schema rowset.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| + * DataSourceName + * | + *+ * string + * | + *+ * A name that identifies this data source. + * | + *+ * Yes + * | + *+ * No + * | + *
| + * DataSourceDescription + * | + *+ * string + * | + *+ * Human readable description of the datasource + * | + *+ * No + * | + *+ * Yes + * | + *
| + * URL + * | + *+ * string + * | + *+ * URL to use to submit requests to this provider. + * | + *+ * Yes + * | + *+ * Yes + * | + *
| + * DataSourceInfo + * | + *+ * string + * | + *+ * Connectstring + * | + *+ * No + * | + *+ * Yes + * | + *
| + * ProviderName + * | + *+ * string + * | + *+ * A name indicating the product providing the XML/A implementation + * | + *+ * Yes + * | + *+ * Yes + * | + *
| + * ProviderType + * | + *+ * string[] + * | + *
+ * The kind of data sets supported by this provider.
+ * The following values are defined by the XML/A specification:
+ *
|
+ * + * Yes + * | + *+ * No + * | + *
| + * AuthenticationMode + * | + *+ * string + * | + *
+ * Type of security offered by the provider
+ * The following values are defined by the XML/A specification:
+ *
|
+ * + * Yes + * | + *+ * No + * | + *
DISCOVER_DATASOURCES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDataSources: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_DATASOURCES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_PROPERTIES schema rowset.
+ * This rowset provides information on the properties that are supported by the XML/A provider.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| + * PropertyName + * | + *+ * string + * | + *+ * The name of the property + * | + *+ * Yes (array) + * | + *+ * No + * | + *
| + * PropertyDescription + * | + *+ * string + * | + *+ * Human readable description of the property + * | + *+ * No + * | + *+ * Yes + * | + *
| + * PropertyType + * | + *+ * string + * | + *+ * The property's datatype (as an XML Schema data type) + * | + *+ * No + * | + *+ * Yes + * | + *
| + * PropertyAccessType + * | + *+ * string + * | + *
+ * How the property may be accessed. Values defined by the XML/A spec are:
+ *
|
+ * + * No + * | + *+ * No + * | + *
| + * IsRequired + * | + *+ * boolean + * | + *
+ * true if the property is required, false if not.
+ * |
+ * + * No + * | + *+ * Yes + * | + *
| + * Value + * | + *+ * string + * | + *+ * The property's current value. + * | + *+ * No + * | + *+ * Yes + * | + *
DISCOVER_DATASOURCES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverProperties: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_PROPERTIES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_SCHEMA_ROWSETS schema rowset.
+ * This rowset lists all possible request types supported by this provider.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| SchemaName | + *string | + *The requestType. | + *Yes | + *No | + *
| Restrictions | + *array | + *A list of columns that may be used to filter the schema rowset. | + *No | + *Yes | + *
| Description | + *string | + *A human readable description of the schema rowset that is returned when using this requestType | + *No | + *Yes | + *
DISCOVER_SCHEMA_ROWSETS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverSchemaRowsets: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_SCHEMA_ROWSETS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_ENUMERATORS schema rowset.
+ * This rowset lists the names, data types, and enumeration values of enumerators supported by the XMLA Provider for a specific data source.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| EnumName | + *string | + *Name of the enumerator. | + *Yes (array) | + *No | + *
| EnumDescription | + *string | + *A human readable description of the enumerator | + *No | + *Yes | + *
| EnumType | + *string | + *The XML Schema data type of this enumerator | + *No | + *No | + *
| ElementName | + *string | + *The name of the enumerator entry | + *No | + *No | + *
| ElementDescription | + *string | + *A human readable description of this enumerator entry | + *No | + *Yes | + *
| ElementValue | + *string | + *The value of this enumerator entry | + *No | + *Yes | + *
DISCOVER_ENUMERATORS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_ENUMERATORS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverEnumerators: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_ENUMERATORS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_KEYWORDS schema rowset.
+ * This rowset is a list of reserved words for this XML/A provider.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| Keyword | + *string | + *Name of the enumerator. | + *Yes (array) | + *No | + *
DISCOVER_KEYWORDS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_ENUMERATORS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverKeywords: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_KEYWORDS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using as value for the requestType,
+ * and retrieves the DISCOVER_LITERALS schema rowset.
+ * This rowset is a list of reserved words for this XML/A provider.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| LiteralName | + *string | + *Name of the literal. | + *Yes (array) | + *No | + *
| LiteralValue | + *string | + *The actual literal value. | + *No | + *Yes | + *
| LiteralInvalidChars | + *string | + *Characters that may not appear in the literal | + *No | + *Yes | + *
| LiteralInvalidStartingChars | + *string | + *Characters that may not appear as first character in the literal | + *No | + *Yes | + *
| LiteralMaxLength | + *int | + *maximum number of characters for this literal, or -1 in case there is no maximum, or the maximum is unknown | + *No | + *Yes | + *
DISCOVER_LITERALS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_LITERALS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverLiterals: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DISCOVER_LITERALS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_CATALOGS schema rowset.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *Name of the catalog | + *Yes | + *No | + *
| DESCRIPTION | + *string | + *Human readable description | + *No | + *Yes | + *
| ROLES | + *string | + *A comma-separatd list of roles available to the current user. | + *No | + *Yes | + *
| DATE_MODIFIED | + *Date | + *The date this catalog was modified | + *No | + *Yes | + *
DBSCHEMA_CATALOGS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_CATALOGS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBCatalogs: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DBSCHEMA_CATALOGS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_COLUMNS schema rowset.
+ * Provides column information for all columns meeting the provided restriction criteria.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| TABLE_CATALOG | + *string | + *The name of the Database. | + *Yes | + *No | + *
| TABLE_SCHEMA | + *string | + *Not supported. | + *Yes | + *No | + *
| TABLE_NAME | + *string | + *The name of the cube. | + *Yes | + *No | + *
| COLUMN_NAME | + *string | + *The name of the attribute hierarchy or measure. | + *Yes | + *No | + *
| COLUMN_GUID | + *string | + *Not supported. | + *No | + *No | + *
| COLUMN_PROPID | + *int | + *Not supported. | + *No | + *No | + *
| ORDINAL_POSITION | + *int | + *The position of the column, beginning with 1. | + *No | + *No | + *
| COLUMN_HAS_DEFAULT | + *boolean | + *Not supported. | + *No | + *No | + *
| COLUMN_DEFAULT | + *string | + *Not supported. | + *No | + *No | + *
| COLUMN_FLAGS | + *int | + *A DBCOLUMNFLAGS bitmask indicating column properties. See 'DBCOLUMNFLAGS Enumerated Type' in IColumnsInfo::GetColumnInfo | + *No | + *No | + *
| IS_NULLABLE | + *boolean | + *Always returns false. | + *No | + *No | + *
| DATA_TYPE | + *string | + *The data type of the column. Returns a string for dimension columns and a variant for measures. | + *No | + *No | + *
| TYPE_GUID + * | srring | + *Not supported. | + *No | + *No | + *
| CHARACTER_MAXIMUM_LENGTH | + *int | + *The maximum possible length of a value within the column. This is retrieved from the DataSize property in the DataItem. | + *No | + *No | + *
| CHARACTER_OCTET_LENGTH | + *int | + *The maximum possible length of a value within the column, in bytes, for character or binary columns. A value of zero (0) indicates the column has no maximum length. NULL will be returned for columns that do not return binary or character data types. | + *No | + *No | + *
| NUMERIC_PRECISION | + *int | + *The maximum precision of the column for numeric data types other than DBTYPE_VARNUMERIC. | + *No | + *No | + *
| NUMERIC_SCALE | + *int | + *The number of digits to the right of the decimal point for DBTYPE_DECIMAL, DBTYPE_NUMERIC, DBTYPE_VARNUMERIC. Otherwise, this is NULL. | + *No | + *No | + *
| DATETIME_PRECISION | + *int | + *Not supported. | + *No | + *No | + *
| CHARACTER_SET_CATALOG | + *string | + *Not supported. | + *No | + *No | + *
| CHARACTER_SET_SCHEMA | + *string | + *Not supported. | + *No | + *No | + *
| CHARACTER_SET_NAME | + *string | + *Not supported. | + *No | + *No | + *
| COLLATION_CATALOG | + *string | + *Not supported. | + *No | + *No | + *
| COLLATION_SCHEMA | + *string | + *Not supported. | + *No | + *No | + *
| COLLATION_NAME | + *string | + *Not supported. | + *No | + *No | + *
| DOMAIN_CATALOG | + *string | + *Not supported. | + *No | + *No | + *
| DOMAIN_SCHEMA | + *string | + *Not supported. | + *No | + *No | + *
| DOMAIN_NAME | + *string | + *Not supported. | + *No | + *No | + *
| DESCRIPTION | + *string | + *Not supported. | + *No | + *No | + *
| COLUMN_OLAP_TYPE | + *string | + *The OLAP type of the object. MEASURE indicates the object is a measure. ATTRIBUTE indicates the object is a dimension attribute. | + *Yes | + *No | + *
DBSCHEMA_COLUMNS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_COLUMNS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBColumns: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DBSCHEMA_COLUMNS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_PROVIDER_TYPES schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| TYPE_NAME | + *string | + *The provider-specific data type name. | + *false | + *true | + *
| DATA_TYPE | + *int | + *The indicator of the data type. | + *false | + *true | + *
| COLUMN_SIZE | + *int | + *The length of a non-numeric column or parameter that refers to either the maximum or the length defined for this type by the provider. For character data, this is the maximum or defined length in characters. For DateTime data types, this is the length of the string representation (assuming the maximum allowed precision of the fractional seconds component). If the data type is numeric, this is the upper bound on the maximum precision of the data type. | + *false | + *true | + *
| LITERAL_PREFIX | + *string | + *The character or characters used to prefix a literal of this type in a text command. | + *false | + *true | + *
| LITERAL_SUFFIX | + *string | + *The character or characters used to suffix a literal of this type in a text command. | + *false | + *true | + *
| CREATE_PARAMS + * | string | + *The creation parameters specified by the consumer when creating a column of this data type. For example, the SQL data type, DECIMAL, needs a precision and a scale. In this case, the creation parameters might be the string "precision,scale". In a text command to create a DECIMAL column with a precision of 10 and a scale of 2, the value of the TYPE_NAME column might be DECIMAL() and the complete type specification would be DECIMAL(10,2). The creation parameters appear as a comma-separated list of values, in the order they are to be supplied and with no surrounding parentheses. If a creation parameter is length, maximum length, precision, scale, seed, or increment, use "length", "max length", "precision", "scale", "seed", and "increment", respectively. If the creation parameter is some other value, the provider determines what text is to be used to describe the creation parameter. If the data type requires creation parameters, "()" usually appears in the type name. This indicates the position at which to insert the creation parameters. If the type name does not include "()", the creation parameters are enclosed in parentheses and appended to the data type name. | + *false | + *true | + *
| IS_NULLABLE | + *boolean | + *A Boolean that indicates whether the data type is nullable. VARIANT_TRUE indicates that the data type is nullable. VARIANT_FALSE indicates that the data type is not nullable. NULL indicates that it is not known whether the data type is nullable. | + *false | + *true | + *
| CASE_SENSITIVE | + *boolean | + *A Boolean that indicates whether the data type is a characters type and case-sensitive. VARIANT_TRUE indicates that the data type is a character type and is case-sensitive. VARIANT_FALSE indicates that the data type is not a character type or is not case-sensitive. | + *false | + *true | + *
| SEARCHABLE | + *int | + *An integer indicating how the data type can be used in searches if the provider supports ICommandText; otherwise, NULL. This column can have the following values: DB_UNSEARCHABLE indicates that the data type cannot be used in a WHERE clause. DB_LIKE_ONLY indicates that the data type can be used in a WHERE clause only with the LIKE predicate.DB_ALL_EXCEPT_LIKE indicates that the data type can be used in a WHERE clause with all comparison operators except LIKE. DB_SEARCHABLE indicates that the data type can be used in a WHERE clause with any comparison operator. | + *false | + *true | + *
| UNSIGNED_ATTRIBUTE | + *boolean | + *A Boolean that indicates whether the data type is unsigned. VARIANT_TRUE indicates that the data type is unsigned. VARIANT_FALSE indicates that the data type is signed.NULL indicates that this is not applicable to the data type. | + *false | + *true | + *
| FIXED_PREC_SCALE | + *boolean | + *A Boolean that indicates whether the data type has a fixed precision and scale. VARIANT_TRUE indicates that the data type has a fixed precision and scale. VARIANT_FALSE indicates that the data type does not have a fixed precision and scale. | + *false | + *true | + *
| AUTO_UNIQUE_VALUE | + *boolean | + *A Boolean that indicates whether the data type is autoincrementing. VARIANT_TRUE indicates that values of this type can be autoincrementing. VARIANT_FALSE indicates that values of this type cannot be autoincrementing. If this value is VARIANT_TRUE, whether or not a column of this type is always autoincrementing depends on the provider's DBPROP_COL_AUTOINCREMENT column property. If the DBPROP_COL_AUTOINCREMENT property is read/write, whether or not a column of this type is autoincrementing depends on the setting of the DBPROP_COL_AUTOINCREMENT property. If DBPROP_COL_AUTOINCREMENT is a read-only property, either all or none of the columns of this type are autoincrementing. | + *false | + *true | + *
| LOCAL_TYPE_NAME | + *string | + *The localized version of TYPE_NAME. NULL is returned if a localized name is not supported by the data provider. | + *false | + *true | + *
| MINIMUM_SCALE | + *int | + *If the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC, the minimum number of digits allowed to the right of the decimal point. Otherwise, NULL. | + *false | + *true | + *
| MAXIMUM_SCALE | + *int | + *The maximum number of digits allowed to the right of the decimal point if the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC; otherwise, NULL. | + *false | + *true | + *
| GUID | + *string | + *(Intended for future use) The GUID of the type, if the type is described in a type library. Otherwise, NULL. | + *false | + *true | + *
| TYPELIB + * | string | + *(Intended for future use) The type library containing the description of the type, if the type is described in a type library. Otherwise, NULL. | + *false | + *true | + *
| VERSION | + *string | + *(Intended for future use) The version of the type definition. Providers might want to version type definitions. Different providers might use different versioning schemes, such as a timestamp or number (integer or float). NULL if not supported. | + *false | + *true | + *
| IS_LONG | + *boolean | + *A Boolean that indicates whether the data type is a binary large object (BLOB) and has very long data. VARIANT_TRUE indicates that the data type is a BLOB that contains very long data; the definition of very long data is provider-specific. VARIANT_FALSE indicates that the data type is a BLOB that does not contain very long data or is not a BLOB. This value determines the setting of the DBCOLUMNFLAGS_ISLONG flag returned by GetColumnInfo in IColumnsInfo and GetParameterInfo in ICommandWithParameters. | + *false | + *true | + *
| BEST_MATCH | + *boolean | + *A Boolean that indicates whether the data type is a best match. VARIANT_TRUE indicates that the data type is the best match between all data types in the data store and the OLE DB data type indicated by the value in the DATA_TYPE column. VARIANT_FALSE indicates that the data type is not the best match. For each set of rows in which the value of the DATA_TYPE column is the same, the BEST_MATCH column is set to VARIANT_TRUE in only one row. | + *false | + *true | + *
| IS_FIXEDLENGTH | + *boolean | + *A Boolean that indicates whether the column is fixed in length. VARIANT_TRUE indicates that columns of this type created by the data definition language (DDL) will be of fixed length. VARIANT_FALSE indicates that columns of this type created by the DDL will be of variable length. If the field is NULL, it is not known whether the provider will map this field with a fixed-length or variable-length column. + * | false | + *true | + *
DBSCHEMA_PROVIDER_TYPES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_PROVIDER_TYPES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBProviderTypes: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DBSCHEMA_PROVIDER_TYPES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_SCHEMATA schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|
DBSCHEMA_SCHEMATA request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_SCHEMATA schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBSchemata: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DBSCHEMA_SCHEMATA
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_TABLES schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|
DBSCHEMA_TABLES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_TABLES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBTables: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.DBSCHEMA_TABLES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the DBSCHEMA_TABLES_INFO schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|
DBSCHEMA_TABLES_INFO request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_TABLES_INFO schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverDBTablesInfo: function(options){
+ var request = _applyProps(
+ options,
+ {
+ requestType: Xmla.DBSCHEMA_TABLES_INFO
+ },
+ true
+ );
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_ACTIONS schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|
MDSCHEMA_ACTIONS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_ACTIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDActions: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_ACTIONS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_CUBES schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *Name of the catalog | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *Not supported | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *Name of the cube. | + *Yes | + *No | + *
| CUBE_TYPE | + *string | + *Type of the cube. | + *No | + *No | + *
| CUBE_GUID | + *string | + *Not supported | + *No | + *No | + *
| CREATED_ON | + *Date | + *Not supported | + *No | + *No | + *
| LAST_SCHEMA_UPDATE | + *Date | + *The time that the cube was last processed. | + *No | + *No | + *
| SCHEMA_UPDATED_BY | + *string | + *+ * | No | + *No | + *
| LAST_DATA_UPDATE | + *Date | + *The time that the cube was last processed. | + *No | + *No | + *
| DATA_UPDATED_BY | + *string | + *+ * | No | + *No | + *
| DESCRIPTION | + *string | + *A Human-readable description of the cube. | + *No | + *No | + *
| IS_DRILLTHROUGH_ENABLED | + *boolean | + *+ * | No | + *No | + *
| IS_LINKABLE | + *boolean | + *+ * | No | + *No | + *
| IS_WRITE_ENABLED | + *boolean | + *+ * | No | + *No | + *
| IS_SQL_ENABLED | + *boolean | + *+ * | No | + *No | + *
| CUBE_CAPTION | + *string | + *Caption for this cube. | + *No | + *No | + *
| BASE_CUBE_NAME | + *string | + *Name of the source cube (if this cube is a perspective cube). | + *Yes | + *No | + *
| ANNOTATIONS | + *string | + *Notes in xml format | + *No | + *No | + *
MDSCHEMA_CUBES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_CUBES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDCubes: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_CUBES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_DIMENSIONS schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *Name of the catalog | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *Not supported | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *Name of the cube. | + *Yes | + *No | + *
| DIMENSION_NAME | + *string | + *Name of the dimension. | + *Yes | + *No | + *
| DIMENSION_UNIQUE_NAME | + *string | + *Unique name for this dimension. | + *Yes | + *No | + *
| DIMENSION_GUID | + *string | + *+ * | No | + *Yes | + *
| DIMENSION_CAPTION | + *string | + *+ * | No | + *Yes | + *
| DIMENSION_ORDINAL | + *int | + *+ * | No | + *Yes | + *
| DIMENSION_TYPE | + *string | + *
+ *
|
+ * No | + *Yes | + *
| DIMENSION_CARDINALITY | + *int | + *+ * | No | + *Yes | + *
| DEFAULT_HIERARCHY | + *string | + *+ * | No | + *Yes | + *
| DESCRIPTION | + *string | + *A Human-readable description of the dimension. | + *No | + *No | + *
| IS_VIRTUAL | + *boolean | + *+ * | No | + *No | + *
| IS_READWRITE | + *boolean | + *+ * | No | + *No | + *
| DIMENSION_UNIQUE_SETTINGS | + *+ * | + * | No | + *No | + *
| DIMENSION_MASTER_UNIQUE_NAME | + *+ * | + * | No | + *No | + *
| DIMENSION_IS_VISIBLE | + *boolean | + *+ * | No | + *No | + *
MDSCHEMA_DIMENSIONS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_DIMENSIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDDimensions: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_DIMENSIONS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_FUNCTIONS schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *|
|---|---|---|---|---|---|
| FUNCTION_NAME | + *DBTYPE_WSTR | + *The name of the function. | + *Yes | + *Yes | + *|
| DESCRIPTION | + *DBTYPE_WSTR | + *A description of the function. | + *No | + *No | + *|
| PARAMETER_LIST | + *DBTYPE_WSTR | + *A comma delimited list of parameters formatted as in Microsoft Visual Basic. For example, a parameter might be Name as String. | + *No | + *No | + *|
| RETURN_TYPE | + *DBTYPE_I4 | + *The VARTYPE of the return data type of the function. | + *No | + *No | + *|
| ORIGIN | + *DBTYPE_I4 | + *The origin of the function:
+ *
|
+ * Yes | + *Yes | + *|
| INTERFACE_NAME | + *DBTYPE_WSTR | + *The name of the interface for user-defined functions. The group name for Multidimensional Expressions (MDX) functions. | + *Yes | + *Yes | + *|
| LIBRARY_NAME | + *DBTYPE_WSTR | + *The name of the type library for user-defined functions. NULL for MDX functions. | + *Yes | + *Yes | + *|
| DLL_NAME | + *DBTYPE_WSTR | + *(Optional) The name of the assembly that implements the user-defined function. Returns VT_NULL for MDX functions. | + *No | + *No | + *|
| HELP_FILE | + *DBTYPE_WSTR | + *(Optional) The name of the file that contains the help documentation for the user-defined function. | + *Returns VT_NULL for MDX functions. | + *No | + *No | + *
| HELP_CONTEXT | + *DBTYPE_I4 | + *(Optional) Returns the Help context ID for this function. | + *No | + *No | + *|
| OBJECT | + *DBTYPE_WSTR | + *
+ * (Optional) The generic name of the object class to which a property applies. For example, the rowset corresponding to the |
+ * No | + *No | + *|
| CAPTION | + *DBTYPE_WSTR | + *The display caption for the function. | + *No | + *No | + *
MDSCHEMA_FUNCTIONS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_FUNCTIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDFunctions: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_FUNCTIONS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_HIERARCHIES schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *Name of the catalog | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *Not supported | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *Name of the cube. | + *Yes | + *No | + *
| DIMENSION_UNIQUE_NAME | + *string | + *Unique name for this dimension. | + *Yes | + *No | + *
| HIERARCHY_NAME | + *string | + *Name of the hierarchy. | + *Yes | + *No | + *
| HIERARCHY_UNIQUE_NAME | + *string | + *Unique name for this hierarchy. | + *Yes | + *No | + *
| HIERARCHY_GUID | + *string | + *+ * | No | + *Yes | + *
| HIERARCHY_CAPTION | + *string | + *+ * | No | + *Yes | + *
| DIMENSION_TYPE | + *string | + *+ * | No | + *Yes | + *
| HIERARCHY_CARDINALITY | + *int | + *+ * | No | + *Yes | + *
| DEFAULT_MEMBER | + *string | + *+ * | No | + *Yes | + *
| ALL_MEMBER | + *string | + *+ * | No | + *Yes | + *
| DESCRIPTION | + *string | + *A Human-readable description of the dimension. | + *No | + *No | + *
| STRUCTURE | + *string | + *+ * | No | + *Yes | + *
| IS_VIRTUAL | + *boolean | + *+ * | No | + *Yes | + *
| IS_READWRITE | + *boolean | + *+ * | No | + *Yes | + *
| DIMENSION_UNIQUE_SETTINGS | + *string | + *+ * | No | + *Yes | + *
| DIMENSION_MASTER_UNIQUE_NAME | + *string | + *+ * | No | + *Yes | + *
| DIMENSION_IS_VISIBLE | + *boolean | + *+ * | No | + *Yes | + *
| HIERARCHY_ORDINAL | + *int | + *+ * | No | + *Yes | + *
| DIMENSION_IS_SHARED | + *boolean | + *+ * | No | + *Yes | + *
| HIERARCHY_IS_VISIBLE | + *boolean | + *+ * | No | + *Yes | + *
| HIERARCHY_ORIGIN | + *+ * | + * | Yes | + *Yes | + *
| HIERARCHY_DISPLAY_FOLDER | + *string | + *+ * | No | + *Yes | + *
| INSTANCE_SELECTION | + *string | + *+ * | No | + *Yes | + *
MDSCHEMA_HIERARCHIES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_HIERARCHIES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDHierarchies: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_HIERARCHIES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_LEVELS schema rowset.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *The name of the catalog to which this level belongs. NULL if the provider does not support catalogs. | + *Yes | + *Yes | + *
| SCHEMA_NAME | + *string | + *The name of the schema to which this level belongs. NULL if the provider does not support schemas. | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *The name of the cube to which this level belongs. | + *Yes | + *Yes | + *
| DIMENSION_UNIQUE_NAME | + *string | + *The unique name of the dimension to which this level belongs. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| HIERARCHY_UNIQUE_NAME | + *string | + *The unique name of the hierarchy. If the level belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| LEVEL_NAME | + *string | + *The name of the level. | + *Yes | + *Yes | + *
| LEVEL_UNIQUE_NAME | + *string | + *The properly escaped unique name of the level. | + *Yes | + *Yes | + *
| LEVEL_GUID | + *string | + *Not supported. | + *No | + *Yes | + *
| LEVEL_CAPTION | + *string | + *A label or caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, LEVEL_NAME is returned. | + *No | + *Yes | + *
| LEVEL_NUMBER | + *int | + *The distance of the level from the root of the hierarchy. Root level is zero (0). | + *No | + *Yes | + *
| LEVEL_CARDINALITY | + *int | + *The number of members in the level. | + *No | + *Yes | + *
| LEVEL_TYPE | + *int | + *Type of the level:
+ *
| No | + *Yes | + *
| DESCRIPTION | + *string | + *A human-readable description of the level. NULL if no description exists. | + *No | + *Yes | + *
| CUSTOM_ROLLUP_SETTINGS | + *int | + *A bitmap that specifies the custom rollup options:
+ *
|
+ * No | + *Yes | + *
| LEVEL_UNIQUE_SETTINGS | + *int | + *A bitmap that specifies which columns contain unique values, if the level only has members with unique names or keys.
+ * The Msmd.h file defines the following bit value constants for this bitmap:
+ *
|
+ * No | + *Yes | + *
| LEVEL_IS_VISIBLE | + *bool | + *A Boolean that indicates whether the level is visible. Always returns True. If the level is not visible, it will not be included in the schema rowset. | + *No | + *Yes | + *
| LEVEL_ORDERING_PROPERTY | + *string | + *The ID of the attribute that the level is sorted on. | + *No | + *Yes | + *
| LEVEL_DBTYPE | + *int | + *The DBTYPE enumeration of the member key column that is used for the level attribute. Null if concatenated keys are used as the member key column. | + *No | + *Yes | + *
| LEVEL_MASTER_UNIQUE_NAME | + *string | + *Always returns NULL. | + *No | + *Yes | + *
| LEVEL_NAME_SQL_COLUMN_NAME | + *string | + *The SQL representation of the level member names. | + *No | + *Yes | + *
| LEVEL_KEY_SQL_COLUMN_NAME | + *string | + *The SQL representation of the level member key values. | + *No | + *Yes | + *
| LEVEL_UNIQUE_NAME_SQL_COLUMN_NAME | + *string | + *The SQL representation of the member unique names. | + *No | + *Yes | + *
| LEVEL_ATTRIBUTE_HIERARCHY_NAME | + *string | + *The name of the attribute hierarchy providing the source of the level. | + *No | + *Yes | + *
| LEVEL_KEY_CARDINALITY | + *int | + *The number of columns in the level key. | + *No | + *Yes | + *
| LEVEL_ORIGIN | + *int | + *A bit map that defines how the level was sourced:MD_ORIGIN_USER_DEFINED identifies levels in a user defined hierarchy.MD_ORIGIN_ATTRIBUTE identifies levels in an attribute hierarchy.MD_ORIGIN_KEY_ATTRIBUTE identifies levels in a key attribute hierarchy.MD_ORIGIN_INTERNAL identifies levels in attribute hierarchies that are not enabled. | + *No | + *Yes | + *
MDSCHEMA_LEVELS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_LEVELS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDLevels: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_LEVELS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_MEASURES schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *Name of the catalog | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *Not supported | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *Name of the cube. | + *Yes | + *No | + *
| MEASURE_NAME | + *string | + *The name of the measure. | + *Yes | + *No | + *
| MEASURE_UNIQUE_NAME | + *string | + *The Unique name of the measure. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *No | + *
| MEASURE_CAPTION | + *string | + *A label or caption associated with the measure. Used primarily for display purposes. If a caption does not exist, MEASURE_NAME is returned. | + *No | + *No | + *
| MEASURE_GUID | + *string | + *Not supported. | + *No | + *No | + *
| MEASURE_AGGREGATOR | + *int | + *An enumeration that indicates how the measure was derived. See http://msdn.microsoft.com/en-us/library/ms126250.aspx | + *No | + *No | + *
| DATA_TYPE | + *int | + *The data type of the measure. Valid values are:
+ *
|
+ * No | + *No | + *
| NUMERIC_PRECISION | + *int | + *The maximum precision of the property if the measure object's data type is exact numeric. NULL for all other property types. | + *No | + *No | + *
| NUMERIC_SCALE | + *int | + *The number of digits to the right of the decimal point if the measure object's type indicator is DBTYPE_NUMERIC or DBTYPE_DECIMAL. Otherwise, this value is NULL. | + *No | + *No | + *
| MEASURE_UNITS | + *int | + *Not supported. | + *No | + *No | + *
| DESCRIPTION | + *string | + *A human-readable description of the measure. NULL if no description exists. | + *No | + *No | + *
| EXPRESSION | + *string | + *An expression for the member. | + *No | + *No | + *
| MEASURE_IS_VISIBLE | + *boolean | + *A Boolean that always returns True. If the measure is not visible, it will not be included in the schema rowset. | + *No | + *No | + *
| LEVELS_LIST | + *string | + *A string that always returns NULL. | + *No | + *No | + *
| MEASURE_NAME_SQL_COLUMN_NAME | + *string | + *The name of the column in the SQL query that corresponds to the measure's name. | + *No | + *No | + *
| MEASURE_UNQUALIFIED_CAPTION | + *string | + *The name of the measure, not qualified with the measure group name. | + *No | + *No | + *
| MEASUREGROUP_NAME | + *string | + *The name of the measure group to which the measure belongs. | + *Yes | + *No | + *
| MEASURE_DISPLAY_FOLDER | + *string | + *The path to be used when displaying the measure in the user interface. Folder names will be separated by a semicolon. Nested folders are indicated by a backslash (\). | + *No | + *No | + *
| DEFAULT_FORMAT_STRING | + *string | + *The default format string for the measure. | + *No | + *No | + *
MDSCHEMA_MEASURES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_MEASURES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDMeasures: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_MEASURES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_MEMBERS schema rowset.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *The name of the catalog | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *The name of the schema | + *Yes | + *No | + *
| CUBE_NAME | + *string | + *The name of the cube | + *Yes | + *No | + *
| DIMENSION_UNIQUE_NAME | + *string | + *The unique name of the dimension | + *Yes | + *No | + *
| HIERARCHY_UNIQUE_NAME | + *string | + *The unique name of the hierarchy | + *Yes | + *No | + *
| LEVEL_UNIQUE_NAME | + *string | + *The unique name of the level | + *Yes | + *No | + *
| LEVEL_NUMBER | + *int | + *Distance of this level to the root | + *Yes | + *No | + *
| MEMBER_ORDINAL | + *int | + *Deprecated: always 0 | + *No | + *No | + *
| MEMBER_NAME | + *string | + *The name of this member | + *Yes | + *No | + *
| MEMBER_UNIQUE_NAME | + *string | + *The unique name of this member | + *Yes | + *No | + *
| MEMBER_TYPE | + *int | + *An integer constant indicating the type of this member. Can take on one of the following values:
+ *
|
+ * Yes | + *No | + *
| MEMBER_GUID | + *string | + *The guid of this member | + *No | + *No | + *
| MEMBER_CAPTION | + *string | + *A label or caption associated with the member. Used primarily for display purposes. If a caption does not exist, MEMBER_NAME is returned. | + *No | + *No | + *
| CHILDREN_CARDINALITY | + *int | + *The number of childrend for this member | + *No | + *No | + *
| PARENT_LEVEL | + *int | + *The distance of the member's parent from the root level of the hierarchy. The root level is zero (0). | + *No | + *No | + *
| DESCRIPTION | + *string | + *This column always returns a NULL value. This column exists for backwards compatibility | + *No | + *No | + *
| EXPRESSION | + *string | + *The expression for calculations, if the member is of type MDMEMBER_TYPE_FORMULA. | + *No | + *No | + *
| MEMBER_KEY | + *string | + *The value of the member's key column. Returns NULL if the member has a composite key. | + *No | + *No | + *
MDSCHEMA_MEMBERS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_MEMBERS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDMembers: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_MEMBERS
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_PROPERTIES schema rowset.
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *The name of the database. | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *The name of the schema to which this property belongs. NULL if the provider does not support schemas. | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *The name of the cube. | + *Yes | + *Yes | + *
| DIMENSION_UNIQUE_NAME | + *string | + *The unique name of the dimension. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| HIERARCHY_UNIQUE_NAME | + *string | + *The unique name of the hierarchy. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| LEVEL_UNIQUE_NAME | + *string | + *The unique name of the level to which this property belongs. If the provider does not support named levels, it should return the DIMENSION_UNIQUE_NAME value for this field. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| MEMBER_UNIQUE_NAME | + *string | + *The unique name of the member to which the property belongs. Used for data stores that do not support named levels or have properties on a member-by-member basis. If the property applies to all members in a level, this column is NULL. For providers that generate unique names by qualification, each component of this name is delimited. | + *Yes | + *Yes | + *
| PROPERTY_TYPE | + *int | + *A bitmap that specifies the type of the property:
+ *
|
+ * Yes | + *Yes | + *
| PROPERTY_NAME | + *string | + *The name of the property. If the key for the property is the same as the name for the property, PROPERTY_NAME will be blank. | + *Yes | + *Yes | + *
| PROPERTY_CAPTION | + *string | + *A label or caption associated with the property, used primarily for display purposes. Returns PROPERTY_NAME if a caption does not exist. | + *No | + *Yes | + *
| DATA_TYPE | + *int | + *The data type of the property. | + *No | + *Yes | + *
| CHARACTER_MAXIMUM_LENGTH | + *int | + *The maximum possible length of the property, if it is a character, binary, or bit type. Zero indicates there is no defined maximum length. Returns NULL for all other data types. | + *No | + *Yes | + *
| CHARACTER_OCTET_LENGTH | + *int | + *The maximum possible length (in bytes) of the property, if it is a character or binary type. Zero indicates there is no defined maximum length. Returns NULL for all other data types. | + *No | + *Yes | + *
| NUMERIC_PRECISION | + *int | + *The maximum precision of the property, if it is a numeric data type. Returns NULL for all other data types. | + *No | + *Yes | + *
| NUMERIC_SCALE | + *int | + *The number of digits to the right of the decimal point, if it is a DBTYPE_NUMERIC or DBTYPE_DECIMAL type. Returns NULL for all other data types. | + *No | + *Yes | + *
| DESCRIPTION | + *string | + *A human readable description of the property. NULL if no description exists. | + *No | + *Yes | + *
| PROPERTY_CONTENT_TYPE | + *int | + *The type of the property. Can be one of the following enumerations: + * | + *Yes | + *Yes | + *
| SQL_COLUMN_NAME | + *string | + *The name of the property used in SQL queries from the cube dimension or database dDimension. | + *No | + *Yes | + *
| LANGUAGE | + *int | + *The translation expressed as an LCID. Only valid for property translations. | + *No | + *Yes | + *
| PROPERTY_ORIGIN | + *int | + *Identifies the type of hierarchy that the property applies to: | + *Yes | + *Yes | + *
| PROPERTY_ATTRIBUTE_HIERARCHY_NAME | + *string | + *The name of the attribute hierarchy sourcing this property. | + *No | + *Yes | + *
| PROPERTY_CARDINALITY | + *string | + *The cardinality of the property. Possible values include the following strings: ONE or MANY | + *No | + *Yes | + *
| MIME_TYPE | + *string | + *The mime type for binary large objects (BLOBs). | + *No | + *Yes | + *
| PROPERTY_IS_VISIBLE | + *boolean | + *A Boolean that indicates whether the property is visible. TRUE if the property is visible; otherwise, FALSE. | + *No | + *Yes | + *
MDSCHEMA_PROPERTIES request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_PROPERTIES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDProperties: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_PROPERTIES
+ }, true);
+ return this.discover(request);
+ },
+ /**
+ * Invokes the discover() method using
+ * as value for the requestType,
+ * and retrieves the MDSCHEMA_SETS schema rowset.
+ * ...todo...
+ * The rowset has the following columns:
+ * | Column Name | + *Type | + *Description | + *Restriction | + *Nullable | + *
|---|---|---|---|---|
| CATALOG_NAME | + *string | + *The name of the catalog to which this set belongs. | + *Yes | + *No | + *
| SCHEMA_NAME | + *string | + *The name of the schema to which this property belongs. NULL if the provider does not support schemas. | + *Yes | + *Yes | + *
| CUBE_NAME | + *string | + *The name of the cube to which the set belongs. This column always contains a value and can never be null. | + *Yes | + *No | + *
| SET_NAME | + *string | + *The name of the set. | + *Yes | + *No | + *
| SCOPE | + *string | + *The scope of the set. | + *Yes | + *No | + *
| DESCRIPTION | + *string | + *+ * | No | + *Yes | + *
| EXPRESSION | + *string | + *The expression for this set. | + *No | + *No | + *
| DIMENSIONS | + *string | + *A comma separated list of dimensions used by this set. | + *No | + *Yes | + *
MDSCHEMA_SETS request.
+ * @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_SETS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
+ */
+ discoverMDSets: function(options){
+ var request = _applyProps(options, {
+ requestType: Xmla.MDSCHEMA_SETS
+ }, true);
+ return this.discover(request);
}
- if (!request.properties) {
- request.properties = {};
+ };
+
+ function _getComplexType(node, name){
+ var types = _getElementsByTagNameNS(node, _xmlnsSchema, _xmlnsSchemaPrefix, "complexType"),
+ numTypes = types.length,
+ type, i
+ ;
+ for (i = 0; i < numTypes; i++){
+ type = types[i];
+ if (_getAttribute(type, "name")===name) return type;
}
- request.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
- return this.request(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_DATASOURCES schema rowset.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| -* DataSourceName -* | -*-* string -* | -*-* A name that identifies this data source. -* | -*-* Yes -* | -*-* No -* | -*
| -* DataSourceDescription -* | -*-* string -* | -*-* Human readable description of the datasource -* | -*-* No -* | -*-* Yes -* | -*
| -* URL -* | -*-* string -* | -*-* URL to use to submit requests to this provider. -* | -*-* Yes -* | -*-* Yes -* | -*
| -* DataSourceInfo -* | -*-* string -* | -*-* Connectstring -* | -*-* No -* | -*-* Yes -* | -*
| -* ProviderName -* | -*-* string -* | -*-* A name indicating the product providing the XML/A implementation -* | -*-* Yes -* | -*-* Yes -* | -*
| -* ProviderType -* | -*-* string[] -* | -*
-* The kind of data sets supported by this provider.
-* The following values are defined by the XML/A specification:
-*
|
-* -* Yes -* | -*-* No -* | -*
| -* AuthenticationMode -* | -*-* string -* | -*
-* Type of security offered by the provider
-* The following values are defined by the XML/A specification:
-*
|
-* -* Yes -* | -*-* No -* | -*
DISCOVER_DATASOURCES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDataSources: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_DATASOURCES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_PROPERTIES schema rowset.
-* This rowset provides information on the properties that are supported by the XML/A provider.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| -* PropertyName -* | -*-* string -* | -*-* The name of the property -* | -*-* Yes (array) -* | -*-* No -* | -*
| -* PropertyDescription -* | -*-* string -* | -*-* Human readable description of the property -* | -*-* No -* | -*-* Yes -* | -*
| -* PropertyType -* | -*-* string -* | -*-* The property's datatype (as an XML Schema data type) -* | -*-* No -* | -*-* Yes -* | -*
| -* PropertyAccessType -* | -*-* string -* | -*
-* How the property may be accessed. Values defined by the XML/A spec are:
-*
|
-* -* No -* | -*-* No -* | -*
| -* IsRequired -* | -*-* boolean -* | -*
-* true if the property is required, false if not.
-* |
-* -* No -* | -*-* Yes -* | -*
| -* Value -* | -*-* string -* | -*-* The property's current value. -* | -*-* No -* | -*-* Yes -* | -*
DISCOVER_DATASOURCES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverProperties: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_PROPERTIES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_SCHEMA_ROWSETS schema rowset.
-* This rowset lists all possible request types supported by this provider.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| SchemaName | -*string | -*The requestType. | -*Yes | -*No | -*
| Restrictions | -*array | -*A list of columns that may be used to filter the schema rowset. | -*No | -*Yes | -*
| Description | -*string | -*A human readable description of the schema rowset that is returned when using this requestType | -*No | -*Yes | -*
DISCOVER_SCHEMA_ROWSETS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_DATASOURCES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverSchemaRowsets: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_SCHEMA_ROWSETS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_ENUMERATORS schema rowset.
-* This rowset lists the names, data types, and enumeration values of enumerators supported by the XMLA Provider for a specific data source.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| EnumName | -*string | -*Name of the enumerator. | -*Yes (array) | -*No | -*
| EnumDescription | -*string | -*A human readable description of the enumerator | -*No | -*Yes | -*
| EnumType | -*string | -*The XML Schema data type of this enumerator | -*No | -*No | -*
| ElementName | -*string | -*The name of the enumerator entry | -*No | -*No | -*
| ElementDescription | -*string | -*A human readable description of this enumerator entry | -*No | -*Yes | -*
| ElementValue | -*string | -*The value of this enumerator entry | -*No | -*Yes | -*
DISCOVER_ENUMERATORS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_ENUMERATORS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverEnumerators: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_ENUMERATORS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_KEYWORDS schema rowset.
-* This rowset is a list of reserved words for this XML/A provider.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| Keyword | -*string | -*Name of the enumerator. | -*Yes (array) | -*No | -*
DISCOVER_KEYWORDS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_ENUMERATORS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverKeywords: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_KEYWORDS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using as value for the requestType,
-* and retrieves the DISCOVER_LITERALS schema rowset.
-* This rowset is a list of reserved words for this XML/A provider.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| LiteralName | -*string | -*Name of the literal. | -*Yes (array) | -*No | -*
| LiteralValue | -*string | -*The actual literal value. | -*No | -*Yes | -*
| LiteralInvalidChars | -*string | -*Characters that may not appear in the literal | -*No | -*Yes | -*
| LiteralInvalidStartingChars | -*string | -*Characters that may not appear as first character in the literal | -*No | -*Yes | -*
| LiteralMaxLength | -*int | -*maximum number of characters for this literal, or -1 in case there is no maximum, or the maximum is unknown | -*No | -*Yes | -*
DISCOVER_LITERALS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DISCOVER_LITERALS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverLiterals: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DISCOVER_LITERALS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_CATALOGS schema rowset.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*Name of the catalog | -*Yes | -*No | -*
| DESCRIPTION | -*string | -*Human readable description | -*No | -*Yes | -*
| ROLES | -*string | -*A comma-separatd list of roles available to the current user. | -*No | -*Yes | -*
| DATE_MODIFIED | -*Date | -*The date this catalog was modified | -*No | -*Yes | -*
DBSCHEMA_CATALOGS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_CATALOGS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBCatalogs: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DBSCHEMA_CATALOGS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_COLUMNS schema rowset.
-* Provides column information for all columns meeting the provided restriction criteria.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| TABLE_CATALOG | -*string | -*The name of the Database. | -*Yes | -*No | -*
| TABLE_SCHEMA | -*string | -*Not supported. | -*Yes | -*No | -*
| TABLE_NAME | -*string | -*The name of the cube. | -*Yes | -*No | -*
| COLUMN_NAME | -*string | -*The name of the attribute hierarchy or measure. | -*Yes | -*No | -*
| COLUMN_GUID | -*string | -*Not supported. | -*No | -*No | -*
| COLUMN_PROPID | -*int | -*Not supported. | -*No | -*No | -*
| ORDINAL_POSITION | -*int | -*The position of the column, beginning with 1. | -*No | -*No | -*
| COLUMN_HAS_DEFAULT | -*boolean | -*Not supported. | -*No | -*No | -*
| COLUMN_DEFAULT | -*string | -*Not supported. | -*No | -*No | -*
| COLUMN_FLAGS | -*int | -*A DBCOLUMNFLAGS bitmask indicating column properties. See 'DBCOLUMNFLAGS Enumerated Type' in IColumnsInfo::GetColumnInfo | -*No | -*No | -*
| IS_NULLABLE | -*boolean | -*Always returns false. | -*No | -*No | -*
| DATA_TYPE | -*string | -*The data type of the column. Returns a string for dimension columns and a variant for measures. | -*No | -*No | -*
| TYPE_GUID -* | srring | -*Not supported. | -*No | -*No | -*
| CHARACTER_MAXIMUM_LENGTH | -*int | -*The maximum possible length of a value within the column. This is retrieved from the DataSize property in the DataItem. | -*No | -*No | -*
| CHARACTER_OCTET_LENGTH | -*int | -*The maximum possible length of a value within the column, in bytes, for character or binary columns. A value of zero (0) indicates the column has no maximum length. NULL will be returned for columns that do not return binary or character data types. | -*No | -*No | -*
| NUMERIC_PRECISION | -*int | -*The maximum precision of the column for numeric data types other than DBTYPE_VARNUMERIC. | -*No | -*No | -*
| NUMERIC_SCALE | -*int | -*The number of digits to the right of the decimal point for DBTYPE_DECIMAL, DBTYPE_NUMERIC, DBTYPE_VARNUMERIC. Otherwise, this is NULL. | -*No | -*No | -*
| DATETIME_PRECISION | -*int | -*Not supported. | -*No | -*No | -*
| CHARACTER_SET_CATALOG | -*string | -*Not supported. | -*No | -*No | -*
| CHARACTER_SET_SCHEMA | -*string | -*Not supported. | -*No | -*No | -*
| CHARACTER_SET_NAME | -*string | -*Not supported. | -*No | -*No | -*
| COLLATION_CATALOG | -*string | -*Not supported. | -*No | -*No | -*
| COLLATION_SCHEMA | -*string | -*Not supported. | -*No | -*No | -*
| COLLATION_NAME | -*string | -*Not supported. | -*No | -*No | -*
| DOMAIN_CATALOG | -*string | -*Not supported. | -*No | -*No | -*
| DOMAIN_SCHEMA | -*string | -*Not supported. | -*No | -*No | -*
| DOMAIN_NAME | -*string | -*Not supported. | -*No | -*No | -*
| DESCRIPTION | -*string | -*Not supported. | -*No | -*No | -*
| COLUMN_OLAP_TYPE | -*string | -*The OLAP type of the object. MEASURE indicates the object is a measure. ATTRIBUTE indicates the object is a dimension attribute. | -*Yes | -*No | -*
DBSCHEMA_COLUMNS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_COLUMNS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBColumns: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DBSCHEMA_COLUMNS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_PROVIDER_TYPES schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| TYPE_NAME | -*string | -*The provider-specific data type name. | -*false | -*true | -*
| DATA_TYPE | -*int | -*The indicator of the data type. | -*false | -*true | -*
| COLUMN_SIZE | -*int | -*The length of a non-numeric column or parameter that refers to either the maximum or the length defined for this type by the provider. For character data, this is the maximum or defined length in characters. For DateTime data types, this is the length of the string representation (assuming the maximum allowed precision of the fractional seconds component). If the data type is numeric, this is the upper bound on the maximum precision of the data type. | -*false | -*true | -*
| LITERAL_PREFIX | -*string | -*The character or characters used to prefix a literal of this type in a text command. | -*false | -*true | -*
| LITERAL_SUFFIX | -*string | -*The character or characters used to suffix a literal of this type in a text command. | -*false | -*true | -*
| CREATE_PARAMS -* | string | -*The creation parameters specified by the consumer when creating a column of this data type. For example, the SQL data type, DECIMAL, needs a precision and a scale. In this case, the creation parameters might be the string "precision,scale". In a text command to create a DECIMAL column with a precision of 10 and a scale of 2, the value of the TYPE_NAME column might be DECIMAL() and the complete type specification would be DECIMAL(10,2). The creation parameters appear as a comma-separated list of values, in the order they are to be supplied and with no surrounding parentheses. If a creation parameter is length, maximum length, precision, scale, seed, or increment, use "length", "max length", "precision", "scale", "seed", and "increment", respectively. If the creation parameter is some other value, the provider determines what text is to be used to describe the creation parameter. If the data type requires creation parameters, "()" usually appears in the type name. This indicates the position at which to insert the creation parameters. If the type name does not include "()", the creation parameters are enclosed in parentheses and appended to the data type name. | -*false | -*true | -*
| IS_NULLABLE | -*boolean | -*A Boolean that indicates whether the data type is nullable. VARIANT_TRUE indicates that the data type is nullable. VARIANT_FALSE indicates that the data type is not nullable. NULL indicates that it is not known whether the data type is nullable. | -*false | -*true | -*
| CASE_SENSITIVE | -*boolean | -*A Boolean that indicates whether the data type is a characters type and case-sensitive. VARIANT_TRUE indicates that the data type is a character type and is case-sensitive. VARIANT_FALSE indicates that the data type is not a character type or is not case-sensitive. | -*false | -*true | -*
| SEARCHABLE | -*int | -*An integer indicating how the data type can be used in searches if the provider supports ICommandText; otherwise, NULL. This column can have the following values: DB_UNSEARCHABLE indicates that the data type cannot be used in a WHERE clause. DB_LIKE_ONLY indicates that the data type can be used in a WHERE clause only with the LIKE predicate.DB_ALL_EXCEPT_LIKE indicates that the data type can be used in a WHERE clause with all comparison operators except LIKE. DB_SEARCHABLE indicates that the data type can be used in a WHERE clause with any comparison operator. | -*false | -*true | -*
| UNSIGNED_ATTRIBUTE | -*boolean | -*A Boolean that indicates whether the data type is unsigned. VARIANT_TRUE indicates that the data type is unsigned. VARIANT_FALSE indicates that the data type is signed.NULL indicates that this is not applicable to the data type. | -*false | -*true | -*
| FIXED_PREC_SCALE | -*boolean | -*A Boolean that indicates whether the data type has a fixed precision and scale. VARIANT_TRUE indicates that the data type has a fixed precision and scale. VARIANT_FALSE indicates that the data type does not have a fixed precision and scale. | -*false | -*true | -*
| AUTO_UNIQUE_VALUE | -*boolean | -*A Boolean that indicates whether the data type is autoincrementing. VARIANT_TRUE indicates that values of this type can be autoincrementing. VARIANT_FALSE indicates that values of this type cannot be autoincrementing. If this value is VARIANT_TRUE, whether or not a column of this type is always autoincrementing depends on the provider's DBPROP_COL_AUTOINCREMENT column property. If the DBPROP_COL_AUTOINCREMENT property is read/write, whether or not a column of this type is autoincrementing depends on the setting of the DBPROP_COL_AUTOINCREMENT property. If DBPROP_COL_AUTOINCREMENT is a read-only property, either all or none of the columns of this type are autoincrementing. | -*false | -*true | -*
| LOCAL_TYPE_NAME | -*string | -*The localized version of TYPE_NAME. NULL is returned if a localized name is not supported by the data provider. | -*false | -*true | -*
| MINIMUM_SCALE | -*int | -*If the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC, the minimum number of digits allowed to the right of the decimal point. Otherwise, NULL. | -*false | -*true | -*
| MAXIMUM_SCALE | -*int | -*The maximum number of digits allowed to the right of the decimal point if the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC; otherwise, NULL. | -*false | -*true | -*
| GUID | -*string | -*(Intended for future use) The GUID of the type, if the type is described in a type library. Otherwise, NULL. | -*false | -*true | -*
| TYPELIB -* | string | -*(Intended for future use) The type library containing the description of the type, if the type is described in a type library. Otherwise, NULL. | -*false | -*true | -*
| VERSION | -*string | -*(Intended for future use) The version of the type definition. Providers might want to version type definitions. Different providers might use different versioning schemes, such as a timestamp or number (integer or float). NULL if not supported. | -*false | -*true | -*
| IS_LONG | -*boolean | -*A Boolean that indicates whether the data type is a binary large object (BLOB) and has very long data. VARIANT_TRUE indicates that the data type is a BLOB that contains very long data; the definition of very long data is provider-specific. VARIANT_FALSE indicates that the data type is a BLOB that does not contain very long data or is not a BLOB. This value determines the setting of the DBCOLUMNFLAGS_ISLONG flag returned by GetColumnInfo in IColumnsInfo and GetParameterInfo in ICommandWithParameters. | -*false | -*true | -*
| BEST_MATCH | -*boolean | -*A Boolean that indicates whether the data type is a best match. VARIANT_TRUE indicates that the data type is the best match between all data types in the data store and the OLE DB data type indicated by the value in the DATA_TYPE column. VARIANT_FALSE indicates that the data type is not the best match. For each set of rows in which the value of the DATA_TYPE column is the same, the BEST_MATCH column is set to VARIANT_TRUE in only one row. | -*false | -*true | -*
| IS_FIXEDLENGTH | -*boolean | -*A Boolean that indicates whether the column is fixed in length. VARIANT_TRUE indicates that columns of this type created by the data definition language (DDL) will be of fixed length. VARIANT_FALSE indicates that columns of this type created by the DDL will be of variable length. If the field is NULL, it is not known whether the provider will map this field with a fixed-length or variable-length column. -* | false | -*true | -*
DBSCHEMA_PROVIDER_TYPES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_PROVIDER_TYPES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBProviderTypes: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DBSCHEMA_PROVIDER_TYPES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_SCHEMATA schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|
DBSCHEMA_SCHEMATA request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_SCHEMATA schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBSchemata: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DBSCHEMA_SCHEMATA
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_TABLES schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|
DBSCHEMA_TABLES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_TABLES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBTables: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.DBSCHEMA_TABLES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the DBSCHEMA_TABLES_INFO schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|
DBSCHEMA_TABLES_INFO request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the DBSCHEMA_TABLES_INFO schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverDBTablesInfo: function(options){
- var request = _applyProps(
- options,
- {
- requestType: Xmla.DBSCHEMA_TABLES_INFO
- },
- true
- );
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_ACTIONS schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|
MDSCHEMA_ACTIONS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_ACTIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDActions: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_ACTIONS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_CUBES schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*Name of the catalog | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*Not supported | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*Name of the cube. | -*Yes | -*No | -*
| CUBE_TYPE | -*string | -*Type of the cube. | -*No | -*No | -*
| CUBE_GUID | -*string | -*Not supported | -*No | -*No | -*
| CREATED_ON | -*Date | -*Not supported | -*No | -*No | -*
| LAST_SCHEMA_UPDATE | -*Date | -*The time that the cube was last processed. | -*No | -*No | -*
| SCHEMA_UPDATED_BY | -*string | -*-* | No | -*No | -*
| LAST_DATA_UPDATE | -*Date | -*The time that the cube was last processed. | -*No | -*No | -*
| DATA_UPDATED_BY | -*string | -*-* | No | -*No | -*
| DESCRIPTION | -*string | -*A Human-readable description of the cube. | -*No | -*No | -*
| IS_DRILLTHROUGH_ENABLED | -*boolean | -*-* | No | -*No | -*
| IS_LINKABLE | -*boolean | -*-* | No | -*No | -*
| IS_WRITE_ENABLED | -*boolean | -*-* | No | -*No | -*
| IS_SQL_ENABLED | -*boolean | -*-* | No | -*No | -*
| CUBE_CAPTION | -*string | -*Caption for this cube. | -*No | -*No | -*
| BASE_CUBE_NAME | -*string | -*Name of the source cube (if this cube is a perspective cube). | -*Yes | -*No | -*
| ANNOTATIONS | -*string | -*Notes in xml format | -*No | -*No | -*
MDSCHEMA_CUBES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_CUBES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDCubes: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_CUBES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_DIMENSIONS schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*Name of the catalog | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*Not supported | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*Name of the cube. | -*Yes | -*No | -*
| DIMENSION_NAME | -*string | -*Name of the dimension. | -*Yes | -*No | -*
| DIMENSION_UNIQUE_NAME | -*string | -*Unique name for this dimension. | -*Yes | -*No | -*
| DIMENSION_GUID | -*string | -*-* | No | -*Yes | -*
| DIMENSION_CAPTION | -*string | -*-* | No | -*Yes | -*
| DIMENSION_ORDINAL | -*int | -*-* | No | -*Yes | -*
| DIMENSION_TYPE | -*string | -*
-*
|
-* No | -*Yes | -*
| DIMENSION_CARDINALITY | -*int | -*-* | No | -*Yes | -*
| DEFAULT_HIERARCHY | -*string | -*-* | No | -*Yes | -*
| DESCRIPTION | -*string | -*A Human-readable description of the dimension. | -*No | -*No | -*
| IS_VIRTUAL | -*boolean | -*-* | No | -*No | -*
| IS_READWRITE | -*boolean | -*-* | No | -*No | -*
| DIMENSION_UNIQUE_SETTINGS | -*-* | -* | No | -*No | -*
| DIMENSION_MASTER_UNIQUE_NAME | -*-* | -* | No | -*No | -*
| DIMENSION_IS_VISIBLE | -*boolean | -*-* | No | -*No | -*
MDSCHEMA_DIMENSIONS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_DIMENSIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDDimensions: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_DIMENSIONS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_FUNCTIONS schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*|
|---|---|---|---|---|---|
| FUNCTION_NAME | -*DBTYPE_WSTR | -*The name of the function. | -*Yes | -*Yes | -*|
| DESCRIPTION | -*DBTYPE_WSTR | -*A description of the function. | -*No | -*No | -*|
| PARAMETER_LIST | -*DBTYPE_WSTR | -*A comma delimited list of parameters formatted as in Microsoft Visual Basic. For example, a parameter might be Name as String. | -*No | -*No | -*|
| RETURN_TYPE | -*DBTYPE_I4 | -*The VARTYPE of the return data type of the function. | -*No | -*No | -*|
| ORIGIN | -*DBTYPE_I4 | -*The origin of the function:
-*
|
-* Yes | -*Yes | -*|
| INTERFACE_NAME | -*DBTYPE_WSTR | -*The name of the interface for user-defined functions. The group name for Multidimensional Expressions (MDX) functions. | -*Yes | -*Yes | -*|
| LIBRARY_NAME | -*DBTYPE_WSTR | -*The name of the type library for user-defined functions. NULL for MDX functions. | -*Yes | -*Yes | -*|
| DLL_NAME | -*DBTYPE_WSTR | -*(Optional) The name of the assembly that implements the user-defined function. Returns VT_NULL for MDX functions. | -*No | -*No | -*|
| HELP_FILE | -*DBTYPE_WSTR | -*(Optional) The name of the file that contains the help documentation for the user-defined function. | -*Returns VT_NULL for MDX functions. | -*No | -*No | -*
| HELP_CONTEXT | -*DBTYPE_I4 | -*(Optional) Returns the Help context ID for this function. | -*No | -*No | -*|
| OBJECT | -*DBTYPE_WSTR | -*
-* (Optional) The generic name of the object class to which a property applies. For example, the rowset corresponding to the |
-* No | -*No | -*|
| CAPTION | -*DBTYPE_WSTR | -*The display caption for the function. | -*No | -*No | -*
MDSCHEMA_FUNCTIONS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_FUNCTIONS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDFunctions: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_FUNCTIONS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_HIERARCHIES schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*Name of the catalog | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*Not supported | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*Name of the cube. | -*Yes | -*No | -*
| DIMENSION_UNIQUE_NAME | -*string | -*Unique name for this dimension. | -*Yes | -*No | -*
| HIERARCHY_NAME | -*string | -*Name of the hierarchy. | -*Yes | -*No | -*
| HIERARCHY_UNIQUE_NAME | -*string | -*Unique name for this hierarchy. | -*Yes | -*No | -*
| HIERARCHY_GUID | -*string | -*-* | No | -*Yes | -*
| HIERARCHY_CAPTION | -*string | -*-* | No | -*Yes | -*
| DIMENSION_TYPE | -*string | -*-* | No | -*Yes | -*
| HIERARCHY_CARDINALITY | -*int | -*-* | No | -*Yes | -*
| DEFAULT_MEMBER | -*string | -*-* | No | -*Yes | -*
| ALL_MEMBER | -*string | -*-* | No | -*Yes | -*
| DESCRIPTION | -*string | -*A Human-readable description of the dimension. | -*No | -*No | -*
| STRUCTURE | -*string | -*-* | No | -*Yes | -*
| IS_VIRTUAL | -*boolean | -*-* | No | -*Yes | -*
| IS_READWRITE | -*boolean | -*-* | No | -*Yes | -*
| DIMENSION_UNIQUE_SETTINGS | -*string | -*-* | No | -*Yes | -*
| DIMENSION_MASTER_UNIQUE_NAME | -*string | -*-* | No | -*Yes | -*
| DIMENSION_IS_VISIBLE | -*boolean | -*-* | No | -*Yes | -*
| HIERARCHY_ORDINAL | -*int | -*-* | No | -*Yes | -*
| DIMENSION_IS_SHARED | -*boolean | -*-* | No | -*Yes | -*
| HIERARCHY_IS_VISIBLE | -*boolean | -*-* | No | -*Yes | -*
| HIERARCHY_ORIGIN | -*-* | -* | Yes | -*Yes | -*
| HIERARCHY_DISPLAY_FOLDER | -*string | -*-* | No | -*Yes | -*
| INSTANCE_SELECTION | -*string | -*-* | No | -*Yes | -*
MDSCHEMA_HIERARCHIES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_HIERARCHIES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDHierarchies: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_HIERARCHIES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_LEVELS schema rowset.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*The name of the catalog to which this level belongs. NULL if the provider does not support catalogs. | -*Yes | -*Yes | -*
| SCHEMA_NAME | -*string | -*The name of the schema to which this level belongs. NULL if the provider does not support schemas. | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*The name of the cube to which this level belongs. | -*Yes | -*Yes | -*
| DIMENSION_UNIQUE_NAME | -*string | -*The unique name of the dimension to which this level belongs. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| HIERARCHY_UNIQUE_NAME | -*string | -*The unique name of the hierarchy. If the level belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| LEVEL_NAME | -*string | -*The name of the level. | -*Yes | -*Yes | -*
| LEVEL_UNIQUE_NAME | -*string | -*The properly escaped unique name of the level. | -*Yes | -*Yes | -*
| LEVEL_GUID | -*string | -*Not supported. | -*No | -*Yes | -*
| LEVEL_CAPTION | -*string | -*A label or caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, LEVEL_NAME is returned. | -*No | -*Yes | -*
| LEVEL_NUMBER | -*int | -*The distance of the level from the root of the hierarchy. Root level is zero (0). | -*No | -*Yes | -*
| LEVEL_CARDINALITY | -*int | -*The number of members in the level. | -*No | -*Yes | -*
| LEVEL_TYPE | -*int | -*Type of the level:
-*
| No | -*Yes | -*
| DESCRIPTION | -*string | -*A human-readable description of the level. NULL if no description exists. | -*No | -*Yes | -*
| CUSTOM_ROLLUP_SETTINGS | -*int | -*A bitmap that specifies the custom rollup options:
-*
|
-* No | -*Yes | -*
| LEVEL_UNIQUE_SETTINGS | -*int | -*A bitmap that specifies which columns contain unique values, if the level only has members with unique names or keys.
-* The Msmd.h file defines the following bit value constants for this bitmap:
-*
|
-* No | -*Yes | -*
| LEVEL_IS_VISIBLE | -*bool | -*A Boolean that indicates whether the level is visible. Always returns True. If the level is not visible, it will not be included in the schema rowset. | -*No | -*Yes | -*
| LEVEL_ORDERING_PROPERTY | -*string | -*The ID of the attribute that the level is sorted on. | -*No | -*Yes | -*
| LEVEL_DBTYPE | -*int | -*The DBTYPE enumeration of the member key column that is used for the level attribute. Null if concatenated keys are used as the member key column. | -*No | -*Yes | -*
| LEVEL_MASTER_UNIQUE_NAME | -*string | -*Always returns NULL. | -*No | -*Yes | -*
| LEVEL_NAME_SQL_COLUMN_NAME | -*string | -*The SQL representation of the level member names. | -*No | -*Yes | -*
| LEVEL_KEY_SQL_COLUMN_NAME | -*string | -*The SQL representation of the level member key values. | -*No | -*Yes | -*
| LEVEL_UNIQUE_NAME_SQL_COLUMN_NAME | -*string | -*The SQL representation of the member unique names. | -*No | -*Yes | -*
| LEVEL_ATTRIBUTE_HIERARCHY_NAME | -*string | -*The name of the attribute hierarchy providing the source of the level. | -*No | -*Yes | -*
| LEVEL_KEY_CARDINALITY | -*int | -*The number of columns in the level key. | -*No | -*Yes | -*
| LEVEL_ORIGIN | -*int | -*A bit map that defines how the level was sourced:MD_ORIGIN_USER_DEFINED identifies levels in a user defined hierarchy.MD_ORIGIN_ATTRIBUTE identifies levels in an attribute hierarchy.MD_ORIGIN_KEY_ATTRIBUTE identifies levels in a key attribute hierarchy.MD_ORIGIN_INTERNAL identifies levels in attribute hierarchies that are not enabled. | -*No | -*Yes | -*
MDSCHEMA_LEVELS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_LEVELS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDLevels: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_LEVELS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_MEASURES schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*Name of the catalog | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*Not supported | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*Name of the cube. | -*Yes | -*No | -*
| MEASURE_NAME | -*string | -*The name of the measure. | -*Yes | -*No | -*
| MEASURE_UNIQUE_NAME | -*string | -*The Unique name of the measure. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*No | -*
| MEASURE_CAPTION | -*string | -*A label or caption associated with the measure. Used primarily for display purposes. If a caption does not exist, MEASURE_NAME is returned. | -*No | -*No | -*
| MEASURE_GUID | -*string | -*Not supported. | -*No | -*No | -*
| MEASURE_AGGREGATOR | -*int | -*An enumeration that indicates how the measure was derived. See http://msdn.microsoft.com/en-us/library/ms126250.aspx | -*No | -*No | -*
| DATA_TYPE | -*int | -*The data type of the measure. Valid values are:
-*
|
-* No | -*No | -*
| NUMERIC_PRECISION | -*int | -*The maximum precision of the property if the measure object's data type is exact numeric. NULL for all other property types. | -*No | -*No | -*
| NUMERIC_SCALE | -*int | -*The number of digits to the right of the decimal point if the measure object's type indicator is DBTYPE_NUMERIC or DBTYPE_DECIMAL. Otherwise, this value is NULL. | -*No | -*No | -*
| MEASURE_UNITS | -*int | -*Not supported. | -*No | -*No | -*
| DESCRIPTION | -*string | -*A human-readable description of the measure. NULL if no description exists. | -*No | -*No | -*
| EXPRESSION | -*string | -*An expression for the member. | -*No | -*No | -*
| MEASURE_IS_VISIBLE | -*boolean | -*A Boolean that always returns True. If the measure is not visible, it will not be included in the schema rowset. | -*No | -*No | -*
| LEVELS_LIST | -*string | -*A string that always returns NULL. | -*No | -*No | -*
| MEASURE_NAME_SQL_COLUMN_NAME | -*string | -*The name of the column in the SQL query that corresponds to the measure's name. | -*No | -*No | -*
| MEASURE_UNQUALIFIED_CAPTION | -*string | -*The name of the measure, not qualified with the measure group name. | -*No | -*No | -*
| MEASUREGROUP_NAME | -*string | -*The name of the measure group to which the measure belongs. | -*Yes | -*No | -*
| MEASURE_DISPLAY_FOLDER | -*string | -*The path to be used when displaying the measure in the user interface. Folder names will be separated by a semicolon. Nested folders are indicated by a backslash (\). | -*No | -*No | -*
| DEFAULT_FORMAT_STRING | -*string | -*The default format string for the measure. | -*No | -*No | -*
MDSCHEMA_MEASURES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_MEASURES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDMeasures: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_MEASURES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_MEMBERS schema rowset.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*The name of the catalog | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*The name of the schema | -*Yes | -*No | -*
| CUBE_NAME | -*string | -*The name of the cube | -*Yes | -*No | -*
| DIMENSION_UNIQUE_NAME | -*string | -*The unique name of the dimension | -*Yes | -*No | -*
| HIERARCHY_UNIQUE_NAME | -*string | -*The unique name of the hierarchy | -*Yes | -*No | -*
| LEVEL_UNIQUE_NAME | -*string | -*The unique name of the level | -*Yes | -*No | -*
| LEVEL_NUMBER | -*int | -*Distance of this level to the root | -*Yes | -*No | -*
| MEMBER_ORDINAL | -*int | -*Deprecated: always 0 | -*No | -*No | -*
| MEMBER_NAME | -*string | -*The name of this member | -*Yes | -*No | -*
| MEMBER_UNIQUE_NAME | -*string | -*The unique name of this member | -*Yes | -*No | -*
| MEMBER_TYPE | -*int | -*An integer constant indicating the type of this member. Can take on one of the following values: -* -* | -*Yes | -*No | -*
| MEMBER_GUID | -*string | -*The guid of this member | -*No | -*No | -*
| MEMBER_CAPTION | -*string | -*A label or caption associated with the member. Used primarily for display purposes. If a caption does not exist, MEMBER_NAME is returned. | -*No | -*No | -*
| CHILDREN_CARDINALITY | -*int | -*The number of childrend for this member | -*No | -*No | -*
| PARENT_LEVEL | -*int | -*The distance of the member's parent from the root level of the hierarchy. The root level is zero (0). | -*No | -*No | -*
| DESCRIPTION | -*string | -*This column always returns a NULL value. This column exists for backwards compatibility | -*No | -*No | -*
| EXPRESSION | -*string | -*The expression for calculations, if the member is of type MDMEMBER_TYPE_FORMULA. | -*No | -*No | -*
| MEMBER_KEY | -*string | -*The value of the member's key column. Returns NULL if the member has a composite key. | -*No | -*No | -*
MDSCHEMA_MEMBERS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_MEMBERS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDMembers: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_MEMBERS
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_PROPERTIES schema rowset.
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*The name of the database. | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*The name of the schema to which this property belongs. NULL if the provider does not support schemas. | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*The name of the cube. | -*Yes | -*Yes | -*
| DIMENSION_UNIQUE_NAME | -*string | -*The unique name of the dimension. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| HIERARCHY_UNIQUE_NAME | -*string | -*The unique name of the hierarchy. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| LEVEL_UNIQUE_NAME | -*string | -*The unique name of the level to which this property belongs. If the provider does not support named levels, it should return the DIMENSION_UNIQUE_NAME value for this field. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| MEMBER_UNIQUE_NAME | -*string | -*The unique name of the member to which the property belongs. Used for data stores that do not support named levels or have properties on a member-by-member basis. If the property applies to all members in a level, this column is NULL. For providers that generate unique names by qualification, each component of this name is delimited. | -*Yes | -*Yes | -*
| PROPERTY_TYPE | -*int | -*A bitmap that specifies the type of the property:
-*
|
-* Yes | -*Yes | -*
| PROPERTY_NAME | -*string | -*The name of the property. If the key for the property is the same as the name for the property, PROPERTY_NAME will be blank. | -*Yes | -*Yes | -*
| PROPERTY_CAPTION | -*string | -*A label or caption associated with the property, used primarily for display purposes. Returns PROPERTY_NAME if a caption does not exist. | -*No | -*Yes | -*
| DATA_TYPE | -*int | -*The data type of the property. | -*No | -*Yes | -*
| CHARACTER_MAXIMUM_LENGTH | -*int | -*The maximum possible length of the property, if it is a character, binary, or bit type. Zero indicates there is no defined maximum length. Returns NULL for all other data types. | -*No | -*Yes | -*
| CHARACTER_OCTET_LENGTH | -*int | -*The maximum possible length (in bytes) of the property, if it is a character or binary type. Zero indicates there is no defined maximum length. Returns NULL for all other data types. | -*No | -*Yes | -*
| NUMERIC_PRECISION | -*int | -*The maximum precision of the property, if it is a numeric data type. Returns NULL for all other data types. | -*No | -*Yes | -*
| NUMERIC_SCALE | -*int | -*The number of digits to the right of the decimal point, if it is a DBTYPE_NUMERIC or DBTYPE_DECIMAL type. Returns NULL for all other data types. | -*No | -*Yes | -*
| DESCRIPTION | -*string | -*A human readable description of the property. NULL if no description exists. | -*No | -*Yes | -*
| PROPERTY_CONTENT_TYPE | -*int | -*The type of the property. Can be one of the following enumerations: -* | -*Yes | -*Yes | -*
| SQL_COLUMN_NAME | -*string | -*The name of the property used in SQL queries from the cube dimension or database dDimension. | -*No | -*Yes | -*
| LANGUAGE | -*int | -*The translation expressed as an LCID. Only valid for property translations. | -*No | -*Yes | -*
| PROPERTY_ORIGIN | -*int | -*Identifies the type of hierarchy that the property applies to: | -*Yes | -*Yes | -*
| PROPERTY_ATTRIBUTE_HIERARCHY_NAME | -*string | -*The name of the attribute hierarchy sourcing this property. | -*No | -*Yes | -*
| PROPERTY_CARDINALITY | -*string | -*The cardinality of the property. Possible values include the following strings: ONE or MANY | -*No | -*Yes | -*
| MIME_TYPE | -*string | -*The mime type for binary large objects (BLOBs). | -*No | -*Yes | -*
| PROPERTY_IS_VISIBLE | -*boolean | -*A Boolean that indicates whether the property is visible. TRUE if the property is visible; otherwise, FALSE. | -*No | -*Yes | -*
MDSCHEMA_PROPERTIES request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_PROPERTIES schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDProperties: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_PROPERTIES
- }, true);
- return this.discover(request);
- },
-/**
-* Invokes the discover() method using
-* as value for the requestType,
-* and retrieves the MDSCHEMA_SETS schema rowset.
-* ...todo...
-* The rowset has the following columns:
-* | Column Name | -*Type | -*Description | -*Restriction | -*Nullable | -*
|---|---|---|---|---|
| CATALOG_NAME | -*string | -*The name of the catalog to which this set belongs. | -*Yes | -*No | -*
| SCHEMA_NAME | -*string | -*The name of the schema to which this property belongs. NULL if the provider does not support schemas. | -*Yes | -*Yes | -*
| CUBE_NAME | -*string | -*The name of the cube to which the set belongs. This column always contains a value and can never be null. | -*Yes | -*No | -*
| SET_NAME | -*string | -*The name of the set. | -*Yes | -*No | -*
| SCOPE | -*string | -*The scope of the set. | -*Yes | -*No | -*
| DESCRIPTION | -*string | -*-* | No | -*Yes | -*
| EXPRESSION | -*string | -*The expression for this set. | -*No | -*No | -*
| DIMENSIONS | -*string | -*A comma separated list of dimensions used by this set. | -*No | -*Yes | -*
MDSCHEMA_SETS request.
-* @return {Xmla.Rowset} The result of the invoking the XML/A Discover method. For synchronous requests, an instance of a Xmla.Rowset that represents the MDSCHEMA_SETS schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: addListener()) and listen for the success (see: EVENT_SUCCESS) or discoversuccess (see: EVENT_DISCOVER_SUCCESS) events.
-*/
- discoverMDSets: function(options){
- var request = _applyProps(options, {
- requestType: Xmla.MDSCHEMA_SETS
- }, true);
- return this.discover(request);
+ return null;
}
-};
-
-function _getComplexType(node, name){
- var types = _getElementsByTagNameNS(node, _xmlnsSchema, _xmlnsSchemaPrefix, "complexType"),
- numTypes = types.length,
- type, i
- ;
- for (i = 0; i < numTypes; i++){
- type = types[i];
- if (_getAttribute(type, "name")===name) return type;
+
+ /**
+ * + * This class implements an XML/A Rowset object. + *
+ *
+ * You do not need to instantiate objects of this class yourself.
+ * Rather, the Xmla class will instantiate this class to convey the result of any of the various discoverXXX() methods
+ * (see discover()).
+ * In addition, this class is also used to instantiate a Resultset for the
+ * execute() method in case the
+ * Format property is set to Tabular
+ * (see OPTION_FORMAT and OPTION_FORMAT_TABULAR).
+ * The request() method itself will also return an instance of this class in case the method is used to do a
+ * Discover request, or in case it is used to do a Execute request and the Format property is set to Tabular.
+ *
+ * An instance of the Xmla.Rowset class is returned immediately as return value from the disoverXXX() or execute() method when doing a synchronous request.
+ * In addition, the rowset is available in the eventdata passed to any registered listeners
+ * (see addListener()).
+ * Note that for asynchronous requests, the only way to obtain the returned Rowset instance is through the listeners.
+ *
Discover request.
+ * @param {string} requestTtype The requestType identifying the particular schema rowset to construct. This facilitates implementing field getters for a few complex types.
+ * @param {Xmla} xmla The Xmla instance that created this Rowset. This is mainly used to allow the Rowset to access the options passed to the Xmla constructor.
+ */
+ Xmla.Rowset = function (node, requestType, xmla){
+ if (typeof(node) === "string"){
+ node = _xjs(node);
+ }
+ this._node = node;
+ this._type = requestType;
+ this._xmla = xmla;
+ this._initData();
+ return this;
+ };
+
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_UNKNOWN
+ * @static
+ * @final
+ * @type int
+ * @default 0
+ */
+ Xmla.Rowset.MD_DIMTYPE_UNKNOWN = 0;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_TIME
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MD_DIMTYPE_TIME = 1;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_MEASURE
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MD_DIMTYPE_MEASURE = 2;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_OTHER
+ * @static
+ * @final
+ * @type int
+ * @default 3
+ */
+ Xmla.Rowset.MD_DIMTYPE_OTHER = 3;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_QUANTITATIVE
+ * @static
+ * @final
+ * @type int
+ * @default 5
+ */
+ Xmla.Rowset.MD_DIMTYPE_QUANTITATIVE = 5;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_ACCOUNTS
+ * @static
+ * @final
+ * @type int
+ * @default 6
+ */
+ Xmla.Rowset.MD_DIMTYPE_ACCOUNTS = 6;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_CUSTOMERS
+ * @static
+ * @final
+ * @type int
+ * @default 7
+ */
+ Xmla.Rowset.MD_DIMTYPE_CUSTOMERS = 7;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_PRODUCTS
+ * @static
+ * @final
+ * @type int
+ * @default 8
+ */
+ Xmla.Rowset.MD_DIMTYPE_PRODUCTS = 8;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_SCENARIO
+ * @static
+ * @final
+ * @type int
+ * @default 9
+ */
+ Xmla.Rowset.MD_DIMTYPE_SCENARIO = 9;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_UTILIY
+ * @static
+ * @final
+ * @type int
+ * @default 10
+ */
+ Xmla.Rowset.MD_DIMTYPE_UTILIY = 10;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_CURRENCY
+ * @static
+ * @final
+ * @type int
+ * @default 11
+ */
+ Xmla.Rowset.MD_DIMTYPE_CURRENCY = 11;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_RATES
+ * @static
+ * @final
+ * @type int
+ * @default 12
+ */
+ Xmla.Rowset.MD_DIMTYPE_RATES = 12;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_CHANNEL
+ * @static
+ * @final
+ * @type int
+ * @default 13
+ */
+ Xmla.Rowset.MD_DIMTYPE_CHANNEL = 13;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_PROMOTION
+ * @static
+ * @final
+ * @type int
+ * @default 14
+ */
+ Xmla.Rowset.MD_DIMTYPE_PROMOTION = 14;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_ORGANIZATION
+ * @static
+ * @final
+ * @type int
+ * @default 15
+ */
+ Xmla.Rowset.MD_DIMTYPE_ORGANIZATION = 15;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_BILL_OF_MATERIALS
+ * @static
+ * @final
+ * @type int
+ * @default 16
+ */
+ Xmla.Rowset.MD_DIMTYPE_BILL_OF_MATERIALS = 16;
+ /**
+ * A possible value for the DIMENSION_TYPE column that appears in the
+ * MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
+ *
+ * @property MD_DIMTYPE_GEOGRAPHY
+ * @static
+ * @final
+ * @type int
+ * @default 17
+ */
+ Xmla.Rowset.MD_DIMTYPE_GEOGRAPHY = 17;
+
+ /**
+ * A possible value for the STRUCTURE column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * @property MD_STRUCTURE_FULLYBALANCED
+ * @static
+ * @final
+ * @type int
+ * @default 0
+ */
+ Xmla.Rowset.MD_STRUCTURE_FULLYBALANCED = 0;
+ /**
+ * A possible value for the STRUCTURE column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * @property MD_STRUCTURE_RAGGEDBALANCED
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MD_STRUCTURE_RAGGEDBALANCED = 1;
+ /**
+ * A possible value for the STRUCTURE column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * @property MD_STRUCTURE_UNBALANCED
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MD_STRUCTURE_UNBALANCED = 2;
+ /**
+ * A possible value for the STRUCTURE column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * @property MD_STRUCTURE_NETWORK
+ * @static
+ * @final
+ * @type int
+ * @default 3
+ */
+ Xmla.Rowset.MD_STRUCTURE_NETWORK = 3;
+
+ /**
+ * A bitmap value for the HIERARCHY_ORIGIN column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * Identifies user defined hierarchies.
+ * @property MD_USER_DEFINED
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MD_USER_DEFINED = 1
+ /**
+ * A bitmap value for the HIERARCHY_ORIGIN column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * identifies attribute hierarchies.
+ * @property MD_SYSTEM_ENABLED
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MD_SYSTEM_ENABLED = 2
+ /**
+ * A bitmap value for the HIERARCHY_ORIGIN column of the
+ * MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
+ * identifies attributes with no attribute hierarchies.
+ * @property MD_SYSTEM_INTERNAL
+ * @static
+ * @final
+ * @type int
+ * @default 4
+ */
+ Xmla.Rowset.MD_SYSTEM_INTERNAL = 4
+
+ /**
+ * A possible value for the MEMBER_TYPE column of the
+ * MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
+ * indicating a regular member.
+ * @property MDMEMBER_TYPE_REGULAR
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MDMEMBER_TYPE_REGULAR = 1;
+ /**
+ * A possible value for the MEMBER_TYPE column of the
+ * MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
+ * indicating an all member.
+ * @property MDMEMBER_TYPE_ALL
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MDMEMBER_TYPE_ALL = 2;
+ /**
+ * A possible value for the MEMBER_TYPE column of the
+ * MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
+ * indicating a formula member.
+ * @property MDMEMBER_TYPE_FORMULA
+ * @static
+ * @final
+ * @type int
+ * @default 3
+ */
+ Xmla.Rowset.MDMEMBER_TYPE_FORMULA = 3;
+ /**
+ * A possible value for the MEMBER_TYPE column of the
+ * MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
+ * indicating a measure member.
+ * @property MDMEMBER_TYPE_MEASURE
+ * @static
+ * @final
+ * @type int
+ * @default 4
+ */
+ Xmla.Rowset.MDMEMBER_TYPE_MEASURE = 4;
+ /**
+ * A possible value for the MEMBER_TYPE column of the
+ * MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
+ * indicating a member of unknown type
+ * @property MDMEMBER_TYPE_UNKNOWN
+ * @static
+ * @final
+ * @type int
+ * @default 0
+ */
+ Xmla.Rowset.MDMEMBER_TYPE_UNKNOWN = 0;
+
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from SUM.
+ * @property MDMEASURE_AGGR_SUM
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_SUM = 1;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from COUNT.
+ * @property MDMEASURE_AGGR_COUNT
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_COUNT = 2;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from MIN.
+ * @property MDMEASURE_AGGR_MIN
+ * @static
+ * @final
+ * @type int
+ * @default 3
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_MIN = 3;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from MAX.
+ * @property MDMEASURE_AGGR_MAX
+ * @static
+ * @final
+ * @type int
+ * @default 4
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_MAX = 4;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from AVG.
+ * @property MDMEASURE_AGGR_AVG
+ * @static
+ * @final
+ * @type int
+ * @default 5
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_AVG = 5;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from VAR.
+ * @property MDMEASURE_AGGR_VAR
+ * @static
+ * @final
+ * @type int
+ * @default 6
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_VAR = 6;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from STDEV.
+ * @property MDMEASURE_AGGR_STD
+ * @static
+ * @final
+ * @type int
+ * @default 7
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_STD = 7;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from DISTINCT COUNT.
+ * @property MDMEASURE_AGGR_DST
+ * @static
+ * @final
+ * @type int
+ * @default 8
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_DST = 8;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from NONE.
+ * @property MDMEASURE_AGGR_NONE
+ * @static
+ * @final
+ * @type int
+ * @default 9
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_NONE = 9;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from AVERAGEOFCHILDREN.
+ * @property MDMEASURE_AGGR_AVGCHILDREN
+ * @static
+ * @final
+ * @type int
+ * @default 10
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_AVGCHILDREN = 10;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from FIRSTCHILD.
+ * @property MDMEASURE_AGGR_FIRSTCHILD
+ * @static
+ * @final
+ * @type int
+ * @default 11
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_FIRSTCHILD = 11;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from LASTCHILD.
+ * @property MDMEASURE_AGGR_LASTCHILD
+ * @static
+ * @final
+ * @type int
+ * @default 12
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_LASTCHILD = 12;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from FIRSTNONEMPTY.
+ * @property MDMEASURE_AGGR_FIRSTNONEMPTY
+ * @static
+ * @final
+ * @type int
+ * @default 13
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_FIRSTNONEMPTY = 13;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from LASTNONEMPTY.
+ * @property MDMEASURE_AGGR_LASTNONEMPTY
+ * @static
+ * @final
+ * @type int
+ * @default 14
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_LASTNONEMPTY = 14;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure aggregates from BYACCOUNT.
+ * @property MDMEASURE_AGGR_BYACCOUNT
+ * @static
+ * @final
+ * @type int
+ * @default 15
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_BYACCOUNT = 15;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure was derived from a formula that was not any single function above.
+ * @property MDMEASURE_AGGR_CALCULATED
+ * @static
+ * @final
+ * @type int
+ * @default 127
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_CALCULATED = 127;
+ /**
+ * A possible value for the MEASURE_AGGREGATOR column of the
+ * MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
+ * identifies that the measure was derived from an unknown aggregation function or formula.
+ * @property MDMEASURE_AGGR_UNKNOWN
+ * @static
+ * @final
+ * @type int
+ * @default 0
+ */
+ Xmla.Rowset.MDMEASURE_AGGR_UNKNOWN = 0;
+
+ /**
+ * Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
+ * see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
+ * Identifies a property of a member.
+ * If set it means this property can be used in the DIMENSION PROPERTIES clause of the SELECT statement.
+ * @property MDPROP_MEMBER
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Rowset.MDPROP_MEMBER = 1;
+ /**
+ * Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
+ * see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
+ * Identifies a property of a cell.
+ * If set, it means this property can be used in the CELL PROPERTIES clause that occurs at the end of the SELECT statement.
+ * @property MDPROP_CELL
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Rowset.MDPROP_CELL = 2;
+ /**
+ * Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
+ * see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
+ * Identifies an internal property.
+ * @property MDPROP_SYSTEM
+ * @static
+ * @final
+ * @type int
+ * @default 4
+ */
+ Xmla.Rowset.MDPROP_SYSTEM = 4;
+ /**
+ * Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
+ * see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
+ * Identifies an internal property.
+ * @property MDPROP_BLOB
+ * @static
+ * @final
+ * @type int
+ * @default 8
+ */
+ Xmla.Rowset.MDPROP_BLOB = 8;
+
+ Xmla.Rowset.KEYS = {};
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_CATALOGS] = ["CATALOG_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_COLUMNS] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_PROVIDER_TYPES] = ["TYPE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_SCHEMATA] = ["CATALOG_NAME", "SCHEMA_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES_INFO] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_DATASOURCES] = ["DataSourceName"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_ENUMERATORS] = ["EnumName", "ElementName"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_KEYWORDS] = ["Keyword"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_LITERALS] = ["LiteralName"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_PROPERTIES] = ["PropertyName"];
+ Xmla.Rowset.KEYS[Xmla.DISCOVER_SCHEMA_ROWSETS] = ["SchemaName"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_ACTIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "ACTION_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_CUBES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_DIMENSIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_FUNCTIONS] = ["FUNCTION_NAME", "PARAMETER_LIST"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_HIERARCHIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_LEVELS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEASURES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "MEASURE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEMBERS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_PROPERTIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME", "PROPERTY_NAME"];
+ Xmla.Rowset.KEYS[Xmla.MDSCHEMA_SETS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "SET_NAME"];
+
+
+ function _boolConverter(val){
+ return val==="true"?true:false;
}
- return null;
-}
-
-/**
-* -* This class implements an XML/A Rowset object. -*
-*
-* You do not need to instantiate objects of this class yourself.
-* Rather, the Xmla class will instantiate this class to convey the result of any of the various discoverXXX() methods
-* (see discover()).
-* In addition, this class is also used to instantiate a Resultset for the
-* execute() method in case the
-* Format property is set to Tabular
-* (see OPTION_FORMAT and OPTION_FORMAT_TABULAR).
-* The request() method itself will also return an instance of this class in case the method is used to do a
-* Discover request, or in case it is used to do a Execute request and the Format property is set to Tabular.
-*
-* An instance of the Xmla.Rowset class is returned immediately as return value from the disoverXXX() or execute() method when doing a synchronous request.
-* In addition, the rowset is available in the eventdata passed to any registered listeners
-* (see addListener()).
-* Note that for asynchronous requests, the only way to obtain the returned Rowset instance is through the listeners.
-*
Discover request.
-* @param {string} requestTtype The requestType identifying the particular schema rowset to construct. This facilitates implementing field getters for a few complex types.
-* @param {Xmla} xmla The Xmla instance that created this Rowset. This is mainly used to allow the Rowset to access the options passed to the Xmla constructor.
-*/
-Xmla.Rowset = function (node, requestType, xmla){
- if (typeof(node) === "string"){
- node = _xjs(node);
+ _boolConverter.jsType = "boolean";
+
+ function _intConverter(val){
+ return parseInt(val, 10);
}
- this._node = node;
- this._type = requestType;
- this._xmla = xmla;
- this._initData();
- return this;
-};
-
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_UNKNOWN
-* @static
-* @final
-* @type int
-* @default 0
-*/
-Xmla.Rowset.MD_DIMTYPE_UNKNOWN = 0;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_TIME
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MD_DIMTYPE_TIME = 1;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_MEASURE
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MD_DIMTYPE_MEASURE = 2;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_OTHER
-* @static
-* @final
-* @type int
-* @default 3
-*/
-Xmla.Rowset.MD_DIMTYPE_OTHER = 3;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_QUANTITATIVE
-* @static
-* @final
-* @type int
-* @default 5
-*/
-Xmla.Rowset.MD_DIMTYPE_QUANTITATIVE = 5;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_ACCOUNTS
-* @static
-* @final
-* @type int
-* @default 6
-*/
-Xmla.Rowset.MD_DIMTYPE_ACCOUNTS = 6;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_CUSTOMERS
-* @static
-* @final
-* @type int
-* @default 7
-*/
-Xmla.Rowset.MD_DIMTYPE_CUSTOMERS = 7;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_PRODUCTS
-* @static
-* @final
-* @type int
-* @default 8
-*/
-Xmla.Rowset.MD_DIMTYPE_PRODUCTS = 8;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_SCENARIO
-* @static
-* @final
-* @type int
-* @default 9
-*/
-Xmla.Rowset.MD_DIMTYPE_SCENARIO = 9;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_UTILIY
-* @static
-* @final
-* @type int
-* @default 10
-*/
-Xmla.Rowset.MD_DIMTYPE_UTILIY = 10;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_CURRENCY
-* @static
-* @final
-* @type int
-* @default 11
-*/
-Xmla.Rowset.MD_DIMTYPE_CURRENCY = 11;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_RATES
-* @static
-* @final
-* @type int
-* @default 12
-*/
-Xmla.Rowset.MD_DIMTYPE_RATES = 12;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_CHANNEL
-* @static
-* @final
-* @type int
-* @default 13
-*/
-Xmla.Rowset.MD_DIMTYPE_CHANNEL = 13;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_PROMOTION
-* @static
-* @final
-* @type int
-* @default 14
-*/
-Xmla.Rowset.MD_DIMTYPE_PROMOTION = 14;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_ORGANIZATION
-* @static
-* @final
-* @type int
-* @default 15
-*/
-Xmla.Rowset.MD_DIMTYPE_ORGANIZATION = 15;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_BILL_OF_MATERIALS
-* @static
-* @final
-* @type int
-* @default 16
-*/
-Xmla.Rowset.MD_DIMTYPE_BILL_OF_MATERIALS = 16;
-/**
-* A possible value for the DIMENSION_TYPE column that appears in the
-* MDSCHEMA_DIMENSIONS (See: discoverMDDimensions()) and
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowsets.
-*
-* @property MD_DIMTYPE_GEOGRAPHY
-* @static
-* @final
-* @type int
-* @default 17
-*/
-Xmla.Rowset.MD_DIMTYPE_GEOGRAPHY = 17;
-
-/**
-* A possible value for the STRUCTURE column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* @property MD_STRUCTURE_FULLYBALANCED
-* @static
-* @final
-* @type int
-* @default 0
-*/
-Xmla.Rowset.MD_STRUCTURE_FULLYBALANCED = 0;
-/**
-* A possible value for the STRUCTURE column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* @property MD_STRUCTURE_RAGGEDBALANCED
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MD_STRUCTURE_RAGGEDBALANCED = 1;
-/**
-* A possible value for the STRUCTURE column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* @property MD_STRUCTURE_UNBALANCED
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MD_STRUCTURE_UNBALANCED = 2;
-/**
-* A possible value for the STRUCTURE column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* @property MD_STRUCTURE_NETWORK
-* @static
-* @final
-* @type int
-* @default 3
-*/
-Xmla.Rowset.MD_STRUCTURE_NETWORK = 3;
-
-/**
-* A bitmap value for the HIERARCHY_ORIGIN column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* Identifies user defined hierarchies.
-* @property MD_USER_DEFINED
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MD_USER_DEFINED = 1
-/**
-* A bitmap value for the HIERARCHY_ORIGIN column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* identifies attribute hierarchies.
-* @property MD_SYSTEM_ENABLED
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MD_SYSTEM_ENABLED = 2
-/**
-* A bitmap value for the HIERARCHY_ORIGIN column of the
-* MDSCHEMA_HIERARCHIES (See: discoverMDHierarchies())rowset.
-* identifies attributes with no attribute hierarchies.
-* @property MD_SYSTEM_INTERNAL
-* @static
-* @final
-* @type int
-* @default 4
-*/
-Xmla.Rowset.MD_SYSTEM_INTERNAL = 4
-
-/**
-* A possible value for the MEMBER_TYPE column of the
-* MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
-* indicating a regular member.
-* @property MDMEMBER_TYPE_REGULAR
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MDMEMBER_TYPE_REGULAR = 1;
-/**
-* A possible value for the MEMBER_TYPE column of the
-* MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
-* indicating an all member.
-* @property MDMEMBER_TYPE_ALL
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MDMEMBER_TYPE_ALL = 2;
-/**
-* A possible value for the MEMBER_TYPE column of the
-* MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
-* indicating a formula member.
-* @property MDMEMBER_TYPE_FORMULA
-* @static
-* @final
-* @type int
-* @default 3
-*/
-Xmla.Rowset.MDMEMBER_TYPE_FORMULA = 3;
-/**
-* A possible value for the MEMBER_TYPE column of the
-* MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
-* indicating a measure member.
-* @property MDMEMBER_TYPE_MEASURE
-* @static
-* @final
-* @type int
-* @default 4
-*/
-Xmla.Rowset.MDMEMBER_TYPE_MEASURE = 4;
-/**
-* A possible value for the MEMBER_TYPE column of the
-* MDSCHEMA_MEMBERS rowset (see: discoverMDMembers()),
-* indicating a member of unknown type
-* @property MDMEMBER_TYPE_UNKNOWN
-* @static
-* @final
-* @type int
-* @default 0
-*/
-Xmla.Rowset.MDMEMBER_TYPE_UNKNOWN = 0;
-
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from SUM.
-* @property MDMEASURE_AGGR_SUM
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MDMEASURE_AGGR_SUM = 1;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from COUNT.
-* @property MDMEASURE_AGGR_COUNT
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MDMEASURE_AGGR_COUNT = 2;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from MIN.
-* @property MDMEASURE_AGGR_MIN
-* @static
-* @final
-* @type int
-* @default 3
-*/
-Xmla.Rowset.MDMEASURE_AGGR_MIN = 3;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from MAX.
-* @property MDMEASURE_AGGR_MAX
-* @static
-* @final
-* @type int
-* @default 4
-*/
-Xmla.Rowset.MDMEASURE_AGGR_MAX = 4;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from AVG.
-* @property MDMEASURE_AGGR_AVG
-* @static
-* @final
-* @type int
-* @default 5
-*/
-Xmla.Rowset.MDMEASURE_AGGR_AVG = 5;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from VAR.
-* @property MDMEASURE_AGGR_VAR
-* @static
-* @final
-* @type int
-* @default 6
-*/
-Xmla.Rowset.MDMEASURE_AGGR_VAR = 6;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from STDEV.
-* @property MDMEASURE_AGGR_STD
-* @static
-* @final
-* @type int
-* @default 7
-*/
-Xmla.Rowset.MDMEASURE_AGGR_STD = 7;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from DISTINCT COUNT.
-* @property MDMEASURE_AGGR_DST
-* @static
-* @final
-* @type int
-* @default 8
-*/
-Xmla.Rowset.MDMEASURE_AGGR_DST = 8;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from NONE.
-* @property MDMEASURE_AGGR_NONE
-* @static
-* @final
-* @type int
-* @default 9
-*/
-Xmla.Rowset.MDMEASURE_AGGR_NONE = 9;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from AVERAGEOFCHILDREN.
-* @property MDMEASURE_AGGR_AVGCHILDREN
-* @static
-* @final
-* @type int
-* @default 10
-*/
-Xmla.Rowset.MDMEASURE_AGGR_AVGCHILDREN = 10;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from FIRSTCHILD.
-* @property MDMEASURE_AGGR_FIRSTCHILD
-* @static
-* @final
-* @type int
-* @default 11
-*/
-Xmla.Rowset.MDMEASURE_AGGR_FIRSTCHILD = 11;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from LASTCHILD.
-* @property MDMEASURE_AGGR_LASTCHILD
-* @static
-* @final
-* @type int
-* @default 12
-*/
-Xmla.Rowset.MDMEASURE_AGGR_LASTCHILD = 12;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from FIRSTNONEMPTY.
-* @property MDMEASURE_AGGR_FIRSTNONEMPTY
-* @static
-* @final
-* @type int
-* @default 13
-*/
-Xmla.Rowset.MDMEASURE_AGGR_FIRSTNONEMPTY = 13;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from LASTNONEMPTY.
-* @property MDMEASURE_AGGR_LASTNONEMPTY
-* @static
-* @final
-* @type int
-* @default 14
-*/
-Xmla.Rowset.MDMEASURE_AGGR_LASTNONEMPTY = 14;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure aggregates from BYACCOUNT.
-* @property MDMEASURE_AGGR_BYACCOUNT
-* @static
-* @final
-* @type int
-* @default 15
-*/
-Xmla.Rowset.MDMEASURE_AGGR_BYACCOUNT = 15;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure was derived from a formula that was not any single function above.
-* @property MDMEASURE_AGGR_CALCULATED
-* @static
-* @final
-* @type int
-* @default 127
-*/
-Xmla.Rowset.MDMEASURE_AGGR_CALCULATED = 127;
-/**
-* A possible value for the MEASURE_AGGREGATOR column of the
-* MDSCHEMA_MEASURES rowset (see: discoverMDMeasures()),
-* identifies that the measure was derived from an unknown aggregation function or formula.
-* @property MDMEASURE_AGGR_UNKNOWN
-* @static
-* @final
-* @type int
-* @default 0
-*/
-Xmla.Rowset.MDMEASURE_AGGR_UNKNOWN = 0;
-
-/**
-* Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
-* see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
-* Identifies a property of a member.
-* If set it means this property can be used in the DIMENSION PROPERTIES clause of the SELECT statement.
-* @property MDPROP_MEMBER
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Rowset.MDPROP_MEMBER = 1;
-/**
-* Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
-* see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
-* Identifies a property of a cell.
-* If set, it means this property can be used in the CELL PROPERTIES clause that occurs at the end of the SELECT statement.
-* @property MDPROP_CELL
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Rowset.MDPROP_CELL = 2;
-/**
-* Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
-* see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
-* Identifies an internal property.
-* @property MDPROP_SYSTEM
-* @static
-* @final
-* @type int
-* @default 4
-*/
-Xmla.Rowset.MDPROP_SYSTEM = 4;
-/**
-* Field in the bitmap value of PROPERTY_TYPE column of the MDSCHEMA_PROPERTIES rowset.
-* see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
-* Identifies an internal property.
-* @property MDPROP_BLOB
-* @static
-* @final
-* @type int
-* @default 8
-*/
-Xmla.Rowset.MDPROP_BLOB = 8;
-
-Xmla.Rowset.KEYS = {};
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_CATALOGS] = ["CATALOG_NAME"];
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_COLUMNS] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"];
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_PROVIDER_TYPES] = ["TYPE_NAME"];
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_SCHEMATA] = ["CATALOG_NAME", "SCHEMA_NAME"];
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
-Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES_INFO] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_DATASOURCES] = ["DataSourceName"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_ENUMERATORS] = ["EnumName", "ElementName"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_KEYWORDS] = ["Keyword"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_LITERALS] = ["LiteralName"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_PROPERTIES] = ["PropertyName"];
-Xmla.Rowset.KEYS[Xmla.DISCOVER_SCHEMA_ROWSETS] = ["SchemaName"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_ACTIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "ACTION_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_CUBES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_DIMENSIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_FUNCTIONS] = ["FUNCTION_NAME", "PARAMETER_LIST"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_HIERARCHIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_LEVELS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEASURES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "MEASURE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEMBERS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_PROPERTIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME", "PROPERTY_NAME"];
-Xmla.Rowset.KEYS[Xmla.MDSCHEMA_SETS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "SET_NAME"];
-
-
-function _boolConverter(val){
- return val==="true"?true:false;
-}
-_boolConverter.jsType = "boolean";
-
-function _intConverter(val){
- return parseInt(val, 10);
-}
-_intConverter.jsType = "number";
-
-function _floatConverter(val){
- return parseFloat(val, 10);
-}
-_floatConverter.jsType = "number";
-
-function _textConverter (val){
- return val;
-}
-_textConverter.jsType = "string";
-
-function _dateTimeConverter (val){
- return Date.parse(val);
-}
-_dateTimeConverter.jsType = "object";
-
-function _restrictionsConverter(val){
- return val;
-}
-_restrictionsConverter.jsType = "object";
-
-function _arrayConverter(nodes, valueConverter){
- var arr = [],
- n = nodes.length,
- i, node
- ;
- for (i = 0; i < n; i++){
- node = nodes[i];
- arr.push(valueConverter(_getElementText(node)));
+ _intConverter.jsType = "number";
+
+ function _floatConverter(val){
+ return parseFloat(val, 10);
}
- return arr;
-}
-_arrayConverter.jsType = "object";
-
-var _typeConverterMap = {
- "xsd:boolean": _boolConverter,
- "xsd:decimal": _floatConverter,
- "xsd:double": _floatConverter,
- "xsd:float": _floatConverter,
- "xsd:int": _intConverter,
- "xsd:integer": _intConverter,
- "xsd:nonPositiveInteger": _intConverter,
- "xsd:negativeInteger": _intConverter,
- "xsd:nonNegativeInteger": _intConverter,
- "xsd:positiveInteger": _intConverter,
- "xsd:short": _intConverter,
- "xsd:byte": _intConverter,
- "xsd:long": _intConverter,
- "xsd:unsignedLong": _intConverter,
- "xsd:unsignedInt": _intConverter,
- "xsd:unsignedShort": _intConverter,
- "xsd:unsignedByte": _intConverter,
- "xsd:string": _textConverter,
- "xsd:dateTime": _dateTimeConverter,
- "Restrictions": _restrictionsConverter
-}
-
-function _getValueConverter(type){
- var func;
- return (func = _typeConverterMap[type]) ? func : _textConverter;
-}
-
-function _getElementValue(el) {
- var txt = _getElementText(el),
- type = _getAttributeNS(el, _xmlnsSchemaInstance, _xmlnsSchemaInstancePrefix, "type"),
- converter
+ _floatConverter.jsType = "number";
+
+ function _textConverter (val){
+ return val;
+ }
+ _textConverter.jsType = "string";
+
+ function _dateTimeConverter (val){
+ return Date.parse(val);
+ }
+ _dateTimeConverter.jsType = "object";
+
+ function _restrictionsConverter(val){
+ return val;
+ }
+ _restrictionsConverter.jsType = "object";
+
+ function _arrayConverter(nodes, valueConverter){
+ var arr = [],
+ n = nodes.length,
+ i, node
;
- if (type){
- converter = _typeConverterMap[type];
- if (converter){
- return converter(txt);
+ for (i = 0; i < n; i++){
+ node = nodes[i];
+ arr.push(valueConverter(_getElementText(node)));
}
+ return arr;
}
- return txt;
-}
-
-function _getterNameForColumnName(columnName){
- //sample: _getterNameForColumnName("DBLITERAL_CATALOG_NAME") returns "getDbLiteralCatalogName"
- return "get" +
- (/^[A-Z]+[a-z]+[A-Za-z]*$/g.test(columnName) ? columnName :
- columnName.charAt(0).toUpperCase() +
- columnName.substr(1).toLowerCase().replace(
- /_[a-z]/g,
- function(a){
- return a.charAt(1).toUpperCase();
+ _arrayConverter.jsType = "object";
+
+ var _typeConverterMap = {
+ "xsd:boolean": _boolConverter,
+ "xsd:decimal": _floatConverter,
+ "xsd:double": _floatConverter,
+ "xsd:float": _floatConverter,
+ "xsd:int": _intConverter,
+ "xsd:integer": _intConverter,
+ "xsd:nonPositiveInteger": _intConverter,
+ "xsd:negativeInteger": _intConverter,
+ "xsd:nonNegativeInteger": _intConverter,
+ "xsd:positiveInteger": _intConverter,
+ "xsd:short": _intConverter,
+ "xsd:byte": _intConverter,
+ "xsd:long": _intConverter,
+ "xsd:unsignedLong": _intConverter,
+ "xsd:unsignedInt": _intConverter,
+ "xsd:unsignedShort": _intConverter,
+ "xsd:unsignedByte": _intConverter,
+ "xsd:string": _textConverter,
+ "xsd:dateTime": _dateTimeConverter,
+ "Restrictions": _restrictionsConverter
+ }
+
+ function _getValueConverter(type){
+ var func;
+ return (func = _typeConverterMap[type]) ? func : _textConverter;
+ }
+
+ function _getElementValue(el) {
+ var txt = _getElementText(el),
+ type = _getAttributeNS(el, _xmlnsSchemaInstance, _xmlnsSchemaInstancePrefix, "type"),
+ converter
+ ;
+ if (type){
+ converter = _typeConverterMap[type];
+ if (converter){
+ return converter(txt);
+ }
+ }
+ return txt;
+ }
+
+ function _getterNameForColumnName(columnName){
+ //sample: _getterNameForColumnName("DBLITERAL_CATALOG_NAME") returns "getDbLiteralCatalogName"
+ return "get" +
+ (/^[A-Z]+[a-z]+[A-Za-z]*$/g.test(columnName) ? columnName :
+ columnName.charAt(0).toUpperCase() +
+ columnName.substr(1).toLowerCase().replace(
+ /_[a-z]/g,
+ function(a){
+ return a.charAt(1).toUpperCase();
+ }
+ )
+ );
+ }
+
+ Xmla.Rowset.prototype = {
+ _node: null,
+ _type: null,
+ _row: null,
+ _rows: null,
+ numRows: null,
+ fieldOrder: null,
+ fields: null,
+ _fieldCount: null,
+ _initData: function(){
+ this._rows = _getElementsByTagNameNS(this._node, _xmlnsRowset, null, "row");
+ this.numRows = this._rows? this._rows.length : 0;
+ this.reset();
+ this.fieldOrder = [];
+ this.fields = {};
+ this._fieldCount = 0;
+ var rowSchema = _getComplexType(this._node, "row");
+ if (rowSchema){
+ var seq = _getElementsByTagNameNS(rowSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence")[0],
+ seqChildren = seq.childNodes, numChildren = seqChildren ? seqChildren.length : 0, seqChild,
+ fieldLabel, fieldName, minOccurs, maxOccurs, type, valueConverter, getter,
+ addFieldGetters = this._xmla.options.addFieldGetters, i, val;
+ for (i = 0; i < numChildren; i++){
+ seqChild = seqChildren[i];
+ if (seqChild.nodeType !== 1) continue;
+ fieldLabel = _getAttributeNS(seqChild, _xmlnsSQL, _xmlnsSQLPrefix, "field");
+ fieldName = _getAttribute(seqChild, "name");
+ type = _getAttribute(seqChild, "type"); //get the type from the xsd
+ if (type===null && this._row) { //bummer, not defined there try to get it from xsi:type in the row
+ val = _getElementsByTagName(this._row, fieldName);
+ if (val.length){
+ type = _getAttributeNS(
+ val[0],
+ _xmlnsSchemaInstance,
+ _xmlnsSchemaInstancePrefix,
+ "type"
+ );
+ }
}
- )
- );
-}
-
-Xmla.Rowset.prototype = {
- _node: null,
- _type: null,
- _row: null,
- _rows: null,
- numRows: null,
- fieldOrder: null,
- fields: null,
- _fieldCount: null,
- _initData: function(){
- this._rows = _getElementsByTagNameNS(this._node, _xmlnsRowset, null, "row");
- this.numRows = this._rows? this._rows.length : 0;
- this.reset();
- this.fieldOrder = [];
- this.fields = {};
- this._fieldCount = 0;
- var rowSchema = _getComplexType(this._node, "row");
- if (rowSchema){
- var seq = _getElementsByTagNameNS(rowSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence")[0],
- seqChildren = seq.childNodes, numChildren = seqChildren ? seqChildren.length : 0, seqChild,
- fieldLabel, fieldName, minOccurs, maxOccurs, type, valueConverter, getter,
- addFieldGetters = this._xmla.options.addFieldGetters, i, val;
- for (i = 0; i < numChildren; i++){
- seqChild = seqChildren[i];
- if (seqChild.nodeType !== 1) continue;
- fieldLabel = _getAttributeNS(seqChild, _xmlnsSQL, _xmlnsSQLPrefix, "field");
- fieldName = _getAttribute(seqChild, "name");
- type = _getAttribute(seqChild, "type"); //get the type from the xsd
- if (type===null && this._row) { //bummer, not defined there try to get it from xsi:type in the row
- val = _getElementsByTagName(this._row, fieldName);
- if (val.length){
- type = _getAttributeNS(
- val[0],
- _xmlnsSchemaInstance,
- _xmlnsSchemaInstancePrefix,
- "type"
- );
+ if (!type &&
+ this._type==Xmla.DISCOVER_SCHEMA_ROWSETS &&
+ fieldName==="Restrictions"
+ ) type = "Restrictions";
+ minOccurs = _getAttribute(seqChild, "minOccurs");
+ if (minOccurs) {
+ minOccurs = parseInt(minOccurs, 10);
}
+ else {
+ minOccurs = 1;
+ }
+ maxOccurs = _getAttribute(seqChild, "maxOccurs");
+ if (maxOccurs) {
+ if (maxOccurs === "unbounded") {
+ maxOccurs = Infinity;
+ }
+ else {
+ minOccurs=parseInt(maxOccurs,10);
+ }
+ }
+ else {
+ maxOccurs = 1;
+ }
+ valueConverter = _getValueConverter(type);
+ getter = this._createFieldGetter(fieldName, valueConverter, minOccurs, maxOccurs);
+ if (addFieldGetters) {
+ this[_getterNameForColumnName(fieldName)] = getter;
+ }
+ this.fields[fieldLabel] = {
+ name: fieldName,
+ label: fieldLabel,
+ index: this._fieldCount++,
+ type: type,
+ jsType: valueConverter.jsType,
+ minOccurs: minOccurs,
+ maxOccurs: maxOccurs,
+ getter: getter
+ };
+ this.fieldOrder.push(fieldLabel);
}
- if (!type &&
- this._type==Xmla.DISCOVER_SCHEMA_ROWSETS &&
- fieldName==="Restrictions"
- ) type = "Restrictions";
- minOccurs = _getAttribute(seqChild, "minOccurs");
- if (minOccurs) {
- minOccurs = parseInt(minOccurs, 10);
- }
- else {
- minOccurs = 1;
- }
- maxOccurs = _getAttribute(seqChild, "maxOccurs");
- if (maxOccurs) {
- if (maxOccurs === "unbounded") {
- maxOccurs = Infinity;
+ }
+ else {
+ Xmla.Exception._newError(
+ "ERROR_PARSING_RESPONSE",
+ "Xmla.Rowset",
+ this._node
+ )._throw();
+ }
+ },
+ _createFieldGetter: function(fieldName, valueConverter, minOccurs, maxOccurs){
+ var getter;
+ if (maxOccurs===1) {
+ if(minOccurs===1)
+ getter = function(){
+ var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
+ if (els.length) {
+ return valueConverter(_getElementText(els[0]));
+ }
+ else {
+ //SAP doesn't know how to send XML that is valid according to their XML Schema
+ if (!_isUnd(console.error)) {
+ console.error("Field \"" + fieldName + "\" is supposed to be present in the rowset but isn't. Are you running on SAP / HANA?");
+ }
+ return null;
+ }
+ };
+ else
+ if (minOccurs === 0)
+ getter = function(){
+ var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
+ if (els.length) {
+ return valueConverter(_getElementText(els[0]));
+ }
+ else {
+ return null;
+ }
+ };
+ }
+ else
+ if(minOccurs === 1)
+ getter = function(){
+ var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
+ return _arrayConverter(els, valueConverter);
+ };
+ else
+ if (minOccurs === 0)
+ getter = function(){
+ var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
+ if (els.length) {
+ return _arrayConverter(els, valueConverter);
}
else {
- minOccurs=parseInt(maxOccurs,10);
+ return null;
+ }
+ };
+ return getter;
+ },
+ /**
+ * Indicates the type of rowset. In most cases, this will be identical to the requestType value that was used in the
+ * Discover request
+ *
+ * @method getType
+ * @return int One of the DISCOVER_XXX, DBSCHEMA_XXX or MDSCHEMA_XXX constants
+ */
+ getType: function(){
+ return this._type;
+ },
+ /**
+ * Retrieve an array of fieldDef objects that describes the fields of the rows in this rowset.
+ * The position of the fieldDef objects in the array corresponds to the column order of the rowset.
+ * For a description of the fieldDef object, see the
+ * fieldDef() method.
+ *
+ * @method getFields
+ * @return {[fieldDef]} An (ordered) array of field definition objects.
+ */
+ getFields: function(){
+ var f = [],
+ i, n = this._fieldCount,
+ fieldOrder = this.fieldOrder
+ ;
+ for (i = 0; i < n; i++) f[i] = this.fieldDef(fieldOrder[i]);
+ return f;
+ },
+ /**
+ * Retrieve an array of field names.
+ * The position of the names in the array corresponds to the column order of the rowset.
+ *
+ * @method getFieldNames
+ * @return {[string]} An (ordered) array of field names.
+ */
+ getFieldNames: function(){
+ var fieldNames = [], i, n = this._fieldCount;
+ for (i = 0; i < n; i++) fieldNames[i] = this.fieldOrder[i];
+ return fieldNames;
+ },
+ /**
+ * Indicates wheter the rowset can still be traversed.
+ * You can use this method together with the
+ * nextRow() method
+ * to drive a while loop to traverse all rows in the rowset, like so:
+
+ while(rowset.hasMoreRows()){
+ ...process row...
+ rowsete.nextRow();
+ }
+
+ * @method hasMoreRows
+ * @return {bool} true in case there are more rows to traverse. false if all rows have been traversed.
+ */
+ hasMoreRows: function(){
+ return this.numRows > this.rowIndex;
+ },
+ /**
+ * Moves the internal row index to the next row.
+ * You can use this method together with the
+ * hasMoreRows() method
+ * to drive a while loop to traverse all rows in the rowset.
+ *
+ * @method nextRow
+ */
+ nextRow: function(){
+ this.rowIndex++;
+ this._row = this._rows[this.rowIndex];
+ return this.rowIndex;
+ },
+ /**
+ * This method is deprecated and may be removed in the future.
+ * Use nextRow() instead.
+ * @method next
+ */
+ next: function(){
+ return this.nextRow();
+ },
+ /**
+ * Walks through all rows, and calls the callback function for each row.
+ * + *The callback function gets passed an object that represents the row. + * The keys of the row object are the column names, and the values are the respective column values.
+ *The scope for calling the callback can be passed as the second argument to this method.
+ * If the scope is not defined (or if it is null), the Rowset's this pointer is used instead.
You can pass additional data to the callback by passing in a third argument. This is then passed as is as second argument to the callback.
+ * + *The eachRow method will iterate untill the callback returns false, or until all rows have been traversed.
+ * If the callback returns false, iteration is aborted and eachRow as a whole returns false too.
+ * If iteration is not aborted, then eachRow returns true.
hasMoreRows().
+ *
+ * @method curr
+ * @return int
+ */
+ currRow: function(){
+ return this.rowIndex;
+ },
+ /**
+ * Returns the number of rows in the set.
+ *
+ * @method rowCount
+ * @return int
+ */
+ rowCount: function(){
+ return this.numRows;
+ },
+ /**
+ * Resets the internal row pointer so the resultset can be traversed again.
+ *
+ * @method reset
+ */
+ reset: function(){
+ this.rowIndex = 0;
+ this._row = (this.hasMoreRows()) ? this._rows[this.rowIndex] : null;
+ },
+ /**
+ * Retrieves a fieldDef object by name.
+ * A fieldDef describes a field (column). It has the following properties:
+ * name argument passed to the fieldDef() method.fieldDef object that matches the argument.
+ */
+ fieldDef: function(name){
+ var field = this.fields[name];
+ if (!field)
+ Xmla.Exception._newError(
+ "INVALID_FIELD",
+ "Xmla.Rowset.fieldDef",
+ name
+ )._throw();
+ return field;
+ },
+ /**
+ * Retrieves the index of a field by name.
+ * Field indexes start at 0.
+ * @method fieldIndex
+ * @param {string} name The name of the field for which you want to retrieve the index.
+ * @return {int} The ordinal position (starting at 0) of the field that matches the argument.
+ */
+ fieldIndex: function(name){
+ return this.fieldDef(name).index;
+ },
+ /**
+ * Retrieves the name of a field by field Index.
+ * Field indexes start at 0.
+ * @method fieldName
+ * @param {string} name The name of the field for which you want to retrieve the index.
+ * @return {int} The ordinal position (starting at 0) of the field that matches the argument.
+ */
+ fieldName: function(index){
+ var fieldName = this.fieldOrder[index];
+ if (!fieldName)
+ Xmla.Exception._newError(
+ "INVALID_FIELD",
+ "Xmla.Rowset.fieldDef",
+ index
+ )._throw();
+ return fieldName;
+ },
+ /**
+ * Retrieves a value from the current row for the field having the name specified by the argument.
+ * @method fieldVal
+ * @param {string | int} name The name or the index of the field for which you want to retrieve the value.
+ * @return {array|boolean|float|int|string} From the current row, the value of the field that matches the argument.
+ */
+ fieldVal: function(name){
+ if (_isNum(name)) name = this.fieldName(name);
+ return this.fieldDef(name).getter.call(this);
+ },
+ /**
+ * Returns the number of fields in this rowset.
+ * @method fieldCount
+ * @return {int} The number of fields in this rowset.
+ */
+ fieldCount: function(){
+ return this._fieldCount;
+ },
+ /**
+ * Releases references to the DomDocument passed to the Rowset constructor.
+ * This should facilitate automatic garbage collection by the browser.
+ * @method close
+ */
+ close: function(){
+ this._node = null;
+ this._row = null;
+ this._rows = null;
+ },
+ /**
+ * Reads the current row and returns the result as a new array.
+ * This method does not advance the internal row pointer, and does not check if there is a valid row.
+ * This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
+ * fetchCustom() method.
+ * If you just want to obtain the results as arrays, see
+ * fetchAsArray()
+ * and
+ * fetchAllAsArray().
+ * @method readAsArray
+ * @return {array}
+ */
+ readAsArray: function(array){
+ var fields = this.fields, fieldName, fieldDef;
+ if (!array) array = [];
+ for (fieldName in fields){
+ if (fields.hasOwnProperty(fieldName)){
+ fieldDef = fields[fieldName];
+ array[fieldDef.index] = fieldDef.getter.call(this);
+ }
+ }
+ return array;
+ },
+ /**
+ * Fetch all values from all fields from the current row, and return it in an array.
+ * The position of the values in the array corresponds to the column order of the rowset.
+ * The internal row pointer is also increased so the next call will read the next row.
+ * The method returns false when there are no more rows to traverse.
+ * You can use this method to drive a loop to travere all rows in the Rowset:
+
+ while (rowArray = rowset.fetchAsArray()){
+ ...process array...
+ }
+
+ * @method fetchAsArray
+ * @return {array}
+ */
+ fetchAsArray: function(array){
+ if (this.hasMoreRows()) {
+ array = this.readAsArray(array);
+ this.nextRow();
+ }
+ else array = false;
+ return array;
+ },
+ /**
+ * Reads the current row and returns the result as a new object.
+ * This method does not advance the internal row pointer, and does not check if there is a valid row.
+ * This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
+ * fetchCustom() method.
+ * If you just want to obtain the results as objects, see
+ * fetchAsObject()
+ * and
+ * fetchAllAsObject().
+ * @method readAsObject
+ * @return {object}
+ */
+ readAsObject: function(object){
+ var fields = this.fields, fieldName, fieldDef;
+ if (!object) object = {};
+ for (fieldName in fields) {
+ if (fields.hasOwnProperty(fieldName)) {
+ fieldDef = fields[fieldName];
+ object[fieldName] = fieldDef.getter.call(this);
+ }
+ }
+ return object;
+ },
+ /**
+ * Fetch all values from all fields from the current row, and return it in an Object literal.
+ * The property names of the returned object correspond to the fieldName (actually the fieldLabel), and the field value is assigned to its respective property.
+ * The internal row pointer is also increased so the next call will read the next row.
+ * The method returns false when there are no more rows to traverse.
+ * You can use this method to drive a loop to travere all rows in the Rowset:
+
+ while (rowObject = rowset.fetchAsObject()){
+ ...process object...
+ }
+
+ * @method fetchAsObject
+ * @return {Object|boolean}
+ */
+ fetchAsObject: function(object){
+ if (this.hasMoreRows()){
+ object = this.readAsObject(object);
+ this.nextRow();
+ }
+ else object = false;
+ return object;
+ },
+ /**
+ * Fetch the values using a custom callback function.
+ * If there are rows to fetch, the custom function is called in scope of the rowset, so you can use this inside the custom function to refer to the rowset object.
+ * Then, the internal row pointer is increased so the next call will read the next row.
+ * The method returns whatever object or value is returned by the custom function, or false when there are no more rows to traverse.
+ *
+ * @method fetchCustom
+ * @param func {function} a custom function to extract and return the data from the current row of the xml result.
+ * @param args {object} an object that will be passed to the function. Useful to hold any data required in addition to the rowset itself (which can be referred to as this inside the function).
+ * @return {mixed|boolean}
+ */
+ fetchCustom: function(func, args){
+ var object;
+ if (this.hasMoreRows()){
+ object = func.call(this, args);
+ this.nextRow();
+ }
+ else object = false;
+ return object;
+ },
+ /**
+ * Fetch all values from all fields from all rows, and return it as an array of arrays.
+ * See fetchAsArray().
+ * @method fetchAllAsArray
+ * @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
+ * @return {array}
+ */
+ fetchAllAsArray: function(rows){
+ var row;
+ if (!rows) rows = [];
+ while((row = this.fetchAsArray())) rows.push(row);
+ return rows;
+ },
+ /**
+ * Fetch all values from all fields from all rows, and return it as an array of objects.
+ * See fetchAsObject().
+ * @method fetchAllAsObject
+ * @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
+ * @return {array}
+ */
+ fetchAllAsObject: function(rows){
+ var row;
+ if (!rows) rows = [];
+ while((row = this.fetchAsObject())) rows.push(row);
+ return rows;
+ },
+ /**
+ * Fetch all rows using a custom function, and return the return values as an array.
+ * See fetchCustom().
+ * @method fetchAllCustom
+ * @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
+ * @param func {function} a callback function to extract the fields.
+ * @param args {object} an object to pass data to the callback.
+ * @return {array}
+ */
+ fetchAllCustom: function(rows, func, args){
+ var row;
+ if (!rows) rows = [];
+ while((row = this.fetchCustom(func, args))) rows.push(row);
+ return rows;
+ },
+ /**
+ * Fetch all row as an object, store it in nested objects according to values in the column identified by the key argument.
+ * This method should typically not be called directly, rather it is a helper method for mapAllAsObject().
+ *
+ * @method mapAsObject
+ * @param map
+ * @param key
+ * @param row
+ * @return {object} a tree using column values as branch names, and storing a row or an array of rows at the leaves.
+ */
+ mapAsObject: function(map, key, row){
+ var k, v, p, i, len = key.length, last = len - 1, m = map;
+ for (i = 0; i < len; i++){
+ k = key[i]; //get the keypart
+ v = row[k]; //get the value for the key part
+ p = m[v]; //get the property from the map for this keypart.
+ if (p) {
+ if (i === last) { //last, we need to store the row now.
+ if (_isArr(p)) p.push(row); //already entries here, append
+ else m[v] = [p, row]; //single row store here. since we need multiple rows, add an array
}
+ else m = p;
}
- else {
- maxOccurs = 1;
- }
- valueConverter = _getValueConverter(type);
- getter = this._createFieldGetter(fieldName, valueConverter, minOccurs, maxOccurs);
- if (addFieldGetters) {
- this[_getterNameForColumnName(fieldName)] = getter;
- }
- this.fields[fieldLabel] = {
- name: fieldName,
- label: fieldLabel,
- index: this._fieldCount++,
- type: type,
- jsType: valueConverter.jsType,
- minOccurs: minOccurs,
- maxOccurs: maxOccurs,
- getter: getter
- };
- this.fieldOrder.push(fieldLabel);
+ else //property didnt exist for this key yet.
+ if (i === last) m[v] = row; //last keypart: store the row here
+ else m = m[v] = {}; //more keyparts to go: add a new map for this keypart
}
+ },
+ /**
+ * Fetch all rows as an object, store them as proprties in an object (which acts as map).
+ * @method mapAllAsObject
+ * @param key {string|array} OPTIONAL. A column name or an array of column names that will be used to generate property names for the map. If not specified, the default key is used. If there is no default key, all column names will be used.
+ * @param map {object} OPTIONAL. The object that is used as map. Rows are added as properties to this map. If not specified, a new object is created
+ * @return {object}
+ */
+ mapAllAsObject: function(key, map){
+ if (!map) map = {};
+ if (!key) key = this.getKey();
+ var row;
+ while (row = this.fetchAsObject()) this.mapAsObject(map, key, row);
+ return map;
+ },
+
+ /*
+ * Find a key for the resultset type.
+ */
+ getKey: function(){
+ return (this._type) ? Xmla.Rowset.KEYS[this._type] : this.getFieldNames();
}
- else {
- Xmla.Exception._newError(
- "ERROR_PARSING_RESPONSE",
- "Xmla.Rowset",
- this._node
- )._throw();
+ };
+
+ /**
+ * + * This class implements an XML/A multidimensional Dataset object. + *
+ *
+ * You do not need to instantiate objects of this class yourself.
+ * Rather, the Xmla class will instantiate this class
+ * to convey the result of the executeMultiDimensional method
+ * (see executeMultiDimensional()),
+ * and possibly the execute method.
+ * (Note that the execute() instantiates either the
+ * Xmla.Rowset or the Xmla.Dataset class
+ * depending on the value of the Format property in the options passed to the execute() method.)
+ *
+ * An instance of the Xmla.Dataset class may be returned immediately as return value from these methods when doing a synchronous request.
+ * In addition, the Xmla.Dataset object is available in the eventdata passed to any registered listeners
+ * (see addListener()).
+ *
Execute request.
+ */
+ Xmla.Dataset = function(doc){
+ if (typeof(doc) === "string") {
+ doc = _xjs(doc);
}
- },
- _createFieldGetter: function(fieldName, valueConverter, minOccurs, maxOccurs){
- var getter;
- if (maxOccurs===1) {
- if(minOccurs===1)
- getter = function(){
- var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
- if (els.length) {
- return valueConverter(_getElementText(els[0]));
- }
- else {
- //SAP doesn't know how to send XML that is valid according to their XML Schema
- if (!_isUnd(console.error)) {
- console.error("Field \"" + fieldName + "\" is supposed to be present in the rowset but isn't. Are you running on SAP / HANA?");
- }
- return null;
- }
- };
+ this._initDataset(doc);
+ return this;
+ }
+
+ /**
+ * Can be used as argument for getAxis() to get the first axis (the column axis).
+ * Alternatively you can simply call getColumnAxis()
+ * @property AXIS_COLUMNS
+ * @static
+ * @final
+ * @type int
+ * @default 0
+ */
+ Xmla.Dataset.AXIS_COLUMNS = 0;
+ /**
+ * Can be used as argument for getAxis() to get the second axis (the row axis).
+ * Alternatively you can simply call getRowAxis()
+ * @property AXIS_ROWS
+ * @static
+ * @final
+ * @type int
+ * @default 1
+ */
+ Xmla.Dataset.AXIS_ROWS = 1;
+ /**
+ * Can be used as argument for getAxis() to get the third axis (the page axis).
+ * Alternatively you can simply call getPageAxis()
+ * @property AXIS_PAGES
+ * @static
+ * @final
+ * @type int
+ * @default 2
+ */
+ Xmla.Dataset.AXIS_PAGES = 2;
+ /**
+ * Can be used as argument for getAxis() to get the fourth axis (the section axis).
+ * Alternatively you can simply call getSectionAxis()
+ * @property AXIS_SECTIONS
+ * @static
+ * @final
+ * @type int
+ * @default 3
+ */
+ Xmla.Dataset.AXIS_SECTIONS = 3;
+ /**
+ * Can be used as argument for getAxis() to get the fifth axis (the chapters axis).
+ * Alternatively you can simply call getChapterAxis()
+ * @property AXIS_CHAPTERS
+ * @static
+ * @final
+ * @type int
+ * @default 4
+ */
+ Xmla.Dataset.AXIS_CHAPTERS = 4;
+ /**
+ * Can be used as argument for getAxis() to get the slicer axis
+ * (the axis that appears in the WHERE clause of an MDX-SELECT statement).
+ * Alternatively you can simply call getSlicerAxis()
+ * @property AXIS_SLICER
+ * @static
+ * @final
+ * @type string
+ * @default SlicerAxis
+ */
+ Xmla.Dataset.AXIS_SLICER = "SlicerAxis";
+
+ Xmla.Dataset.prototype = {
+ _root: null,
+ _axes: null,
+ _axesOrder: null,
+ _numAxes: null,
+ _slicer: null,
+ _cellset:null,
+ _initDataset: function(doc){
+ this._initRoot(doc);
+ this.cubeName = _getElementText(
+ _getElementsByTagNameNS(
+ this._root, _xmlnsDataset, "", "CubeName"
+ )[0]
+ );
+ this._initAxes();
+ this._initCells();
+ /*
+ var a, i, j, func, funcBody = "", mul;
+ func = "var ordinal = 0, a;" +
+ "\nif (arguments.length !== " + this._numAxes + ") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();"
+ for (a = 0, i = this._numAxes-1; i >= 0; i--, a++) {
+ func += "\nif (typeof(a = arguments[" + a + "])!==\"number\") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();";
+ mul = 1;
+ for (j = i-1; j >= 0; j--) mul *= this._axesOrder[j].tupleCount();
+ func += "\nordinal += a ";
+ if (i) func += "* " + mul + ";";
+ }
+ func += funcBody + "\nreturn ordinal;"
+ this._cellset.cellOrdinalForTupleIndexes = this.cellOrdinalForTupleIndexes = new Function(func);
+ */
+ },
+ _initRoot: function(doc){
+ var root = _getElementsByTagNameNS(doc, _xmlnsDataset, "", "root");
+ if (root.length) this._root = root[0];
else
- if (minOccurs === 0)
- getter = function(){
- var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
- if (els.length) {
- return valueConverter(_getElementText(els[0]));
- }
- else {
- return null;
- }
- };
- }
- else
- if(minOccurs === 1)
- getter = function(){
- var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
- return _arrayConverter(els, valueConverter);
- };
- else
- if (minOccurs === 0)
- getter = function(){
- var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
- if (els.length) {
- return _arrayConverter(els, valueConverter);
- }
+ Xmla.Exception._newError(
+ "ERROR_PARSING_RESPONSE",
+ "Xmla.Dataset._initData",
+ doc
+ )._throw();
+ },
+ _initAxes: function(){
+ var i, axis, axisNode, axisName, axisNodes, numAxisNodes, tmpAxes = {};
+
+ this._axes = {};
+ this._axesOrder = [];
+
+ //collect the axisInfo nodes
+ axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "AxisInfo");
+ numAxisNodes = axisNodes.length;
+ for (i = 0; i < numAxisNodes; i++) {
+ axisNode = axisNodes[i];
+ axisName = _getAttribute(axisNode, "name");
+ tmpAxes[axisName] = axisNode;
+ }
+ //collect the axis nodes
+ axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "Axis");
+ numAxisNodes = axisNodes.length;
+ for (i = 0; i < numAxisNodes; i++){
+ axisNode = axisNodes[i];
+ axisName = _getAttribute(axisNode, "name");
+ axis = new Xmla.Dataset.Axis(this, tmpAxes[axisName], axisNode, axisName, i);
+ if (axisName === Xmla.Dataset.AXIS_SLICER) this._slicer = axis;
else {
- return null;
+ this._axes[axisName] = axis;
+ this._axesOrder.push(axis);
}
- };
- return getter;
- },
-/**
-* Indicates the type of rowset. In most cases, this will be identical to the requestType value that was used in the
-* Discover request
-*
-* @method getType
-* @return int One of the DISCOVER_XXX, DBSCHEMA_XXX or MDSCHEMA_XXX constants
-*/
- getType: function(){
- return this._type;
- },
-/**
-* Retrieve an array of fieldDef objects that describes the fields of the rows in this rowset.
-* The position of the fieldDef objects in the array corresponds to the column order of the rowset.
-* For a description of the fieldDef object, see the
-* fieldDef() method.
-*
-* @method getFields
-* @return {[fieldDef]} An (ordered) array of field definition objects.
-*/
- getFields: function(){
- var f = [],
- i, n = this._fieldCount,
- fieldOrder = this.fieldOrder
- ;
- for (i = 0; i < n; i++) f[i] = this.fieldDef(fieldOrder[i]);
- return f;
- },
-/**
-* Retrieve an array of field names.
-* The position of the names in the array corresponds to the column order of the rowset.
-*
-* @method getFieldNames
-* @return {[string]} An (ordered) array of field names.
-*/
- getFieldNames: function(){
- var fieldNames = [], i, n = this._fieldCount;
- for (i = 0; i < n; i++) fieldNames[i] = this.fieldOrder[i];
- return fieldNames;
- },
-/**
-* Indicates wheter the rowset can still be traversed.
-* You can use this method together with the
-* nextRow() method
-* to drive a while loop to traverse all rows in the rowset, like so:
-
- while(rowset.hasMoreRows()){
- ...process row...
- rowsete.nextRow();
- }
-
-* @method hasMoreRows
-* @return {bool} true in case there are more rows to traverse. false if all rows have been traversed.
-*/
- hasMoreRows: function(){
- return this.numRows > this.rowIndex;
- },
-/**
-* Moves the internal row index to the next row.
-* You can use this method together with the
-* hasMoreRows() method
-* to drive a while loop to traverse all rows in the rowset.
-*
-* @method nextRow
-*/
- nextRow: function(){
- this.rowIndex++;
- this._row = this._rows[this.rowIndex];
- return this.rowIndex;
- },
-/**
-* This method is deprecated and may be removed in the future.
-* Use nextRow() instead.
-* @method next
-*/
- next: function(){
- return this.nextRow();
- },
-/**
-* Walks through all rows, and calls the callback function for each row.
-* -*The callback function gets passed an object that represents the row. -* The keys of the row object are the column names, and the values are the respective column values.
-*The scope for calling the callback can be passed as the second argument to this method.
-* If the scope is not defined (or if it is null), the Rowset's this pointer is used instead.
You can pass additional data to the callback by passing in a third argument. This is then passed as is as second argument to the callback.
-* -*The eachRow method will iterate untill the callback returns false, or until all rows have been traversed.
-* If the callback returns false, iteration is aborted and eachRow as a whole returns false too.
-* If iteration is not aborted, then eachRow returns true.
hasMoreRows().
-*
-* @method curr
-* @return int
-*/
- currRow: function(){
- return this.rowIndex;
- },
-/**
-* Returns the number of rows in the set.
-*
-* @method rowCount
-* @return int
-*/
- rowCount: function(){
- return this.numRows;
- },
-/**
-* Resets the internal row pointer so the resultset can be traversed again.
-*
-* @method reset
-*/
- reset: function(){
- this.rowIndex = 0;
- this._row = (this.hasMoreRows()) ? this._rows[this.rowIndex] : null;
- },
-/**
-* Retrieves a fieldDef object by name.
-* A fieldDef describes a field (column). It has the following properties:
-* name argument passed to the fieldDef() method.fieldDef object that matches the argument.
-*/
- fieldDef: function(name){
- var field = this.fields[name];
- if (!field)
- Xmla.Exception._newError(
- "INVALID_FIELD",
- "Xmla.Rowset.fieldDef",
- name
- )._throw();
- return field;
- },
-/**
-* Retrieves the index of a field by name.
-* Field indexes start at 0.
-* @method fieldIndex
-* @param {string} name The name of the field for which you want to retrieve the index.
-* @return {int} The ordinal position (starting at 0) of the field that matches the argument.
-*/
- fieldIndex: function(name){
- return this.fieldDef(name).index;
- },
-/**
-* Retrieves the name of a field by field Index.
-* Field indexes start at 0.
-* @method fieldName
-* @param {string} name The name of the field for which you want to retrieve the index.
-* @return {int} The ordinal position (starting at 0) of the field that matches the argument.
-*/
- fieldName: function(index){
- var fieldName = this.fieldOrder[index];
- if (!fieldName)
- Xmla.Exception._newError(
- "INVALID_FIELD",
- "Xmla.Rowset.fieldDef",
- index
- )._throw();
- return fieldName;
- },
-/**
-* Retrieves a value from the current row for the field having the name specified by the argument.
-* @method fieldVal
-* @param {string | int} name The name or the index of the field for which you want to retrieve the value.
-* @return {array|boolean|float|int|string} From the current row, the value of the field that matches the argument.
-*/
- fieldVal: function(name){
- if (_isNum(name)) name = this.fieldName(name);
- return this.fieldDef(name).getter.call(this);
- },
-/**
-* Returns the number of fields in this rowset.
-* @method fieldCount
-* @return {int} The number of fields in this rowset.
-*/
- fieldCount: function(){
- return this._fieldCount;
- },
-/**
-* Releases references to the DomDocument passed to the Rowset constructor.
-* This should facilitate automatic garbage collection by the browser.
-* @method close
-*/
- close: function(){
- this._node = null;
- this._row = null;
- this._rows = null;
- },
-/**
-* Reads the current row and returns the result as a new array.
-* This method does not advance the internal row pointer, and does not check if there is a valid row.
-* This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
-* fetchCustom() method.
-* If you just want to obtain the results as arrays, see
-* fetchAsArray()
-* and
-* fetchAllAsArray().
-* @method readAsArray
-* @return {array}
-*/
- readAsArray: function(array){
- var fields = this.fields, fieldName, fieldDef;
- if (!array) array = [];
- for (fieldName in fields){
- if (fields.hasOwnProperty(fieldName)){
- fieldDef = fields[fieldName];
- array[fieldDef.index] = fieldDef.getter.call(this);
}
- }
- return array;
- },
-/**
-* Fetch all values from all fields from the current row, and return it in an array.
-* The position of the values in the array corresponds to the column order of the rowset.
-* The internal row pointer is also increased so the next call will read the next row.
-* The method returns false when there are no more rows to traverse.
-* You can use this method to drive a loop to travere all rows in the Rowset:
-
-while (rowArray = rowset.fetchAsArray()){
- ...process array...
-}
-
-* @method fetchAsArray
-* @return {array}
-*/
- fetchAsArray: function(array){
- if (this.hasMoreRows()) {
- array = this.readAsArray(array);
- this.nextRow();
- }
- else array = false;
- return array;
- },
-/**
-* Reads the current row and returns the result as a new object.
-* This method does not advance the internal row pointer, and does not check if there is a valid row.
-* This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
-* fetchCustom() method.
-* If you just want to obtain the results as objects, see
-* fetchAsObject()
-* and
-* fetchAllAsObject().
-* @method readAsObject
-* @return {object}
-*/
- readAsObject: function(object){
- var fields = this.fields, fieldName, fieldDef;
- if (!object) object = {};
- for (fieldName in fields) {
- if (fields.hasOwnProperty(fieldName)) {
- fieldDef = fields[fieldName];
- object[fieldName] = fieldDef.getter.call(this);
+ this._numAxes = this._axesOrder.length;
+ },
+ _initCells: function(){
+ this._cellset = new Xmla.Dataset.Cellset(this);
+ },
+ /**
+ * Get the number of proper axes in this Dataset. This is the number of axes that appears in the SELECT list, and excludes the slicer axis.
+ * @method axisCount
+ * @return {int}
+ */
+ axisCount: function(){
+ return this._numAxes;
+ },
+ _getAxis: function(nameOrIndex) {
+ var name, axis;
+ switch (typeof(nameOrIndex)) {
+ case "number":
+ axis = this._axesOrder[nameOrIndex];
+ break;
+ case "string":
+ axis = (name === Xmla.Dataset.AXIS_SLICER) ? this._slicer : this._axes[name];
+ break;
}
- }
- return object;
- },
-/**
-* Fetch all values from all fields from the current row, and return it in an Object literal.
-* The property names of the returned object correspond to the fieldName (actually the fieldLabel), and the field value is assigned to its respective property.
-* The internal row pointer is also increased so the next call will read the next row.
-* The method returns false when there are no more rows to traverse.
-* You can use this method to drive a loop to travere all rows in the Rowset:
-
-while (rowObject = rowset.fetchAsObject()){
- ...process object...
-}
-
-* @method fetchAsObject
-* @return {Object|boolean}
-*/
- fetchAsObject: function(object){
- if (this.hasMoreRows()){
- object = this.readAsObject(object);
- this.nextRow();
- }
- else object = false;
- return object;
- },
-/**
-* Fetch the values using a custom callback function.
-* If there are rows to fetch, the custom function is called in scope of the rowset, so you can use this inside the custom function to refer to the rowset object.
-* Then, the internal row pointer is increased so the next call will read the next row.
-* The method returns whatever object or value is returned by the custom function, or false when there are no more rows to traverse.
-*
-* @method fetchCustom
-* @param func {function} a custom function to extract and return the data from the current row of the xml result.
-* @param args {object} an object that will be passed to the function. Useful to hold any data required in addition to the rowset itself (which can be referred to as this inside the function).
-* @return {mixed|boolean}
-*/
- fetchCustom: function(func, args){
- var object;
- if (this.hasMoreRows()){
- object = func.call(this, args);
- this.nextRow();
- }
- else object = false;
- return object;
- },
-/**
-* Fetch all values from all fields from all rows, and return it as an array of arrays.
-* See fetchAsArray().
-* @method fetchAllAsArray
-* @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
-* @return {array}
-*/
- fetchAllAsArray: function(rows){
- var row;
- if (!rows) rows = [];
- while((row = this.fetchAsArray())) rows.push(row);
- return rows;
- },
-/**
-* Fetch all values from all fields from all rows, and return it as an array of objects.
-* See fetchAsObject().
-* @method fetchAllAsObject
-* @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
-* @return {array}
-*/
- fetchAllAsObject: function(rows){
- var row;
- if (!rows) rows = [];
- while((row = this.fetchAsObject())) rows.push(row);
- return rows;
- },
-/**
-* Fetch all rows using a custom function, and return the return values as an array.
-* See fetchCustom().
-* @method fetchAllCustom
-* @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
-* @param func {function} a callback function to extract the fields.
-* @param args {object} an object to pass data to the callback.
-* @return {array}
-*/
- fetchAllCustom: function(rows, func, args){
- var row;
- if (!rows) rows = [];
- while((row = this.fetchCustom(func, args))) rows.push(row);
- return rows;
- },
-/**
-* Fetch all row as an object, store it in nested objects according to values in the column identified by the key argument.
-* This method should typically not be called directly, rather it is a helper method for mapAllAsObject().
-*
-* @method mapAsObject
-* @param map
-* @param key
-* @param row
-* @return {object} a tree using column values as branch names, and storing a row or an array of rows at the leaves.
-*/
- mapAsObject: function(map, key, row){
- var k, v, p, i, len = key.length, last = len - 1, m = map;
- for (i = 0; i < len; i++){
- k = key[i]; //get the keypart
- v = row[k]; //get the value for the key part
- p = m[v]; //get the property from the map for this keypart.
- if (p) {
- if (i === last) { //last, we need to store the row now.
- if (_isArr(p)) p.push(row); //already entries here, append
- else m[v] = [p, row]; //single row store here. since we need multiple rows, add an array
- }
- else m = p;
+ return axis;
+ },
+ /**
+ * Get the axis specified by the argument index or name.
+ * If the axis does not exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasAxis() method to determine if the axis exists.
+ * Alternatively, you can call axisCount(), and use an integer argument between zero (inclusive) and axis count (exclusive).
+ * @method getAxis
+ * @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the AXIS_xxx constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form AxisN where N is an ordinal that identifies the axis.
+ * @return {Xmla.Dataset.Axis} The Xmla.Dataset.Axis object that corresponds to the argument.
+ */
+ getAxis: function(nameOrIndex){
+ if (nameOrIndex === Xmla.Dataset.AXIS_SLICER) return this._slicer;
+ var axis = this._getAxis(nameOrIndex);
+ if (!axis)
+ Xmla.Exception._newError(
+ "INVALID_AXIS",
+ "Xmla.Dataset.getAxis",
+ nameOrIndex
+ )._throw();
+ return axis;
+ },
+ /**
+ * Determine if the axis specified by the argument exists.
+ * @method hasAxis
+ * @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the AXIS_xxx constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form AxisN where N is an ordinal that identifies the axis.
+ * @return {boolean} true if the specified axis exists, false if it doesn't exist.
+ */
+ hasAxis: function(nameOrIndex) {
+ var axis = this._getAxis(nameOrIndex);
+ return !_isUnd(axis);
+ },
+ /**
+ * Get the Column axis. This is the first axis, and has ordinal 0. If the column axis doesn't exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasColumnAxis() method to determine if the axis exists.
+ * @method getColumnAxis
+ * @return {Xmla.Dataset.Axis} The column Xmla.Dataset.Axis object.
+ */
+ getColumnAxis: function(){
+ return this.getAxis(Xmla.Dataset.AXIS_COLUMNS);
+ },
+ /**
+ * Determine if the column axis exists.
+ * @method hasColumnAxis
+ * @return {boolean} true if the column axis exists, false if it doesn't exist.
+ */
+ hasColumnAxis: function(){
+ return this.hasAxis(Xmla.Dataset.AXIS_COLUMNS);
+ },
+ /**
+ * Get the Row axis. This is the second axis, and has ordinal 1. If the row axis doesn't exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasRowAxis() method to determine if the axis exists.
+ * @method getRowAxis
+ * @return {Xmla.Dataset.Axis} The row Xmla.Dataset.Axis object.
+ */
+ getRowAxis: function(){
+ return this.getAxis(Xmla.Dataset.AXIS_ROWS);
+ },
+ /**
+ * Determine if the row axis exists.
+ * @method hasRowAxis
+ * @return {boolean} true if the row axis exists, false if it doesn't exist.
+ */
+ hasRowAxis: function(){
+ return this.hasAxis(Xmla.Dataset.AXIS_ROWS);
+ },
+ /**
+ * Get the Page axis. This is the third axis, and has ordinal 2. If the page axis doesn't exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasPageAxis() method to determine if the axis exists.
+ * @method getPageAxis
+ * @return {Xmla.Dataset.Axis} The page Xmla.Dataset.Axis object.
+ */
+ getPageAxis: function(){
+ return this.getAxis(Xmla.Dataset.AXIS_PAGES);
+ },
+ /**
+ * Determine if the page axis exists.
+ * @method hasPageAxis
+ * @return {boolean} true if the page axis exists, false if it doesn't exist.
+ */
+ hasPageAxis: function(){
+ return this.hasAxis(Xmla.Dataset.AXIS_PAGES);
+ },
+ /**
+ * Get the Chapter axis. This is the fourth axis, and has ordinal 3. If the chapter axis doesn't exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasChapterAxis() method to determine if the axis exists.
+ * @method getChapterAxis
+ * @return {Xmla.Dataset.Axis} The chapter Xmla.Dataset.Axis object.
+ */
+ getChapterAxis: function(){
+ return this.getAxis(Xmla.Dataset.AXIS_CHAPTERS);
+ },
+ /**
+ * Determine if the chapter axis exists.
+ * @method hasChapterAxis
+ * @return {boolean} true if the chapter axis exists, false if it doesn't exist.
+ */
+ hasChapterAxis: function(){
+ return this.hasAxis(Xmla.Dataset.AXIS_CHAPTERS);
+ },
+ /**
+ * Get the Section axis. This is the fifth axis, and has ordinal 4. If the section axis doesn't exist, an INVALID_AXIS exception is thrown.
+ * To prevent an exception from being thrown, you should call the hasSectionAxis() method to determine if the axis exists.
+ * @method getSectionAxis
+ * @return {Xmla.Dataset.Axis} The section Xmla.Dataset.Axis object.
+ */
+ getSectionAxis: function(){
+ return this.getAxis(Xmla.Dataset.AXIS_SECTIONS);
+ },
+ /**
+ * Determine if the section axis exists.
+ * @method hasSectionAxis
+ * @return {boolean} true if the section axis exists, false if it doesn't exist.
+ */
+ hasSectionAxis: function(){
+ return this.hasAxis(Xmla.Dataset.AXIS_SECTIONS);
+ },
+ /**
+ * Get the Slicer axis. This is the axis that appears in the WHERE clause of the MDX statement.
+ * @method getSlicerAxis
+ * @return {Xmla.Dataset.Axis} The slicer Xmla.Dataset.Axis object.
+ */
+ getSlicerAxis: function(){
+ return this._slicer;
+ },
+ /**
+ * Determine if the slicer axis exists.
+ * @method hasSlicerAxis
+ * @return {boolean} true if the slicer axis exists, false if it doesn't exist.
+ */
+ hasSlicerAxis: function(){
+ return this._slicer !== null;
+ },
+ /**
+ * Get the Cellset object.
+ * @method getCellset
+ * @return {Xmla.Dataset.Cellset} The Xmla.Dataset.Cellset object.
+ */
+ getCellset: function(){
+ return this._cellset;
+ },
+ /**
+ * Calculate the cellset ordinal for the argument tuple indexes.
+ *This method accepts a variable number of tuple indexes. One integer argument must be passed for each proper axis (excluding the slicer axis). + * Each integer arguments represent the index of a tuple on the respective axis.
+ *The arguments must be specified by descending axis order. So if the data set has two axes (a row and a column axis), + * this method expects the tuple index of a tuple on the row axis first, and after that, the tuple index on the column axis.
+ *The method returns an integer that represents the ordinal of the cell identified by the tuples specified by the tuple index arguments.
+ * One could use this ordinal as argument to the getByOrdinal() method of this Dataset's Cellset.
Instead of calling this method and passing the result into the Cellsets getByOrdinal() method,
+ * you can call the getByTupleIndexes() method of this Dataset's Cellset.
Xmla.Dataset.Cellset that belongs to the tuples identified by the arguments.
+ */
+ cellOrdinalForTupleIndexes: function() {
+ var numAxes = this._numAxes, axesOrder = this._axesOrder, i, ordinal = 0, a, arg, j, tupleCount;
+ //for each axis, in descending order
+ for (a = 0, i = numAxes - 1; i >= 0; i--, a++) {
+ arg = arguments[a];
+ tupleCount = 1;
+ //for all preceding axes, in descending order
+ for (j = i-1; j >= 0; j--) {
+ tupleCount *= axesOrder[j].tupleCount();
}
- else //property didnt exist for this key yet.
- if (i === last) m[v] = row; //last keypart: store the row here
- else m = m[v] = {}; //more keyparts to go: add a new map for this keypart
- }
- },
-/**
-* Fetch all rows as an object, store them as proprties in an object (which acts as map).
-* @method mapAllAsObject
-* @param key {string|array} OPTIONAL. A column name or an array of column names that will be used to generate property names for the map. If not specified, the default key is used. If there is no default key, all column names will be used.
-* @param map {object} OPTIONAL. The object that is used as map. Rows are added as properties to this map. If not specified, a new object is created
-* @return {object}
-*/
- mapAllAsObject: function(key, map){
- if (!map) map = {};
- if (!key) key = this.getKey();
- var row;
- while (row = this.fetchAsObject()) this.mapAsObject(map, key, row);
- return map;
- },
-
-/*
-* Find a key for the resultset type.
-*/
- getKey: function(){
- return (this._type) ? Xmla.Rowset.KEYS[this._type] : this.getFieldNames();
- }
-};
-
-/**
-* -* This class implements an XML/A multidimensional Dataset object. -*
-*
-* You do not need to instantiate objects of this class yourself.
-* Rather, the Xmla class will instantiate this class
-* to convey the result of the executeMultiDimensional method
-* (see executeMultiDimensional()),
-* and possibly the execute method.
-* (Note that the execute() instantiates either the
-* Xmla.Rowset or the Xmla.Dataset class
-* depending on the value of the Format property in the options passed to the execute() method.)
-*
-* An instance of the Xmla.Dataset class may be returned immediately as return value from these methods when doing a synchronous request.
-* In addition, the Xmla.Dataset object is available in the eventdata passed to any registered listeners
-* (see addListener()).
-*
Execute request.
-*/
-Xmla.Dataset = function(doc){
- if (typeof(doc) === "string") {
- doc = _xjs(doc);
- }
- this._initDataset(doc);
- return this;
-}
-
-/**
-* Can be used as argument for getAxis() to get the first axis (the column axis).
-* Alternatively you can simply call getColumnAxis()
-* @property AXIS_COLUMNS
-* @static
-* @final
-* @type int
-* @default 0
-*/
-Xmla.Dataset.AXIS_COLUMNS = 0;
-/**
-* Can be used as argument for getAxis() to get the second axis (the row axis).
-* Alternatively you can simply call getRowAxis()
-* @property AXIS_ROWS
-* @static
-* @final
-* @type int
-* @default 1
-*/
-Xmla.Dataset.AXIS_ROWS = 1;
-/**
-* Can be used as argument for getAxis() to get the third axis (the page axis).
-* Alternatively you can simply call getPageAxis()
-* @property AXIS_PAGES
-* @static
-* @final
-* @type int
-* @default 2
-*/
-Xmla.Dataset.AXIS_PAGES = 2;
-/**
-* Can be used as argument for getAxis() to get the fourth axis (the section axis).
-* Alternatively you can simply call getSectionAxis()
-* @property AXIS_SECTIONS
-* @static
-* @final
-* @type int
-* @default 3
-*/
-Xmla.Dataset.AXIS_SECTIONS = 3;
-/**
-* Can be used as argument for getAxis() to get the fifth axis (the chapters axis).
-* Alternatively you can simply call getChapterAxis()
-* @property AXIS_CHAPTERS
-* @static
-* @final
-* @type int
-* @default 4
-*/
-Xmla.Dataset.AXIS_CHAPTERS = 4;
-/**
-* Can be used as argument for getAxis() to get the slicer axis
-* (the axis that appears in the WHERE clause of an MDX-SELECT statement).
-* Alternatively you can simply call getSlicerAxis()
-* @property AXIS_SLICER
-* @static
-* @final
-* @type string
-* @default SlicerAxis
-*/
-Xmla.Dataset.AXIS_SLICER = "SlicerAxis";
-
-Xmla.Dataset.prototype = {
- _root: null,
- _axes: null,
- _axesOrder: null,
- _numAxes: null,
- _slicer: null,
- _cellset:null,
- _initDataset: function(doc){
- this._initRoot(doc);
- this.cubeName = _getElementText(
- _getElementsByTagNameNS(
- this._root, _xmlnsDataset, "", "CubeName"
- )[0]
- );
- this._initAxes();
- this._initCells();
-/*
- var a, i, j, func, funcBody = "", mul;
- func = "var ordinal = 0, a;" +
- "\nif (arguments.length !== " + this._numAxes + ") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();"
- for (a = 0, i = this._numAxes-1; i >= 0; i--, a++) {
- func += "\nif (typeof(a = arguments[" + a + "])!==\"number\") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();";
- mul = 1;
- for (j = i-1; j >= 0; j--) mul *= this._axesOrder[j].tupleCount();
- func += "\nordinal += a ";
- if (i) func += "* " + mul + ";";
- }
- func += funcBody + "\nreturn ordinal;"
- this._cellset.cellOrdinalForTupleIndexes = this.cellOrdinalForTupleIndexes = new Function(func);
-*/
- },
- _initRoot: function(doc){
- var root = _getElementsByTagNameNS(doc, _xmlnsDataset, "", "root");
- if (root.length) this._root = root[0];
- else
- Xmla.Exception._newError(
- "ERROR_PARSING_RESPONSE",
- "Xmla.Dataset._initData",
- doc
- )._throw();
- },
- _initAxes: function(){
- var i, axis, axisNode, axisName, axisNodes, numAxisNodes, tmpAxes = {};
-
- this._axes = {};
- this._axesOrder = [];
-
- //collect the axisInfo nodes
- axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "AxisInfo");
- numAxisNodes = axisNodes.length;
- for (i = 0; i < numAxisNodes; i++) {
- axisNode = axisNodes[i];
- axisName = _getAttribute(axisNode, "name");
- tmpAxes[axisName] = axisNode;
- }
- //collect the axis nodes
- axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "Axis");
- numAxisNodes = axisNodes.length;
- for (i = 0; i < numAxisNodes; i++){
- axisNode = axisNodes[i];
- axisName = _getAttribute(axisNode, "name");
- axis = new Xmla.Dataset.Axis(this, tmpAxes[axisName], axisNode, axisName, i);
- if (axisName === Xmla.Dataset.AXIS_SLICER) this._slicer = axis;
- else {
- this._axes[axisName] = axis;
- this._axesOrder.push(axis);
+ ordinal += arg * tupleCount;
+ }
+ return ordinal;
+ },
+ /**
+ * Gets all of the XML data into one JS object. The object consists of the following members:
+ * axes: An array of objects that represent the query axes (but not the slicer axis).
+ * Each axis has a positions member which is an array of tuples, and a hierarchies member, which is an array of hierarchies.slicerAxis: An object that represents the slicer axis, or null if there is no slicer axis.cells: An array of cell objects, representing the cellset.SELECT list, and excludes the slicer axis.
-* @method axisCount
-* @return {int}
-*/
- axisCount: function(){
- return this._numAxes;
- },
- _getAxis: function(nameOrIndex) {
- var name, axis;
- switch (typeof(nameOrIndex)) {
- case "number":
- axis = this._axesOrder[nameOrIndex];
- break;
- case "string":
- axis = (name === Xmla.Dataset.AXIS_SLICER) ? this._slicer : this._axes[name];
- break;
- }
- return axis;
- },
-/**
-* Get the axis specified by the argument index or name.
-* If the axis does not exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasAxis() method to determine if the axis exists.
-* Alternatively, you can call axisCount(), and use an integer argument between zero (inclusive) and axis count (exclusive).
-* @method getAxis
-* @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the AXIS_xxx constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form AxisN where N is an ordinal that identifies the axis.
-* @return {Xmla.Dataset.Axis} The Xmla.Dataset.Axis object that corresponds to the argument.
-*/
- getAxis: function(nameOrIndex){
- if (nameOrIndex === Xmla.Dataset.AXIS_SLICER) return this._slicer;
- var axis = this._getAxis(nameOrIndex);
- if (!axis)
- Xmla.Exception._newError(
- "INVALID_AXIS",
- "Xmla.Dataset.getAxis",
- nameOrIndex
- )._throw();
- return axis;
- },
-/**
-* Determine if the axis specified by the argument exists.
-* @method hasAxis
-* @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the AXIS_xxx constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form AxisN where N is an ordinal that identifies the axis.
-* @return {boolean} true if the specified axis exists, false if it doesn't exist.
-*/
- hasAxis: function(nameOrIndex) {
- var axis = this._getAxis(nameOrIndex);
- return !_isUnd(axis);
- },
-/**
-* Get the Column axis. This is the first axis, and has ordinal 0. If the column axis doesn't exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasColumnAxis() method to determine if the axis exists.
-* @method getColumnAxis
-* @return {Xmla.Dataset.Axis} The column Xmla.Dataset.Axis object.
-*/
- getColumnAxis: function(){
- return this.getAxis(Xmla.Dataset.AXIS_COLUMNS);
- },
-/**
-* Determine if the column axis exists.
-* @method hasColumnAxis
-* @return {boolean} true if the column axis exists, false if it doesn't exist.
-*/
- hasColumnAxis: function(){
- return this.hasAxis(Xmla.Dataset.AXIS_COLUMNS);
- },
-/**
-* Get the Row axis. This is the second axis, and has ordinal 1. If the row axis doesn't exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasRowAxis() method to determine if the axis exists.
-* @method getRowAxis
-* @return {Xmla.Dataset.Axis} The row Xmla.Dataset.Axis object.
-*/
- getRowAxis: function(){
- return this.getAxis(Xmla.Dataset.AXIS_ROWS);
- },
-/**
-* Determine if the row axis exists.
-* @method hasRowAxis
-* @return {boolean} true if the row axis exists, false if it doesn't exist.
-*/
- hasRowAxis: function(){
- return this.hasAxis(Xmla.Dataset.AXIS_ROWS);
- },
-/**
-* Get the Page axis. This is the third axis, and has ordinal 2. If the page axis doesn't exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasPageAxis() method to determine if the axis exists.
-* @method getPageAxis
-* @return {Xmla.Dataset.Axis} The page Xmla.Dataset.Axis object.
-*/
- getPageAxis: function(){
- return this.getAxis(Xmla.Dataset.AXIS_PAGES);
- },
-/**
-* Determine if the page axis exists.
-* @method hasPageAxis
-* @return {boolean} true if the page axis exists, false if it doesn't exist.
-*/
- hasPageAxis: function(){
- return this.hasAxis(Xmla.Dataset.AXIS_PAGES);
- },
-/**
-* Get the Chapter axis. This is the fourth axis, and has ordinal 3. If the chapter axis doesn't exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasChapterAxis() method to determine if the axis exists.
-* @method getChapterAxis
-* @return {Xmla.Dataset.Axis} The chapter Xmla.Dataset.Axis object.
-*/
- getChapterAxis: function(){
- return this.getAxis(Xmla.Dataset.AXIS_CHAPTERS);
- },
-/**
-* Determine if the chapter axis exists.
-* @method hasChapterAxis
-* @return {boolean} true if the chapter axis exists, false if it doesn't exist.
-*/
- hasChapterAxis: function(){
- return this.hasAxis(Xmla.Dataset.AXIS_CHAPTERS);
- },
-/**
-* Get the Section axis. This is the fifth axis, and has ordinal 4. If the section axis doesn't exist, an INVALID_AXIS exception is thrown.
-* To prevent an exception from being thrown, you should call the hasSectionAxis() method to determine if the axis exists.
-* @method getSectionAxis
-* @return {Xmla.Dataset.Axis} The section Xmla.Dataset.Axis object.
-*/
- getSectionAxis: function(){
- return this.getAxis(Xmla.Dataset.AXIS_SECTIONS);
- },
-/**
-* Determine if the section axis exists.
-* @method hasSectionAxis
-* @return {boolean} true if the section axis exists, false if it doesn't exist.
-*/
- hasSectionAxis: function(){
- return this.hasAxis(Xmla.Dataset.AXIS_SECTIONS);
- },
-/**
-* Get the Slicer axis. This is the axis that appears in the WHERE clause of the MDX statement.
-* @method getSlicerAxis
-* @return {Xmla.Dataset.Axis} The slicer Xmla.Dataset.Axis object.
-*/
- getSlicerAxis: function(){
- return this._slicer;
- },
-/**
-* Determine if the slicer axis exists.
-* @method hasSlicerAxis
-* @return {boolean} true if the slicer axis exists, false if it doesn't exist.
-*/
- hasSlicerAxis: function(){
- return this._slicer !== null;
- },
-/**
-* Get the Cellset object.
-* @method getCellset
-* @return {Xmla.Dataset.Cellset} The Xmla.Dataset.Cellset object.
-*/
- getCellset: function(){
- return this._cellset;
- },
-/**
-* Calculate the cellset ordinal for the argument tuple indexes.
-*This method accepts a variable number of tuple indexes. One integer argument must be passed for each proper axis (excluding the slicer axis). -* Each integer arguments represent the index of a tuple on the respective axis.
-*The arguments must be specified by descending axis order. So if the data set has two axes (a row and a column axis), -* this method expects the tuple index of a tuple on the row axis first, and after that, the tuple index on the column axis.
-*The method returns an integer that represents the ordinal of the cell identified by the tuples specified by the tuple index arguments.
-* One could use this ordinal as argument to the getByOrdinal() method of this Dataset's Cellset.
Instead of calling this method and passing the result into the Cellsets getByOrdinal() method,
-* you can call the getByTupleIndexes() method of this Dataset's Cellset.
Xmla.Dataset.Cellset that belongs to the tuples identified by the arguments.
-*/
- cellOrdinalForTupleIndexes: function() {
- var numAxes = this._numAxes, axesOrder = this._axesOrder, i, ordinal = 0, a, arg, j, tupleCount;
- //for each axis, in descending order
- for (a = 0, i = numAxes - 1; i >= 0; i--, a++) {
- arg = arguments[a];
- tupleCount = 1;
- //for all preceding axes, in descending order
- for (j = i-1; j >= 0; j--) {
- tupleCount *= axesOrder[j].tupleCount();
- }
- ordinal += arg * tupleCount;
- }
- return ordinal;
- },
-/**
- * Gets all of the XML data into one JS object. The object consists of the following members:
- * axes: An array of objects that represent the query axes (but not the slicer axis).
- * Each axis has a positions member which is an array of tuples, and a hierarchies member, which is an array of hierarchies.slicerAxis: An object that represents the slicer axis, or null if there is no slicer axis.cells: An array of cell objects, representing the cellset.+ * This class implements an Axis object. + *
+ *
+ * You do not need to instantiate objects of this class yourself.
+ * Rather, the Xmla.Dataset class creates instances of this class to represent the axes of an MDX query.
+ * (see getAxis().)
+ *
+ * @class Xmla.Dataset.Axis
+ * @constructor
+ */
+ Xmla.Dataset.Axis = function(_dataset, _axisInfoNode, _axisNode, name, id){
+ this._dataset = _dataset;
+ this._initAxis(_axisInfoNode, _axisNode);
+ this.name = name;
+ this.id = id;
+ return this;
}
-};
-
-/**
-*
-* This class implements an Axis object. -*
-*
-* You do not need to instantiate objects of this class yourself.
-* Rather, the Xmla.Dataset class creates instances of this class to represent the axes of an MDX query.
-* (see getAxis().)
-*
-* @class Xmla.Dataset.Axis
-* @constructor
-*/
-Xmla.Dataset.Axis = function(_dataset, _axisInfoNode, _axisNode, name, id){
- this._dataset = _dataset;
- this._initAxis(_axisInfoNode, _axisNode);
- this.name = name;
- this.id = id;
- return this;
-}
-
-/**
-* The name of the standard member property that contains the unique name for this member.
-* See Ole DB standard for more information.
-* @property MEMBER_UNIQUE_NAME
-* @static
-* @final
-* @type string
-* @default Uname
-*/
-Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME = "UName";
-/**
-* The name of the standard member property that contains the caption for this member.
-* See Ole DB standard for more information.
-* @property MEMBER_CAPTION
-* @static
-* @final
-* @type string
-* @default Caption
-*/
-Xmla.Dataset.Axis.MEMBER_CAPTION = "Caption";
-/**
-* The name of the standard member property that contains the name of the level for this member.
-* See Ole DB standard for more information.
-* @property MEMBER_LEVEL_NAME
-* @static
-* @final
-* @type string
-* @default LName
-*/
-Xmla.Dataset.Axis.MEMBER_LEVEL_NAME = "LName";
-/**
-* The name of the standard member property that contains the number of the level for this member.
-* See Ole DB standard for more information.
-* @property MEMBER_LEVEL_NUMBER
-* @static
-* @final
-* @type string
-* @default LNum
-*/
-Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER = "LNum";
-/**
-* The name of the member property that contains displayinfo for this member.
-* See Ole DB standard for more information.
-* @property MEMBER_DISPLAY_INFO
-* @static
-* @final
-* @type string
-* @default LNum
-*/
-Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO = "DisplayInfo";
-/**
-* The default mem ber properties for members
-* See Ole DB standard for more information.
-* @property DefaultMemberProperties
-* @static
-* @final
-* @type array
-*/
-Xmla.Dataset.Axis.DefaultMemberProperties = [
- Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME,
- Xmla.Dataset.Axis.MEMBER_CAPTION,
- Xmla.Dataset.Axis.MEMBER_LEVEL_NAME,
- Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER,
- Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO
-];
-
-/**
-* A constant that can be used as a bitmask for a member's DisplayInfo property.
-* Bitwise AND-ing this mask to the member's DisplayInfo property returns an estimate of the number of children of this member.
-* @property MDDISPINFO_CHILDREN_CARDINALITY
-* @static
-* @final
-* @type int
-* @default 65535
-*/
-Xmla.Dataset.Axis.MDDISPINFO_CHILDREN_CARDINALITY = 65535;
-/**
-* A constant that can be used as a bitmask for a member's DisplayInfo property.
-* If this bit is set, it means the member is drilled down.
-* This is the case whenever at least one child of this member appears on the axis immediately following this member.
-* @property MDDISPINFO_DRILLED_DOWN
-* @static
-* @final
-* @type int
-* @default 65536
-*/
-Xmla.Dataset.Axis.MDDISPINFO_DRILLED_DOWN = 65536;
-/**
-* A constant that can be used as a bitmask for a member's DisplayInfo property.
-* If this bit is set, it means this member has the same parent as the member immediately preceding this member.
-* @property MDDISPINFO_SAME_PARENT_AS_PREV
-* @static
-* @final
-* @type int
-* @default 131072
-*/
-Xmla.Dataset.Axis.MDDISPINFO_SAME_PARENT_AS_PREV = 131072;
-
-Xmla.Dataset.Axis.prototype = {
-/**
-* The 0-based id of the axis.
-* @property id
-* @type int
-*/
- id: -1,
-/**
-* The name of the axis.
-* @property name
-* @type string
-*/
- name: null,
- _dataset: null,
- _tuples: null,
- _members: null,
- _memberProperties: null,
- numTuples: null,
- numHierarchies: null,
- _tupleIndex: null,
- _hierarchyIndex: null,
- _hierarchyOrder: null,
- _hierarchyDefs: null,
- _hierarchyIndexes: null,
- _initHierarchies: function(_axisInfoNode){
- var hierarchyInfoNodes = _getElementsByTagNameNS(
- _axisInfoNode,
- _xmlnsDataset,
- "",
- "HierarchyInfo"
- ),
- numHierarchies = hierarchyInfoNodes.length,
- i, j, hierarchyInfoNode, hierarchyName,
- hierarchyDef, properties, numPropertyNodes, propertyNodes, propertyNode,
- nodeName, type, memberProperty, memberProperties = this._memberProperties,
- converter
- ;
- this._hierarchyDefs = {};
- this._hierarchyOrder = [];
- this._hierarchyIndexes = {};
- this.numHierarchies = numHierarchies;
- var propertyTagName, propertyName;
- for (i = 0; i < numHierarchies; i++){
- hierarchyInfoNode = hierarchyInfoNodes[i];
- hierarchyName = _getAttribute(hierarchyInfoNode, "name");
- this._hierarchyOrder[i] = hierarchyName;
- this._hierarchyIndexes[hierarchyName] = i;
- hierarchyDef = {
- index: i,
- name: hierarchyName,
- properties: properties = {}
- };
- propertyNodes = _getElementsByTagNameNS(hierarchyInfoNode, _xmlnsDataset, "", "*");
- numPropertyNodes = propertyNodes.length;
- for (j = 0; j < numPropertyNodes; j++) {
- propertyNode = propertyNodes[j];
- nodeName = propertyNode.nodeName;
- //note: MSAS doesn't seem to include a type for custom properties
- type = _getAttribute(propertyNode, "type");
- if (!type) {
- memberProperty = memberProperties[nodeName];
- if (memberProperty) {
- type = memberProperty.type;
- }
- else {
- switch (nodeName) {
+
+ /**
+ * The name of the standard member property that contains the unique name for this member.
+ * See Ole DB standard for more information.
+ * @property MEMBER_UNIQUE_NAME
+ * @static
+ * @final
+ * @type string
+ * @default Uname
+ */
+ Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME = "UName";
+ /**
+ * The name of the standard member property that contains the caption for this member.
+ * See Ole DB standard for more information.
+ * @property MEMBER_CAPTION
+ * @static
+ * @final
+ * @type string
+ * @default Caption
+ */
+ Xmla.Dataset.Axis.MEMBER_CAPTION = "Caption";
+ /**
+ * The name of the standard member property that contains the name of the level for this member.
+ * See Ole DB standard for more information.
+ * @property MEMBER_LEVEL_NAME
+ * @static
+ * @final
+ * @type string
+ * @default LName
+ */
+ Xmla.Dataset.Axis.MEMBER_LEVEL_NAME = "LName";
+ /**
+ * The name of the standard member property that contains the number of the level for this member.
+ * See Ole DB standard for more information.
+ * @property MEMBER_LEVEL_NUMBER
+ * @static
+ * @final
+ * @type string
+ * @default LNum
+ */
+ Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER = "LNum";
+ /**
+ * The name of the member property that contains displayinfo for this member.
+ * See Ole DB standard for more information.
+ * @property MEMBER_DISPLAY_INFO
+ * @static
+ * @final
+ * @type string
+ * @default LNum
+ */
+ Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO = "DisplayInfo";
+ /**
+ * The default mem ber properties for members
+ * See Ole DB standard for more information.
+ * @property DefaultMemberProperties
+ * @static
+ * @final
+ * @type array
+ */
+ Xmla.Dataset.Axis.DefaultMemberProperties = [
+ Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME,
+ Xmla.Dataset.Axis.MEMBER_CAPTION,
+ Xmla.Dataset.Axis.MEMBER_LEVEL_NAME,
+ Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER,
+ Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO
+ ];
+
+ /**
+ * A constant that can be used as a bitmask for a member's DisplayInfo property.
+ * Bitwise AND-ing this mask to the member's DisplayInfo property returns an estimate of the number of children of this member.
+ * @property MDDISPINFO_CHILDREN_CARDINALITY
+ * @static
+ * @final
+ * @type int
+ * @default 65535
+ */
+ Xmla.Dataset.Axis.MDDISPINFO_CHILDREN_CARDINALITY = 65535;
+ /**
+ * A constant that can be used as a bitmask for a member's DisplayInfo property.
+ * If this bit is set, it means the member is drilled down.
+ * This is the case whenever at least one child of this member appears on the axis immediately following this member.
+ * @property MDDISPINFO_DRILLED_DOWN
+ * @static
+ * @final
+ * @type int
+ * @default 65536
+ */
+ Xmla.Dataset.Axis.MDDISPINFO_DRILLED_DOWN = 65536;
+ /**
+ * A constant that can be used as a bitmask for a member's DisplayInfo property.
+ * If this bit is set, it means this member has the same parent as the member immediately preceding this member.
+ * @property MDDISPINFO_SAME_PARENT_AS_PREV
+ * @static
+ * @final
+ * @type int
+ * @default 131072
+ */
+ Xmla.Dataset.Axis.MDDISPINFO_SAME_PARENT_AS_PREV = 131072;
+
+ Xmla.Dataset.Axis.prototype = {
+ /**
+ * The 0-based id of the axis.
+ * @property id
+ * @type int
+ */
+ id: -1,
+ /**
+ * The name of the axis.
+ * @property name
+ * @type string
+ */
+ name: null,
+ _dataset: null,
+ _tuples: null,
+ _members: null,
+ _memberProperties: null,
+ numTuples: null,
+ numHierarchies: null,
+ _tupleIndex: null,
+ _hierarchyIndex: null,
+ _hierarchyOrder: null,
+ _hierarchyDefs: null,
+ _hierarchyIndexes: null,
+ _initHierarchies: function(_axisInfoNode){
+ var hierarchyInfoNodes = _getElementsByTagNameNS(
+ _axisInfoNode,
+ _xmlnsDataset,
+ "",
+ "HierarchyInfo"
+ ),
+ numHierarchies = hierarchyInfoNodes.length,
+ i, j, hierarchyInfoNode, hierarchyName,
+ hierarchyDef, properties, numPropertyNodes, propertyNodes, propertyNode,
+ nodeName, type, memberProperty, memberProperties = this._memberProperties,
+ converter
+ ;
+ this._hierarchyDefs = {};
+ this._hierarchyOrder = [];
+ this._hierarchyIndexes = {};
+ this.numHierarchies = numHierarchies;
+ var propertyTagName, propertyName;
+ for (i = 0; i < numHierarchies; i++){
+ hierarchyInfoNode = hierarchyInfoNodes[i];
+ hierarchyName = _getAttribute(hierarchyInfoNode, "name");
+ this._hierarchyOrder[i] = hierarchyName;
+ this._hierarchyIndexes[hierarchyName] = i;
+ hierarchyDef = {
+ index: i,
+ name: hierarchyName,
+ properties: properties = {}
+ };
+ propertyNodes = _getElementsByTagNameNS(hierarchyInfoNode, _xmlnsDataset, "", "*");
+ numPropertyNodes = propertyNodes.length;
+ for (j = 0; j < numPropertyNodes; j++) {
+ propertyNode = propertyNodes[j];
+ nodeName = propertyNode.nodeName;
+ //note: MSAS doesn't seem to include a type for custom properties
+ type = _getAttribute(propertyNode, "type");
+ if (!type) {
+ memberProperty = memberProperties[nodeName];
+ if (memberProperty) {
+ type = memberProperty.type;
+ }
+ else {
+ switch (nodeName) {
+ case Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER:
+ case Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO:
+ type = "xsd:int";
+ }
+ }
+ }
+ converter = _typeConverterMap[type];
+ if (!converter){
+ converter = _textConverter;
+ }
+ propertyTagName = _decodeXmlaTagName(nodeName);
+ switch (propertyTagName) {
+ case Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME:
+ case Xmla.Dataset.Axis.MEMBER_CAPTION:
+ case Xmla.Dataset.Axis.MEMBER_LEVEL_NAME:
case Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER:
case Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO:
- type = "xsd:int";
- }
- }
- }
- converter = _typeConverterMap[type];
- if (!converter){
- converter = _textConverter;
- }
- propertyTagName = _decodeXmlaTagName(nodeName);
- switch (propertyTagName) {
- case Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME:
- case Xmla.Dataset.Axis.MEMBER_CAPTION:
- case Xmla.Dataset.Axis.MEMBER_LEVEL_NAME:
- case Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER:
- case Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO:
- //map default properties with their tagName (Standard)
- propertyName = propertyTagName;
- break;
- default:
- //map non-default properties by unqualified property name.
- propertyName = _getAttribute(propertyNode, "name");
- if (propertyName) {
- propertyName = propertyName.split(".");
- propertyName = propertyName[propertyName.length - 1];
- if (propertyName.charAt(0) === "[" && propertyName.charAt(propertyName.length -1) === "]") {
- propertyName = propertyName.substr(1, propertyName.length - 2);
- }
+ //map default properties with their tagName (Standard)
+ propertyName = propertyTagName;
+ break;
+ default:
+ //map non-default properties by unqualified property name.
+ propertyName = _getAttribute(propertyNode, "name");
+ if (propertyName) {
+ propertyName = propertyName.split(".");
+ propertyName = propertyName[propertyName.length - 1];
+ if (propertyName.charAt(0) === "[" && propertyName.charAt(propertyName.length -1) === "]") {
+ propertyName = propertyName.substr(1, propertyName.length - 2);
+ }
+ }
}
+ properties[nodeName] = {
+ converter: converter,
+ name: propertyTagName,
+ propertyName: propertyName
+ };
}
- properties[nodeName] = {
- converter: converter,
- name: propertyTagName,
- propertyName: propertyName
+ this._hierarchyDefs[hierarchyName] = hierarchyDef;
+ }
+ },
+ _initMembers: function(){
+ var root = this._dataset._root,
+ memberSchema, memberSchemaElements, numMemberSchemaElements, memberSchemaElement,
+ type, name, i, memberProperties = this._memberProperties = {}
+ ;
+ memberSchema = _getComplexType(root, "MemberType");
+ if (!memberSchema)
+ Xmla.Exception._newError(
+ "ERROR_PARSING_RESPONSE",
+ "Xmla.DataSet.Axis",
+ root
+ )._throw();
+ memberSchema = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence");
+ if (!memberSchema.length) {
+ //Jedox does not specify content of members.
+ if (!_isUnd(console.error)) {
+ console.error("MemberType in schema does not define any child elements. Are you running on Jedox/Palo?");
+ }
+ return;
+ }
+ memberSchema = memberSchema[0];
+ memberSchemaElements = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element");
+ numMemberSchemaElements = memberSchemaElements.length;
+ for (i = 0; i < numMemberSchemaElements; i++) {
+ memberSchemaElement = memberSchemaElements[i];
+ type = _getAttribute(memberSchemaElement, "type");
+ name = _getAttribute(memberSchemaElement, "name");
+ memberProperties[name] = {
+ type: type,
+ converter: _typeConverterMap[type],
+ name: _decodeXmlaTagName(name)
};
}
- this._hierarchyDefs[hierarchyName] = hierarchyDef;
- }
- },
- _initMembers: function(){
- var root = this._dataset._root,
- memberSchema, memberSchemaElements, numMemberSchemaElements, memberSchemaElement,
- type, name, i, memberProperties = this._memberProperties = {}
- ;
- memberSchema = _getComplexType(root, "MemberType");
- if (!memberSchema)
- Xmla.Exception._newError(
- "ERROR_PARSING_RESPONSE",
- "Xmla.DataSet.Axis",
- root
- )._throw();
- memberSchema = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence");
- if (!memberSchema.length) {
- //Jedox does not specify content of members.
- if (!_isUnd(console.error)) {
- console.error("MemberType in schema does not define any child elements. Are you running on Jedox/Palo?");
- }
- return;
- }
- memberSchema = memberSchema[0];
- memberSchemaElements = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element");
- numMemberSchemaElements = memberSchemaElements.length;
- for (i = 0; i < numMemberSchemaElements; i++) {
- memberSchemaElement = memberSchemaElements[i];
- type = _getAttribute(memberSchemaElement, "type");
- name = _getAttribute(memberSchemaElement, "name");
- memberProperties[name] = {
- type: type,
- converter: _typeConverterMap[type],
- name: _decodeXmlaTagName(name)
- };
- }
- },
- _initAxis: function(_axisInfoNode, _axisNode){
- this.name = _getAttribute(_axisNode, "name");
- this._initMembers();
- this._initHierarchies(_axisInfoNode);
- this._tuples = _getElementsByTagNameNS(_axisNode, _xmlnsDataset, "", "Tuple");
- this.numTuples = this._tuples.length;
- this.reset();
- },
- close: function(){
- this.numTuples = -1;
- this._tuples = null;
- this._hierarchyDefs = null;
- this._hierarchyOrder = null;
- this._hierarchyIndexes = null;
- this._members = null;
- },
- _getMembers: function(){
- if (!this.hasMoreTuples()) {
- return null;
- }
- return _getElementsByTagNameNS(
- this._tuples[this._tupleIndex],
- _xmlnsDataset, "", "Member"
- );
- },
-/**
-* Resets this axis object.
-* This resets internal counters for iterating through the hierarchies and tuples of this Axis object.
-* When using hierarchy and tuple iterators to traverse the entire axis, you typically won't need to call this method yourself.
-* @method reset
-*/
- reset: function(){
- this._hierarchyIndex = 0;
- this._tupleIndex = 0;
- this._members = this._getMembers();
- },
-/**
-* Checks if there are more hierarchies to iterate through.
-* You can use this method along with the nextHierarchy() method to drive a loop
-* to iterate through the hierarchies contained in this axis object.
-* @method hasMoreHierarchies
-* @return {boolean} Returns true if there are more hierarchies to vist, false if all hierarchies are traversed.
-*/
- hasMoreHierarchies: function(){
- return this.numHierarchies > this._hierarchyIndex;
- },
-/**
-* Moves the internal hierarchy pointer forward.
-* You can use this method along with the hasMoreHierarchies() method to drive a loop
-* to iterate through the hierarchies contained in this axis object.
-* @method nextHierarchy
-* @return {int} Returns the index of current hierarchy.
-*/
- nextHierarchy: function(){
- return this._hierarchyIndex++;
- },
-/**
-*
Calls a callback function for each hierarchy in this Axis object.
-*The callback function is passed an object that represents the current hierarchy. This object has the following structure:
index int The ordinal identifying this hierarchyname string The name of this hierarchyThe callback may return false to abort iteration. If the callback does not return false, iteration will resume until all hierarchies are traversed.
null, the Axis' this pointer will be used.
-* @param {object} args Additional data to be passed to the callback function..
-* @method eachHierarchy
-* @return {boolean} Returns true if all hierarchies were visited and the callback did not return false. Returns false if the callback returned false and further iteration was aborted.
-*/
- eachHierarchy: function(callback, scope, args){
- var mArgs = [null];
- if (!scope) scope = this;
- if (args) {
- if (!_isArr(args)) args = [args];
- mArgs = mArgs.concat(args);
- }
- while (this.hasMoreHierarchies()){
- mArgs[0] = this._hierarchyDefs[this._hierarchyOrder[this._hierarchyIndex]];
- if (callback.apply(scope, mArgs)===false) return false;
- this.nextHierarchy();
- }
- this._hierarchyIndex = 0;
- return true;
- },
-/**
-* Checks if there are more tuples to iterate through.
-* You can use this method along with the nextTuple() method to drive a loop
-* to iterate through the tuples contained in this axis object.
-* @method hasMoreTuples
-* @return {boolean} Returns true if there are more tuples to vist, false if all tuples are traversed.
-*/
- hasMoreTuples: function(){
- return this.numTuples > this._tupleIndex;
- },
-/**
-* Moves the internal tuple pointer forward.
-* You can use this method along with the nextTuple() method to drive a loop
-* to iterate through the tuples contained in this axis object.
-* @method nextTuple
-* @return {int} Returns the index of current tuple.
-*/
- nextTuple: function(){
- this._tupleIndex++;
- this._members = this._getMembers();
- return this._tupleIndex;
- },
-/**
-* Gets the number of tuples in this axis object.
-* @method tupleCount
-* @return {int} Returns the number of tuples in this Axis object.
-*/
- tupleCount: function(){
- return this.numTuples;
- },
-/**
-* Returns the current value of the tuple pointer.
-* @method tupleIndex
-* @return {int} Returns the current value of the tuple pointer.
-*/
- tupleIndex: function() {
- return this._tupleIndex;
- },
-/**
-* Get the current tuple as an object. The tuple object has the following structure: index int: the ordinal of this tuple within its axishierarchies object: A map of members using hierarchy names as keys, and member objects as valuesmembers array: An array of members in order of hierarchy order.Calls a callback function for each tuple in this Axis object.
-*The callback function is passed an object that represents the current tuple. (see getTuple() for a description of the tuple format.)
The callback may return false to abort iteration. If the callback does not return false, iteration will resume until all tuples are traversed.
null, the Axis' this pointer will be used.
-* @param {object} args Additional data to be passed as the second argument to the callback function.
-* @method eachTuple
-* @return {boolean} Returns true if all tuples were visited and the callback did not return false. Returns false if the callback returned false and further iteration was aborted.
-*/
- eachTuple: function(callback, scope, args){
- var mArgs = [null];
- if (!scope) {
- scope = this;
- }
- if (args) {
- if (_isArr(args)) {
- mArgs.concat(args)
+ return _getElementsByTagNameNS(
+ this._tuples[this._tupleIndex],
+ _xmlnsDataset, "", "Member"
+ );
+ },
+ /**
+ * Resets this axis object.
+ * This resets internal counters for iterating through the hierarchies and tuples of this Axis object.
+ * When using hierarchy and tuple iterators to traverse the entire axis, you typically won't need to call this method yourself.
+ * @method reset
+ */
+ reset: function(){
+ this._hierarchyIndex = 0;
+ this._tupleIndex = 0;
+ this._members = this._getMembers();
+ },
+ /**
+ * Checks if there are more hierarchies to iterate through.
+ * You can use this method along with the nextHierarchy() method to drive a loop
+ * to iterate through the hierarchies contained in this axis object.
+ * @method hasMoreHierarchies
+ * @return {boolean} Returns true if there are more hierarchies to vist, false if all hierarchies are traversed.
+ */
+ hasMoreHierarchies: function(){
+ return this.numHierarchies > this._hierarchyIndex;
+ },
+ /**
+ * Moves the internal hierarchy pointer forward.
+ * You can use this method along with the hasMoreHierarchies() method to drive a loop
+ * to iterate through the hierarchies contained in this axis object.
+ * @method nextHierarchy
+ * @return {int} Returns the index of current hierarchy.
+ */
+ nextHierarchy: function(){
+ return this._hierarchyIndex++;
+ },
+ /**
+ * Calls a callback function for each hierarchy in this Axis object.
+ *The callback function is passed an object that represents the current hierarchy. This object has the following structure:
index int The ordinal identifying this hierarchyname string The name of this hierarchyThe callback may return false to abort iteration. If the callback does not return false, iteration will resume until all hierarchies are traversed.
null, the Axis' this pointer will be used.
+ * @param {object} args Additional data to be passed to the callback function..
+ * @method eachHierarchy
+ * @return {boolean} Returns true if all hierarchies were visited and the callback did not return false. Returns false if the callback returned false and further iteration was aborted.
+ */
+ eachHierarchy: function(callback, scope, args){
+ var mArgs = [null];
+ if (!scope) scope = this;
+ if (args) {
+ if (!_isArr(args)) args = [args];
+ mArgs = mArgs.concat(args);
}
- else {
- mArgs.push(args);
+ while (this.hasMoreHierarchies()){
+ mArgs[0] = this._hierarchyDefs[this._hierarchyOrder[this._hierarchyIndex]];
+ if (callback.apply(scope, mArgs)===false) return false;
+ this.nextHierarchy();
}
- }
- while (this.hasMoreTuples()){
- mArgs[0] = this.getTuple();
- if (callback.apply(scope, mArgs) === false) {
- return false;
+ this._hierarchyIndex = 0;
+ return true;
+ },
+ /**
+ * Checks if there are more tuples to iterate through.
+ * You can use this method along with the nextTuple() method to drive a loop
+ * to iterate through the tuples contained in this axis object.
+ * @method hasMoreTuples
+ * @return {boolean} Returns true if there are more tuples to vist, false if all tuples are traversed.
+ */
+ hasMoreTuples: function(){
+ return this.numTuples > this._tupleIndex;
+ },
+ /**
+ * Moves the internal tuple pointer forward.
+ * You can use this method along with the nextTuple() method to drive a loop
+ * to iterate through the tuples contained in this axis object.
+ * @method nextTuple
+ * @return {int} Returns the index of current tuple.
+ */
+ nextTuple: function(){
+ this._tupleIndex++;
+ this._members = this._getMembers();
+ return this._tupleIndex;
+ },
+ /**
+ * Gets the number of tuples in this axis object.
+ * @method tupleCount
+ * @return {int} Returns the number of tuples in this Axis object.
+ */
+ tupleCount: function(){
+ return this.numTuples;
+ },
+ /**
+ * Returns the current value of the tuple pointer.
+ * @method tupleIndex
+ * @return {int} Returns the current value of the tuple pointer.
+ */
+ tupleIndex: function() {
+ return this._tupleIndex;
+ },
+ /**
+ * Get the current tuple as an object. The tuple object has the following structure: index int: the ordinal of this tuple within its axishierarchies object: A map of members using hierarchy names as keys, and member objects as valuesmembers array: An array of members in order of hierarchy order.Calls a callback function for each tuple in this Axis object.
+ *The callback function is passed an object that represents the current tuple. (see getTuple() for a description of the tuple format.)
The callback may return false to abort iteration. If the callback does not return false, iteration will resume until all tuples are traversed.
null, the Axis' this pointer will be used.
+ * @param {object} args Additional data to be passed as the second argument to the callback function.
+ * @method eachTuple
+ * @return {boolean} Returns true if all tuples were visited and the callback did not return false. Returns false if the callback returned false and further iteration was aborted.
+ */
+ eachTuple: function(callback, scope, args){
+ var mArgs = [null];
+ if (!scope) {
+ scope = this;
+ }
+ if (args) {
+ if (_isArr(args)) {
+ mArgs.concat(args)
+ }
+ else {
+ mArgs.push(args);
+ }
+ }
+ while (this.hasMoreTuples()){
+ mArgs[0] = this.getTuple();
+ if (callback.apply(scope, mArgs) === false) {
+ return false;
+ }
+ this.nextTuple();
+ }
+ this._tupleIndex = 0;
+ this._members = this._getMembers();
+ return true;
+ },
+ /**
+ * Returns the hierarchies of this Axis object.
+ * The hierarchies are returned as an object. The keys are the hierarchy names; the values are objects representing the hierarchies.
+ * The hierarchy object has the following properties: index - inthierarchy - string. Name of the hiearchy to which this member belongs.UName - string. Unique name of this member.Caption - string. Human friendly name for this member.LName - string. Name of the level to which this member belongs.LNum - int. Number of the level to which this member belongs. Typically, the top-level is level 0, its children are level 1 and so on.DisplayInfo - int. A 4 byte value. The 2 least significant bytes form a 16 bit integer that conveys the number of children of this member.
-* The remaining two most significant bytes form a 16 bit bitfield.
-*
-* The index and hierarchy properties are non standard and always added by Xmla4js.
-* The properties UName, Caption, LName and LNum are defined by the XML/A standard, and should always be present.
-* The property DisplayInfo is non-standard, but often available.
-* Other properties may be present depending on the specific XML/A provider.
-*
index - inthierarchy - string. Name of the hiearchy to which this member belongs.UName - string. Unique name of this member.Caption - string. Human friendly name for this member.LName - string. Name of the level to which this member belongs.LNum - int. Number of the level to which this member belongs. Typically, the top-level is level 0, its children are level 1 and so on.DisplayInfo - int. A 4 byte value. The 2 least significant bytes form a 16 bit integer that conveys the number of children of this member.
+ * The remaining two most significant bytes form a 16 bit bitfield.
+ *
+ * The index and hierarchy properties are non standard and always added by Xmla4js.
+ * The properties UName, Caption, LName and LNum are defined by the XML/A standard, and should always be present.
+ * The property DisplayInfo is non-standard, but often available.
+ * Other properties may be present depending on the specific XML/A provider.
+ *
UNameCaptionLNameLNumDisplayInfotrue if the current member has the specified property, false if it doesn't.
-*/
- hasMemberProperty: function(propertyName) {
- return !_isUnd(this._memberProperties[propertyName]);
- },
-/**
-* Gets the current tuple as an array of members.
-* For a description of the structure of the member elements, see member().
-* @method readAsArray
-* @param array {array} An existing array to store the members in. If omitted, a new array is returned.
-* @return {array} An array of members that represents the current tuple.
-*/
- readAsArray: function(array){
- if (!array) array = [];
- var i, n = this.numHierarchies;
- for (i = 0; i < n; i++) array[i] = this._member(i);
- return array;
- },
-/**
-* Gets the current tuple as an object.
-* The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
-* For a description of the structure of the member elements, see member().
-* @method readAsObject
-* @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
-* @return {object} An object that represents the current tuple.
-*/
- readAsObject: function(object){
- if (!object) object = {};
- var i, n = this.numHierarchies;
- for (i = 0; i < n; i++) object[this._hierarchyOrder[i]] = this._member(i);
- return object;
- },
-/**
-* Gets the current tuple as an array of members and advances the internal tuple pointer.
-* For a description of the structure of the member elements, see member().
-* @method fetchAsArray
-* @param array {array} An existing array to store the members in. If omitted, a new array is returned.
-* @return {array|false} An array of members that represents the current tuple, or false if there are no more tuples.
-*/
- fetchAsArray: function(array){
- if (this.hasMoreTuples()) {
- array = this.readAsArray(array);
- this.nextTuple();
- }
- else array = false;
- return array;
- },
-/**
-* Gets the current tuple as an object and advances the current tuple pointer.
-* The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
-* For a description of the structure of the member elements, see member().
-* @method fetchAsObject
-* @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
-* @return {object} An object that represents the current tuple.
-*/
- fetchAsObject: function(object){
- if (this.hasMoreTuples(object)){
- object = this.readAsObject();
- this.nextTuple();
+ var index, hierarchyName;
+ switch(typeof(hierarchyIndexOrName)){
+ case "string":
+ index = this.hierarchyIndex(hierarchyIndexOrName);
+ hierarchyName = hierarchyIndexOrName;
+ break;
+ case "number":
+ if (hierarchyIndexOrName !== parseInt(hierarchyIndexOrName, 10) ||
+ hierarchyIndexOrName >= this.numHierarchies
+ )
+ Xmla.Exception._newError(
+ "INVALID_HIERARCHY",
+ "Xmla.Dataset.Axis.hierarchyDef",
+ hierarchyIndexOrName
+ )._throw();
+ index = hierarchyIndexOrName;
+ break;
+ }
+ return this._member(index);
+ },
+ _member: function(index){
+ var memberNode = this._members[index],
+ childNodes = memberNode.childNodes,
+ i, n = childNodes.length,
+ hierarchyName = this.hierarchyName(index),
+ hierarchyDef = this._hierarchyDefs[hierarchyName],
+ properties = hierarchyDef.properties,
+ property,
+ member = {
+ index: index,
+ hierarchy: hierarchyName
+ },
+ el,
+ valueConverter
+ ;
+ for (i = 0; i < n; i++) {
+ el = childNodes[i];
+ if (el.nodeType !== 1) {
+ continue;
+ }
+ property = properties[el.nodeName];
+ if (!property) {
+ continue;
+ }
+ member[property.propertyName || property.name] = property.converter(_getElementText(el));
+ }
+ return member;
+ },
+ /**
+ * Check if the member has the specified property.
+ * XML/A defines these standard properties:UNameCaptionLNameLNumDisplayInfotrue if the current member has the specified property, false if it doesn't.
+ */
+ hasMemberProperty: function(propertyName) {
+ return !_isUnd(this._memberProperties[propertyName]);
+ },
+ /**
+ * Gets the current tuple as an array of members.
+ * For a description of the structure of the member elements, see member().
+ * @method readAsArray
+ * @param array {array} An existing array to store the members in. If omitted, a new array is returned.
+ * @return {array} An array of members that represents the current tuple.
+ */
+ readAsArray: function(array){
+ if (!array) array = [];
+ var i, n = this.numHierarchies;
+ for (i = 0; i < n; i++) array[i] = this._member(i);
+ return array;
+ },
+ /**
+ * Gets the current tuple as an object.
+ * The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
+ * For a description of the structure of the member elements, see member().
+ * @method readAsObject
+ * @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
+ * @return {object} An object that represents the current tuple.
+ */
+ readAsObject: function(object){
+ if (!object) object = {};
+ var i, n = this.numHierarchies;
+ for (i = 0; i < n; i++) object[this._hierarchyOrder[i]] = this._member(i);
+ return object;
+ },
+ /**
+ * Gets the current tuple as an array of members and advances the internal tuple pointer.
+ * For a description of the structure of the member elements, see member().
+ * @method fetchAsArray
+ * @param array {array} An existing array to store the members in. If omitted, a new array is returned.
+ * @return {array|false} An array of members that represents the current tuple, or false if there are no more tuples.
+ */
+ fetchAsArray: function(array){
+ if (this.hasMoreTuples()) {
+ array = this.readAsArray(array);
+ this.nextTuple();
+ }
+ else array = false;
+ return array;
+ },
+ /**
+ * Gets the current tuple as an object and advances the current tuple pointer.
+ * The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
+ * For a description of the structure of the member elements, see member().
+ * @method fetchAsObject
+ * @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
+ * @return {object} An object that represents the current tuple.
+ */
+ fetchAsObject: function(object){
+ if (this.hasMoreTuples(object)){
+ object = this.readAsObject();
+ this.nextTuple();
+ }
+ else object = false;
+ return object;
+ },
+ /**
+ * Fetches all tuples and returns them as an array of arrays.
+ * Each element of the returned array is an array of member objects.
+ * For a description of the structure of the member elements, see member().
+ * @method fetchAllAsArray
+ * @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
+ * @return {[[array]]} An array of arrays representing all tuples that belong to this axis.
+ **/
+ fetchAllAsArray: function(rows){
+ var row;
+ if (!rows) rows = [];
+ while((row = this.fetchAsArray())) rows.push(row);
+ this.reset();
+ return rows;
+ },
+ /**
+ * Fetches all tuples and returns them as an array of objects.
+ * Each element of the returned array is a tuple object.
+ * The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
+ * For a description of the structure of the member elements, see member().
+ * @method fetchAllAsObject
+ * @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
+ * @return {[[object]]} An array of arrays representing all tuples that belong to this axis.
+ **/
+ fetchAllAsObject: function(rows){
+ var row;
+ if (!rows) rows = [];
+ while((row = this.fetchAsObject())) rows.push(row);
+ this.reset();
+ return rows;
}
- else object = false;
- return object;
- },
-/**
-* Fetches all tuples and returns them as an array of arrays.
-* Each element of the returned array is an array of member objects.
-* For a description of the structure of the member elements, see member().
-* @method fetchAllAsArray
-* @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
-* @return {[[array]]} An array of arrays representing all tuples that belong to this axis.
-**/
- fetchAllAsArray: function(rows){
- var row;
- if (!rows) rows = [];
- while((row = this.fetchAsArray())) rows.push(row);
- this.reset();
- return rows;
- },
-/**
-* Fetches all tuples and returns them as an array of objects.
-* Each element of the returned array is a tuple object.
-* The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
-* For a description of the structure of the member elements, see member().
-* @method fetchAllAsObject
-* @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
-* @return {[[object]]} An array of arrays representing all tuples that belong to this axis.
-**/
- fetchAllAsObject: function(rows){
- var row;
- if (!rows) rows = [];
- while((row = this.fetchAsObject())) rows.push(row);
- this.reset();
- return rows;
}
-}
-
-/**
-* -* This class implements a Cellset object. -*
-*
-* You do not need to instantiate objects of this class yourself.
-* Rather, the Xmla.Dataset class creates instances of this class to represent the cells (the value of the measures) of an MDX query.
-* (see getCellset().)
-*
-* @class Xmla.Dataset.Cellset
-* @constructor
-*/
-Xmla.Dataset.Cellset = function(dataset){
- this._dataset = dataset;
- this._initCellset();
- return this;
-}
-
-Xmla.Dataset.Cellset.prototype = {
- _dataset: null,
- _cellNodes: null,
- _cellCount: null,
- _cellNode: null,
- _cellProperties: null,
- _idx: null,
- _cellOrd: null,
- _initCellset: function(){
- var root = this._dataset._root,
- cellSchema, cellSchemaElements, numCellSchemaElements, cellSchemaElement,
- cellInfoNodes, cellInfoNode, type,
- propertyNodes, propertyNode, propertyNodeTagName, numPropertyNodes, i, j
- ;
- cellSchema = _getComplexType(root, "CellData");
- if (!cellSchema)
- Xmla.Exception._newError(
- "ERROR_PARSING_RESPONSE",
- "Xmla.Dataset.Cellset",
- root
- )._throw();
- cellSchemaElements = _getElementsByTagNameNS(
- cellSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element"
- );
- numCellSchemaElements = cellSchemaElements.length;
- cellInfoNodes = _getElementsByTagNameNS(
- root, _xmlnsDataset, "", "CellInfo"
- );
- if (!cellInfoNodes || cellInfoNodes.length===0)
- Xmla.Exception._newError(
- "ERROR_PARSING_RESPONSE",
- "Xmla.Rowset",
- root
- )._throw();
-
- cellInfoNode = cellInfoNodes[0];
- propertyNodes = _getElementsByTagNameNS(
- cellInfoNode, _xmlnsDataset, "", "*"
- );
- this._cellProperties = {};
- //examine cell property info so we can parse them
- numPropertyNodes = propertyNodes.length;
- var me = this;
- var makePropertyGetter = function(propertyNodeTagName){
- me["cell" + propertyNodeTagName] = function(){
- return this.cellProperty(propertyNodeTagName);
- };
- };
- for(i = 0; i < numPropertyNodes; i++) {
- propertyNode = propertyNodes[i];
- propertyNodeTagName = propertyNode.nodeName;
- //find the xsd:element node that describes this property
- for (j = 0; j < numCellSchemaElements; j++) {
- cellSchemaElement = cellSchemaElements[j];
- if (_getAttribute(cellSchemaElement, "name") !== propertyNodeTagName) {
+
+ /**
+ *
+ * This class implements a Cellset object. + *
+ *
+ * You do not need to instantiate objects of this class yourself.
+ * Rather, the Xmla.Dataset class creates instances of this class to represent the cells (the value of the measures) of an MDX query.
+ * (see getCellset().)
+ *
+ * @class Xmla.Dataset.Cellset
+ * @constructor
+ */
+ Xmla.Dataset.Cellset = function(dataset){
+ this._dataset = dataset;
+ this._initCellset();
+ return this;
+ }
+
+ Xmla.Dataset.Cellset.prototype = {
+ _dataset: null,
+ _cellNodes: null,
+ _cellCount: null,
+ _cellNode: null,
+ _cellProperties: null,
+ _idx: null,
+ _cellOrd: null,
+ _initCellset: function(){
+ var root = this._dataset._root,
+ cellSchema, cellSchemaElements, numCellSchemaElements, cellSchemaElement,
+ cellInfoNodes, cellInfoNode, type,
+ propertyNodes, propertyNode, propertyNodeTagName, numPropertyNodes, i, j
+ ;
+ cellSchema = _getComplexType(root, "CellData");
+ if (!cellSchema)
+ Xmla.Exception._newError(
+ "ERROR_PARSING_RESPONSE",
+ "Xmla.Dataset.Cellset",
+ root
+ )._throw();
+ cellSchemaElements = _getElementsByTagNameNS(
+ cellSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element"
+ );
+ numCellSchemaElements = cellSchemaElements.length;
+ cellInfoNodes = _getElementsByTagNameNS(
+ root, _xmlnsDataset, "", "CellInfo"
+ );
+ if (!cellInfoNodes || cellInfoNodes.length===0)
+ Xmla.Exception._newError(
+ "ERROR_PARSING_RESPONSE",
+ "Xmla.Rowset",
+ root
+ )._throw();
+
+ cellInfoNode = cellInfoNodes[0];
+ propertyNodes = _getElementsByTagNameNS(
+ cellInfoNode, _xmlnsDataset, "", "*"
+ );
+ this._cellProperties = {};
+ //examine cell property info so we can parse them
+ numPropertyNodes = propertyNodes.length;
+ var me = this;
+ var makePropertyGetter = function(propertyNodeTagName){
+ me["cell" + propertyNodeTagName] = function(){
+ return this.cellProperty(propertyNodeTagName);
+ };
+ };
+ for(i = 0; i < numPropertyNodes; i++) {
+ propertyNode = propertyNodes[i];
+ propertyNodeTagName = propertyNode.nodeName;
+ //find the xsd:element node that describes this property
+ for (j = 0; j < numCellSchemaElements; j++) {
+ cellSchemaElement = cellSchemaElements[j];
+ if (_getAttribute(cellSchemaElement, "name") !== propertyNodeTagName) {
+ continue;
+ }
+ type = _getAttribute(cellSchemaElement, "type");
+ this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
+ //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
+ makePropertyGetter(propertyNodeTagName);
+ break;
+ }
+ //extra: if the schema doesn't explicitly define this property, we somehow have to
+ if (!this._cellProperties[propertyNodeTagName]) {
+ type = _getAttribute(propertyNode, "type");
+ if (!type) {
+ type = (propertyNodeTagName === "Value") ? "xs:decimal" : "xs:string";
+ }
+ this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
+ //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
+ makePropertyGetter(propertyNodeTagName);
+ }
+ }
+ this._cellNodes = _getElementsByTagNameNS(
+ root, _xmlnsDataset, "", "Cell"
+ );
+ this._cellCount = this._cellNodes.length;
+ this.reset();
+ },
+ _getCellNode: function(index){
+ //console.debug(index);
+ if (!_isUnd(index)) {
+ this._idx = index;
+ }
+ this._cellNode = this._cellNodes[this._idx];
+ this._cellOrd = this._getCellOrdinal(this._cellNode);
+ },
+ _getCellOrdinal: function(node){
+ return parseInt(_getAttribute(node, "CellOrdinal"), 10);
+ },
+ /**
+ * Returns the number of cells contained in this cellset.
+ * This is the number of cells that is actually present in the cellset - not the number of logical cells.
+ * The nuber of logical cells can be be calculated by multiplying the tuple counts of all axes of the data set.
+ * The XML/A provider will typically not return empty cells, hence, the cellCount may be less than the logical cell count.
+ * @method cellCount
+ * @return {int} The number of cells in this cellset.
+ */
+ cellCount: function() {
+ return this._cellNodes.length;
+ },
+ /**
+ * Resets the internal cell pointer to the argument, or to 0 if the argument is omitted.
+ * Normally, you shouldn't have to call this method yourself.
+ * @method reset
+ * @param idx {int}
+ */
+ reset: function(idx){
+ this._idx = idx ? idx : 0;
+ if (this.hasMoreCells()) {
+ this._getCellNode();
+ }
+ },
+ /**
+ * Check if there are cells to iterate through.
+ * @method hasMoreCells
+ * @return {boolean} true if there are more cells to iterate, false if there are no more cells to iterate.
+ */
+ hasMoreCells: function(){
+ return this._idx < this._cellCount;
+ },
+ /**
+ * Advance to the next (physical) cell.
+ * Note that this method may appear to be skipping cells. This happens when the XML/A provider omits empty cells in the response.
+ * @method nextCell
+ * @return {int} returns the ordinal of the next cell, or -1 if there was no next cell.
+ */
+ nextCell: function(){
+ this._idx += 1;
+ if (this.hasMoreCells()) {
+ this._getCellNode();
+ return this._cellOrd;
+ }
+ else {
+ this._idx = 0;
+ return -1;
+ }
+ },
+ /**
+ * Returns the internal cell pointer. This is the fysical cell pointer.
+ * To get the logical cell pointer, see cellOrdinal()
+ * @method curr
+ * @return {int} returns the internal cell pointer.
+ */
+ curr: function(){
+ return this._idx;
+ },
+ /**
+ * Check if the cell has the specified property.
+ * XML/A defines these standard properties:
ValueFmtValueForeColorBackColortrue if the current cell has the specified property, false if it doesn't.
+ */
+ hasCellProperty: function(propertyName) {
+ return !_isUnd(this._cellProperties[propertyName]);
+ },
+ /**
+ * Return the value of the current property of the current cell.
+ * XML/A defines these standard properties:ValueFmtValueForeColorBackColorcurr()
+ * @method cellOrdinal
+ * @return {int} returns the logical cell pointer.
+ */
+ cellOrdinal: function() {
+ return this._cellOrd;
+ },
+ _readCell: function(node, object){
+ var p, cellProp, cellProperty;
+ for (p in this._cellProperties){
+ cellProp = _getElementsByTagNameNS(
+ node, _xmlnsDataset, "", p
+ )[0];
+ if (!cellProp) {
continue;
}
- type = _getAttribute(cellSchemaElement, "type");
- this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
- //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
- makePropertyGetter(propertyNodeTagName);
- break;
+ cellProperty = this._cellProperties[p];
+ if (cellProperty) {
+ object[p] = cellProperty(_getElementText(cellProp));
+ }
+ else
+ if (p === "Value") {
+ object[p] = _getElementValue(cellProp);
+ }
+ else {
+ object[p] = _getElementText(cellProp);
+ }
+ }
+ object.ordinal = this._getCellOrdinal(node);
+ return object;
+ },
+ /**
+ * Reads the current cell into the specified object.
+ * @method readCell
+ * @param {object} object An existing object to use for the current cell. If omitted, a new object will be created.
+ * @return {object} An object that represents the current cell.
+ */
+ readCell: function(object) {
+ if (!object) {
+ object = {};
}
- //extra: if the schema doesn't explicitly define this property, we somehow have to
- if (!this._cellProperties[propertyNodeTagName]) {
- type = _getAttribute(propertyNode, "type");
- if (!type) {
- type = (propertyNodeTagName === "Value") ? "xs:decimal" : "xs:string";
+ return this._readCell(this._cellNode, object);
+ },
+ /**
+ * Iterate through each cell.
+ * @method eachCell
+ * @param {function()} callback
+ * @param {object} scope
+ * @param {object} args
+ * @return {boolean}
+ */
+ eachCell: function(callback, scope, args) {
+ var mArgs = [null];
+ if (!scope) {
+ scope = this;
+ }
+ if (args) {
+ if (!_isArr(args)) {
+ args = [args];
+ }
+ mArgs = mArgs.concat(args);
+ }
+ var ord;
+ while (ord !== -1 && this.hasMoreCells()){
+ ord = this.nextCell();
+ mArgs[0] = this.readCell();
+ if (callback.apply(scope, mArgs)===false) {
+ return false;
}
- this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
- //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
- makePropertyGetter(propertyNodeTagName);
}
- }
- this._cellNodes = _getElementsByTagNameNS(
- root, _xmlnsDataset, "", "Cell"
- );
- this._cellCount = this._cellNodes.length;
- this.reset();
- },
- _getCellNode: function(index){
- //console.debug(index);
- if (!_isUnd(index)) {
- this._idx = index;
- }
- this._cellNode = this._cellNodes[this._idx];
- this._cellOrd = this._getCellOrdinal(this._cellNode);
- },
- _getCellOrdinal: function(node){
- return parseInt(_getAttribute(node, "CellOrdinal"), 10);
- },
-/**
-* Returns the number of cells contained in this cellset.
-* This is the number of cells that is actually present in the cellset - not the number of logical cells.
-* The nuber of logical cells can be be calculated by multiplying the tuple counts of all axes of the data set.
-* The XML/A provider will typically not return empty cells, hence, the cellCount may be less than the logical cell count.
-* @method cellCount
-* @return {int} The number of cells in this cellset.
-*/
- cellCount: function() {
- return this._cellNodes.length;
- },
-/**
-* Resets the internal cell pointer to the argument, or to 0 if the argument is omitted.
-* Normally, you shouldn't have to call this method yourself.
-* @method reset
-* @param idx {int}
-*/
- reset: function(idx){
- this._idx = idx ? idx : 0;
- if (this.hasMoreCells()) {
- this._getCellNode();
- }
- },
-/**
-* Check if there are cells to iterate through.
-* @method hasMoreCells
-* @return {boolean} true if there are more cells to iterate, false if there are no more cells to iterate.
-*/
- hasMoreCells: function(){
- return this._idx < this._cellCount;
- },
-/**
-* Advance to the next (physical) cell.
-* Note that this method may appear to be skipping cells. This happens when the XML/A provider omits empty cells in the response.
-* @method nextCell
-* @return {int} returns the ordinal of the next cell, or -1 if there was no next cell.
-*/
- nextCell: function(){
- this._idx += 1;
- if (this.hasMoreCells()) {
- this._getCellNode();
- return this._cellOrd;
- }
- else {
this._idx = 0;
- return -1;
- }
- },
-/**
-* Returns the internal cell pointer. This is the fysical cell pointer.
-* To get the logical cell pointer, see cellOrdinal()
-* @method curr
-* @return {int} returns the internal cell pointer.
-*/
- curr: function(){
- return this._idx;
- },
-/**
-* Check if the cell has the specified property.
-* XML/A defines these standard properties:ValueFmtValueForeColorBackColortrue if the current cell has the specified property, false if it doesn't.
-*/
- hasCellProperty: function(propertyName) {
- return !_isUnd(this._cellProperties[propertyName]);
- },
-/**
-* Return the value of the current property of the current cell.
-* XML/A defines these standard properties:ValueFmtValueForeColorBackColorcurr()
-* @method cellOrdinal
-* @return {int} returns the logical cell pointer.
-*/
- cellOrdinal: function() {
- return this._cellOrd;
- },
- _readCell: function(node, object){
- var p, cellProp, cellProperty;
- for (p in this._cellProperties){
- cellProp = _getElementsByTagNameNS(
- node, _xmlnsDataset, "", p
- )[0];
- if (!cellProp) {
- continue;
+ return cells;
+ },
+ /**
+ * Get a cell by its physical index.
+ * This method should typically not be called by clients.
+ * Instead, they should use getByOrdinal()
+ * @method getByIndex
+ * @param {int} index - the physical index of the cell within the cellset.
+ * @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
+ * @return {object} An object that represents the cell.
+ */
+ getByIndex: function(index, object) {
+ this._getCellNode(index);
+ return this.readCell(object);
+ },
+ /**
+ * Get a cell by its logical index.
+ * @method getByOrdinal
+ * @param {int} ordinal - the ordinal number of the cell to retrieve.
+ * @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
+ * @return {object} An object that represents the cell.
+ */
+ getByOrdinal: function(ordinal, object) {
+ var node, ord, idx, lastIndex = this.cellCount() - 1;
+ idx = ordinal > lastIndex ? lastIndex : ordinal;
+ while(true) {
+ node = this._cellNodes[idx];
+ ord = this._getCellOrdinal(node);
+ if (ord === ordinal) return this.getByIndex(idx, object);
+ else
+ if (ord > ordinal) idx--;
+ else return null;
+ }
+ },
+ /**
+ * Get the physical cell index for the specified ordinal number.
+ * This method is useful to calculate boundaries to retrieve a range of cells.
+ * @method indexForOrdinal
+ * @param {int} ordinal - the ordinal number for which the index shoul dbe returned
+ * @return {int} The physical index.
+ */
+ indexForOrdinal: function(ordinal){
+ var cellNodes = this._cellNodes,
+ n = cellNodes.length,
+ index = Math.min(ordinal, n-1),
+ cellOrdinal, node
+ ;
+ while(index >= 0) {
+ //get the node at the current index
+ node = cellNodes[index];
+ cellOrdinal = this._getCellOrdinal(node);
+ if (cellOrdinal === ordinal) {
+ return index;
+ }
+ else
+ if (cellOrdinal > ordinal) {
+ index--;
+ }
+ else {
+ return -1;
+ }
}
- cellProperty = this._cellProperties[p];
- if (cellProperty) {
- object[p] = cellProperty(_getElementText(cellProp));
+ return -1;
+ },
+ /**
+ * Get a range of cells that fits the specified ordinals.
+ * This method is useful to grab a slice of cells for a subset of the axes.
+ * (You can use cellOrdinalForTupleIndexes to calculate ordinals in terms of tuple indexes.)
+ * The returned range only contains cells that actually exist so the ordinal of adjacent cells may have gaps,
+ * @method fetchRangeAsArray
+ * @param {int} from - the ordinal number indicating the start of the range
+ * @param {int} to - the ordinal number indicating the end of the range
+ * @return {[object]} - An array of cells that fit the specified range.
+ */
+ fetchRangeAsArray: function(from, to){
+ var range = [], cellNodes = this._cellNodes, n = cellNodes.length;
+ if (n === 0) {
+ return range;
}
- else
- if (p === "Value") {
- object[p] = _getElementValue(cellProp);
+
+ var cellNode, ordinal;
+ if (_isUnd(to) || to === -1) {
+ to = this._getCellOrdinal(cellNodes[n-1]);
}
- else {
- object[p] = _getElementText(cellProp);
+ if (_isUnd(from) || from === -1) {
+ from = this._getCellOrdinal(cellNodes[0]);
}
- }
- object.ordinal = this._getCellOrdinal(node);
- return object;
- },
-/**
- * Reads the current cell into the specified object.
-* @method readCell
-* @param {object} object An existing object to use for the current cell. If omitted, a new object will be created.
-* @return {object} An object that represents the current cell.
-*/
- readCell: function(object) {
- if (!object) {
- object = {};
- }
- return this._readCell(this._cellNode, object);
- },
-/**
- * Iterate through each cell.
-* @method eachCell
-* @param {function()} callback
-* @param {object} scope
-* @param {object} args
-* @return {boolean}
-*/
- eachCell: function(callback, scope, args) {
- var mArgs = [null];
- if (!scope) {
- scope = this;
- }
- if (args) {
- if (!_isArr(args)) {
- args = [args];
+
+ //start at to (or at end of array of cells in case empty cells exist)
+ var toIndex = Math.min(to, n - 1);
+ while (toIndex >= 0) {
+ cellNode = cellNodes[toIndex];
+ ordinal = this._getCellOrdinal(cellNode);
+ if (ordinal <= to) {
+ break;
+ }
+ toIndex -= 1;
}
- mArgs = mArgs.concat(args);
- }
- var ord;
- while (ord !== -1 && this.hasMoreCells()){
- ord = this.nextCell();
- mArgs[0] = this.readCell();
- if (callback.apply(scope, mArgs)===false) {
- return false;
+
+ if (toIndex === -1) {
+ //Would be very strange to arrive here.
+ return range;
}
- }
- this._idx = 0;
- return true;
- },
-/**
- * Iterate through each cell and return them all as a object by cell ordinal.
-* @method fetchAllAsObject
-* @return {object}
-*/
- fetchAllAsObject: function(){
- var cell, cells = {}, i = 0, count = this._cellCount;
- for (i = 0; i < count; i++){
- cell = this.readCell();
- cells[cell.ordinal] = cell;
- this.nextCell();
- }
- return cells;
- },
-/**
- * Get a cell by its physical index.
- * This method should typically not be called by clients.
- * Instead, they should use getByOrdinal()
-* @method getByIndex
-* @param {int} index - the physical index of the cell within the cellset.
-* @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
-* @return {object} An object that represents the cell.
-*/
- getByIndex: function(index, object) {
- this._getCellNode(index);
- return this.readCell(object);
- },
-/**
- * Get a cell by its logical index.
-* @method getByOrdinal
-* @param {int} ordinal - the ordinal number of the cell to retrieve.
-* @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
-* @return {object} An object that represents the cell.
-*/
- getByOrdinal: function(ordinal, object) {
- var node, ord, idx, lastIndex = this.cellCount() - 1;
- idx = ordinal > lastIndex ? lastIndex : ordinal;
- while(true) {
- node = this._cellNodes[idx];
- ord = this._getCellOrdinal(node);
- if (ord === ordinal) return this.getByIndex(idx, object);
- else
- if (ord > ordinal) idx--;
- else return null;
- }
- },
-/**
- * Get the physical cell index for the specified ordinal number.
- * This method is useful to calculate boundaries to retrieve a range of cells.
- * @method indexForOrdinal
- * @param {int} ordinal - the ordinal number for which the index shoul dbe returned
- * @return {int} The physical index.
- */
- indexForOrdinal: function(ordinal){
- var cellNodes = this._cellNodes,
- n = cellNodes.length,
- index = Math.min(ordinal, n-1),
- cellOrdinal, node
- ;
- while(index >= 0) {
- //get the node at the current index
- node = cellNodes[index];
- cellOrdinal = this._getCellOrdinal(node);
- if (cellOrdinal === ordinal) {
- return index;
+
+ if (ordinal < from) {
+ //The ordinal closest to "to" lies before "from" -> no cells are in range.
+ return range;
}
- else
- if (cellOrdinal > ordinal) {
- index--;
+
+ var fromIndex = Math.min(toIndex, from);
+ while (fromIndex >= 0) {
+ cellNode = cellNodes[fromIndex];
+ ordinal = this._getCellOrdinal(cellNode);
+ if (ordinal <= from) {
+ if (ordinal < from) {
+ fromIndex += 1;
+ }
+ break;
+ }
+ fromIndex -= 1;
}
- else {
- return -1;
+
+ if (fromIndex === -1) {
+ fromIndex = 0;
}
- }
- return -1;
- },
-/**
- * Get a range of cells that fits the specified ordinals.
- * This method is useful to grab a slice of cells for a subset of the axes.
- * (You can use cellOrdinalForTupleIndexes to calculate ordinals in terms of tuple indexes.)
- * The returned range only contains cells that actually exist so the ordinal of adjacent cells may have gaps,
- * @method fetchRangeAsArray
- * @param {int} from - the ordinal number indicating the start of the range
- * @param {int} to - the ordinal number indicating the end of the range
- * @return {[object]} - An array of cells that fit the specified range.
- */
- fetchRangeAsArray: function(from, to){
- var range = [], cellNodes = this._cellNodes, n = cellNodes.length;
- if (n === 0) {
- return range;
- }
-
- var cellNode, ordinal;
- if (_isUnd(to) || to === -1) {
- to = this._getCellOrdinal(cellNodes[n-1]);
- }
- if (_isUnd(from) || from === -1) {
- from = this._getCellOrdinal(cellNodes[0]);
- }
-
- //start at to (or at end of array of cells in case empty cells exist)
- var toIndex = Math.min(to, n - 1);
- while (toIndex >= 0) {
- cellNode = cellNodes[toIndex];
- ordinal = this._getCellOrdinal(cellNode);
- if (ordinal <= to) {
- break;
- }
- toIndex -= 1;
- }
-
- if (toIndex === -1) {
- //Would be very strange to arrive here.
- return range;
- }
-
- if (ordinal < from) {
- //The ordinal closest to "to" lies before "from" -> no cells are in range.
- return range;
- }
-
- var fromIndex = Math.min(toIndex, from);
- while (fromIndex >= 0) {
- cellNode = cellNodes[fromIndex];
- ordinal = this._getCellOrdinal(cellNode);
- if (ordinal <= from) {
- if (ordinal < from) {
- fromIndex += 1;
+
+ var index;
+ for (index = fromIndex; index <= toIndex; index++) {
+ cellNode = cellNodes[index];
+ range.push(this._readCell(cellNode, {}));
}
- break;
- }
- fromIndex -= 1;
- }
-
- if (fromIndex === -1) {
- fromIndex = 0;
- }
-
- var index;
- for (index = fromIndex; index <= toIndex; index++) {
- cellNode = cellNodes[index];
- range.push(this._readCell(cellNode, {}));
+ return range;
+ },
+ /**
+ * Calculate the ordinal based on the specified tuple indexes.
+ * @method cellOrdinalForTupleIndexes
+ * @param {int...} tuple index - a variable list of integer arguments. Arguments represent the index of a tuple on the query axes. Tuple indexes should be specified by descending order of axes. For example, if you have a DataSet with 2 Axes, pass the row tuple index as the first argument, and the column tuple index as the last argument.
+ * @return {int} The ordinal number for this combination of tuple indexes. This return value can be used as argument for getByOrdinal()
+ */
+ cellOrdinalForTupleIndexes: function() {
+ return this._dataset.cellOrdinalForTupleIndexes.apply(this._dataset, arguments);
+ },
+ /**
+ * Get the cell corresponding to the specified tuple indexes.
+ * @method getByTupleIndexes
+ * @param {int...} ordinal
+ * @return {object}
+ */
+ getByTupleIndexes: function() {
+ return this.getByOrdinal(this.cellOrdinalForTupleIndexes.apply(this, arguments));
+ },
+ /**
+ * Close this cellset.
+ * @method close
+ */
+ close: function(){
+ this._dataset = null;
+ this._cellNodes = null;
+ this._cellNode = null;
}
- return range;
- },
-/**
- * Calculate the ordinal based on the specified tuple indexes.
-* @method cellOrdinalForTupleIndexes
-* @param {int...} tuple index - a variable list of integer arguments. Arguments represent the index of a tuple on the query axes. Tuple indexes should be specified by descending order of axes. For example, if you have a DataSet with 2 Axes, pass the row tuple index as the first argument, and the column tuple index as the last argument.
-* @return {int} The ordinal number for this combination of tuple indexes. This return value can be used as argument for getByOrdinal()
-*/
- cellOrdinalForTupleIndexes: function() {
- return this._dataset.cellOrdinalForTupleIndexes.apply(this._dataset, arguments);
- },
-/**
- * Get the cell corresponding to the specified tuple indexes.
-* @method getByTupleIndexes
-* @param {int...} ordinal
-* @return {object}
-*/
- getByTupleIndexes: function() {
- return this.getByOrdinal(this.cellOrdinalForTupleIndexes.apply(this, arguments));
- },
-/**
- * Close this cellset.
-* @method close
-*/
- close: function(){
- this._dataset = null;
- this._cellNodes = null;
- this._cellNode = null;
}
-}
-
-
-/**
-* -* This class is used to indicate an runtime errors occurring in any of the methods of the xmla4js classes. -*
-*-* You do not need to instantiate objects of this class yourself. -* Rather, instances of this class are created and thrown at runtime whenever an error occurs. -* The purpose is to provide a clean and clear way for applications that use xmla4js to recognize and handle Xmla4js specific runtime errors. -*
-*
-* To handle Xmla4js errors, you can use a try...catch block like this:
-*
- try {
- ...general xmla4js work...
- } catch (exception) {
- if (exception instanceof Xmla.Exception) {
- ...use exception.code, exception.message and exception.data to handle the exception.
- } else {
- ...handle other errors...
- }
- }
-
-*
-* @class Xmla.Exception
-* @constructor
-*/
-Xmla.Exception = function(type, code, message, helpfile, source, data, args, detail, actor){
- this.type = type;
- this.code = code;
- this.message = message;
- this.source = source;
- this.helpfile = helpfile;
- this.data = data;
- this.args = args;
- this.detail = detail;
- this.actor = actor;
- return this;
-};
-
-/**
-* Can appear as value for the type property of instances of the Xmla.Exception class,
-* and indicates that this Xmla.Exception signals a warning.
-*
-* @property TYPE_WARNING
-* @static
-* @final
-* @type string
-* @default warning
-*/
-Xmla.Exception.TYPE_WARNING = "warning";
-/**
-* Can appear as value for the type property of instances of the Xmla.Exception class,
-* and indicates that this Xmla.Exception signals an error.
-*
-* @property TYPE_ERROR
-* @static
-* @final
-* @type string
-* @default error
-*/
-Xmla.Exception.TYPE_ERROR = "error";
-
-var _exceptionHlp = "http://code.google.com/p/xmla4js/wiki/ExceptionCodes";
-
-/**
-* Exception code indicating a requestType option was expected but ommitted.
-*
-* @property MISSING_REQUEST_TYPE_CDE
-* @static
-* @final
-* @type {int}
-* @default -1
-*/
-Xmla.Exception.MISSING_REQUEST_TYPE_CDE = -1;
-Xmla.Exception.MISSING_REQUEST_TYPE_MSG = "Missing_Request_Type";
-Xmla.Exception.MISSING_REQUEST_TYPE_HLP = _exceptionHlp +
- "#" + Xmla.Exception.MISSING_REQUEST_TYPE_CDE +
- "_" + Xmla.Exception.MISSING_REQUEST_TYPE_MSG;
-/**
-* Exception code indicating a statement option was expected but ommitted.
-*
-* @property MISSING_STATEMENT_CDE
-* @static
-* @final
-* @type {int}
-* @default -2
-*/
-Xmla.Exception.MISSING_STATEMENT_CDE = -2;
-Xmla.Exception.MISSING_STATEMENT_MSG = "Missing_Statement";
-Xmla.Exception.MISSING_STATEMENT_HLP = _exceptionHlp +
- "#" + Xmla.Exception.MISSING_STATEMENT_CDE +
- "_" + Xmla.Exception.MISSING_STATEMENT_MSG;
-
-/**
-* Exception code indicating a url option was expected but ommitted.
-*
-* @property MISSING_URL_CDE
-* @static
-* @final
-* @type {int}
-* @default -3
-*/
-Xmla.Exception.MISSING_URL_CDE = -3;
-Xmla.Exception.MISSING_URL_MSG = "Missing_URL";
-Xmla.Exception.MISSING_URL_HLP = _exceptionHlp +
- "#" + Xmla.Exception.MISSING_URL_CDE +
- "_" + Xmla.Exception.MISSING_URL_MSG;
-
-/**
-* Exception code indicating a events were expected but ommitted.
-*
-* @property NO_EVENTS_SPECIFIED_CDE
-* @static
-* @final
-* @type {int}
-* @default -4
-*/
-Xmla.Exception.NO_EVENTS_SPECIFIED_CDE = -4;
-Xmla.Exception.NO_EVENTS_SPECIFIED_MSG = "No_Events_Specified";
-Xmla.Exception.NO_EVENTS_SPECIFIED_HLP = _exceptionHlp +
- "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE +
- "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;
-
-/**
-* Exception code indicating a events were specifeid in the wrong format.
-*
-* @property WRONG_EVENTS_FORMAT_CDE
-* @static
-* @final
-* @type {int}
-* @default -5
-*/
-Xmla.Exception.WRONG_EVENTS_FORMAT_CDE = -5;
-Xmla.Exception.WRONG_EVENTS_FORMAT_MSG = "Wrong_Events_Format";
-Xmla.Exception.WRONG_EVENTS_FORMAT_HLP = _exceptionHlp +
- "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE +
- "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;
-
-/**
-* Exception code indicating that the event name was unrecognized.
-*
-* @property UNKNOWN_EVENT_CDE
-* @static
-* @final
-* @type {int}
-* @default -6
-*/
-Xmla.Exception.UNKNOWN_EVENT_CDE = -6;
-Xmla.Exception.UNKNOWN_EVENT_MSG = "Unknown_Event";
-Xmla.Exception.UNKNOWN_EVENT_HLP = _exceptionHlp +
- "#" + Xmla.Exception.UNKNOWN_EVENT_CDE +
- "_" + Xmla.Exception.UNKNOWN_EVENT_MSG;
-/**
-* Exception code indicating that no proper handler was passed for the events.
-*
-* @property INVALID_EVENT_HANDLER_CDE
-* @static
-* @final
-* @type {int}
-* @default -7
-*/
-Xmla.Exception.INVALID_EVENT_HANDLER_CDE = -7;
-Xmla.Exception.INVALID_EVENT_HANDLER_MSG = "Invalid_Events_Handler";
-Xmla.Exception.INVALID_EVENT_HANDLER_HLP = _exceptionHlp +
- "#" + Xmla.Exception.INVALID_EVENT_HANDLER_CDE +
- "_" + Xmla.Exception.INVALID_EVENT_HANDLER_MSG;
-/**
-* Exception code indicating that the rrepsonse could not be parsed
-*
-* @property ERROR_PARSING_RESPONSE_CDE
-* @static
-* @final
-* @type {int}
-* @default -8
-*/
-Xmla.Exception.ERROR_PARSING_RESPONSE_CDE = -8;
-Xmla.Exception.ERROR_PARSING_RESPONSE_MSG = "Error_Parsing_Response";
-Xmla.Exception.ERROR_PARSING_RESPONSE_HLP = _exceptionHlp +
- "#" + Xmla.Exception.ERROR_PARSING_RESPONSE_CDE +
- "_" + Xmla.Exception.ERROR_PARSING_RESPONSE_MSG ;
-/**
-* Exception code indicating the field name is not valid.
-*
-* @property INVALID_FIELD_CDE
-* @static
-* @final
-* @type {int}
-* @default -9
-*/
-Xmla.Exception.INVALID_FIELD_CDE = -9;
-Xmla.Exception.INVALID_FIELD_MSG = "Invalid_Field";
-Xmla.Exception.INVALID_FIELD_HLP = _exceptionHlp +
- "#" + Xmla.Exception.INVALID_FIELD_CDE +
- "_" + Xmla.Exception.INVALID_FIELD_MSG;
-
-/**
-* Exception code indicating a general XMLHttpRequest error.
-* If this error occurs, the data object of the exception will have these members:
-* -10
-*/
-Xmla.Exception.HTTP_ERROR_CDE = -10;
-Xmla.Exception.HTTP_ERROR_MSG = "HTTP Error";
-Xmla.Exception.HTTP_ERROR_HLP = _exceptionHlp +
- "#" + Xmla.Exception.HTTP_ERROR_CDE +
- "_" + Xmla.Exception.HTTP_ERROR_MSG;
-
-/**
-* Exception code indicating the hierarchy name is not valid.
-*
-* @property INVALID_HIERARCHY_CDE
-* @static
-* @final
-* @type {int}
-* @default -11
-*/
-Xmla.Exception.INVALID_HIERARCHY_CDE = -11;
-Xmla.Exception.INVALID_HIERARCHY_MSG = "Invalid_Hierarchy";
-Xmla.Exception.INVALID_HIERARCHY_HLP = _exceptionHlp +
- "#" + Xmla.Exception.INVALID_HIERARCHY_CDE +
- "_" + Xmla.Exception.INVALID_HIERARCHY_MSG;
-
-/**
-* Exception code indicating a problem reading a member property
-*
-* @property UNEXPECTED_ERROR_READING_MEMBER_CDE
-* @static
-* @final
-* @type {int}
-* @default -12
-*/
-Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE = -12;
-Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG = "Error_Reading_Member";
-Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_HLP = _exceptionHlp +
- "#" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE +
- "_" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG;
-
-/**
-* Exception code indicating the requested axis does not exist
-*
-* @property INVALID_AXIS
-* @static
-* @final
-* @type {int}
-* @default -13
-*/
-Xmla.Exception.INVALID_AXIS_CDE = -13;
-Xmla.Exception.INVALID_AXIS_MSG = "The requested axis does not exist.";
-Xmla.Exception.INVALID_AXIS_HLP = _exceptionHlp +
- "#" + Xmla.Exception.INVALID_AXIS_CDE +
- "_" + Xmla.Exception.INVALID_AXIS_MSG;
-
-/**
-* Exception code indicating illegal number of axis arguments
-*
-* @property ILLEGAL_ARGUMENT
-* @static
-* @final
-* @type {int}
-* @default -14
-*/
-Xmla.Exception.ILLEGAL_ARGUMENT_CDE = -14;
-Xmla.Exception.ILLEGAL_ARGUMENT_MSG = "Illegal arguments";
-Xmla.Exception.ILLEGAL_ARGUMENT_HLP = _exceptionHlp +
- "#" + Xmla.Exception.ILLEGAL_ARGUMENT_CDE +
- "_" + Xmla.Exception.ILLEGAL_ARGUMENT_MSG;
-
-/**
-* Exception code indicating that we couldn't instantiate a xml http request object
-*
-* @property ERROR_INSTANTIATING_XMLHTTPREQUEST
-* @static
-* @final
-* @type {int}
-* @default -15
-*/
-Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE = -15;
-Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG = "Error creating XML Http Request";
-Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_HLP = _exceptionHlp +
- "#" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE +
- "_" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG;
-
-Xmla.Exception._newError = function(codeName, source, data){
- return new Xmla.Exception(
- Xmla.Exception.TYPE_ERROR,
- Xmla.Exception[codeName + "_CDE"],
- Xmla.Exception[codeName + "_MSG"],
- Xmla.Exception[codeName + "_HLP"],
- source,
- data
- );
-};
-
-Xmla.Exception.prototype = {
-/**
-* This propery indicates what kind of exception occurred. It can have one of the following values: TYPE_WARNINGTYPE_ERRORarguments array of the function that is throwing the exception
-* This can be used to get a "stack trace"
-* @property args
-* @type {array}
-*/
- args: null,
-/**
- * Returns a string representing this exception
-* @method toString
-* @return a string representing this exception
-*/
- toString: function(){
- var string = this.type + " " +
- this.code + ": " + this.message +
- " (source: " + this.source + ", " +
- " actor: " + this.actor + ")";
- return string;
- },
-/**
- * Get a stack trace.
-* @method getStackTrace
-* @return an array of objects describing the function on the stack
-*/
- getStackTrace: function(){
- var funcstring, stack = "";
- if (this.args) {
- var func = this.args.callee;
- while (func){
- funcstring = String(func);
- func = func.caller;
+
+
+ /**
+ * + * This class is used to indicate an runtime errors occurring in any of the methods of the xmla4js classes. + *
+ *+ * You do not need to instantiate objects of this class yourself. + * Rather, instances of this class are created and thrown at runtime whenever an error occurs. + * The purpose is to provide a clean and clear way for applications that use xmla4js to recognize and handle Xmla4js specific runtime errors. + *
+ *
+ * To handle Xmla4js errors, you can use a try...catch block like this:
+ *
+ try {
+ ...general xmla4js work...
+ } catch (exception) {
+ if (exception instanceof Xmla.Exception) {
+ ...use exception.code, exception.message and exception.data to handle the exception.
+ } else {
+ ...handle other errors...
+ }
+ }
+
+ *
+ * @class Xmla.Exception
+ * @constructor
+ */
+ Xmla.Exception = function(type, code, message, helpfile, source, data, args, detail, actor){
+ this.type = type;
+ this.code = code;
+ this.message = message;
+ this.source = source;
+ this.helpfile = helpfile;
+ this.data = data;
+ this.args = args;
+ this.detail = detail;
+ this.actor = actor;
+ return this;
+ };
+
+ /**
+ * Can appear as value for the type property of instances of the Xmla.Exception class,
+ * and indicates that this Xmla.Exception signals a warning.
+ *
+ * @property TYPE_WARNING
+ * @static
+ * @final
+ * @type string
+ * @default warning
+ */
+ Xmla.Exception.TYPE_WARNING = "warning";
+ /**
+ * Can appear as value for the type property of instances of the Xmla.Exception class,
+ * and indicates that this Xmla.Exception signals an error.
+ *
+ * @property TYPE_ERROR
+ * @static
+ * @final
+ * @type string
+ * @default error
+ */
+ Xmla.Exception.TYPE_ERROR = "error";
+
+ var _exceptionHlp = "http://code.google.com/p/xmla4js/wiki/ExceptionCodes";
+
+ /**
+ * Exception code indicating a requestType option was expected but ommitted.
+ *
+ * @property MISSING_REQUEST_TYPE_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -1
+ */
+ Xmla.Exception.MISSING_REQUEST_TYPE_CDE = -1;
+ Xmla.Exception.MISSING_REQUEST_TYPE_MSG = "Missing_Request_Type";
+ Xmla.Exception.MISSING_REQUEST_TYPE_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.MISSING_REQUEST_TYPE_CDE +
+ "_" + Xmla.Exception.MISSING_REQUEST_TYPE_MSG;
+ /**
+ * Exception code indicating a statement option was expected but ommitted.
+ *
+ * @property MISSING_STATEMENT_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -2
+ */
+ Xmla.Exception.MISSING_STATEMENT_CDE = -2;
+ Xmla.Exception.MISSING_STATEMENT_MSG = "Missing_Statement";
+ Xmla.Exception.MISSING_STATEMENT_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.MISSING_STATEMENT_CDE +
+ "_" + Xmla.Exception.MISSING_STATEMENT_MSG;
+
+ /**
+ * Exception code indicating a url option was expected but ommitted.
+ *
+ * @property MISSING_URL_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -3
+ */
+ Xmla.Exception.MISSING_URL_CDE = -3;
+ Xmla.Exception.MISSING_URL_MSG = "Missing_URL";
+ Xmla.Exception.MISSING_URL_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.MISSING_URL_CDE +
+ "_" + Xmla.Exception.MISSING_URL_MSG;
+
+ /**
+ * Exception code indicating a events were expected but ommitted.
+ *
+ * @property NO_EVENTS_SPECIFIED_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -4
+ */
+ Xmla.Exception.NO_EVENTS_SPECIFIED_CDE = -4;
+ Xmla.Exception.NO_EVENTS_SPECIFIED_MSG = "No_Events_Specified";
+ Xmla.Exception.NO_EVENTS_SPECIFIED_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE +
+ "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;
+
+ /**
+ * Exception code indicating a events were specifeid in the wrong format.
+ *
+ * @property WRONG_EVENTS_FORMAT_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -5
+ */
+ Xmla.Exception.WRONG_EVENTS_FORMAT_CDE = -5;
+ Xmla.Exception.WRONG_EVENTS_FORMAT_MSG = "Wrong_Events_Format";
+ Xmla.Exception.WRONG_EVENTS_FORMAT_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE +
+ "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;
+
+ /**
+ * Exception code indicating that the event name was unrecognized.
+ *
+ * @property UNKNOWN_EVENT_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -6
+ */
+ Xmla.Exception.UNKNOWN_EVENT_CDE = -6;
+ Xmla.Exception.UNKNOWN_EVENT_MSG = "Unknown_Event";
+ Xmla.Exception.UNKNOWN_EVENT_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.UNKNOWN_EVENT_CDE +
+ "_" + Xmla.Exception.UNKNOWN_EVENT_MSG;
+ /**
+ * Exception code indicating that no proper handler was passed for the events.
+ *
+ * @property INVALID_EVENT_HANDLER_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -7
+ */
+ Xmla.Exception.INVALID_EVENT_HANDLER_CDE = -7;
+ Xmla.Exception.INVALID_EVENT_HANDLER_MSG = "Invalid_Events_Handler";
+ Xmla.Exception.INVALID_EVENT_HANDLER_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.INVALID_EVENT_HANDLER_CDE +
+ "_" + Xmla.Exception.INVALID_EVENT_HANDLER_MSG;
+ /**
+ * Exception code indicating that the rrepsonse could not be parsed
+ *
+ * @property ERROR_PARSING_RESPONSE_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -8
+ */
+ Xmla.Exception.ERROR_PARSING_RESPONSE_CDE = -8;
+ Xmla.Exception.ERROR_PARSING_RESPONSE_MSG = "Error_Parsing_Response";
+ Xmla.Exception.ERROR_PARSING_RESPONSE_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.ERROR_PARSING_RESPONSE_CDE +
+ "_" + Xmla.Exception.ERROR_PARSING_RESPONSE_MSG ;
+ /**
+ * Exception code indicating the field name is not valid.
+ *
+ * @property INVALID_FIELD_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -9
+ */
+ Xmla.Exception.INVALID_FIELD_CDE = -9;
+ Xmla.Exception.INVALID_FIELD_MSG = "Invalid_Field";
+ Xmla.Exception.INVALID_FIELD_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.INVALID_FIELD_CDE +
+ "_" + Xmla.Exception.INVALID_FIELD_MSG;
+
+ /**
+ * Exception code indicating a general XMLHttpRequest error.
+ * If this error occurs, the data object of the exception will have these members:
+ * -10
+ */
+ Xmla.Exception.HTTP_ERROR_CDE = -10;
+ Xmla.Exception.HTTP_ERROR_MSG = "HTTP Error";
+ Xmla.Exception.HTTP_ERROR_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.HTTP_ERROR_CDE +
+ "_" + Xmla.Exception.HTTP_ERROR_MSG;
+
+ /**
+ * Exception code indicating the hierarchy name is not valid.
+ *
+ * @property INVALID_HIERARCHY_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -11
+ */
+ Xmla.Exception.INVALID_HIERARCHY_CDE = -11;
+ Xmla.Exception.INVALID_HIERARCHY_MSG = "Invalid_Hierarchy";
+ Xmla.Exception.INVALID_HIERARCHY_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.INVALID_HIERARCHY_CDE +
+ "_" + Xmla.Exception.INVALID_HIERARCHY_MSG;
+
+ /**
+ * Exception code indicating a problem reading a member property
+ *
+ * @property UNEXPECTED_ERROR_READING_MEMBER_CDE
+ * @static
+ * @final
+ * @type {int}
+ * @default -12
+ */
+ Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE = -12;
+ Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG = "Error_Reading_Member";
+ Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE +
+ "_" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG;
+
+ /**
+ * Exception code indicating the requested axis does not exist
+ *
+ * @property INVALID_AXIS
+ * @static
+ * @final
+ * @type {int}
+ * @default -13
+ */
+ Xmla.Exception.INVALID_AXIS_CDE = -13;
+ Xmla.Exception.INVALID_AXIS_MSG = "The requested axis does not exist.";
+ Xmla.Exception.INVALID_AXIS_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.INVALID_AXIS_CDE +
+ "_" + Xmla.Exception.INVALID_AXIS_MSG;
+
+ /**
+ * Exception code indicating illegal number of axis arguments
+ *
+ * @property ILLEGAL_ARGUMENT
+ * @static
+ * @final
+ * @type {int}
+ * @default -14
+ */
+ Xmla.Exception.ILLEGAL_ARGUMENT_CDE = -14;
+ Xmla.Exception.ILLEGAL_ARGUMENT_MSG = "Illegal arguments";
+ Xmla.Exception.ILLEGAL_ARGUMENT_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.ILLEGAL_ARGUMENT_CDE +
+ "_" + Xmla.Exception.ILLEGAL_ARGUMENT_MSG;
+
+ /**
+ * Exception code indicating that we couldn't instantiate a xml http request object
+ *
+ * @property ERROR_INSTANTIATING_XMLHTTPREQUEST
+ * @static
+ * @final
+ * @type {int}
+ * @default -15
+ */
+ Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE = -15;
+ Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG = "Error creating XML Http Request";
+ Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_HLP = _exceptionHlp +
+ "#" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE +
+ "_" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG;
+
+ Xmla.Exception._newError = function(codeName, source, data){
+ return new Xmla.Exception(
+ Xmla.Exception.TYPE_ERROR,
+ Xmla.Exception[codeName + "_CDE"],
+ Xmla.Exception[codeName + "_MSG"],
+ Xmla.Exception[codeName + "_HLP"],
+ source,
+ data
+ );
+ };
+
+ Xmla.Exception.prototype = {
+ /**
+ * This propery indicates what kind of exception occurred. It can have one of the following values: TYPE_WARNINGTYPE_ERRORarguments array of the function that is throwing the exception
+ * This can be used to get a "stack trace"
+ * @property args
+ * @type {array}
+ */
+ args: null,
+ /**
+ * Returns a string representing this exception
+ * @method toString
+ * @return a string representing this exception
+ */
+ toString: function(){
+ var string = this.type + " " +
+ this.code + ": " + this.message +
+ " (source: " + this.source + ", " +
+ " actor: " + this.actor + ")";
+ return string;
+ },
+ /**
+ * Get a stack trace.
+ * @method getStackTrace
+ * @return an array of objects describing the function on the stack
+ */
+ getStackTrace: function(){
+ var funcstring, stack = "";
+ if (this.args) {
+ var func = this.args.callee;
+ while (func){
+ funcstring = String(func);
+ func = func.caller;
+ }
}
+ return stack;
}
- return stack;
+ };
+
+ /*
+ * Register Xmla.
+ * In an amd (https://github.com/amdjs/amdjs-api/wiki/AMD) environment, use the define function
+ * Otherwise, add it to the global window variable.
+ * For server side environemnts that do not have a proper window object,
+ * simply create a global variable called window and assign an object to it that you want to function as the Xmla container.
+ */
+ if (typeof(define)==="function" && define.amd) {
+ define(function (){
+ return Xmla;
+ });
}
-};
-
-/*
-* Register Xmla.
-* In an amd (https://github.com/amdjs/amdjs-api/wiki/AMD) environment, use the define function
-* Otherwise, add it to the global window variable.
-* For server side environemnts that do not have a proper window object,
-* simply create a global variable called window and assign an object to it that you want to function as the Xmla container.
-*/
-if (typeof(define)==="function" && define.amd) {
- define(function (){
- return Xmla;
- });
-}
-else {
- window.Xmla = Xmla;
-}
-return Xmla;
-})(typeof exports === "undefined" ? window : exports);
+ else {
+ window.Xmla = Xmla;
+ }
+ return Xmla;
+ })(typeof exports === "undefined" ? window : exports);
+
\ No newline at end of file