Search in sources :

Example 61 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class LocaleSetting method setLanguageCodeToConfigFile.

public void setLanguageCodeToConfigFile() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    configMgr.addProperty(LANGUAGE_CODE, languageCode);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 62 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class LocaleSetting method setDirectionToConfigFile.

public void setDirectionToConfigFile() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    configMgr.addProperty(DIRECTION, direction);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 63 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class LocaleSetting method clearDirection.

public void clearDirection() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    configMgr.clearProperty(DIRECTION);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 64 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class LocaleSetting method clearLanguageCode.

public void clearLanguageCode() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    configMgr.clearProperty(LANGUAGE_CODE);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 65 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class LocaleSetting method load.

private void load() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    if (configMgr.containsKey(COUNTRY_CODE)) {
        countryCode = configMgr.getString(COUNTRY_CODE);
    } else {
        throw new RuntimeException("The country code is not defined in the config file.");
    }
    if (configMgr.containsKey(LANGUAGE_CODE)) {
        languageCode = configMgr.getString(LANGUAGE_CODE);
    } else {
        throw new RuntimeException("The language code is not defined in the config file.");
    }
    direction = configMgr.getString(DIRECTION, DEFAULT_DIRECTION);
    setLabLevel(configMgr.getInteger(LAB_LEVEL, DEFAULT_LAB_LEVEL));
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Aggregations

MifosConfigurationManager (org.mifos.config.business.MifosConfigurationManager)66 Test (org.junit.Test)18 ConfigurationException (org.mifos.config.exceptions.ConfigurationException)8 Properties (java.util.Properties)5 MifosRuntimeException (org.mifos.core.MifosRuntimeException)5 PersistenceException (org.mifos.framework.exceptions.PersistenceException)5 ApplicationException (org.mifos.framework.exceptions.ApplicationException)4 RoundingMode (java.math.RoundingMode)3 ConfigurationPersistence (org.mifos.config.persistence.ConfigurationPersistence)3 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)3 SystemException (org.mifos.framework.exceptions.SystemException)3 BigDecimal (java.math.BigDecimal)2 Ignore (org.junit.Ignore)2 AccountBO (org.mifos.accounts.business.AccountBO)2 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)2 ConfigurationKeyValue (org.mifos.config.business.ConfigurationKeyValue)2 CurrencyMismatchException (org.mifos.core.CurrencyMismatchException)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1