Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.MenuViewBean


    final List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
   
        List<String> homeUrls = new ArrayList<String>();
        homeUrls.add(BoUrls.HOME.getUrlWithoutWildcard());
       
    MenuViewBean menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, homeUrls));
        menu.setCssIcon("fa fa-home");
    menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.HOME, requestData));
    menuViewBeans.add(menu);

        List<String> engineSettingUrls = new ArrayList<String>();
        engineSettingUrls.add(BoUrls.ENGINE_SETTING_LIST.getUrlWithoutWildcard());
        engineSettingUrls.add(BoUrls.ENGINE_SETTING_DETAILS.getUrlWithoutWildcard());
        engineSettingUrls.add(BoUrls.ENGINE_SETTING_EDIT.getUrlWithoutWildcard());
        engineSettingUrls.add(BoUrls.ENGINE_SETTING_VALUE_EDIT.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, engineSettingUrls));
        menu.setCssIcon("fa fa-cogs");
    menu.setName("Engine Setting");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.ENGINE_SETTING_LIST, requestData));
    menuViewBeans.add(menu);
   
        List<String> cacheUrls = new ArrayList<String>();
        cacheUrls.add(BoUrls.CACHE.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, cacheUrls));
    menu.setCssIcon("fa fa-bars");
    menu.setName("Cache");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.CACHE, requestData));
    menuViewBeans.add(menu);

        List<String> batchUrls = new ArrayList<String>();
        batchUrls.add(BoUrls.BATCH.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, batchUrls));
    menu.setCssIcon("fa fa-random");
    menu.setName("Batch");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.BATCH, requestData));
    menuViewBeans.add(menu);
   
        List<String> paymentGatewayUrls = new ArrayList<String>();
        paymentGatewayUrls.add(BoUrls.PAYMENT_GATEWAY_LIST.getUrlWithoutWildcard());
        paymentGatewayUrls.add(BoUrls.PAYMENT_GATEWAY_DETAILS.getUrlWithoutWildcard());
        paymentGatewayUrls.add(BoUrls.PAYMENT_GATEWAY_EDIT.getUrlWithoutWildcard());

        menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, paymentGatewayUrls));
        menu.setCssIcon("fa fa-money");
        menu.setName("Payment Gateway");
        menu.setUrl(backofficeUrlService.generateUrl(BoUrls.PAYMENT_GATEWAY_LIST, requestData));
        menuViewBeans.add(menu);

        List<String> userUrls = new ArrayList<String>();
        userUrls.add(BoUrls.USER_LIST.getUrlWithoutWildcard());
        userUrls.add(BoUrls.USER_DETAILS.getUrlWithoutWildcard());
        userUrls.add(BoUrls.USER_EDIT.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, userUrls));
    menu.setCssIcon("fa fa-group");
    menu.setName("User");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.USER_LIST, requestData));
    menuViewBeans.add(menu);
   
        List<String> referenceDataUrls = new ArrayList<String>();
        referenceDataUrls.add(BoUrls.REFERENCE_DATAS.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, referenceDataUrls));
    menu.setCssIcon("fa fa-book");
    menu.setName("References Datas");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.REFERENCE_DATAS, requestData));
    menuViewBeans.add(menu);
   
        List<String> monitoringUrls = new ArrayList<String>();
        monitoringUrls.add(BoUrls.MONITORING.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, monitoringUrls));
    menu.setCssIcon("fa fa-bar-chart-o");
    menu.setName("Monitoring");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.MONITORING, requestData));
    menuViewBeans.add(menu);
   
