private static String lookupSetting( IApplicationContext applicationContext, String applicationContextName, String hibernateSettingsName, String pentahoXmlName ) { // 1- Look in applicationContext // 2- Look in PentahoSystem/hibernate-settings.xml // 3- Look in pentaho.xml String tmp = null; tmp = applicationContext.getProperty( applicationContextName, null ); if ( ( tmp != null ) && ( !StringUtil.isEmpty( tmp ) ) ) { return tmp.trim(); } if ( tmp == null ) { tmp = PentahoSystem.getSystemSetting( "hibernate/hibernate-settings.xml", hibernateSettingsName, null ); //$NON-NLS-1$ if ( ( tmp != null ) && ( !StringUtil.isEmpty( tmp ) ) ) { return tmp.trim(); } } if ( tmp == null ) { tmp = PentahoSystem.getSystemSetting( pentahoXmlName, null ); if ( ( tmp != null ) && ( !StringUtil.isEmpty( tmp ) ) ) { return tmp.trim(); } } return null; }