com.tonbeller.jpivot.mondrian
Class MondrianModel

java.lang.Object
  extended by com.tonbeller.jpivot.core.ModelSupport
      extended by com.tonbeller.jpivot.olap.query.MdxOlapModel
          extended by com.tonbeller.jpivot.mondrian.MondrianModel
All Implemented Interfaces:
com.tonbeller.jpivot.core.Model, OlapModel, com.tonbeller.jpivot.olap.query.QueryAdapter.QueryAdapterHolder, com.tonbeller.wcf.bookmarks.Bookmarkable

public class MondrianModel
extends com.tonbeller.jpivot.olap.query.MdxOlapModel
implements OlapModel, com.tonbeller.jpivot.olap.query.QueryAdapter.QueryAdapterHolder

The Model represents all (meta-)data for an MDX query.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.tonbeller.jpivot.olap.model.OlapModel
OlapModel.EmptyCubeException, OlapModel.ResultTooLargeException
 
Field Summary
 
Fields inherited from interface com.tonbeller.wcf.bookmarks.Bookmarkable
EXTENSIONAL, INTENSIONAL
 
Constructor Summary
MondrianModel()
          constructor must be "default"
 
Method Summary
 com.tonbeller.jpivot.mondrian.MondrianMember addMember(mondrian.olap.Member monMember)
          add Member to Hashtable, if not already there
 void destroy()
          session terminated, closing connections etc
 java.lang.Object getBookmarkState(int levelOfDetail)
          create a Memento bean object holding current state.
 java.lang.String getCurrentMdx()
          get the MDX for the user to edit
 com.tonbeller.jpivot.olap.model.Dimension[] getDimensions()
           
 java.lang.String getDynLocale()
          Getter for property dynLocale.
 java.lang.String getDynresolver()
           
 javax.sql.DataSource getExternalDataSource()
          get the external DataSource to be used by Mondrian
 java.lang.String getID()
           
 com.tonbeller.jpivot.olap.model.Member[] getMeasures()
           
 com.tonbeller.jpivot.olap.query.QueryAdapter getQueryAdapter()
          Returns the queryAdapter.
 com.tonbeller.jpivot.olap.model.Result getResult()
          Let Mondrian parse and execute the query
 java.lang.Object getRootDecoree()
           
 javax.sql.DataSource getSqlDataSource()
           
 void initialize()
          complete the initilization.
 void initialize(java.util.List dimAccList)
          called once after creation.
 boolean isConnectionPooling()
          get Mondrian Connection Pooling property
 com.tonbeller.jpivot.mondrian.MondrianDimension lookupDimension(java.lang.String uniqueName)
          find the Dimension.
 com.tonbeller.jpivot.mondrian.MondrianHierarchy lookupHierarchy(java.lang.String uniqueName)
          find the Hierarchy in the dimensions.
 com.tonbeller.jpivot.mondrian.MondrianLevel lookupLevel(java.lang.String uniqueName)
          find level in the Olap Hierarchy.
 com.tonbeller.jpivot.olap.model.Member lookupMemberByUName(java.lang.String uniqueName)
          find member in the Olap Hierarchy.
 void removeMember(java.lang.String uniqueName)
          remove Member from Hashtable (for a calculated member)
 void setBookmarkState(java.lang.Object state)
          restore state from Memento.
 void setConnectionPooling(boolean connectionPooling)
          set Mondrian Connection Pooling property
 void setConnectString(java.lang.String connectString)
          set the Mondrian Connect String
 void setDynLocale(java.lang.String dynLocale)
          Setter for property dynLocale.
 void setDynresolver(java.lang.String dynresolver)
           
 void setExternalDataSource(javax.sql.DataSource externalDataSource)
          set the external DataSource to be used by Mondrian
 void setID(java.lang.String ID)
          sets an ID string for this model
 void setJdbcDriver(java.lang.String jdbcDriver)
          set the JDBC Driver
 void setMdxQuery(java.lang.String mdxQuery)
          Sets the mdxQuery.
 void setServletContext(javax.servlet.ServletContext servletContext)
          store a servlet context to the model
 
Methods inherited from class com.tonbeller.jpivot.core.ModelSupport
addExtension, addModelChangeListener, fireModelChanged, fireModelChanged, fireStructureChanged, fireStructureChanged, getExtension, getExtensions, getLocale, getTopDecorator, removeModelChangeListener, setLocale
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tonbeller.jpivot.core.Model
addExtension, addModelChangeListener, getExtension, getExtensions, getTopDecorator, removeModelChangeListener, setLocale
 

Constructor Detail

MondrianModel

public MondrianModel()
constructor must be "default"

Method Detail

getID

public java.lang.String getID()
Specified by:
getID in interface OlapModel
Returns:
an ID string for this model

setID

public void setID(java.lang.String ID)
Description copied from interface: OlapModel
sets an ID string for this model

Specified by:
setID in interface OlapModel

getQueryAdapter

public com.tonbeller.jpivot.olap.query.QueryAdapter getQueryAdapter()
Returns the queryAdapter.

Specified by:
getQueryAdapter in interface com.tonbeller.jpivot.olap.query.QueryAdapter.QueryAdapterHolder
Returns:
MondrianQueryAdapter

getResult

public com.tonbeller.jpivot.olap.model.Result getResult()
                                                 throws com.tonbeller.jpivot.olap.model.OlapException
Let Mondrian parse and execute the query

Specified by:
getResult in interface OlapModel
Returns:
Result of Query Execution
Throws:
com.tonbeller.jpivot.olap.model.OlapException
See Also:
OlapModel.getResult()

