Examples of ProductMarketing


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

            if (productSkus != null) {
                if (productFetchPlan != null) {
                    for (Iterator<ProductSku> iteratorProductMarketing = productSkus.iterator(); iteratorProductMarketing.hasNext();) {
                        final ProductSku productSku = (ProductSku) iteratorProductMarketing.next();
                        final ProductSku reloadedProductSku = productService.getProductSkuByCode(productSku.getCode(), skuFetchPlan);
                        final ProductMarketing productMarketing = productService.getProductMarketingByCode(reloadedProductSku.getProductMarketing().getCode(), productFetchPlan);
                        ProductMarketingViewBean productMarketingViewBean = buildViewBeanProductMarketing(requestData, catalogCategory, productMarketing, reloadedProductSku);
                        productMarketingViewBeans.add(productMarketingViewBean);
                        if (productMarketing.isFeatured()) {
                            featuredProductMarketings.add(productMarketingViewBean);
                        }
                    }
                }
                catalogCategoryViewBean.setCountProductMarketings(catalogCategory.getSortedProductMarketings().size());
View Full Code Here

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

     *
     */
    public List<ProductMarketingViewBean> buildListViewBeanProductMarketing(final RequestData requestData, final List<ProductMarketing> productMarketings) throws Exception {
        final List<ProductMarketingViewBean> productMarketingViewBeans = new ArrayList<ProductMarketingViewBean>();
        for (Iterator<ProductMarketing> iterator = productMarketings.iterator(); iterator.hasNext();) {
            ProductMarketing productMarketing = (ProductMarketing) iterator.next();
            productMarketingViewBeans.add(buildViewBeanProductMarketing(requestData, productMarketing));
        }
        return productMarketingViewBeans;
    }
View Full Code Here

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

        final Set<ProductAssociationLink> productAssociationLinks = productMarketing.getProductAssociationLinks();
        if (Hibernate.isInitialized(productAssociationLinks) && productAssociationLinks != null) {
            for (Iterator<ProductAssociationLink> iterator = productAssociationLinks.iterator(); iterator.hasNext();) {
                final ProductAssociationLink productAssociationLink = (ProductAssociationLink) iterator.next();
                if (productAssociationLink.getType().equals(ProductAssociationLinkType.CROSS_SELLING)) {
                    final ProductMarketing reloadedAssociatedProductMarketing = productService.getProductMarketingByCode(productAssociationLink.getProductSku().getProductMarketing().getCode());
                    productMarketingViewBean.getProductAssociationLinks().add(buildViewBeanProductAssociationLink(requestData, catalogCategory, reloadedAssociatedProductMarketing));
                }
            }
        }
View Full Code Here

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

        final Localization localization = requestData.getMarketAreaLocalization();
        final String localizationCode = localization.getCode();
        final MarketArea marketArea = requestData.getMarketArea();
        final Retailer retailer = requestData.getMarketAreaRetailer();
       
        final ProductMarketing productMarketing = productSku.getProductMarketing();
       
        final ProductSkuViewBean productSkuViewBean = new ProductSkuViewBean();

        productSkuViewBean.setCode(productSku.getCode());
        productSkuViewBean.setName(productSku.getName());
        productSkuViewBean.setI18nName(productSku.getI18nName(localizationCode));
        productSkuViewBean.setDescription(productSku.getDescription());

        productSkuViewBean.setDefault(productSku.isDefault());
        productSkuViewBean.setSalable(productSku.isSalable(marketArea.getId()));

        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        if (productMarketing.getDateCreate() != null) {
            productSkuViewBean.setDateCreate(dateFormat.format(productMarketing.getDateCreate()));
        }
        if (productMarketing.getDateUpdate() != null) {
            productSkuViewBean.setDateUpdate(dateFormat.format(productMarketing.getDateUpdate()));
        }
       
        final ProductSkuPrice productSkuPrice = productSku.getPrice(marketArea.getId(), retailer.getId());
        if(productSkuPrice != null){
            productSkuViewBean.setCatalogPrice(productSkuPrice.getCatalogPrice().toString());
            productSkuViewBean.setSalePrice(productSkuPrice.getSalePrice().toString());
            productSkuViewBean.setPriceWithCurrencySign(productSkuPrice.getPriceWithStandardCurrencySign());
        } else {
            productSkuViewBean.setPriceWithCurrencySign("NA");
        }
       
        // ATTRIBUTES
        List<ProductSkuAttribute> globalAttributes = productSku.getGlobalAttributes();
        if(globalAttributes != null){
            for (Iterator<ProductSkuAttribute> iterator = globalAttributes.iterator(); iterator.hasNext();) {
                ProductSkuAttribute attribute = (ProductSkuAttribute) iterator.next();
                productSkuViewBean.getGlobalAttributes().put(attribute.getAttributeDefinition().getCode(), buildViewBeanAttributeValue(requestData, attribute));
            }
        }

        List<ProductSkuAttribute> marketAreaAttributes = productSku.getMarketAreaAttributes(marketArea.getId());
        if(marketAreaAttributes != null){
            for (Iterator<ProductSkuAttribute> iterator = marketAreaAttributes.iterator(); iterator.hasNext();) {
                ProductSkuAttribute attribute = (ProductSkuAttribute) iterator.next();
                productSkuViewBean.getMarketAreaAttributes().put(attribute.getAttributeDefinition().getCode(), buildViewBeanAttributeValue(requestData, attribute));
            }
        }
       
        // ASSETS
        final Asset defaultBackgroundImage = productSku.getDefaultBackgroundImage();
        if (defaultBackgroundImage != null) {
            String backgroundImage = engineSettingService.getProductSkuImageWebPath(defaultBackgroundImage);
            productSkuViewBean.setBackgroundImage(backgroundImage);
        } else {
            productSkuViewBean.setBackgroundImage("");
        }
        final Asset defaultPackshotImage = productMarketing.getDefaultPackshotImage(ImageSize.HD.name());
        if (defaultPackshotImage != null) {
            String carouselImage = engineSettingService.getProductSkuImageWebPath(defaultPackshotImage);
            productSkuViewBean.setCarouselImage(carouselImage);
        } else {
            productSkuViewBean.setCarouselImage("");
View Full Code Here

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

        Map<String, String> getParams = new HashMap<String, String>();
        getParams.put(RequestConstants.REQUEST_PARAMETER_PRODUCT_SKU_CODE, cartItem.getProductSkuCode());
        cartItemViewBean.setDeleteUrl(urlService.generateUrl(FoUrls.CART_REMOVE_ITEM, requestData, getParams));

        final ProductMarketing productMarketing = productService.getProductMarketingByCode(cartItem.getProductMarketingCode());
        final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getVirtualCatalogCategoryByCode(cartItem.getCatalogCategoryCode(), requestData.getVirtualCatalogCode(), requestData.getMasterCatalogCode());
       
        cartItemViewBean.setProductDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, catalogCategory, productMarketing, cartItem.getProductSku()));

        return cartItemViewBean;