//    menu = new MenuViewBean();
//    menu.setCssIcon("fa fa-paper-clip");
//    menu.setName("FAQ");
View Full Code Here


    final List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
   
        List<String> homeUrls = new ArrayList<String>();
        homeUrls.add(BoUrls.HOME.getUrlWithoutWildcard());
       
    MenuViewBean menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, homeUrls));
    menu.setCssIcon("fa fa-home");
    menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.HOME, requestData));
    menuViewBeans.add(menu);

        List<String> catalogUrls = new ArrayList<String>();
        catalogUrls.add(BoUrls.CATALOG.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, catalogUrls));
    menu.setCssIcon("fa fa-sitemap");
    menu.setName("Catalog stats");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.CATALOG, requestData));
    menuViewBeans.add(menu);
   
        List<String> ruletUrls = new ArrayList<String>();
        ruletUrls.add(BoUrls.RULE_LIST.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, ruletUrls));
    menu.setCssIcon("fa fa-money");
    menu.setName("Promotion stats");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.RULE_LIST, requestData));
    menuViewBeans.add(menu);

        List<String> deliveryMethodsUrls = new ArrayList<String>();
        deliveryMethodsUrls.add(BoUrls.DELIVERY_METHOD_LIST.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, deliveryMethodsUrls));
    menu.setCssIcon("fa fa-truck");
    menu.setName("Shipping stats");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.DELIVERY_METHOD_LIST, requestData));
    menuViewBeans.add(menu);
   
        List<String> orderUrls = new ArrayList<String>();
        orderUrls.add(BoUrls.ORDER_LIST.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, orderUrls));
    menu.setCssIcon("fa fa-shopping-cart");
    menu.setName("Orders stats");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.ORDER_LIST, requestData));
    menuViewBeans.add(menu);
   
        List<String> customerUrls = new ArrayList<String>();
        customerUrls.add(BoUrls.CUSTOMER_LIST.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, customerUrls));
    menu.setCssIcon("fa fa-group");
    menu.setName("Customers stats");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.CUSTOMER_LIST, requestData));
    menuViewBeans.add(menu);
   
        List<String> reportingUrls = new ArrayList<String>();
        reportingUrls.add(BoUrls.REPORTING.getUrlWithoutWildcard());
       
    menu = new MenuViewBean();
        menu.setActive(menuIsActive(currentUrl, reportingUrls));
    menu.setCssIcon("fa fa-bar-chart-o");
    menu.setName("Reporting");
    menu.setUrl(backofficeUrlService.generateUrl(BoUrls.REPORTING, requestData));
    menuViewBeans.add(menu);
   
//    menu = new MenuViewBean();
//    menu.setCssIcon("fa fa-paper-clip");
//    menu.setName("FAQ");
View Full Code Here

       
        final List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();

        // TODO : denis : move this part in the global list menu java/vm

        MenuViewBean menu = new MenuViewBean();
        menu.setCssIcon("fa fa-question");
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "faq", locale));
        menu.setUrl(backofficeUrlService.generateUrl(BoUrls.FAQ, requestData));
        menuViewBeans.add(menu);

        menu = new MenuViewBean();
        menu.setCssIcon("fa fa-user");
        menu.setName(getSpecificMessage(ScopeWebMessage.COMMON, "header_link_my_account", locale));
        menu.setUrl(backofficeUrlService.generateUrl(BoUrls.PERSONAL_DETAILS, requestData, currentUser));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setCssIcon("fa fa-lock");
        if(currentUser != null){
            menu.setName(getSpecificMessage(ScopeWebMessage.AUTH, "header_title_logout", locale));
            menu.setUrl(backofficeUrlService.generateUrl(BoUrls.LOGOUT, requestData));
        } else {
            menu.setName(getSpecificMessage(ScopeWebMessage.AUTH, "header_title_login", locale));
            menu.setUrl(backofficeUrlService.generateUrl(BoUrls.LOGIN, requestData));
        }
        menuViewBeans.add(menu);
       
        return menuViewBeans;
    }
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "store_location", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "store_location", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.STORE_LOCATION, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        breadcrumbViewBean.setMenus(menuViewBeans);
        model.addAttribute(ModelConstants.BREADCRUMB_VIEW_BEAN, breadcrumbViewBean);
       
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "follow_us", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "follow_us", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.FOLLOW_US, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        return modelAndView;
  }
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "legal_terms", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "legal_terms", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.LEGAL_TERMS, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        return modelAndView;
  }
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "all_brand", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "all_brand", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.BRAND_ALL, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        breadcrumbViewBean.setMenus(menuViewBeans);
        model.addAttribute(ModelConstants.BREADCRUMB_VIEW_BEAN, breadcrumbViewBean);
       
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "contact", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "contact", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.CONTACT, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        return modelAndView;
  }
