Examples of ProductMarketing


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

      // WARNING
      addInfoMessage(request, getSpecificMessage(ScopeWebMessage.PRODUCT_MARKETING, "comment_form_empty_warning_message",  locale));
      return displayProductCommentForm(request, productCode, model, productCommentForm);
    }
   
    final ProductMarketing product = productService.getProductMarketingByCode(productCode);
    final Customer customer = requestData.getCustomer();
   
    if (qualityOfService != 0) {
      ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
      productCustomerRate.setRate(qualityOfService);
      productCustomerRate.setProductMarketingId(product.getId());
      productCustomerRate.setCustomerId(customer.getId());
      productCustomerRate.setType(Constants.PRODUCT_QUALITY_RATING_TYPE);
      productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
    }
   
    if (ratioQualityPrice != 0) {
      ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
      productCustomerRate.setRate(ratioQualityPrice);
      productCustomerRate.setProductMarketingId(product.getId());
      productCustomerRate.setCustomerId(customer.getId());
      productCustomerRate.setType(Constants.PRODUCT_PRICE_RATING_TYPE);
      productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
    }
   
    if (priceScore != 0) {
      ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
      productCustomerRate.setRate(priceScore);
      productCustomerRate.setProductMarketingId(product.getId());
      productCustomerRate.setCustomerId(customer.getId());
      productCustomerRate.setType(Constants.PRODUCT_VALUE_RATING_TYPE);
      productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
    }
   
    if (StringUtils.isNotEmpty(productCommentForm.getComment())) {
      ProductMarketingCustomerComment productCustomerComment = new ProductMarketingCustomerComment();
      productCustomerComment.setComment(productCommentForm.getComment());
      productCustomerComment.setProductMarketingId(product.getId());
      productCustomerComment.setCustomer(customer);
      productService.saveOrUpdateProductMarketingCustomerComment(productCustomerComment);
    }
   
    addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.PRODUCT_MARKETING, "comment_form_success_message",  locale));
View Full Code Here

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

    public SearchProductItemViewBean buildViewBeanSearchProductItem(final RequestData requestData, final ProductMarketingSolr productMarketingSolr) throws Exception {
        final Localization localization = requestData.getMarketAreaLocalization();
        final String localeCode = localization.getCode();

        final String productCode = productMarketingSolr.getCode();
        final ProductMarketing productMarketing = productService.getProductMarketingByCode(productCode);
        final ProductSku productSku = productService.getProductSkuByCode(productMarketing.getDefaultProductSku().getCode());
        final String productSkuName = productSku.getI18nName(localeCode);
       
        final SearchProductItemViewBean searchItemViewBean = new SearchProductItemViewBean();
       
        final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getDefaultVirtualCatalogCategoryByProductSkuId(productSku.getId());
        String categoryName = "";
        if(catalogCategory != null){
            categoryName = catalogCategory.getI18nName(localeCode);
            searchItemViewBean.setCategoryCode(catalogCategory.getCode());
            searchItemViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, catalogCategory, productMarketing, productSku));
        }
        final String productName = productMarketing.getCode();

        searchItemViewBean.setName(categoryName + " " + productName + " " + productSkuName);
        searchItemViewBean.setDescription(productMarketing.getDescription());
        searchItemViewBean.setCode(productCode);
        searchItemViewBean.setCategoryName(categoryName);

        Map<String, String> getParams = new HashMap<String, String>();
        getParams.put(RequestConstants.REQUEST_PARAMETER_PRODUCT_SKU_CODE, productSku.getCode());

        searchItemViewBean.setAddToCartUrl(urlService.generateUrl(FoUrls.CART_ADD_ITEM, requestData, getParams));
       
        final Asset defaultBackgroundImage = productMarketing.getDefaultBackgroundImage();
        if (defaultBackgroundImage != null) {
            final String backgroundImage = engineSettingService.getProductMarketingImageWebPath(defaultBackgroundImage);
            searchItemViewBean.setBackgroundImage(backgroundImage);
        } else {
          searchItemViewBean.setBackgroundImage("");
        }
       
        final Asset defaultPackshotImage = productMarketing.getDefaultPackshotImage(ImageSize.SMALL.name());
        if (defaultPackshotImage != null) {
            final String carouselImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
            searchItemViewBean.setCarouselImage(carouselImage);
        } else {
          searchItemViewBean.setCarouselImage("");
        }
       
        final Asset defaultIconImage = productMarketing.getDefaultThumbnailImage();
        if (defaultIconImage != null) {
            final String iconImage = engineSettingService.getProductMarketingImageWebPath(defaultIconImage);
            searchItemViewBean.setIconImage(iconImage);
        } else {
          searchItemViewBean.setIconImage("");
        }
       
        Set<ProductSku> skus = productMarketing.getProductSkus();
        if (skus != null) {
            for (Iterator<ProductSku> iterator = skus.iterator(); iterator.hasNext();) {
                final ProductSku productSkuTmp = (ProductSku) iterator.next();
                final ProductSku reloadedProductSku = productService.getProductSkuByCode(productSkuTmp.getCode());
                searchItemViewBean.getProductSkus().add(buildViewBeanProductSku(requestData, catalogCategory, productMarketing, reloadedProductSku));
            }
        }
       
        searchItemViewBean.setCustomerProductRates(productService.calculateProductMarketingCustomerRatesByProductId(productMarketing.getId()));

        return searchItemViewBean;
    }
