use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.
the class ViewOrganizationSettingsServiceFacadeWebTier method getGeneralConfig.
private Properties getGeneralConfig() {
Properties configContent = new Properties();
MifosConfigurationManager configuration = MifosConfigurationManager.getInstance();
String maxPointsPerPPISurvey = configuration.getString("GeneralConfig.MaxPointsPerPPISurvey");
String batchSizeForBatchJobs = configuration.getString("GeneralConfig.BatchSizeForBatchJobs");
String recordCommittingSizeForBatchJobs = configuration.getString("GeneralConfig.RecordCommittingSizeForBatchJobs");
String outputIntervalForBatchJobs = configuration.getString("GeneralConfig.OutputIntervalForBatchJobs");
String allowDataPrefetchingWhenSavingCollectionSheets = configuration.getString("GeneralConfig.allowDataPrefetchingWhenSavingCollectionSheets");
String shutdownCountdownNotificationThreshold = configuration.getString("GeneralConfig.ShutdownCountdownNotificationThreshold");
String imageStorageType = configuration.getString("GeneralConfig.ImageStorageType");
String uploadStorageDirectory = getUploadStorageDirectory();
String uploadQGDirectory = new ConfigurationLocator().resolvePath(getUploadQGDirectory());
String imageStorageDirectory = ImageStorageManager.getStorageLocation();
configContent.put("maxPointsPerPPISurvey", maxPointsPerPPISurvey);
configContent.put("batchSizeForBatchJobs", batchSizeForBatchJobs);
configContent.put("recordCommittingSizeForBatchJobs", recordCommittingSizeForBatchJobs);
configContent.put("outputIntervalForBatchJobs", outputIntervalForBatchJobs);
configContent.put("allowDataPrefetchingWhenSavingCollectionSheets", allowDataPrefetchingWhenSavingCollectionSheets);
configContent.put("shutdownCountdownNotificationThreshold", shutdownCountdownNotificationThreshold);
configContent.put("imageStorageType", imageStorageType);
configContent.put("uploadStorageDirectory", uploadStorageDirectory);
configContent.put("uploadQGDirectory", uploadQGDirectory);
configContent.put("imageStorageDirectory", imageStorageDirectory);
return configContent;
}
use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.
the class ViewOrganizationSettingsServiceFacadeWebTier method getMiscRules.
private Properties getMiscRules(HttpSession httpSession) {
Properties misc = new Properties();
Integer timeoutVal = httpSession.getMaxInactiveInterval() / 60;
misc.setProperty("sessionTimeout", timeoutVal.toString());
misc.setProperty("backDatedTransactions", booleanToYesNo(AccountingRules.isBackDatedTxnAllowed()));
misc.setProperty("backDatedApprovals", booleanToYesNo(AccountingRules.isBackDatedApprovalAllowed()));
ConfigurationBusinessService cbs = new ConfigurationBusinessService();
misc.setProperty("glim", booleanToYesNo(cbs.isGlimEnabled()));
misc.setProperty("lsim", booleanToYesNo(cbs.isRepaymentIndepOfMeetingEnabled()));
MifosConfigurationManager configurationManager = MifosConfigurationManager.getInstance();
misc.setProperty("backDatedLoanProductCreationAllowed", booleanToYesNo(configurationManager.getBoolean(LoanConstants.BACK_DATED_LOAN_PRODUCT_CREATION)));
misc.setProperty("grouploanwithmembers", booleanToYesNo(AccountingRules.isGroupLoanWithMembers()));
return misc;
}
use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.
the class ViewOrganizationSettingsServiceFacadeWebTier method getRest.
private Properties getRest() {
Properties configContent = new Properties();
MifosConfigurationManager configuration = MifosConfigurationManager.getInstance();
String approvalRequired = configuration.getString("REST.approvalRequired");
configContent.put("approvalRequired", approvalRequired);
return configContent;
}
use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.
the class GeneralConfigTest method testGetMaxPointsPerPPISurvey.
public void testGetMaxPointsPerPPISurvey() {
int configuredValue = GeneralConfig.getMaxPointsPerPPISurvey();
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
int currentValue = 30;
configMgr.setProperty(GeneralConfig.MaxPointsPerPPISurvey, currentValue);
Assert.assertEquals(currentValue, GeneralConfig.getMaxPointsPerPPISurvey());
// clear the MaxPointsPerPPISurvey property from the config file so
// should get the default value
configMgr.clearProperty(GeneralConfig.MaxPointsPerPPISurvey);
int defaultValue = GeneralConfig.getMaxPointsPerPPISurvey();
int expectedDefaultValue = 101;
Assert.assertEquals(defaultValue, expectedDefaultValue);
// save it back
configMgr.setProperty(GeneralConfig.MaxPointsPerPPISurvey, configuredValue);
}
use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.
the class AccountingRulesTest method canConfigureAlternateCurrencyWithNonDefaultDigitsAfterDecimal.
@Test
public void canConfigureAlternateCurrencyWithNonDefaultDigitsAfterDecimal() {
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
try {
configMgr.setProperty(AccountingRulesConstants.ADDITIONAL_CURRENCY_CODES, TestUtils.EURO.getCurrencyCode());
configMgr.setProperty(AccountingRulesConstants.DIGITS_AFTER_DECIMAL + "." + TestUtils.EURO.getCurrencyCode(), (short) 2);
assertEquals(new Short("2"), AccountingRules.getDigitsAfterDecimal(TestUtils.EURO));
} finally {
configMgr.clearProperty(AccountingRulesConstants.ADDITIONAL_CURRENCY_CODES);
configMgr.clearProperty(AccountingRulesConstants.DIGITS_AFTER_DECIMAL + "." + TestUtils.EURO.getCurrencyCode());
}
}
Aggregations