public OlapMetaExplorer(IConnectionManager ic) {
connections = ic;
}
public SaikuConnection getConnection(String connectionName) throws SaikuOlapException {
OlapConnection olapcon = connections.getOlapConnection(connectionName);
SaikuConnection connection;
if (olapcon != null) {
List<SaikuCatalog> catalogs = new ArrayList<SaikuCatalog>();
try {
for (Catalog cat : olapcon.getOlapCatalogs()) {
List<SaikuSchema> schemas = new ArrayList<SaikuSchema>();
for (Schema schem : cat.getSchemas()) {
List<SaikuCube> cubes = new ArrayList<SaikuCube>();
for (Cube cub : schem.getCubes()) {
cubes.add(
new SaikuCube(connectionName, cub.getUniqueName(), cub.getName(), cub.getCaption(), cat.getName(),
schem.getName(), cub.isVisible()));
}
Collections.sort(cubes, new SaikuCubeCaptionComparator());
schemas.add(new SaikuSchema(schem.getName(), cubes));
}
if (schemas.size() == 0) {
OlapDatabaseMetaData olapDbMeta = olapcon.getMetaData();
ResultSet cubesResult = olapDbMeta.getCubes(cat.getName(), null, null);
try {
List<SaikuCube> cubes = new ArrayList<SaikuCube>();
while (cubesResult.next()) {