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

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


    /**
     *
     */
    public CustomerWishlistViewBean buildViewBeanCustomerWishlist(final RequestData requestData, final Customer customer) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final CustomerWishlistViewBean customerWishlistViewBean = new CustomerWishlistViewBean();
        final CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
        if (customerMarketArea != null) {
            final Set<CustomerWishlist> customerWishlists = customerMarketArea.getWishlistProducts();
            if (Hibernate.isInitialized(customerWishlists) && customerWishlists != null) {
                for (Iterator<CustomerWishlist> iterator = customerWishlists.iterator(); iterator.hasNext();) {
                    final CustomerWishlist customerWishlist = (CustomerWishlist) iterator.next();
                    final ProductSku productSku = productService.getProductSkuByCode(customerWishlist.getProductSkuCode());
                    final ProductMarketing productMarketing =  productService.getProductMarketingByCode(productSku.getProductMarketing().getCode());
                    final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getDefaultVirtualCatalogCategoryByProductSkuId(productSku.getId());
                    customerWishlistViewBean.getProductSkus().add(buildViewBeanProductSku(requestData, catalogCategory, productMarketing, productSku));
                }
            }
        }
        return customerWishlistViewBean;
    }
View Full Code Here


   
    // WE RELOAD THE CUSTOMER FOR THE PERSISTANCE PROXY FILTER
    // IT AVOIDS LazyInitializationException: could not initialize proxy - no Session
    final Customer reloadedCustomer = customerService.getCustomerByCode(customer.getCode());
   
    final CustomerWishlistViewBean customerWishListViewBean = frontofficeViewBeanFactory.buildViewBeanCustomerWishlist(requestUtil.getRequestData(request), reloadedCustomer);
    model.addAttribute(ModelConstants.CUSTOMER_WISHLIST_VIEW_BEAN, customerWishListViewBean);

        Object[] params = { customer.getLastname(), customer.getFirstname() };
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.PERSONAL_WISHLIST.getKey(), params);
View Full Code Here

TOP

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

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.