|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.olap.OLAPUtil
public class OLAPUtil
A collection of static utility methods for working with the OLAP classes.
| Method Summary | |
|---|---|
static MondrianModel.Cube |
findReferencedCube(MondrianModel.VirtualCube vCube,
MondrianModel.CubeUsage cu)
Finds and returns the Cube that the given CubeUsage references. |
static MondrianModel.Dimension |
findReferencedDimension(MondrianModel.CubeDimension cubeDim)
Finds and returns the base Dimension that the given CubeDimension references. |
static java.util.List<SQLTable> |
getAvailableTables(OLAPObject obj)
Compiles a list of all accessible tables in the database being used by this OLAP object's session. |
static java.lang.String |
getQualifier(SQLTable t)
Mondrian uses a single string as a table name qualifier, so this method helps by finding the parent schema and/or catalog and produces the correct Mondrian qualifier for the given table. |
static OLAPSession |
getSession(OLAPObject oo)
Finds the OLAPSession that owns the given OLAPObject, by following parent pointers successively until an ancestor of type OLAPSession is encountered. |
static SQLTable |
getSQLTableFromOLAPTable(SQLDatabase database,
MondrianModel.Table table)
Search the database and retrieve the matching SQLTable(Relational) object thats logically equivalent to the given Table(OLAP representation) |
static boolean |
isNameUnique(OLAPObject parent,
java.lang.Class<? extends OLAPObject> type,
java.lang.String name)
Checks if the name is unique for an OLAPObject, relies on OLAPObject.getName() for name comparisons, case insensitive. |
static void |
listenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl)
Adds the given OLAPChildListener and optional PropertyChangeListener to the given root object and all of its descendants. |
static void |
listenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl,
CompoundEditListener cel)
Adds the given OLAPChildListener and optional PropertyChangeListener to the given root object and all of its descendants. |
static java.lang.String |
nameFor(OLAPObject obj)
OLAPObject.getName() does not always return the correct name so
this method helps by finding the proper name for those exceptions and
returns the correct value. |
static SQLTable |
tableForCube(MondrianModel.Cube cube)
Retrieves the SQLTable that represents the data source for the given cube. |
static SQLTable |
tableForHierarchy(MondrianModel.Hierarchy hier)
Retrieves the SQLTable that represents the data source for the given hierarchy. |
static void |
unlistenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl)
Removes the given OLAPChildListener and optional PropertyChangeListener from the given root object and all of its descendants. |
static void |
unlistenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl,
CompoundEditListener cel)
Removes the given OLAPChildListener and optional PropertyChangeListener from the given root object and all of its descendants. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static OLAPSession getSession(OLAPObject oo)
Note that when we say ancestor in this doc comment, we include
the given oo object as an "ancestor" of itself. In other
words, if you pass in an OLAPSession, you will get that same object back.
oo - The object to start searching at
public static java.lang.String getQualifier(SQLTable t)
public static void listenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl,
CompoundEditListener cel)
ocl - The OLAPChildListener to add to the subtree of OLAPObjects
rooted at root.pcl - The PropertyChangeListener to add to the subtree of
OLAPObjects rooted at root. If you don't want to know about
property changes to the nodes themselves, you can leave this
parameter as null.cel - The CompoundEditListener to add to the subtree of OLAPObjects
rooted at root. If you don't want to know about compound edit
groupings, you can leave this parameter as null.
public static void listenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl)
ocl - The OLAPChildListener to add to the subtree of OLAPObjects
rooted at root.pcl - The PropertyChangeListener to add to the subtree of
OLAPObjects rooted at root. If you don't want to know about
property changes to the nodes themselves, you can leave this
parameter as null.
public static void unlistenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl,
CompoundEditListener cel)
ocl - The OLAPChildListener to remove from the subtree of
OLAPObjects rooted at root. It is not an error if the listener
is not registered with any or all of the objects in the
subtree, so it's safe to call this with the root of the tree
if you want.pcl - The PropertyChangeListener to add to the subtree of
OLAPObjects rooted at root. It is not an error if the listener
is not registered with any or all of the objects in the
subtree, so it's safe to call this with the root of the tree
if you want. If you weren't listening for property change
events, you can leave this parameter as null. Note that this
parameter is pronounced "pockle," not "pickle."cel - The CompoundEditListener to add to the subtree of
OLAPObjects rooted at root. It is not an error if the listener
is not registered with any or all of the objects in the
subtree, so it's safe to call this with the root of the tree
if you want. If you weren't listening for compound edit
events, you can leave this parameter as null.
public static void unlistenToHierarchy(OLAPObject root,
OLAPChildListener ocl,
java.beans.PropertyChangeListener pcl)
ocl - The OLAPChildListener to remove from the subtree of
OLAPObjects rooted at root. It is not an error if the listener
is not registered with any or all of the objects in the
subtree, so it's safe to call this with the root of the tree
if you want.pcl - The PropertyChangeListener to add to the subtree of
OLAPObjects rooted at root. It is not an error if the listener
is not registered with any or all of the objects in the
subtree, so it's safe to call this with the root of the tree
if you want. If you weren't listening for property change
events, you can leave this parameter as null. Note that this
parameter is pronounced "pockle," not "pickle."public static java.lang.String nameFor(OLAPObject obj)
OLAPObject.getName() does not always return the correct name so
this method helps by finding the proper name for those exceptions and
returns the correct value.
obj - The object to find the name of.
public static SQLTable tableForHierarchy(MondrianModel.Hierarchy hier)
throws ArchitectException
hierarchy - the hierarchy whose data source to retrieve
ArchitectException - if populating the necessary SQLObjects fails
public static SQLTable tableForCube(MondrianModel.Cube cube)
throws ArchitectException
cube - The cube whose data source to retrieve.
ArchitectException - if populating the necessary SQLObjects fails.
public static SQLTable getSQLTableFromOLAPTable(SQLDatabase database,
MondrianModel.Table table)
throws ArchitectException
table - Table object representing a table in a relational database
ArchitectException
public static java.util.List<SQLTable> getAvailableTables(OLAPObject obj)
throws ArchitectException
obj - An object in the session you want the table list for.
ArchitectException - If there is a problem populating the list of tables (for
example, the database might not be reachable).
public static MondrianModel.Cube findReferencedCube(MondrianModel.VirtualCube vCube,
MondrianModel.CubeUsage cu)
vCube - Parent of the CubeUsage, used to find OLAPSession ancestor.CubeUsage - The CubeUsage to search by.
public static MondrianModel.Dimension findReferencedDimension(MondrianModel.CubeDimension cubeDim)
cubeDim - The CubeDimension to search by, OLAPSession ancestor must not
be null.
public static boolean isNameUnique(OLAPObject parent,
java.lang.Class<? extends OLAPObject> type,
java.lang.String name)
OLAPObject.getName() for name comparisons, case insensitive.
parent - The object that will be the parent.type - The type of the object.name - The name to check for, can be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||