View Full Code Here

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

                }

                if (StringUtils.isNotEmpty(catalogCategoryCode)) {
                    cartItem.setCatalogCategoryCode(catalogCategoryCode);
                } else {
                    final ProductMarketing reloadedProductMarketing = productService.getProductMarketingByCode(productSku.getProductMarketing().getCode());
                    final List<CatalogCategoryVirtual> catalogCategories = catalogCategoryService.findVirtualCategoriesByProductSkuId(productSku.getId());
                    final CatalogCategoryVirtual defaultVirtualCatalogCategory = productService.getDefaultVirtualCatalogCategory(reloadedProductMarketing, catalogCategories, true);
                    cartItem.setCatalogCategoryCode(defaultVirtualCatalogCategory.getCode());
                }
                cart.getCartItems().add(cartItem);
View Full Code Here

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

 
  public ProductMarketing getProductMarketingById(final Long productMarketingId, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductMarketing.class);
        FetchPlan fetchPlan = handleSpecificProductMarketingFetchMode(criteria, params);
        criteria.add(Restrictions.eq("id", productMarketingId));
        ProductMarketing productMarketing = (ProductMarketing) criteria.uniqueResult();
        if(productMarketing != null){
            productMarketing.setFetchPlan(fetchPlan);
        }
        return productMarketing;
  }
View Full Code Here

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

  public ProductMarketing getProductMarketingByCode(final String productMarketingCode, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductMarketing.class);
        FetchPlan fetchPlan = handleSpecificProductMarketingFetchMode(criteria, params);
        criteria.add(Restrictions.eq("code", handleCodeValue(productMarketingCode)));
        ProductMarketing productMarketing = (ProductMarketing) criteria.uniqueResult();
        if(productMarketing != null){
            productMarketing.setFetchPlan(fetchPlan);
        }
    return productMarketing;
  }
View Full Code Here

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

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

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

   
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
       
    ProductMarketing productMarketing = productService.getProductMarketingByCode(productCode);
   
    if(productCommentForm == null
          || productCommentForm.equals(new ProductCommentForm())){
      productCommentForm = formFactory.buildProductCommentForm(requestData, productMarketing);
      model.addAttribute("productContactForm", productCommentForm);
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.