Search in sources :

Example 1 with CenterHierarchySearchDto

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());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) CenterHierarchySearchDto(org.mifos.dto.screen.CenterHierarchySearchDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with CenterHierarchySearchDto

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);
}
Also used : UserContext(org.mifos.security.util.UserContext) CenterHierarchySearchDto(org.mifos.dto.screen.CenterHierarchySearchDto) MifosUser(org.mifos.security.MifosUser) CenterSearchInput(org.mifos.dto.screen.CenterSearchInput)

Aggregations

CenterHierarchySearchDto (org.mifos.dto.screen.CenterHierarchySearchDto)2 ActionForwards (org.mifos.application.util.helpers.ActionForwards)1 CenterSearchInput (org.mifos.dto.screen.CenterSearchInput)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 MifosUser (org.mifos.security.MifosUser)1 UserContext (org.mifos.security.util.UserContext)1