getDimensions

public com.tonbeller.jpivot.olap.model.Dimension[] getDimensions()
Specified by:
getDimensions in interface OlapModel
Returns:
all dimensions of the cube for navigation
See Also:
OlapModel.getDimensions()

getMeasures

public com.tonbeller.jpivot.olap.model.Member[] getMeasures()
Specified by:
getMeasures in interface OlapModel
Returns:
all measures of the cube for navigation
See Also:
OlapModel.getMeasures()

setConnectString

public void setConnectString(java.lang.String connectString)
set the Mondrian Connect String

Parameters:
connectString - Connect String - default: provider=Mondrian;Jdbc=jdbc:odbc:MondrianFoodMart; Catalog=file:///c:/j/mondrian/demo/FoodMart.xml

setJdbcDriver

public void setJdbcDriver(java.lang.String jdbcDriver)
set the JDBC Driver

Parameters:
jdbcDriver - JDBC Driver - default: sun.jdbc.odbc.JdbcOdbcDriver

setMdxQuery

public void setMdxQuery(java.lang.String mdxQuery)
Sets the mdxQuery.

Parameters:
mdxQuery - The mdxQuery to set

initialize

public void initialize()
                throws com.tonbeller.jpivot.olap.model.OlapException
complete the initilization.

Specified by:
initialize in interface OlapModel
Throws:
com.tonbeller.jpivot.olap.model.OlapException

initialize

public void initialize(java.util.List dimAccList)
                throws com.tonbeller.jpivot.olap.model.OlapException
Description copied from interface: OlapModel
called once after creation. E.g. open DB connection

Specified by:
initialize in interface OlapModel
Throws:
com.tonbeller.jpivot.olap.model.OlapException

addMember

public com.tonbeller.jpivot.mondrian.MondrianMember addMember(mondrian.olap.Member monMember)
add Member to Hashtable, if not already there

Parameters:
monMember - - the "key" is the Mondrian Member
Returns:
the corresponding member

removeMember

public void removeMember(java.lang.String uniqueName)
remove Member from Hashtable (for a calculated member)

Parameters:
monMember - - the "key" is the Mondrian Member

lookupDimension

public com.tonbeller.jpivot.mondrian.MondrianDimension lookupDimension(java.lang.String uniqueName)
find the Dimension.

Parameters:
uniqueName - is the search key (
Returns:
the corresponding MondrianDimension

lookupHierarchy

public com.tonbeller.jpivot.mondrian.MondrianHierarchy lookupHierarchy(java.lang.String uniqueName)
find the Hierarchy in the dimensions.

Parameters:
uniqueName - is the search key
Returns:
the corresponding hierarchy

lookupMemberByUName

public com.tonbeller.jpivot.olap.model.Member lookupMemberByUName(java.lang.String uniqueName)
find member in the Olap Hierarchy.

Specified by:
lookupMemberByUName in class com.tonbeller.jpivot.olap.query.MdxOlapModel
Parameters:
uniqueName - is the search key (Mondrian member unique name)
Returns:
the corresponding member

lookupLevel

public com.tonbeller.jpivot.mondrian.MondrianLevel lookupLevel(java.lang.String uniqueName)
find level in the Olap Hierarchy.

Parameters:
monLevel - is the search key (Mondrian level)
Returns:
the corresponding level

getCurrentMdx

public java.lang.String getCurrentMdx()
get the MDX for the user to edit

Specified by:
getCurrentMdx in class com.tonbeller.jpivot.olap.query.MdxOlapModel
Returns:
current MDX statement
See Also:
MdxOlapModel.getCurrentMdx()

getRootDecoree

public java.lang.Object getRootDecoree()

destroy

public void destroy()
session terminated, closing connections etc

Specified by:
destroy in interface OlapModel
Overrides:
destroy in class com.tonbeller.jpivot.core.ModelSupport

getBookmarkState

public java.lang.Object getBookmarkState(int levelOfDetail)
create a Memento bean object holding current state.

Specified by:
getBookmarkState in interface com.tonbeller.wcf.bookmarks.Bookmarkable
Overrides:
getBookmarkState in class com.tonbeller.jpivot.core.ModelSupport
Returns:
MondrianMemento current state

setBookmarkState

public void setBookmarkState(java.lang.Object state)
restore state from Memento.

Specified by:
setBookmarkState in interface com.tonbeller.wcf.bookmarks.Bookmarkable
Overrides:
setBookmarkState in class com.tonbeller.jpivot.core.ModelSupport
Parameters:
Object - state bean to be restored

getSqlDataSource

public javax.sql.DataSource getSqlDataSource()

getDynresolver

public java.lang.String getDynresolver()

setDynresolver

public void setDynresolver(java.lang.String dynresolver)

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Description copied from interface: OlapModel
store a servlet context to the model

Specified by:
setServletContext in interface OlapModel

isConnectionPooling

public boolean isConnectionPooling()
get Mondrian Connection Pooling property


setConnectionPooling

public void setConnectionPooling(boolean connectionPooling)
set Mondrian Connection Pooling property


getExternalDataSource

public javax.sql.DataSource getExternalDataSource()
get the external DataSource to be used by Mondrian


setExternalDataSource

public void setExternalDataSource(javax.sql.DataSource externalDataSource)
set the external DataSource to be used by Mondrian


getDynLocale

public java.lang.String getDynLocale()
Getter for property dynLocale.

Returns:
Value of property dynLocale.

setDynLocale

public void setDynLocale(java.lang.String dynLocale)
Setter for property dynLocale.

Parameters:
dynLocale - New value of property dynLocale.