View Full Code Here

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

      final Localization localization = requestData.getMarketAreaLocalization();
        final String localeCode = localization.getCode();
      for (String productSkuCode : listProductSkuCodes) {
        RecentProductViewBean recentProductViewBean = new RecentProductViewBean();
            final ProductSku reloadedProductSku = productService.getProductSkuByCode(productSkuCode, productSkuFetchPlans);
            final ProductMarketing productMarketing = productService.getProductMarketingByCode(reloadedProductSku.getProductMarketing().getCode(), productMarketingFetchPlans);
            final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getDefaultVirtualCatalogCategoryByProductSkuId(reloadedProductSku.getId(), categoryVirtualFetchPlans);
          recentProductViewBean.setId(productMarketing.getId());
        recentProductViewBean.setCode(productMarketing.getCode());
        recentProductViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, catalogCategory, productMarketing, productMarketing.getDefaultProductSku()))
          recentProductViewBean.setI18nName(productMarketing.getI18nName(localeCode));
          recentProductViewBeans.add(recentProductViewBean);
      }
      return recentProductViewBeans;
    }
View Full Code Here

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

    }
   
    public List<ProductMarketingViewBean> buildListViewBeanProductMarketing(final RequestData requestData, final AbstractCatalogCategory catalogCategory, final List<ProductMarketing> productMarketings, boolean withDependency) throws Exception {
        List<ProductMarketingViewBean> products = new ArrayList<ProductMarketingViewBean>();
        for (Iterator<ProductMarketing> iterator = productMarketings.iterator(); iterator.hasNext();) {
            ProductMarketing productMarketing = (ProductMarketing) iterator.next();
           
            // TODO : Denis : fetch optim - cache
            ProductMarketing reloadedProductMarketing = (ProductMarketing) productService.getProductMarketingById(productMarketing.getId());
           
            products.add(buildViewBeanProductMarketing(requestData, catalogCategory, reloadedProductMarketing, null));
//            products.add(buildProductMarketingViewBean(requestData, reloadedProductMarketing, withDependency));
        }
        return products;
View Full Code Here

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

     *
     */
    public List<ProductMarketingViewBean> buildListViewBeanProductMarketing(final RequestData requestData, final CatalogCategoryVirtual catalogCategory, final List<ProductMarketing> productMarketings, boolean withDependency) throws Exception {
        List<ProductMarketingViewBean> products = new ArrayList<ProductMarketingViewBean>();
        for (Iterator<ProductMarketing> iterator = productMarketings.iterator(); iterator.hasNext();) {
            ProductMarketing productMarketing = (ProductMarketing) iterator.next();
           
            // TODO : Denis : fetch optim - cache
            ProductMarketing reloadedProductMarketing = (ProductMarketing) productService.getProductMarketingById(productMarketing.getId());
           
            products.add(buildViewBeanProductMarketing(requestData, catalogCategory, reloadedProductMarketing, null));
//            products.add(buildProductMarketingViewBean(requestData, reloadedProductMarketing, withDependency));
        }
        return products;
View Full Code Here

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

        final List<GlobalSearchViewBean> globalSearchViewBeans = new ArrayList<GlobalSearchViewBean>();

        final List<ProductMarketing> productMarketings = productService.findProductMarketings(currentMarketArea.getId(), searchText);
        for (Iterator<ProductMarketing> iterator = productMarketings.iterator(); iterator.hasNext();) {
            ProductMarketing productMarketing = (ProductMarketing) iterator.next();

            final GlobalSearchViewBean globalSearchViewBean = new GlobalSearchViewBean();
            globalSearchViewBean.setValue(productMarketing.getName() + " : " + productMarketing.getCode());
            globalSearchViewBean.setType("ProductMarketing");
            globalSearchViewBean.setUrl(backofficeUrlService.generateUrl(BoUrls.PRODUCT_MARKETING_DETAILS, requestData, productMarketing));

            globalSearchViewBeans.add(globalSearchViewBean);
        }
View Full Code Here

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

    return catalogCategoryVirtualAttribute;
  }
 
  public ProductMarketing createOrUpdateProductMarketing(ProductMarketing productMarketing, final ProductMarketingForm productMarketingForm) {
       if(productMarketing == null){
           productMarketing = new ProductMarketing();
        }
        if (StringUtils.isNotEmpty(productMarketingForm.getCode())) {
            productMarketing.setCode(productMarketingForm.getCode());
        }
        if (StringUtils.isNotEmpty(productMarketingForm.getName())) {
            productMarketing.setName(productMarketingForm.getName());
        }
    productMarketing.setDescription(productMarketingForm.getDescription());
   
    ProductMarketing savedProductMarketing = productService.saveOrUpdateProductMarketing(productMarketing);
    return savedProductMarketing;
  }
View Full Code Here

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

        }
    productSku.setDescription(productSkuForm.getDescription());

    ProductSku savedProductSku = null;
        if (StringUtils.isNotEmpty(productSkuForm.getProductMarketingId())) {
            ProductMarketing productMarketing = productService.getProductMarketingById(productSkuForm.getProductMarketingId());
            productSku.setProductMarketing(productMarketing);
            savedProductSku = productService.saveOrUpdateProductSku(productSku);
        }
        return savedProductSku;
  }