View Full Code Here

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
        breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "customer_create_account", locale));
       
        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();
        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "customer_create_account", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.CUSTOMER_CREATE_ACCOUNT, requestData));
        menu.setActive(true);
        menuViewBeans.add(menu);
       
        return modelAndView;
  }
View Full Code Here

        final Locale locale = localization.getLocale();
        final String localeCode = localization.getCode();

        List<MenuViewBean> menuViewBeans = new ArrayList<MenuViewBean>();

        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);

        CatalogVirtual catalogVirtual = catalogService.getVirtualCatalogbyMarketAreaId(marketArea.getId());
        if (catalogVirtual != null) {
            final List<CatalogCategoryVirtual> catalogCategories = catalogVirtual.getSortedRootCatalogCategories();
            if (catalogCategories != null) {
                for (Iterator<CatalogCategoryVirtual> iteratorCatalogCategory = catalogCategories.iterator(); iteratorCatalogCategory.hasNext();) {
                    final CatalogCategoryVirtual catalogCategory = (CatalogCategoryVirtual) iteratorCatalogCategory.next();
                    final CatalogCategoryVirtual catalogCategoryReloaded = catalogCategoryService.getVirtualCatalogCategoryById(catalogCategory.getId(), categoryFetchPlan);
                   
                    menu = new MenuViewBean();
                    final String seoCatalogCategoryName = catalogCategoryReloaded.getI18nName(localeCode);
                    menu.setName(seoCatalogCategoryName);
                    menu.setUrl(urlService.generateUrl(FoUrls.CATEGORY_AS_AXE, requestData, catalogCategoryReloaded));

                    List<CatalogCategoryVirtual> subCatalogCategories = catalogCategoryReloaded.getSortedChildCatalogCategories();
                    if (subCatalogCategories != null) {
                        List<MenuViewBean> subMenus = new ArrayList<MenuViewBean>();
                        for (Iterator<CatalogCategoryVirtual> iteratorSubCatalogCategory = subCatalogCategories.iterator(); iteratorSubCatalogCategory.hasNext();) {
                            final CatalogCategoryVirtual subCatalogCategory = (CatalogCategoryVirtual) iteratorSubCatalogCategory.next();
                            final CatalogCategoryVirtual subCatalogCategoryReloaded = catalogCategoryService.getVirtualCatalogCategoryById(subCatalogCategory.getId(), categoryFetchPlan);
                            final MenuViewBean subMenu = new MenuViewBean();
                            final String seoSubCatalogCategoryName = catalogCategoryReloaded.getI18nName(localeCode) + " " + subCatalogCategoryReloaded.getI18nName(localeCode);
                            subMenu.setName(seoSubCatalogCategoryName);
                            subMenu.setUrl(urlService.generateUrl(FoUrls.CATEGORY_AS_LINE, requestData, subCatalogCategoryReloaded));
                            subMenus.add(subMenu);
                        }
                        menu.setSubMenus(subMenus);
                    }
                    menuViewBeans.add(menu);
                }
            }
        }

        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "our_company", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.OUR_COMPANY, requestData));
        menuViewBeans.add(menu);
       
        menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "store_location", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.STORE_LOCATION, requestData));
        menuViewBeans.add(menu);

        // Set active menu
        String currentUrl = requestUtil.getLastRequestUrl(request);
        for (Iterator<MenuViewBean> iteratorMenu = menuViewBeans.iterator(); iteratorMenu.hasNext();) {
            MenuViewBean menuCheck = (MenuViewBean) iteratorMenu.next();
            menuCheck.setActive(false);
            if (currentUrl != null && currentUrl.contains(menuCheck.getUrl())) {
                menuCheck.setActive(true);
                for (Iterator<MenuViewBean> iteratorSubMenu = menuCheck.getSubMenus().iterator(); iteratorSubMenu.hasNext();) {
                    MenuViewBean subMenu = (MenuViewBean) iteratorSubMenu.next();
                    subMenu.setActive(false);
                    if (currentUrl != null && currentUrl.contains(subMenu.getUrl())) {
                        subMenu.setActive(true);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.MenuViewBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.