use of org.mifos.framework.exceptions.SystemException in project head by mifos.
the class ReportsPersistence method createReportParams.
public void createReportParams(ReportsParamsValue reportsParams) throws ApplicationException, SystemException {
Session session = null;
Transaction trxn = null;
try {
session = StaticHibernateUtil.getSessionTL();
StaticHibernateUtil.startTransaction();
session.save(reportsParams);
session.flush();
StaticHibernateUtil.commitTransaction();
} catch (HibernateProcessException hpe) {
StaticHibernateUtil.rollbackTransaction();
throw new ApplicationException(hpe);
} catch (HibernateException hpe) {
trxn.rollback();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION);
} catch (Exception e) {
trxn.rollback();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} finally {
StaticHibernateUtil.closeSession();
}
}
use of org.mifos.framework.exceptions.SystemException in project head by mifos.
the class MenuTag method doStartTag.
/**
* Method to find left menu respective to given topMenuTab
*
* @return integer to indicate what to do next after executing the do
* function.
*/
@Override
public int doStartTag() throws JspException {
StringBuilder output = new StringBuilder();
// Locale locale =
// TagUtils.getInstance().getUserLocale(pageContext,getLocale());
Locale locale = LabelTagUtils.getInstance().getUserPreferredLocale();
MenuRepository menuRepository = MenuRepository.getInstance();
leftMenu = menuRepository.getMenuForTabAndLocale(topMenuTab, locale);
try {
if (leftMenu == null) {
MenuBuilder.buildMenuForLocale(pageContext);
leftMenu = menuRepository.getMenuForTabAndLocale(topMenuTab, locale);
if (leftMenu == null) {
// System.out.println("error: menu could not built for locale");
;
}
}
} catch (SystemException mpe) {
throw new JspException(mpe);
}
output.append("<td class=\"leftpanelinks\" colspan=\"2\">");
MenuGroup[] menuGroups = leftMenu.getMenuGroups();
for (MenuGroup menuGroup : menuGroups) {
prepareMenu(output, menuGroup);
}
output.append("</td>");
TagUtils.getInstance().write(pageContext, output.toString());
return SKIP_BODY;
}
use of org.mifos.framework.exceptions.SystemException in project head by mifos.
the class ApplicationInitializer method initializeSecurity.
/**
* This function initialize and bring up the authorization and authentication services
*
* @throws AppNotConfiguredException
* - IF there is any failures during init
*/
private void initializeSecurity() throws AppNotConfiguredException {
try {
ActivityMapper.getInstance().init();
HierarchyManager.getInstance().init();
} catch (XMLReaderException e) {
throw new AppNotConfiguredException(e);
} catch (ApplicationException ae) {
throw new AppNotConfiguredException(ae);
} catch (SystemException se) {
throw new AppNotConfiguredException(se);
}
}
Aggregations