MdxConnectionAction connAction = (MdxConnectionAction) getActionDefinition();
String catalogName = connAction.getCatalog().getStringValue();
IMondrianCatalogService mondrianCatalogService =
PentahoSystem.get( IMondrianCatalogService.class, "IMondrianCatalogService", PentahoSessionHolder.getSession() ); //$NON-NLS-1$
MondrianCatalog catalog = mondrianCatalogService.getCatalog( catalogName, PentahoSessionHolder.getSession() );
if ( catalog == null ) {
return getConnectionOrig();
}
Util.PropertyList connectProperties = Util.parseConnectString( catalog.getDataSourceInfo() );
Properties properties = new Properties();
Iterator<Pair<String, String>> iter = connectProperties.iterator();
while ( iter.hasNext() ) {
Pair<String, String> pair = iter.next();
properties.put( pair.getKey(), pair.getValue() );
}
properties.put( "Catalog", catalog.getDefinition() );
properties.put( "Provider", "mondrian" );
properties.put( "PoolNeeded", "false" );
properties.put( RolapConnectionProperties.Locale.name(), LocaleHelper.getLocale().toString() );
debug( "Mondrian Connection Properties: " + properties.toString() );