use of org.mifos.accounts.loan.struts.action.Criteria in project head by mifos.
the class QuestionnaireFlowAdapter method getQuestionGroups.
private List<QuestionGroupDetail> getQuestionGroups(HttpServletRequest request) {
QuestionnaireServiceFacade questionnaireServiceFacade = serviceLocator.getService(request);
Criteria<QuestionGroupDetail> criteria = new Criteria<QuestionGroupDetail>() {
@Override
public QuestionGroupDetail filter(Integer questionGroupId, List<QuestionGroupDetail> questionGroupDetails) {
QuestionGroupDetail result = null;
for (QuestionGroupDetail questionGroupDetail : questionGroupDetails) {
if (questionGroupId.equals(questionGroupDetail.getId())) {
result = questionGroupDetail;
break;
}
}
return result;
}
};
return questionnaireServiceFacade != null ? questionGroupFilter.doFilter(questionnaireServiceFacade.getQuestionGroups(event, source), criteria) : null;
}
use of org.mifos.accounts.loan.struts.action.Criteria in project head by mifos.
the class QuestionnaireFlowAdapter method getQuestionGroupInstances.
public List<QuestionGroupInstanceDetail> getQuestionGroupInstances(HttpServletRequest request, Integer entityId) {
QuestionnaireServiceFacade questionnaireServiceFacade = serviceLocator.getService(request);
Criteria<QuestionGroupInstanceDetail> criteria = new Criteria<QuestionGroupInstanceDetail>() {
@Override
public QuestionGroupInstanceDetail filter(Integer questionGroupId, List<QuestionGroupInstanceDetail> questionGroupInstanceDetails) {
QuestionGroupInstanceDetail result = null;
for (QuestionGroupInstanceDetail questionGroupInstanceDetail : questionGroupInstanceDetails) {
if (questionGroupId.equals(questionGroupInstanceDetail.getQuestionGroupDetail().getId())) {
result = questionGroupInstanceDetail;
break;
}
}
return result;
}
};
return questionnaireServiceFacade != null ? questionGroupFilter.doFilter(questionnaireServiceFacade.getQuestionGroupInstancesWithUnansweredQuestionGroups(entityId, event, source), criteria) : new ArrayList<QuestionGroupInstanceDetail>();
}
Aggregations