use of org.mifos.reports.struts.actionforms.ReportsDataSourceActionForm in project head by mifos.
the class ReportsDataSourceAction method loadView.
/**
* Veiw DataSource
*/
public ActionForward loadView(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In ReportsDataSourceAction:loadView Method: ");
ReportsDataSourceActionForm actionForm = (ReportsDataSourceActionForm) form;
String strDataSourceId = request.getParameter("dataSourceId");
if (strDataSourceId == null) {
strDataSourceId = actionForm.getDatasourceId() + "";
}
if (strDataSourceId.equals("")) {
strDataSourceId = "0";
}
int dataSourceId = Integer.parseInt(strDataSourceId);
actionForm.setDatasourceId(dataSourceId);
request.getSession().setAttribute("viewDataSource", reportsPersistence.viewDataSource(dataSourceId));
return mapping.findForward(ReportsConstants.VIEWREPORTSDATASOURCE);
}
use of org.mifos.reports.struts.actionforms.ReportsDataSourceActionForm in project head by mifos.
the class ReportsDataSourceAction method createDataSource.
/**
* Controls the creation of DataSource
*/
public ActionForward createDataSource(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In ReportsDataSourceAction:createDataSource Method: ");
ReportsDataSourceActionForm actionForm = (ReportsDataSourceActionForm) form;
ReportsDataSource objDs = new ReportsDataSource();
objDs.setDriver(actionForm.getDriver());
objDs.setName(actionForm.getName());
objDs.setUrl(actionForm.getUrl());
objDs.setPassword(actionForm.getPassword());
objDs.setUsername(actionForm.getUsername());
reportsPersistence.createReportsDataSource(objDs);
return mapping.findForward("reportdatasource_path");
}
use of org.mifos.reports.struts.actionforms.ReportsDataSourceActionForm in project head by mifos.
the class ReportsDataSourceAction method deleteDataSource.
/**
* Controls the deletion of DataSource
*/
public ActionForward deleteDataSource(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In ReportsDataSourceAction:deleteDataSource Method: ");
ReportsDataSourceActionForm actionForm = (ReportsDataSourceActionForm) form;
ReportsDataSource objDs = new ReportsDataSource();
objDs.setDatasourceId(actionForm.getDatasourceId());
String error = reportsBusinessService.deleteReportsDataSource(objDs);
request.getSession().setAttribute("deleteError", error);
return mapping.findForward("reportdatasource_path");
}
Aggregations