Package org.hoteia.qalingo.core.domain

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


     * @throws Exception
     *
     */
    public CartViewBean buildViewBeanCart(final RequestData requestData, final Cart cart) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final Locale locale = requestData.getLocale();
       
        List<SpecificFetchMode> productSkuFetchPlans = new ArrayList<SpecificFetchMode>();
        productSkuFetchPlans.add(new SpecificFetchMode(ProductSku_.productMarketing.getName()));
        productSkuFetchPlans.add(new SpecificFetchMode(ProductSku_.attributes.getName()));
View Full Code Here


    /**
     *
     */
    protected CartItemViewBean buildViewBeanCartItem(final RequestData requestData, final CartItem cartItem, final FetchPlan productSkuFetchPlan) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final Localization localization = requestData.getMarketAreaLocalization();
        final String localizationCode = localization.getCode();
       
        final CartItemViewBean cartItemViewBean = new CartItemViewBean();

        cartItemViewBean.setSkuCode(cartItem.getProductSkuCode());
        final ProductSku productSku = productService.getProductSkuByCode(cartItem.getProductSkuCode(), productSkuFetchPlan);
        cartItem.setProductSku(productSku);
       
        cartItemViewBean.setI18nName(productSku.getI18nName(localizationCode));
        cartItemViewBean.setQuantity(cartItem.getQuantity());

        final Asset defaultPackshotImage = productSku.getDefaultPackshotImage(ImageSize.SMALL.name());
        if (defaultPackshotImage != null) {
            String summaryImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
            cartItemViewBean.setSummaryImage(summaryImage);
        } else {
            cartItemViewBean.setSummaryImage("");
        }
       
        // UNIT PRICE
        cartItemViewBean.setUnitPriceWithCurrencySign(cartItem.getPriceWithStandardCurrencySign(marketArea.getId(), retailer.getId()));

        // FEES AMOUNT FOR THIS PRODUCT SKU AND THIS QUANTITY
       
        //...
       
        // TOTAL AMOUNT FOR THIS PRODUCT SKU AND THIS QUANTITY
        cartItemViewBean.setAmountWithCurrencySign(cartItem.getTotalAmountWithStandardCurrencySign(marketArea.getId(), retailer.getId()));

        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));

