public static String getInitialQuery( final Properties properties, final String cubeName, IPentahoSession session )
throws Throwable {
// Apply any properties for this catalog specified in datasource.xml
IMondrianCatalogService mondrianCatalogService =
PentahoSystem.get( IMondrianCatalogService.class, "IMondrianCatalogService",
PentahoSessionHolder.getSession() );
List<MondrianCatalog> catalogs = mondrianCatalogService.listCatalogs( PentahoSessionHolder.getSession(), true );
String propCat = properties.getProperty( RolapConnectionProperties.Catalog.name() );
for ( MondrianCatalog cat : catalogs ) {
if ( cat.getDefinition().equalsIgnoreCase( propCat ) ) {
Util.PropertyList connectProperties = Util.parseConnectString( cat.getDataSourceInfo() );
Iterator<Pair<String, String>> iter = connectProperties.iterator();