use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class LoanPrdActionForm method setSelectedQuestionGroups.
// Intentionally made public to aid testing !!!
void setSelectedQuestionGroups(HttpServletRequest request) {
try {
List<QuestionGroupDetail> questionGroups = new ArrayList<QuestionGroupDetail>();
if (loanOfferingQGs != null && loanOfferingQGs.length > 0) {
List<QuestionGroupDetail> srcQGDetails = (List<QuestionGroupDetail>) SessionUtils.getAttribute(ProductDefinitionConstants.SRCQGLIST, request);
for (String loanOfferingQG : loanOfferingQGs) {
for (QuestionGroupDetail questionGroupDetail : srcQGDetails) {
if (String.valueOf(questionGroupDetail.getId()).equals(loanOfferingQG)) {
questionGroups.add(questionGroupDetail);
break;
}
}
}
}
SessionUtils.setCollectionAttribute(ProductDefinitionConstants.SELECTEDQGLIST, questionGroups, request);
} catch (PageExpiredException e) {
logger.error("An error occurred while setting selected question groups on session", e);
}
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class LoanPrdActionForm method validateSelectedFeeForVariableInstallment.
@SuppressWarnings("unchecked")
//made default access to assist testing
void validateSelectedFeeForVariableInstallment(HttpServletRequest request, ActionErrors errors) {
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
List<FeeDto> feeDtos = new ArrayList<FeeDto>();
try {
if (getPrdOfferinFees() != null && getPrdOfferinFees().length > 0) {
List<FeeBO> fees = (List<FeeBO>) SessionUtils.getAttribute(ProductDefinitionConstants.LOANPRDFEE, request);
for (String selectedFee : getPrdOfferinFees()) {
FeeBO fee = getFeeFromList(fees, selectedFee);
if (fee != null) {
if (canConfigureVariableInstallments()) {
if (validateIfFeeTypeNonPeriodic(fee, errors) && validateFeeIsNotDependentOnPercentOfInterest(fee, errors)) {
feeDtos.add(getFeeDto(request, fee));
}
} else {
feeDtos.add(getFeeDto(request, fee));
}
}
}
}
setSelectedFeeDtoOnSession(request, feeDtos);
} catch (PageExpiredException e) {
}
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class ClientCustActionForm method validateSelectedOfferings.
@SuppressWarnings("unchecked")
private void validateSelectedOfferings(ActionErrors errors, HttpServletRequest request) {
boolean duplicateFound = false;
for (int i = 0; i < selectedOfferings.size() - 1; i++) {
for (int j = i + 1; j < selectedOfferings.size(); j++) {
if (selectedOfferings.get(i) != null && selectedOfferings.get(j) != null && selectedOfferings.get(i).equals(selectedOfferings.get(j))) {
String selectedOffering = "";
try {
List<SavingsDetailDto> offeringsList = (List<SavingsDetailDto>) SessionUtils.getAttribute(ClientConstants.SAVINGS_OFFERING_LIST, request);
for (SavingsDetailDto savingsOffering : offeringsList) {
if (selectedOfferings.get(i).equals(savingsOffering.getPrdOfferingId())) {
selectedOffering = savingsOffering.getPrdOfferingName();
}
break;
}
} catch (PageExpiredException pee) {
}
errors.add(ClientConstants.ERRORS_DUPLICATE_OFFERING_SELECTED, new ActionMessage(ClientConstants.ERRORS_DUPLICATE_OFFERING_SELECTED, selectedOffering));
duplicateFound = true;
break;
}
}
if (duplicateFound) {
break;
}
}
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class FlowKeyInterceptor method joinToken.
private void joinToken(HttpServletRequest request) throws PageExpiredException {
String flowKey = request.getParameter(Constants.CURRENTFLOWKEY);
if (null == flowKey) {
flowKey = (String) request.getAttribute(Constants.CURRENTFLOWKEY);
}
FlowManager flowManager = (FlowManager) request.getSession().getAttribute(Constants.FLOWMANAGER);
if (flowKey == null || !flowManager.isFlowValid(flowKey)) {
throw new PageExpiredException("no flow for key " + flowKey);
}
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class PersonActionForm method validate.
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String method = request.getParameter("method");
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
request.getSession().setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
if (method.equals(Methods.preview.toString())) {
handleCreatePreviewValidations(errors, request);
}
if (method.equals(Methods.previewManage.toString())) {
handleManagePreviewValidations(errors, request);
}
if (method.equals(Methods.search.toString())) {
if (StringUtils.isBlank(searchString)) {
try {
cleanUpSearch(request);
} catch (PageExpiredException e) {
errors.add(ExceptionConstants.PAGEEXPIREDEXCEPTION, new ActionMessage(ExceptionConstants.PAGEEXPIREDEXCEPTION));
}
errors.add(PersonnelConstants.NO_SEARCH_STRING, new ActionMessage(PersonnelConstants.NO_SEARCH_STRING));
}
}
if (!errors.isEmpty()) {
request.setAttribute(Globals.ERROR_KEY, errors);
request.setAttribute("methodCalled", method);
try {
updateRoleLists(request);
} catch (PageExpiredException e) {
errors.add(ExceptionConstants.PAGEEXPIREDEXCEPTION, new ActionMessage(ExceptionConstants.PAGEEXPIREDEXCEPTION));
}
}
return errors;
}
Aggregations