use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class PentahoReportLocator method getPathToUploadedReport.
private static String getPathToUploadedReport(String reportFileName) {
ConfigurationLocator configurationLocator = new ConfigurationLocator();
String configPath = configurationLocator.getConfigurationDirectory() + "/uploads";
String uploadsDir = configPath;
StringBuilder sb;
if (File.separatorChar == '\\') {
// windows platform
uploadsDir = uploadsDir.replaceAll("/", "\\\\");
sb = new StringBuilder("file:/");
} else {
sb = new StringBuilder("file://");
}
sb.append(uploadsDir);
if (!uploadsDir.endsWith(File.separator)) {
sb.append(File.separator);
}
sb.append("report").append(File.separator).append(reportFileName);
return sb.toString();
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class LoanArrearsTaskIntegrationTest method getMifosScheduler.
private MifosScheduler getMifosScheduler(String taskConfigurationPath) throws TaskSystemException, IOException, FileNotFoundException {
ConfigurationLocator mockConfigurationLocator = createMock(ConfigurationLocator.class);
expect(mockConfigurationLocator.getResource(SchedulerConstants.CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(taskConfigurationPath));
expectLastCall().times(2);
replay(mockConfigurationLocator);
MifosScheduler mifosScheduler = new MifosScheduler();
mifosScheduler.setConfigurationLocator(mockConfigurationLocator);
mifosScheduler.initialize();
return mifosScheduler;
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class LoanArrearsAndPortfolioAtRiskIntegrationTest method getMifosScheduler.
private MifosScheduler getMifosScheduler(String taskConfigurationPath) throws TaskSystemException, IOException, FileNotFoundException {
ConfigurationLocator mockConfigurationLocator = createMock(ConfigurationLocator.class);
expect(mockConfigurationLocator.getResource(SchedulerConstants.CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(taskConfigurationPath));
expectLastCall().times(2);
replay(mockConfigurationLocator);
MifosScheduler mifosScheduler = new MifosScheduler();
mifosScheduler.setConfigurationLocator(mockConfigurationLocator);
mifosScheduler.initialize();
return mifosScheduler;
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class PentahoReportsServiceImpl method getLogoParameterForReport.
private PentahoInputParameter getLogoParameterForReport() throws IOException {
ConfigurationLocator configurationLocator = new ConfigurationLocator();
org.springframework.core.io.Resource logo = configurationLocator.getUploadedMifosLogo();
PentahoInputParameter logoParameter = new PentahoInputParameter();
logoParameter.setParamName("mifosLogoPath");
logoParameter.setLabelName("mifosLogoPath");
String logoPath = logo.getFile().getAbsolutePath();
logoParameter.setValue(logoPath);
return logoParameter;
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class PPITest method verifyPPIQuestionGroup.
//http://mifosforge.jira.com/browse/MIFOSTEST-147
public void verifyPPIQuestionGroup() throws Exception {
//Given
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
String configPath = new ConfigurationLocator().getConfigurationDirectory();
String fileName = "PPISurveyBANGLADESH2009.xml";
String sourcePath = PPITest.class.getResource("/mpesa/" + fileName).getFile();
String qgDestPath = configPath + "/uploads/questionGroups/";
String destPath = qgDestPath + fileName;
new File(qgDestPath).mkdirs();
File sourceFile = new File(sourcePath);
File destFile = new File(destPath);
List<String> QGlist = new ArrayList<String>();
QGlist.add("PPI Bangladesh 2009");
CreateClientEnterPersonalDataPage.SubmitFormParameters formParameters = FormParametersHelper.getClientEnterPersonalDataPageFormParameters();
QuestionResponseParameters responseParams = getQuestionResponseParametersForPPIIndia2008();
AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
attachParams.setQuestionGroupName("PPI Bangladesh 2009");
attachParams.addTextResponse("Date Survey Was Taken", "24/01/2011");
attachParams.addCheckResponse("How many household members are 11-years-old or younger?", "Four or more");
attachParams.addCheckResponse("Does any household member work for a daily wage?", "Yes");
attachParams.addCheckResponse("What type of latrine does the household use?", "Open field");
attachParams.addCheckResponse("How many rooms does the household occupy (excluding rooms used for business)?", "Four");
attachParams.addCheckResponse("What is the main construction material of the walls?", "Brick/cement");
attachParams.addCheckResponse("What is the main construction material of the roof?", "Cement");
attachParams.addCheckResponse("What is the total cultivable agricultural land owned by the household?", "More than 1 acre");
attachParams.addCheckResponse("Does the household own a television?", "Yes");
attachParams.addCheckResponse("Does the household own a two-in-one cassette player?", "No");
attachParams.addCheckResponse("Does the household own a wristwatch?", "Yes");
String[] eventList = { "View Client", "Create Client", "Close Client" };
//When
if (!destFile.exists()) {
copyFile(sourceFile, destFile);
}
questionGroupTestHelper.activatePPI("BANGLADESH2009");
questionGroupTestHelper.changeAppliesTo("PPI Bangladesh 2009", eventList);
questionGroupTestHelper.navigateToViewQuestionGroups(QGlist);
String clientName = clientTestHelper.createClientWithQuestionGroups(formParameters, "MyGroup1232993846342", responseParams).getHeading();
attachParams.setTarget(clientName);
clientTestHelper.activateClient(clientName);
questionGroupTestHelper.attachQuestionGroupToClient(attachParams);
clientTestHelper.closeClientWithQG(clientName, responseParams);
}
Aggregations