use of org.mifos.dto.screen.CenterHierarchySearchDto in project head by mifos.
the class GroupCustAction method hierarchyCheck.
@TransactionDemarcate(saveToken = true)
public ActionForward hierarchyCheck(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ActionForwards actionForward = null;
CenterHierarchySearchDto centerHierarchySearchDto = this.groupServiceFacade.isCenterHierarchyConfigured();
if (centerHierarchySearchDto.isCenterHierarchyExists()) {
SessionUtils.setAttribute(GroupConstants.CENTER_SEARCH_INPUT, centerHierarchySearchDto.getSearchInputs(), request.getSession());
actionForward = ActionForwards.loadCenterSearch;
} else {
actionForward = ActionForwards.loadCreateGroup;
}
SessionUtils.setAttribute(CustomerConstants.URL_MAP, null, request.getSession(false));
SessionUtils.setAttribute(GroupConstants.PREVIEW_CREATE_NEW_GROUP_FAILURE, false, request);
return mapping.findForward(actionForward.toString());
}
use of org.mifos.dto.screen.CenterHierarchySearchDto in project head by mifos.
the class GroupServiceFacadeWebTier method isCenterHierarchyConfigured.
@Override
public CenterHierarchySearchDto isCenterHierarchyConfigured() {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
boolean isCenterHierarchyExists = ClientRules.getCenterHierarchyExists();
CenterSearchInput searchInputs = new CenterSearchInput(userContext.getBranchId(), GroupConstants.CREATE_NEW_GROUP);
return new CenterHierarchySearchDto(isCenterHierarchyExists, searchInputs);
}
Aggregations