use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingAction method validate.
@TransactionDemarcate(joinToken = true)
public ActionForward validate(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
String method = (String) request.getAttribute("methodCalled");
MeetingActionForm maf = (MeetingActionForm) form;
if (maf.getInput() == null || maf.getInput().equals(MeetingConstants.INPUT_EDIT)) {
return mapping.findForward(method + "_failure");
}
return mapping.findForward(ActionForwards.createMeeting_failure.toString());
}
use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingAction method create.
@TransactionDemarcate(joinToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MeetingActionForm actionForm = (MeetingActionForm) form;
MeetingBO meeting = createMeeting(actionForm);
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, meeting, request);
return mapping.findForward(forwardForCreate(actionForm.getCustomerLevelValue()).toString());
}
use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MeetingActionForm form1 = (MeetingActionForm) form;
MeetingBO meeting = (MeetingBO) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_MEETING, request);
clearActionForm(form1);
if (meeting != null) {
setValuesInActionForm(form1, meeting);
}
List<WeekDay> workingDays = getLocalizedWorkingDays();
SessionUtils.setCollectionAttribute(MeetingConstants.WEEKDAYSLIST, workingDays, request);
SessionUtils.setCollectionAttribute(MeetingConstants.WEEKRANKLIST, RankOfDay.getRankOfDayList(), request);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingAction method update.
@TransactionDemarcate(validateAndResetToken = true)
@CloseSession
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MeetingActionForm actionForm = (MeetingActionForm) form;
MeetingBO meeting = createMeeting(actionForm);
CustomerBO customerInSession = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
MeetingDto meetingDto = null;
if (meeting != null) {
meetingDto = meeting.toDto();
}
meetingServiceFacade.updateCustomerMeeting(meetingDto, customerInSession.getCustomerId());
ActionForwards forward = forwardForUpdate(actionForm.getCustomerLevelValue());
return mapping.findForward(forward.toString());
}
use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingActionStrutsTest method testLoadForGroup.
@Test
public void testLoadForGroup() throws Exception {
setRequestPathInfo("/meetingAction.do");
addRequestParameter("method", "load");
addRequestParameter("customerLevel", CustomerLevel.GROUP.getValue().toString());
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter("input", "create");
actionPerform();
verifyForward(ActionForwards.load_success.toString());
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKDAYSLIST, request));
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKRANKLIST, request));
verifyNoActionErrors();
verifyNoActionMessages();
MeetingActionForm actionForm = (MeetingActionForm) request.getSession().getAttribute("meetingActionForm");
Assert.assertEquals(CustomerLevel.GROUP, actionForm.getCustomerLevelValue());
}
Aggregations