View Full Code Here

        model.addAttribute(ModelConstants.PRICE_SCORE_MAX, 5);
        }
   
        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())){
View Full Code Here

  public ModelAndView submitProductComment(final HttpServletRequest request, @PathVariable(RequestConstants.URL_PATTERN_PRODUCT_MARKETING_CODE) final String productCode,
                       @Valid @ModelAttribute(ModelConstants.PRODUCT_COMMENT_FORM) ProductCommentForm productCommentForm,
                BindingResult result, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
        final Locale locale = requestData.getLocale();
       
        //binding form
        bindProductCommentForm(request, productCommentForm);
   
View Full Code Here

                CartItem cartItem = (CartItem) event.getSourceObject();
                FoCartItemPojo cartItemPojo = (FoCartItemPojo) event.getDestinationObject();
                try {
                    final RequestData requestData = requestUtil.getRequestData(httpServletRequest);
                    final MarketArea marketArea = requestData.getMarketArea();
                    final Retailer retailer = requestData.getMarketAreaRetailer();
                    final Localization localization = requestData.getMarketAreaLocalization();
                    final String localizationCode = localization.getCode();
                   
                    final Asset defaultPackshotImage = cartItem.getProductSku().getDefaultPackshotImage(ImageSize.SMALL.name());
                    if (defaultPackshotImage != null) {
                        String summaryImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
                        cartItemPojo.setSummaryImage(summaryImage);
                    } else {
                        cartItemPojo.setSummaryImage("");
                    }
                   
                    cartItemPojo.setI18nName(cartItem.getProductSku().getI18nName(localizationCode));
                   
                    cartItemPojo.setProductDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, cartItem.getCatalogCategory(), cartItem.getProductMarketing(), cartItem.getProductSku()));

                    cartItemPojo.setPriceWithStandardCurrencySign(cartItem.getPriceWithStandardCurrencySign(marketArea.getId(), retailer.getId()));
                    cartItemPojo.setTotalAmountWithStandardCurrencySign(cartItem.getTotalAmountWithStandardCurrencySign(marketArea.getId(), retailer.getId()));

                } catch (Exception e) {
                    logger.error("postWritingDestinationValue error with FoCartItemPojo", e);
                }
            }
        } else if(event.getDestinationObject() instanceof ProductSkuPojo){
            if(event.getFieldMap().getDestFieldName().equals("code")){
                // INJECT BACKOFFICE URLS
                ProductSku productSku = (ProductSku) event.getSourceObject();
                ProductSkuPojo productSkuPojo = (ProductSkuPojo) event.getDestinationObject();
                try {
                    final RequestData requestData = requestUtil.getRequestData(httpServletRequest);
                    final MarketArea marketArea = requestData.getMarketArea();
                    final Retailer retailer = requestData.getMarketAreaRetailer();
                    final Localization localization = requestData.getMarketAreaLocalization();
                    final String localizationCode = localization.getCode();
                   
                    final Asset defaultPackshotImage = productSku.getDefaultPackshotImage(ImageSize.SMALL.name());
                    if (defaultPackshotImage != null) {
                        String summaryImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
                        productSkuPojo.setDefaultPackshotImage(summaryImage);
                    } else {
                        productSkuPojo.setDefaultPackshotImage("");
                    }
                   
                    productSkuPojo.setI18nName(productSku.getI18nName(localizationCode));
                   
                    ProductSkuPrice price = productSku.getPrice(marketArea.getId(), retailer.getId());
                    if(price != null){
                        productSkuPojo.setPriceWithStandardCurrencySign(price.getPriceWithStandardCurrencySign());
                    }

                } catch (Exception e) {
View Full Code Here

    public List<RetailerViewBean> buildListViewBeanRetailer(final RequestData requestData) throws Exception {
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final List<Retailer> retailers = new ArrayList<Retailer>(currentMarketArea.getRetailers());
        List<RetailerViewBean> retailerViewBeans = new ArrayList<RetailerViewBean>();
        for (Iterator<Retailer> iterator = retailers.iterator(); iterator.hasNext();) {
            final Retailer retailerIt = (Retailer) iterator.next();
            retailerViewBeans.add(buildViewBeanRetailer(requestData, retailerIt));
        }
        return retailerViewBeans;
    }
View Full Code Here

   
    /**
     *
     */
    public void addToCart(final RequestData requestData, final String catalogCategoryCode, final String productSkuCode, final int quantity) throws Exception {
        final Retailer retailer = requestData.getMarketAreaRetailer();
        addToCart(requestData, retailer, catalogCategoryCode, productSkuCode, quantity);
    }
View Full Code Here

   
    /**
     *
     */
    public void updateCart(final RequestData requestData, final String catalogCategoryCode, final String productSkuCode, final int quantity) throws Exception {
        final Retailer retailer = requestData.getMarketAreaRetailer();
        updateCart(requestData, retailer, catalogCategoryCode, productSkuCode, quantity);
    }
View Full Code Here

    /**
     *
     */
    public void deleteCartItem(final RequestData requestData, final String productSkuCode) throws Exception {
        final Retailer retailer = requestData.getMarketAreaRetailer();
        deleteCartItem(requestData, retailer, productSkuCode);
    }
View Full Code Here

    /**
     *
     */
    public void buildAndSaveRetailerContactMail(final RequestData requestData, final RetailerContactForm retailerContactForm) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final String contextNameValue = requestData.getContextNameValue();

        final Retailer retailerToContact = retailerService.getRetailerByCode(marketArea.getId(), retailer.getId(), retailerContactForm.getRetailerCode());
       
        final RetailerContactEmailBean retailerContactEmailBean = new RetailerContactEmailBean();
        BeanUtils.copyProperties(retailerContactForm, retailerContactEmailBean);
        retailerContactEmailBean.setFromAddress(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RETAILER_CONTACT));
        retailerContactEmailBean.setFromName(marketArea.getEmailFromName(contextNameValue, Email.EMAIl_TYPE_RETAILER_CONTACT));
        retailerContactEmailBean.setReplyToEmail(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RETAILER_CONTACT));
        retailerContactEmailBean.setToEmail(retailerToContact.getDefaultAddress().getEmail());
       
        buildAndSaveRetailerContactMail(requestData, retailerToContact, retailerContactEmailBean);
    }
View Full Code Here

TOP

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

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.