View Full Code Here

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

  public ModelAndView productMarketingDetails(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.PRODUCT_MARKETING_DETAILS.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
    final String productMarketingCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_PRODUCT_MARKETING_CODE);
   
        final ProductMarketing productMarketing = productService.getProductMarketingByCode(productMarketingCode, new FetchPlan(productMarketingFetchPlans));
        final ProductSku productSku = productMarketing.getDefaultProductSku();
        final List<CatalogCategoryVirtual> catalogCategories = catalogCategoryService.findVirtualCategoriesByProductSkuId(productSku.getId());
       
        final CatalogCategoryVirtual defaultVirtualCatalogCategory = productService.getDefaultVirtualCatalogCategory(productSku, catalogCategories, true);
       
        ProductMarketingViewBean productMarketingViewBean = backofficeViewBeanFactory.buildViewBeanProductMarketing(requestUtil.getRequestData(request), defaultVirtualCatalogCategory, productMarketing, productSku);
        modelAndView.addObject(ModelConstants.PRODUCT_MARKETING_VIEW_BEAN, productMarketingViewBean);

        modelAndView.addObject("availableGlobaleAttributeDefinitions", backofficeViewBeanFactory.buildListViewBeanAttributeDefinition(requestData, attributeService.findProductMarketingGlobalAttributeDefinitions()));
        modelAndView.addObject("availableMarketAreaAttributeDefinitions", backofficeViewBeanFactory.buildListViewBeanAttributeDefinition(requestData, attributeService.findProductMarketingMarketAreaAttributeDefinitions()));

        modelAndView.addObject(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.VIRTUAL_CATALOG, requestData));

        Object[] params = {productMarketing.getName() + " (" + productMarketing.getCode() + ")"};
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView,  BoUrls.PRODUCT_MARKETING_DETAILS.getKey(), params);
   
        return modelAndView;
  }
View Full Code Here

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

   
    final String productMarketingCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_PRODUCT_MARKETING_CODE);

    if(StringUtils.isNotEmpty(productMarketingCode)){
        // EDIT MODE
          final ProductMarketing productMarketing = productService.getProductMarketingByCode(productMarketingCode, new FetchPlan(productMarketingFetchPlans));
          final ProductSku productSku = productMarketing.getDefaultProductSku();
          final List<CatalogCategoryVirtual> catalogCategories = catalogCategoryService.findVirtualCategoriesByProductSkuId(productSku.getId());
          final CatalogCategoryVirtual defaultVirtualCatalogCategory = productService.getDefaultVirtualCatalogCategory(productMarketing, catalogCategories, true);
         
          ProductMarketingViewBean productMarketingViewBean = backofficeViewBeanFactory.buildViewBeanProductMarketing(requestUtil.getRequestData(request), defaultVirtualCatalogCategory, productMarketing, productSku);
          modelAndView.addObject(ModelConstants.PRODUCT_MARKETING_VIEW_BEAN, productMarketingViewBean);
         
          modelAndView.addObject("availableGlobaleAttributeDefinitions", backofficeViewBeanFactory.buildListViewBeanAttributeDefinition(requestData, attributeService.findProductMarketingGlobalAttributeDefinitions()));
          modelAndView.addObject("availableMarketAreaAttributeDefinitions", backofficeViewBeanFactory.buildListViewBeanAttributeDefinition(requestData, attributeService.findProductMarketingMarketAreaAttributeDefinitions()));

          modelAndView.addObject(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.PRODUCT_MARKETING_DETAILS, requestData, productMarketing));
         
          Object[] params = {productMarketing.getName() + " (" + productMarketing.getCode() + ")"};
          overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.PRODUCT_MARKETING_EDIT.getKey(), params);

    } else {
        // ADD/CREATE MODE
            modelAndView.addObject(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.VIRTUAL_CATALOG, requestData));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.