org.openi.xmla
Class XmlaConnector

java.lang.Object
  extended by org.openi.xmla.XmlaConnector

public class XmlaConnector
extends java.lang.Object

does the work of connecting to an xmla server, queries, parses results. Goal is to isolate from jpivot xmla_soap


Constructor Summary
XmlaConnector()
          Constructor
 
Method Summary
 java.lang.String createDefaultMdx(Datasource datasource, java.lang.String cube, java.lang.String dimension, java.util.List measures)
          Generates an MDX statement from the cube param, and the dimension param.
 java.util.List discoverHier(Datasource datasource, java.lang.String cube, java.lang.String dimension)
           
 java.util.List discoverMeasures(Datasource datasource, java.lang.String cube)
           
 java.util.List getCubeList(Datasource datasource)
          returns cube list from the olap server using XMLA_SOAP's discoverCube method
 java.util.List getDimensionList(Datasource datasource, java.lang.String cubeName)
          Returns a List of dimension names as Strings Includes the Measures!
 com.tonbeller.jpivot.xmla.XMLA_Model query(Datasource datasource, java.lang.String mdxQuery)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlaConnector

public XmlaConnector()
Constructor

Parameters:
arg0 -
Method Detail

query

public com.tonbeller.jpivot.xmla.XMLA_Model query(Datasource datasource,
                                                  java.lang.String mdxQuery)
                                           throws java.io.IOException,
                                                  com.tonbeller.jpivot.olap.model.OlapException,
                                                  org.xml.sax.SAXException
Throws:
java.io.IOException
com.tonbeller.jpivot.olap.model.OlapException
org.xml.sax.SAXException

getCubeList

public java.util.List getCubeList(Datasource datasource)
                           throws com.tonbeller.jpivot.olap.model.OlapException
returns cube list from the olap server using XMLA_SOAP's discoverCube method

Parameters:
server - String
catalog - String
user - String
pwd - String
Returns:
List
Throws:
com.tonbeller.jpivot.olap.model.OlapException
java.lang.Exception

getDimensionList

public java.util.List getDimensionList(Datasource datasource,
                                       java.lang.String cubeName)
                                throws com.tonbeller.jpivot.olap.model.OlapException
Returns a List of dimension names as Strings Includes the Measures!

Parameters:
uri -
catalog -
cubeName -
user -
pwd -
Returns:
Throws:
com.tonbeller.jpivot.olap.model.OlapException

discoverHier

public java.util.List discoverHier(Datasource datasource,
                                   java.lang.String cube,
                                   java.lang.String dimension)
                            throws com.tonbeller.jpivot.olap.model.OlapException
Throws:
com.tonbeller.jpivot.olap.model.OlapException

createDefaultMdx

public java.lang.String createDefaultMdx(Datasource datasource,
                                         java.lang.String cube,
                                         java.lang.String dimension,
                                         java.util.List measures)
                                  throws com.tonbeller.jpivot.olap.model.OlapException
Generates an MDX statement from the cube param, and the dimension param. sample result: SELECT {[Measures].DefaultMember} on columns, {[Category].Children} on rows FROM [Budget] If your dimension has multiple hierarchies (SSAS 2005), we use first discovered hierarchy: SELECT {[Measures].DefaultMember} on columns, {[Product Class].[Product Category].Children And a variation is if you want to pass in a specific list of measures, the result would look like this: SELECT {[Measures].[Gross Weight], [Measures].[Net Weight]} on columns, {[Product Class].[Product Category].Children} on rows FROM [Foodmart 2005]

Parameters:
datasource -
cube -
dimension -
measures - if you want the mdx to use a specific list of measures use this param otherwise, you will get [Measures].DefaultMember
Returns:
Throws:
com.tonbeller.jpivot.olap.model.OlapException

discoverMeasures

public java.util.List discoverMeasures(Datasource datasource,
                                       java.lang.String cube)
                                throws com.tonbeller.jpivot.olap.model.OlapException
Throws:
com.tonbeller.jpivot.olap.model.OlapException