Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.ProductBrand


                    } else if (param instanceof CatalogCategoryMaster) {
                        CatalogCategoryMaster category = (CatalogCategoryMaster) param;
                        urlParams.put(RequestConstants.URL_PATTERN_CATEGORY_CODE, handleParamValue(category.getCode()));
                        urlStr = addFullPrefixUrl(requestData, urlStr) + handleParamValue(category.getName()) + "/";
                    } else if (param instanceof ProductBrand) {
                        ProductBrand productBrand = (ProductBrand) param;
                        urlParams.put(RequestConstants.URL_PATTERN_BRAND_CODE, handleParamValue(productBrand.getCode()));
                        urlStr = addFullPrefixUrl(requestData, urlStr) + handleParamValue(productBrand.getName()) + "/";
                    } else if (param instanceof CartItem) {
                        CartItem cartItem = (CartItem) param;
                        urlParams.put(RequestConstants.URL_PATTERN_CART_ITEM_CODE, handleParamValue(cartItem.getId().toString()));
                    else if (param instanceof Store) {
                        Store store = (Store) param;
View Full Code Here


            productMarketingViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, catalogCategory, productMarketing, productSku));
        } else {
            productMarketingViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, catalogCategory, productMarketing, productMarketing.getDefaultProductSku()));
        }

        final ProductBrand productBrand = productMarketing.getProductBrand();
        if (Hibernate.isInitialized(productBrand) && productBrand != null) {
            productMarketingViewBean.setBrand(buildViewBeanProductBrand(requestData, productBrand));
            productMarketingViewBean.setBrandDetailsUrl(urlService.generateUrl(FoUrls.BRAND_DETAILS, requestData, productBrand));
            productMarketingViewBean.setBrandLineDetailsUrl(urlService.generateUrl(FoUrls.BRAND_LINE, requestData, productBrand));
        }
View Full Code Here

   
    public ProductBrand getProductBrandById(final Long productBrandId, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductBrand.class);
        FetchPlan fetchPlan = handleSpecificProductBrandFetchMode(criteria, params);
        criteria.add(Restrictions.eq("id", productBrandId));
        ProductBrand productBrand = (ProductBrand) criteria.uniqueResult();
        if(productBrand != null){
            productBrand.setFetchPlan(fetchPlan);
        }
        return productBrand;
    }
View Full Code Here

    public ProductBrand getProductBrandByCode(final String productBrandCode, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductBrand.class);
        FetchPlan fetchPlan = handleSpecificProductBrandFetchMode(criteria, params);
        criteria.add(Restrictions.eq("code", handleCodeValue(productBrandCode)));
        ProductBrand productBrand = (ProductBrand) criteria.uniqueResult();
        if(productBrand != null){
            productBrand.setFetchPlan(fetchPlan);
        }
        return productBrand;
    }
View Full Code Here

        productBrand.setDateUpdate(new Date());
        if (productBrand.getId() != null) {
            if(em.contains(productBrand)){
                em.refresh(productBrand);
            }
            ProductBrand mergedProductBrand = em.merge(productBrand);
            em.flush();
            return mergedProductBrand;
        } else {
            em.persist(productBrand);
            return productBrand;
View Full Code Here

  public ModelAndView brandLine(final HttpServletRequest request, final Model model, @PathVariable(RequestConstants.URL_PATTERN_BRAND_CODE) final String brandCode) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.BRAND_LINE.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
       
    final ProductBrand productBrand = productService.getProductBrandByCode(brandCode);
   
    List<ProductMarketing>  productMarketings = productService.findProductMarketingsByBrandId(currentMarketArea.getId(), productBrand.getId());
    final ProductBrandViewBean productBrandViewBean = frontofficeViewBeanFactory.buildViewBeanProductBrand(requestUtil.getRequestData(request), productBrand, productMarketings);
    model.addAttribute("productBrand", productBrandViewBean);
   
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.BRAND_LINE.getKey());
View Full Code Here

    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.BRAND_DETAILS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.BRAND_DETAILS.getKey());

    final ProductBrand productBrand = productService.getProductBrandByCode(brandCode);
    final ProductBrandViewBean productBrandViewBean = frontofficeViewBeanFactory.buildViewBeanProductBrand(requestUtil.getRequestData(request), productBrand);
    model.addAttribute(ModelConstants.PRODUCT_BRAND_VIEW_BEAN, productBrandViewBean);
   
    List<ProductMarketing> productMarketings = productService.findProductMarketingsByBrandCode(brandCode, new FetchPlan(productMarketingFetchPlans));
    List<ProductMarketingViewBean> productMarketingViewBeans = frontofficeViewBeanFactory.buildListViewBeanProductMarketing(requestData, productMarketings);
View Full Code Here

   
    // CATALOG
   
    public ProductBrand createOrUpdateProductBrand(final MarketArea marketArea, final Localization localization, ProductBrand brand, final ProductBrandForm brandForm) throws Exception {
        if(brand == null){
            brand = new ProductBrand();
        }
       
        if(StringUtils.isNotEmpty(brandForm.getCode())){
            brand.setCode(brandForm.getCode());
        }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.ProductBrand

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.